ZipInputStream brokenness
Jesse Rosenstock
jmr@ugcs.caltech.edu
Thu Aug 29 14:19:00 GMT 2002
Tom Tromey <tromey@redhat.com> writes:
> Yeah. Though for me it fails differently. It prints a lot of stuff
> and then at the end:
>> Exception in thread "main" java.lang.NullPointerException
This is also the Sun JDK gives, although you'd never guess this from the
javadoc. Apparently, ZipInputStream.getNextEntry() returns null when
there isn't a next entry.
However, when I compile with -g, I get a different error:
; gcj -g ZISTest.java --main=ZISTest -o zistest
; ./zistest
org/bouncycastle/crypto/InvalidCipherTextException.class
org/bouncycastle/crypto/StreamCipher.class
org/bouncycastle/crypto/RuntimeCryptoException.class
Exception in thread "main" java.util.zip.ZipException: Wrong Local header signaturef42283ec
at java.util.zip.ZipInputStream.getNextEntry() (/home/user/jmr/app/gcc/lib/libgcj.so.3.0.0)
at ZISTest.main(java.lang.String[]) (/home/user/jmr/gcj_test/zipinputstream/ZISTest.java:13)
I also get this error when running gij on the class file (be either gcj or
javac).
When I change "while (true)" to "while (zis.available() > 0)",
the Sun JDK prints all the class names, then exits without a
NullPointerException, but gcj/gij don't print anything because
zis.available() returns 0 on the first call, before any entries have
been read.
Should I submit PRs for any of these?
More information about the Java
mailing list