fb-contrib is a bug detector plugin for the FindBugs application (findbugs.sourceforge.net). This release adds five detectors that can easily be integrated into FindBugs by dropping the jar file into FindBugs' plugin directory. fb-contrib version 3.6.0 requires FindBugs version 1.1.0 or later.
New Detectors added in this release:
Confusing Function Semantics
Looks for methods that return a parameter after making what looks like modifications to that parameter. This leads to confusion for the user of this method as it isn't obvious that the 'original' object is modified. If the point of this method is to modify the parameter, it is probably better just to have the method be a void method, to avoid confusion.
Suspicious Clone Algorithm
Looks for implementation of clone where an assignment is made to a field of the source object. It is likely that that store should have occurred on the cloned object, as the clone operation is almost always considered read only.
JUnit Assertion Oddities
Looks for junit test case methods that use assertions with odd parameters. Things such as, passing a constant as the second (actual) parameter, not using the three parameter version of asserts for doubles, or passing true or false as the first parameter instead of using assertTrue, or assertFalse.
Weak Exception Messaging
Looks for exceptions that are thrown with static strings as messages. Using static strings doesn't differentiate one use of this method versus another, and so it may be difficult to determine how this exception occurred without showing context.
In addition, fb-contrib is now an OSGI bundle.