Insert nested classes into separate files

I have a file with nested classes, but it gets long enough to be unreadable. Is there a way to break nested classes into separate files?

+6
java nested-class
source share
3 answers

Use the right tools.

alt text

+11
source share

I'm afraid not.
Alternatively, you might consider converting some of them into simple Java classes: although nested classes increase encapsulation, you can certainly create a good OO design without them.

My two cents.

+3
source share

Write unit tests to cover the code you are about to refactor.

Then use refactoring tools, for example. Eclipse / JDT to retrieve each class. Run tests for each refactoring job.

For added pleasure, you can do this without unit tests.

+1
source share

All Articles