FindBugs is a free static source code analysis tool created by David Hovemeyer and Bill Pugh which helps you to find the bugs in your java code and improve the code quality. FindBugs uses static analysis on java code to find the bugs.
FindBugs works on byte code rather than source code, So FindBugs should be run after building the project
FindBugs is available as a small GUI application. Also plug-ins available forNetbeans, IntelliJ IDEA & Eclipse.
Another options are FindBugs maven plugin and FindBugs ant plugin