http://sourceforge.net/projects/pmd

PMD is a Java source code analyzer. It finds unused variables, empty catch blocks, unnecessary object creation, and so forth.