Serialization fails to serialize java.util.Vector due to following bug.
There is a class verification bug when a class contains a
private or package accessible inner class. The inner class
is being verified instead of the class that is being
used to request the modifiers from.
The following test case run against JDK1.2Beta4-A confirms this.
(I shut the JIT off just to remove a variable.)
public class Inner {
private class Itr {
int i;
};
public static void main(String argv[]) throws Exception {
System.out.println("public class Inner.getModifiers() " +
Inner.class.getModifiers());
}
};
Output:
joef/scarry>java Inner
Warning: JIT compiler "none" not found. Will use interpreter.
java.lang.IllegalAccessError: try to access class Inner$Itr from class java/lang/Class
at java.lang.Class.getModifiers(Native Method)
at Inner.main(Inner.java:8)
There is a class verification bug when a class contains a
private or package accessible inner class. The inner class
is being verified instead of the class that is being
used to request the modifiers from.
The following test case run against JDK1.2Beta4-A confirms this.
(I shut the JIT off just to remove a variable.)
public class Inner {
private class Itr {
int i;
};
public static void main(String argv[]) throws Exception {
System.out.println("public class Inner.getModifiers() " +
Inner.class.getModifiers());
}
};
Output:
joef/scarry>java Inner
Warning: JIT compiler "none" not found. Will use interpreter.
java.lang.IllegalAccessError: try to access class Inner$Itr from class java/lang/Class
at java.lang.Class.getModifiers(Native Method)
at Inner.main(Inner.java:8)
- duplicates
-
JDK-4129928 Class.getModifiers() throws IllegalAccessError in presence of inner classes
-
- Closed
-
- relates to
-
JDK-4127103 missing beginPrivileged and/or AccessibleObject call check?
-
- Closed
-