Community
Participate
Working Groups
When trying to access protected fields of base class objects in subclasses in another package, the compiler rightfully signals an error, but the proposed Quickfix, in this case changing the field visibility to protected, doesn't help; maybe it should suggest changing visibility to public?
Moving to JDT/UI. Could you please provide an example that fails?
[file 1] package a; public class Base { protected int myField; } [file 2] package b; import a.Base; public class Child extends Base { public void aMethod(Base parent) { System.out.println (parent.myField); } } This example rightfully fails to compile, but the proposed Quickfix is "change visibility of myField to protected", which is already the case.
*** This bug has been marked as a duplicate of bug 65876 ***