FindBugs is an open source program which looks for bugs in Java code. It performs static analysis for the Java byte-code to identify hundreds of different potential types of errors in Java programs.
The software is distributed as a stand-alone GUI application and as a plug-in for IDE’s like Eclipse, Netbeans, IntelliJ IDEA.
Companies like Google, Sun Microsystems (now Oracle) and many more Institutions and Projects are the financial supporters of FindBugs which itself says about its usage and popularity among developers and organizations around the world. In this post I will teach you how to use FindBugs plugin for Eclipse IDE.
What type of errors FindBugs tells:
Any coding mistake, any probable bug, coding bad practices e.g HashCode and Equal problem, code that is confusing, anomalous, or written in a way that leads itself to errors e,g dead local stores, unconfirmed casts, redundant null check of value known to be null, coloneable idiom etc.
Follow the simple steps to use FindBugs
STEP 1: Install the FindBug plugin in your Eclipse IDE using-
URL: http://findbugs.cs.umd.edu/eclipse and NAME: FindBug update site
(if you do not know how to install plugin in an eclipse IDE, click on install FindBug Eclipse plugin )
STEP 2: Right click on your Java project in Package Explorer, and select the option labeled “Find Bugs”.
You are done. 🙂 FindBugs will run, and problem markers (displayed in source windows, and also in the Eclipse Problems view) will point to locations in your code which have been identified as potential instances of bug patterns.
I recommend using FindBugs to find errors in your Java project. This will not just automatically find bugs but give you alarm of many potential bugs at the early stages of development.