JDK-6240058 : Update ZipInputStream javadocs to describe more about getNextEntry() method
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Affected Version: 1.4.2,5.0,5.0u5
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-03-14
  • Updated: 2011-02-16
Related Reports
Relates :  
Relates :  
Relates :  
Description
The present description of the public ZipEntry getNextEntry() does not mention that the ZipEntry object returned from getNextEntry method the does not return attribute information of the zip entry. Please refer to the evaluations of Bugs 4079029 & 4113731. 
Executing methods to obtain the attributes of the ZipEntry object returns -1 and this results in confusion for the developer. Explicit information in the javadocs should make it more clear.
###@###.### 2005-03-14 11:03:28 GMT

Same problem has been reported by a CAP member:
---------------------
J2SE Version (please include all output from java -version flag):
  java version "1.5.0_05-ea"
  Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-ea-b02)
  Java HotSpot(TM) Client VM (build 1.5.0_05-ea-b02, mixed mode, sharing)

Does this problem occur on J2SE 1.4.x or 5.0.x ?  Yes / No (pick one)
  Not tested due to new language features used in the project.

Operating System Configuration Information (be specific):
  Windows XP Professional DE SP2

Hardware Configuration Information (be specific):
  VAIO VGN-FS115 Notebook with Intel Pentium M, 1.6 GHz Centrino, 1 GB RAM

Bug Description:
  When reading ZipEntries using
  java.util.zip.ZipInputStream.getNextEntry(), the corresponding entries
  only supply name and date information. Other metainformation like size
  or compressed size are missing, i.e. -1.

  By contrast, when using java.util.zip.ZipFile.entries(), the entries are
  supplied correctly.


Steps to Reproduce (be specific):
  Use any simple program to read and existing zip via ZipInputStream.



###@###.### 2005-07-19 20:25:11 GMT

Comments
EVALUATION I assume the reader is referring to fields such as size, which are not always filled in. This is due to the design of the zip file format, which does not always make the data available at the time that the user might need it. It's hard to understand why this class works the way it does without groking the file format, but an attempt to clarify the docs would be good. ###@###.### 2005-04-19 04:44:31 GMT Bug 4813151, if addressed, will ameliorate the problem because the number of un-filled-in fields in zip file LOC headers will decrease. ###@###.### 2005-07-18 21:29:07 GMT
14-03-2005