| Summary: | [encapsulate field] Encap. a field yields comp. error due to override getter | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | kely_garcia <kely_garcia> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | xiemaisi |
| Version: | 3.3 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | stalebug | ||
Move to JDT/UI *** Bug 209317 has been marked as a duplicate of this bug. *** This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |
Steps To Reproduce: Build id: I20070608-1718 Encapsulate field "theField" on the following: public class A { String theField; public static void main(String[] args) { B b = new A().new B(); System.out.println(b.getTheField()); } class B extends A { private String getTheField() { return theField; } } } Yields the following refactored code: public class A { private String theField; public static void main(String[] args) { B b = new A().new B(); System.out.println(b.getTheField()); } void setTheField(String theField) { this.theField = theField; } String getTheField() { return theField; } class B extends A { private String getTheField() { return theField; } } } The compilation error is: "cannot reduce the visibility of inherited method from A" More information: