PMD scans Java source code and looks for potential problems like:
PMD has plugins for JDeveloper, JEdit, JBuilder, NetBeans/Sun ONE Studio, IntelliJ IDEA, TextPad, Maven, Ant, Eclipse, Gel, and Emacs. You can download everything from here.
Thanks to the Cougaar program for sponsoring PMD!