-
Bug
-
Resolution: Fixed
-
P3
-
6
-
b01
-
x86
-
windows_xp
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2177078 | 7 | Keith Mcguigan | P3 | Closed | Fixed | b27 |
JDK-2174888 | 6u14 | Keith Mcguigan | P3 | Closed | Fixed | b01 |
FULL PRODUCT VERSION :
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
Example below throws a runtime exception
Exception in thread "main" java.lang.IllegalAccessError: tried to access method
ab.A.m()V from class c.C
at c.C.c(C.java:8)
at D.main(D.java:5)
It compiles and runs w/o exception in jdk 1.5.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
either a compile time error or no error as in jdk 1.5
ACTUAL -
Exception in thread "main" java.lang.IllegalAccessError: tried to access method
ab.A.m()V from class c.C
at c.C.c(C.java:8)
at D.main(D.java:5)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package ab;
public abstract class A{
protected static void m(){
System.out.println("A.m()");
}
}
-----------------------------------------------------------------------
package ab;
public abstract class B extends A{
}
-----------------------------------------------------------------------
package c;
import ab.A;
import ab.B;
public class C extends A{
public static void c(){
B.m();
}
}
------------------------------------------------------------------------
import c.C;
public class D {
public static void main(String [] argv){
C.c();
}
}
------------------------------------------------------------------------
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
change a call B.m() to A.m()
Release Regression From : 6
The above release value was the last known release where this
bug was not reproducible. Since then there has been a regression.
java version "1.6.0"
Java(TM) SE Runtime Environment (build 1.6.0-b105)
Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
Example below throws a runtime exception
Exception in thread "main" java.lang.IllegalAccessError: tried to access method
ab.A.m()V from class c.C
at c.C.c(C.java:8)
at D.main(D.java:5)
It compiles and runs w/o exception in jdk 1.5.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
either a compile time error or no error as in jdk 1.5
ACTUAL -
Exception in thread "main" java.lang.IllegalAccessError: tried to access method
ab.A.m()V from class c.C
at c.C.c(C.java:8)
at D.main(D.java:5)
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
package ab;
public abstract class A{
protected static void m(){
System.out.println("A.m()");
}
}
-----------------------------------------------------------------------
package ab;
public abstract class B extends A{
}
-----------------------------------------------------------------------
package c;
import ab.A;
import ab.B;
public class C extends A{
public static void c(){
B.m();
}
}
------------------------------------------------------------------------
import c.C;
public class D {
public static void main(String [] argv){
C.c();
}
}
------------------------------------------------------------------------
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
change a call B.m() to A.m()
Release Regression From : 6
The above release value was the last known release where this
bug was not reproducible. Since then there has been a regression.
- backported by
-
JDK-2174888 Accessing protected static methods
- Closed
-
JDK-2177078 Accessing protected static methods
- Closed