I\'ve been assigned to do some work on a huge Java project, and the influence of several iterations of developers is obvious. There is no standard coding style, formatting, nam
I find Eclipse to be an incredibly powerful tool for operations such as this.
A lot of people swear by command-line tools and modal-based text editors for programming but there are strong advantages of using a full IDE for major refactoring:
In addition to Eclipse's toolset you might look in to utilizing other modern Java tools for ensuring your code is always functioning.
edit:
I also personally prefer Eclipse because I am the one doing the refactoring, not some automated tool that knows next to nothing about my code.
Start with the monolithic classes and break them up (greater than 500 statements excluding comments and lines with just braces). Introduce interfaces, then dependency injection.
My suggestion would be add something like Checkstyle to your build system. It's hard to get management to buy into the idea of doing a complete overhaul all at once. Design what you think are a good set of style guidelines and implement them in Checkstyle and add it to your build.
Then, require that all new check-in of code doesn't break Checkstyle. That means whenever you work on a class you'll bring it up to standards. It won't seem you're doing any extra work at all if it's just a little something you have to do before committing for a while.
Also, checkstyle plugins exist for Eclipse.
What I like to do in this situation is:
I had such experience. I agree with people that recommend maven build, eclipse, Checkstyle, refactoring of big classes etc. I understand that you cannot achieve full test coverage before your are starting to work. I'd recommend 1. reformat code in batch mode using checkstyle or similar tool 2. enable all reasonable warnings in Eclipse and refactor code that cause such warnings if this refactoring is trivial. In other cases put @SupressWarning and special TODO to come back to this code later. 3. use defect driven automatic testing, i.e. develop tests for module you are going to change.
Good luck!
It's a rather common task, not very joyful but neither a nightmare... It could be worse, if coded in other languages (Perl, PHP, C++, -gasp- VB... ); actually, Java is one the best for your scenario.
Get a decent IDE (Eclipse) and spend a good time understanding dependences and call cycles. It will take a long time to get familiar with everything, so try to make only small changes first.
When documentation is lacking, the IDE (and the static compiling) helps a lot to know who is using which class or method, and you can do refactoring quite confidently. But first try to identify in which layers/packages/classes is reflection used (explicitly by your code, or implicitly by your frameworks - eg. some getters and setters).
There are many books devoted to "Reengineering Legacy Software" and related issues.