Consider the following code:
package otherpkg;
public class PublicC {
protected class ProtectedMem {}
}
package thispkg;
class Lucky {
otherpkg.PublicC.ProtectedMem z; // Allowed by gjc!
class Tricky2 extends otherpkg.PublicC{}
}
javac (in 1.3) accepts this. It does not accept it in 1.2. This code is illegal
according to the JLS 2nd edition (6.6.1, 6.6.2).
gilad.bracha@eng 2000-01-26
package otherpkg;
public class PublicC {
protected class ProtectedMem {}
}
package thispkg;
class Lucky {
otherpkg.PublicC.ProtectedMem z; // Allowed by gjc!
class Tricky2 extends otherpkg.PublicC{}
}
javac (in 1.3) accepts this. It does not accept it in 1.2. This code is illegal
according to the JLS 2nd edition (6.6.1, 6.6.2).
gilad.bracha@eng 2000-01-26