Community
Participate
Working Groups
According to: http://developer.java.sun.com/developer/bugParade/bugs/4637755.html for a Java 1.4 compatible javac the compiler should not allow access to protected members from classes defined outside their package, even if members are overrider the method from a base class that *is* in the accessor's package. This "bug" existed in the javac included with JDK 1.3, but is "fixed" in the JDK 1.4 javac. Included is a piece of sample code that demonstrates the problem. With Sun's javac from JDK1.4 the following error is reported on compilation: PackageA/MainClass.java:12: overriddenMethod() has protected access in PackageB.DerivedClass derivedObject.overriddenMethod(); Eclipse's java compiler compiles the code happily, even when JDK1.4 compatibility is enabled.
Created attachment 2009 [details] Tiny eclipse project demonstrating the problem
I should mention that the attachment *does* compile with Eclipse, but it should not. I've commented the line that should not compile.
Works for me in latest. This is a duplicate of bug 22428. Fix is part of 2.1-M1 build. *** This bug has been marked as a duplicate of 22428 ***
Forgot to assign.
*** This bug has been marked as a duplicate of 22428 ***