fb-contrib is a bug detector plugin for the FindBugs application (findbugs.sourceforge.net).
This release adds six detectors that can easily be integrated into FindBugs by dropping the jar file into FindBugs' plugin directory. fb-contrib version 4.6.0 requires FindBugs version 1.1.0 or later. This version of fb-contrib uses java 1.6.
New Detectors added in this release:
Lingering Graphics Object
Looks for creation of java.awt.Graphics object that do not have the .dispose() method called on them when finished. These objects will be cleaned up by the Garbage collector, bug given the likelyhood that large numbers of these objects can be created in a short period of time, it is better to dispose them as soon as possible.
Compare Class Name Equals
Looks for code that compares to classes by name, rather than by just comparing the classes with ==
CommonsStringBuilderToString
Looks for usage of ToStringBuilder from Apache commons, where the code invokes toString() on the constructed object without invoking append().
Usage without invoking append is equivalent of using the Object.toString() method
new ToStringBuilder(this).toString();
CommonsHashcodeBuilderToHashcode
Looks for uses for Commons-lang HashCodeBuilder where the result of hashCode() is returned instead of calling the method toHashCode().
BackportReusePublicIdentifiers
Looks for use of Backport Utils concurrent classes. Updated/Efficient version of these classes are available in versions of the JDK 5.0 and higher, and these classes should only be used if you are targeting JDK 1.4 and lower.
Clone Usability
Looks for classes that implement clone() that do not specialize the return value, and do not swallow CloneNotSupportedException. Not doing so makes the clone method not as simple to use, and should be harmless to do.