changeset 13309:62eef4aafefd

8145343: CorruptEntry.java fails after push for JDK-8145260 Reviewed-by: weijun
author sherman
date Tue, 15 Dec 2015 08:54:35 -0800
parents 67dfec9bb281
children 0034a6f1ead1 5e31a4fac6ce
files src/java.base/share/classes/java/util/zip/ZipFile.java
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/java/util/zip/ZipFile.java	Fri Dec 11 16:35:59 2015 +0300
+++ b/src/java.base/share/classes/java/util/zip/ZipFile.java	Tue Dec 15 08:54:35 2015 -0800
@@ -833,7 +833,8 @@
             byte[] cen = zsrc.cen;
             for (int i = 0; i < names.length; i++) {
                 int pos = zsrc.metanames.get(i);
-                names[i] = zc.toStringUTF8(cen, pos + CENHDR,  CENNAM(cen, pos));
+                names[i] = new String(cen, pos + CENHDR,  CENNAM(cen, pos),
+                                      StandardCharsets.UTF_8);
             }
             return names;
         }