Community
Participate
Working Groups
Build Identifier: 20110615-0604 While working on the CodingSpectator <http://codingspectator.cs.illinois.edu/> project, we tried the pull up refactoring on a piece of code whose structure was similar to the one I use below. We expected the refactoring tool to warn us about the erroneous output that it was going to generate. Reproducible: Always Steps to Reproduce: 1. Create a Java project that contains a Java file C.java with the following contents. abstract class D { abstract void m(); static class D1 { } } class C { void m() { } class C1 extends D.D1 { void m() { C.this.m(); } } } 2. Invoke the pull up method refactoring on method m in C1 to D1 in the above piece of code. 3. Eclipse will perform the refactoring but the resulting code will contain the compilation problem "No enclosing instance of the type C is accessible in scope". I think it would be better if the precondition checks prevent or warn the user about performing this refactoring.
Created attachment 199221 [details] The Eclipse project containing the minimal example that demonstrates the bug in the pull up refactoring The attached Java project contains the piece of code I used to explain the bug.
Moving to JDT/UI
*** This bug has been marked as a duplicate of bug 195005 ***