Project: JDT
Bug 394547 [extract class] Extract class refactoring on a field in an inner non-static class yields compilation error
Reported: 2012-11-18 22:05:11 | Status: resolved fixed

Steps to reproduce: 1. Invoke "Extract Class..." on "m" in code below 2. Specify "Nested Class in 'C' 3. There is a compilation error in the resulting file ("cannot be declared static") class ExtractClassBug { class C { // Invoke "Extract Class..." on "m" (and specify "Nested Class in 'C'" int m; } } (Thanks to Yilong Li for helping with the bug report.)

Files changed in fix:
org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testNested1/in/Nested1.java org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testNested1/out/Nested1.java org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testNested2/in/Nested2.java org.eclipse.jdt.ui.tests.refactoring/resources/ExtractClass/testNested2/out/Nested2.java org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractClassTests.java org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/structure/ExtractClassRefactoring.java