Community
Participate
Working Groups
pkg1.Abstract has a protected method callme() pkg2.Concrete extends pkg1.Abstract, and overrides protected callme() pkg1.Caller tries to call aConcrete = new Concrete(); aConcrete.callme() This isn't allowed by either jikes or javac, but compiles and runs in eclipse. A protected method in pkg2 shouldn't be seen by an object in pkg1.
Which drop on you running? Did you change any of the default compiler settings? If so, which ones?
Using eclipse 2.1.1 with compiler compliance 1.3 and jdk1.4.1_02 jars. Everything else is default.
Did I misunderstand your test? I tried the following & javac compiled it without error: package p1; public class A { protected void foo() {} } package p2; public class B extends p1.A { protected void foo() {} } package p1; public class C { void test (p2.B b) { b.foo(); } }
I can't get this to compile with either with javac 1.4.1_02 or jikes 1.18 from the command line. I copied and pasted your code into new java files in appropriate packages to test the build. This shouldn't work as C doesn't have view of B's protected methods.
But you said you were running with compliance level 1.3. This was changed between javac 1.3 & 1.4 so you need to switch the Compiler compliance level in Eclipse to 1.4 to test apples to apples.