-
Bug
-
Resolution: Fixed
-
P2
-
1.4.0
-
beta
-
generic, x86, sparc
-
generic, linux, solaris_2.6, solaris_7, windows_2000
-
Verified
Any attempt to call ObjectStreamClass.lookup() on an interface that
extends Serializable (but not Externalizable) will result in a
NullPointerException on recent builds of merlin:
$ cat Foo.java
import java.io.*;
interface Bar extends Serializable {}
public class Foo {
public static void main(String[] args) {
ObjectStreamClass.lookup(Bar.class);
}
}
$ javac Foo.java
$ java Foo
Exception in thread "main" java.lang.NullPointerException
at java.lang.Class.isAssignableFrom(Native Method)
at sun.misc.ClassReflector.getSerializableConstructor(ClassReflector.java:1181)
at sun.misc.ClassReflector.getInvocables(ClassReflector.java:1143)
at sun.misc.ClassReflector.access$900(ClassReflector.java:27)
at sun.misc.ClassReflector$2.run(ClassReflector.java:1058)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.ClassReflector.createClassReflector(ClassReflector.java:1055)
at sun.misc.ClassReflector.getClassReflector(ClassReflector.java:1043)
at sun.misc.ClassReflector.access$100(ClassReflector.java:27)
at sun.misc.ClassReflector$Factory.getClassReflector(ClassReflector.java:87)
at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:237)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:226)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:103)
at Foo.main(Foo.java:7)
extends Serializable (but not Externalizable) will result in a
NullPointerException on recent builds of merlin:
$ cat Foo.java
import java.io.*;
interface Bar extends Serializable {}
public class Foo {
public static void main(String[] args) {
ObjectStreamClass.lookup(Bar.class);
}
}
$ javac Foo.java
$ java Foo
Exception in thread "main" java.lang.NullPointerException
at java.lang.Class.isAssignableFrom(Native Method)
at sun.misc.ClassReflector.getSerializableConstructor(ClassReflector.java:1181)
at sun.misc.ClassReflector.getInvocables(ClassReflector.java:1143)
at sun.misc.ClassReflector.access$900(ClassReflector.java:27)
at sun.misc.ClassReflector$2.run(ClassReflector.java:1058)
at java.security.AccessController.doPrivileged(Native Method)
at sun.misc.ClassReflector.createClassReflector(ClassReflector.java:1055)
at sun.misc.ClassReflector.getClassReflector(ClassReflector.java:1043)
at sun.misc.ClassReflector.access$100(ClassReflector.java:27)
at sun.misc.ClassReflector$Factory.getClassReflector(ClassReflector.java:87)
at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:237)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:226)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:103)
at Foo.main(Foo.java:7)
- duplicates
-
JDK-4403092 JCK13: 6 api/java_io/Serialization/ tests failed with NullPointerException
-
- Closed
-
-
JDK-4402151 java.io.ObjectStreamClass.lookup() throws NPE on interface class
-
- Closed
-