| Summary: | [Pull Up Method] Strong precondition: Method [] referenced in one of the moved elements is not accessible from type [] | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Gustavo Soares <gsoares> |
| Component: | UI | Assignee: | JDT-UI-Inbox <jdt-ui-inbox> |
| Status: | CLOSED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | noopur_gupta |
| Version: | 4.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Mac OS X | ||
| Whiteboard: | stalebug | ||
Tested with Build ID: I20130204-1400. The bug is reproducible. 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. |
Step 1: Create the classes: package p1; public class A { protected long k( long a){ return 6; } } package p2; import p1.*; public class B extends A { public long m(){ return new B().k(2); } public long k( int a){ return 92; } public long test(){ return m(); } } Step 2: apply the pull up method to the m() method. Eclipse will show a warning: Method p2.B.k(...) referenced in one of the moved elements is not accessible from type p1.A. However, if we apply the transformation regardless the warning, the resulting program will compile: package p1; import p2.B; public class A { protected long k( long a){ return 6; } public long m() { return new B().k(2); } } package p2; import p1.*; public class B extends A { public long k( int a){ return 92; } public long test(){ return m(); } }