| Summary: | [refactoring] Pull Up Field changes the accessibility of the field | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Jonhnanthan Oliveira <jonhnanthan> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | 4.5.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | stalebug | ||
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. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. 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. |
Applying pull up field refactoring to move B.field to class A, increases the accessibility of the field from "no modifier" to protected. The same input was tested in NetBeans IDE and it does not increase the accessibility of the field. According to Fowler's book [1], we should preserve the field accessibility. --- Before Refactoring: public class A {} public class B extends A { int field = 11; public long m() { return field; } } --- Resulting Program: public class A { protected int field = 11; } public class B extends A { public long m() { return field; } } [1] Martin Fowler. Refactoring: improving the design of existing code. Addison-Wesley Longman Publishing Company, Inc., Boston, MA, USA, 1999.