8024338: Constant fields introduced by JDK-4759491 fix in b94 are exposed as public fields in public API
authorsherman
Wed, 11 Sep 2013 11:29:57 -0700
changeset 19843 71c34227ccb1
parent 19842 6283eea2f0e6
child 19844 c124c3d601ba
8024338: Constant fields introduced by JDK-4759491 fix in b94 are exposed as public fields in public API Summary: to move the new constants out of ZipConstants.java Reviewed-by: martin
jdk/src/share/classes/java/util/zip/ZipConstants.java
jdk/src/share/classes/java/util/zip/ZipConstants64.java
jdk/src/share/classes/java/util/zip/ZipEntry.java
--- a/jdk/src/share/classes/java/util/zip/ZipConstants.java	Wed Sep 11 10:35:31 2013 -0400
+++ b/jdk/src/share/classes/java/util/zip/ZipConstants.java	Wed Sep 11 11:29:57 2013 -0700
@@ -69,21 +69,6 @@
     static final int EXTLEN = 12;       // uncompressed size
 
     /*
-     * Extra field header ID
-     */
-    static final int  EXTID_ZIP64 = 0x0001;    // Zip64
-    static final int  EXTID_NTFS  = 0x000a;    // NTFS
-    static final int  EXTID_UNIX  = 0x000d;    // UNIX
-    static final int  EXTID_EXTT  = 0x5455;    // Info-ZIP Extended Timestamp
-
-    /*
-     * EXTT timestamp flags
-     */
-    static final int  EXTT_FLAG_LMT = 0x1;       // LastModifiedTime
-    static final int  EXTT_FLAG_LAT = 0x2;       // LastAccessTime
-    static final int  EXTT_FLAT_CT  = 0x4;       // CreationTime
-
-    /*
      * Central directory (CEN) header field offsets
      */
     static final int CENVEM = 4;        // version made by
--- a/jdk/src/share/classes/java/util/zip/ZipConstants64.java	Wed Sep 11 10:35:31 2013 -0400
+++ b/jdk/src/share/classes/java/util/zip/ZipConstants64.java	Wed Sep 11 11:29:57 2013 -0700
@@ -80,5 +80,26 @@
                                         // comment fields for this file must be
                                         // encoded using UTF-8.
 
+    /*
+     * Constants below are defined here (instead of in ZipConstants)
+     * to avoid being exposed as public fields of ZipFile, ZipEntry,
+     * ZipInputStream and ZipOutputstream.
+     */
+
+    /*
+     * Extra field header ID
+     */
+    static final int  EXTID_ZIP64 = 0x0001;    // Zip64
+    static final int  EXTID_NTFS  = 0x000a;    // NTFS
+    static final int  EXTID_UNIX  = 0x000d;    // UNIX
+    static final int  EXTID_EXTT  = 0x5455;    // Info-ZIP Extended Timestamp
+
+    /*
+     * EXTT timestamp flags
+     */
+    static final int  EXTT_FLAG_LMT = 0x1;       // LastModifiedTime
+    static final int  EXTT_FLAG_LAT = 0x2;       // LastAccessTime
+    static final int  EXTT_FLAT_CT  = 0x4;       // CreationTime
+
     private ZipConstants64() {}
 }
--- a/jdk/src/share/classes/java/util/zip/ZipEntry.java	Wed Sep 11 10:35:31 2013 -0400
+++ b/jdk/src/share/classes/java/util/zip/ZipEntry.java	Wed Sep 11 11:29:57 2013 -0700
@@ -30,6 +30,8 @@
 import java.util.Objects;
 import java.util.concurrent.TimeUnit;
 
+import static java.util.zip.ZipConstants64.*;
+
 /**
  * This class is used to represent a ZIP file entry.
  *