Community
Participate
Working Groups
Build R2.0 When compiling the following test case, javac 1.4 reports an error, where the Eclipse compiler (1.4) doesn't. package p; public class X { protected void foo(){} } class Z { void bar(){ new q.Y().foo(); // should complain about visibility } } package q; public class Y extends p.X { protected void foo(){} }
Two fixes are possible: 1- either change the #canBeSeenBy implementation to check for shadowing protected methods (somewhat similar to package visible check) 2- or change the #findMethod implementation to explicitly filter out the shadowed method during lookup (leaving the non-visible one in for complaining). Releasing fix #2.
Verified.
*** Bug 23788 has been marked as a duplicate of this bug. ***