-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.2.0
-
sparc
-
solaris_2.5.1
Name: laC46010 Date: 04/17/98
The method Class.getModifiers() throws IllegalAccessError if the Class
instance represents class which contains nested classes (JDK1.2beta4A).
If the class declares nested class with public or protected access, than the
Class.getModifiers() is executed correctly.
If the class declares nested class which local to the block or has private
or default access, than IllegalAccessError will be thrown.
An example below produces the following output:
-----------------output------------------
> java -fullversion
java full version "JDK-1.2beta4-A"
> java Test
java.lang.IllegalAccessError: try to access class Test$NestedClass from class java/lang/Class
at java.lang.Class.getModifiers(Native Method)
at Test.main(Compiled Code)
---------------Test.java-----------------
class Test {
class NestedClass{
}
public static void main(String argv[]) {
Class c = Test.class;
int k = c.getModifiers();
System.out.println("OK. ");
}
}
-----------------------------------------
Hook 5(hook5):
======================================================================
- duplicates
-
JDK-4129934 Class.getModifiers() throws IllegalAccessError in presence of inner classes
- Closed
-
JDK-4129937 Class.getModifiers() throws IllegalAccessError in presence of inner classes
- Closed
-
JDK-4129943 Class.getModifiers() throws IllegalAccessError in presence of inner classes
- Closed
-
JDK-4127549 inner class is incorrectly verified when requesting modifiers of outer class
- Closed