This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: [Bug] ZipFile.entries() returns null for bad zip-file
- From: Tom Tromey <tromey at redhat dot com>
- To: Martin Egholm Nielsen <martin at egholm-nielsen dot dk>
- Cc: java at gcc dot gnu dot org
- Date: 18 Oct 2006 13:11:56 -0600
- Subject: Re: [Bug] ZipFile.entries() returns null for bad zip-file
- References: <eh4tck$94j$1@sea.gmane.org>
- Reply-to: tromey at redhat dot com
>>>>> "Martin" == Martin Egholm Nielsen <martin@egholm-nielsen.dk> writes:
Martin> Nevertheless, invoking "ZipFile.entries()" on a ZipFile-instance
Martin> representing a corrupt zip-file (any file not being a valid zip-file),
Martin> returns null, whereas I would expect an empty enumeration instead...
I tried the test program with svn head and I get:
opsy. gij Provoke
Exception in thread "main" java.util.zip.ZipException: Not a valid zip file
at java.util.zip.ZipFile.checkZipFile(ZipFile.java:197)
at java.util.zip.ZipFile.<init>(ZipFile.java:136)
at Provoke.main(Provoke.java:8)
This seems more reasonable offhand, but in cases like this I
ordinarily would test against the JDK as well (however I don't have it
installed atm...)
Tom