Name: aaC67449 Date: 07/20/98
javac incorrectly denies access from a subclass to protected inner class from a superclass placed in other package.
See the examples and javac output.
This bug is introduced in JDK1.2-fcsB, all works correctly in JDK1.2-fcsA, JDK1.2-beta4 and JDK1.1.6.
------------------Example-----------------------------------
---- Test1.java -------
package test;
public class Test1 {
protected class InnerTest1 {
}
}
---- Test2.java -----
import test.Test1;
public class Test2 extends Test1 {
protected class InnerTest2 extends InnerTest1{
}
}
-------------------Output------------------------------------
JDK1.2-fcsB:
#>/set/java/JDK1.2-fcsB/solaris/bin/javac -d . Test1.java Test2.java
Test2.java:3: The type test.Test1.InnerTest1 to which the member <init> belongs is not accessible from inner class Test2. InnerTest2.
protected class InnerTest2 extends InnerTest1{
^
1 error
#>
JDK1.2-fcsA:
#>/set/java/JDK1.2-fcsA/solaris/bin/javac -d . Test1.java Test2.java
#>
======================================================================