EVALUATION
The regression occurs in Mustang b70. The given test case works in b69, and fails in b70.
gzilla[play]% for i in /java/re/jdk/6/promoted/all/{b69,b70} ; do echo $i ; $i/binaries/solaris-sparc/bin/javac $(find . -name \*.java ); $i/binaries/solaris-sparc/bin/java -classpath . D; done
/java/re/jdk/6/promoted/all/b69
A.m()
/java/re/jdk/6/promoted/all/b70
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)
gzilla[play]%
There were no compiler (java/java/compiler) changes in b70. Period.
This looks related to this java/runtime bug, which *was* fixed in b70.
4293149 Priv. member accessible if its visibility chgd after class using it is compiled
[[ Of the other fixes in b70, one is java/install, one other is java/runtime but is to do with servlet annotatations, and the rest are java/classes_*. ]]
Refiling against java/java/runtime.
|
EVALUATION
Code in class C can access class B, since B is public. And, code in class C can access B.m because m is declared in A and C is a subclass of A (JLS 6.6.2, JVMS 5.4.4). The crucial point is that m is static, so there is no additional check at compile-time or run-time that the reference to m is through A (m's declaring class) or a subclass.
|