I have a file with nested classes, but it's becoming long enough to be unreadable. Is there a way I can break out the nested classes into separate files?
+3
A:
I'm afraid not.
As an alternative, you could consider converting some of them to plain Java classes: although nested classes increase encapsulation, you can certainly create good OO design without them.
My two cents.
Nikita Rybak
2010-09-05 04:52:50
encapsulation - FTFY.
slomojo
2010-09-05 04:59:41
@slomojo oops :)
Nikita Rybak
2010-09-05 05:09:14
...although technically this isn't what I asked for (as Nikita pointed out), this is in fact what I wanted.
Goose Bumper
2010-09-05 05:34:22
Or press F6 when your cursor is over the class name in IDEA, which is the right tool.
Ricky Clarkson
2010-09-05 05:38:22
+1
A:
Write unit-tests to cover the code you are going to refactor.
Then use refactoring tools, e.g. Eclipse/JDT to extract each class. Run the tests for each refactoring job.
For extra fun, you can do this without the unit tests.
slomojo
2010-09-05 04:55:14