JDK-6738211 : ZipFile.open error message fails to include path to (potentially corrupt) ZIP file
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.jar
  • Affected Version: 6u7
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2008-08-18
  • Updated: 2010-04-03
  • Resolved: 2008-08-18
Related Reports
Duplicate :  
Description
If you try to open a ZIP file which is corrupt, the resulting ZipException makes no mention of which ZIP file was being opened (much less what the problem with the file was). This can make it difficult to diagnose a bare stack trace. By comparison, other file-related IOException's thrown from JRE code are typically given a message noting at least the path name.

Comments
WORK AROUND Catch and rethrow ZipException's after adding out-of-band information about the file you were trying to open. For example: http://svn.apache.org/viewvc?view=rev&revision=683997
18-08-2008

SUGGESTED FIX Java_java_util_zip_ZipFile_open in jdk/src/share/native/java/util/zip/ZipFile.c has ThrowZipException(env, "error in opening zip file"); It should insert the 'path' variable into the error message.
18-08-2008