changeset 8163:60b4cbdb446d

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
author sherman
date Wed, 11 Sep 2013 11:29:57 -0700
parents 8b4aef582087
children 70aab3db56de
files src/share/classes/java/util/zip/ZipConstants.java src/share/classes/java/util/zip/ZipConstants64.java src/share/classes/java/util/zip/ZipEntry.java
diffstat 3 files changed, 23 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/zip/ZipConstants.java	Wed Sep 11 10:35:31 2013 -0400
+++ b/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/src/share/classes/java/util/zip/ZipConstants64.java	Wed Sep 11 10:35:31 2013 -0400
+++ b/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/src/share/classes/java/util/zip/ZipEntry.java	Wed Sep 11 10:35:31 2013 -0400
+++ b/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.
  *