-
Bug
-
Resolution: Fixed
-
P3
-
1.2.0
-
1.2fcs
-
sparc
-
solaris_2.5
-
Verified
Name: mgC56079 Date: 08/14/98
Here is the test: create an ampty jar with JarOutputStream.
Try to open it with JarInputStream. This will result in a NullPointerException.
=== JarIS.java ======
import java.util.jar.*;
import java.io.*;
public class JarIS {
public static void main(String args[]) {
ByteArrayOutputStream out=new ByteArrayOutputStream();
try {
new JarOutputStream(out);
JarInputStream is = new JarInputStream(new ByteArrayInputStream(out.toByteArray()));
}
catch (IOException e) {
System.out.println("unexpected IOException");
}
System.out.println("passed");
}
}
==== sample run ====
% java -Djava.compiler=None JarIS
Warning: JIT compiler "None" not found. Will use interpreter.
Exception in thread "main" java.lang.NullPointerException
at java.util.jar.JarInputStream.<init>(JarInputStream.java:67)
at java.util.jar.JarInputStream.<init>(JarInputStream.java:50)
at JarIS.main(JarIS.java:10)
======================================================================