Community
Participate
Working Groups
Sometimes in the course of refactoring, I'll realize that I've got an inner class that does not reference the outer class's fields in any way, so I mark it 'static'. Later on, I want to move this static inner class to its own compilation unit, or (rarely) to inside some other class. In the most common case, Inner has no references to any members or fields of Outer, and all I want to do is grab it and create a new compilation unit. e.g. public class Outer { // stuff public static class Inner { // other stuff } } Just supporting this behaviour would be good enough, except sometimes (rarely), Inner references some static fields or members of Outer. In which case, precondition checking would have to verify that they are visible from the new location, and the refactoring would expand the scoped references as needed for the new context.
agreed that this would be useful, but cannot committ to it for 2.0
Related to Bug 6502 and others.
[refactoring] This is "Create Outer class from static inner class" Consider for 2.1
*** Bug 12414 has been marked as a duplicate of this bug. ***
*** Bug 22462 has been marked as a duplicate of this bug. ***
From bug 22462 For non-static inner classes, the implicit reference to the outer class should be made explicit if required. I guess initialy the refactoring could be allowed only when the inner class doesn't use non-public features of the outer class.
iin the build