In NetBeans 7.4, the FindBugs integration inside the IDE has been improved giving us the possibility to specify additional rules to be checked.
FindBugs has a plugin architecture that let user to add custom rules sets. I usually add FindBugs rules from FBContrib, a FindBugs auxiliary rules set.
There are hundred of rules included in FBContrib. Complete list can be found here.
What is amazing in NetBeans is that not only you can tell the IDE to use the additional rules sets but that the new rules are seamless integrated in the NetBeans interface. For example, FBContrib rules are grouped together with standard FindBugs checks.
First step is to specify the path to the FBContrib jar file (downloaded from the FBContrib website) in the FindBugs configuration (Options –> Editor –> Hints –> FindBugs )
Press “Custom FindBugs Plugins” button.
The “Add” button let us specify one or more additional jar files.
As I already mentioned, the rules included in the FBContrib jar file are integrated with the other native FindBugs rules.
See for example, the rules related to the “Secure” description before
and after FBContrib has been specified:
Both native and FBContrib rules can be enabled and disabled one by one.
With NetBeans Hints, FindBugs and, may be, PMD (see this post on PMD plugin ) all enabled there is a good chance that one problematic line can have more than one warning. In this case I suggest to keep native NetBeans hints enabled and disable the check in the other tools, mainly because NetBeans native checks are faster.