I’ve ran across a spate of tools that make developing Java even easier and even better. I am kind of amazed at the last few years in Java development tools. Just think how much of a contribution that Ant and JUnit have had by themselves, for the efficiency of development and quality of Java code in the last few years. Now at work we’ve found even more cool ones. Today I downloaded and used FindBugs. This is a program that looks for common bug patterns amongst Java programs (will work on compiled classes, source not necessary.) It immediately flagged that we had 3 of 4 access points for a given field synchronized, and that the unsynchronized 4th use is a potential source of bugs. It found a lot of things like that. As an aside, the guy who did this, Bill Pugh is although the guy who devised the skip list algorithm.
Another tool I just got working is Jadclipse. This is an Eclipse plugin that works with the Jad decompiler. If you open a class for which Eclipse doesn’t know about the source file, it will then pass it to Jad, which will decompile it on the fly and present it as source. I’m hoping, although I haven’t tested it yet, that will work while debugging and stepping through as well, so anytime you leave your own code into a library, Jad will automatically take a stab at decompiling it. Cool, no?
The third tool is PMD, a tool that does source code analysis. This one is not the knockout of the other two, partly because it overlaps with checks that already exist in the base Eclipse program. It does check for unused code, unused parameters and methods, etc. It’s a lot like lint, doing static analysis on the source code. I’m installing that now and will run my current project through it. The sum of adding these three projects is a pretty slick effect. I like it.