EnkiFindBugsPlugin
To aid in detecting uses of == on repository objects, Enki contains a FindBugs plugin that will detect use of the == and != operators on the javax.jmi.reflect.RefObject interface and its sub-interfaces and implementations.
Note that FindBugs is a static analysis tool and therefore cannot detect this error if the objects in question have been cast to java.lang.Object.
The Farrago build script contains a FindBugs target which can be adapted to use Enki's plugin:
- Copy
eigenbase-enki-xxx-findbugs.jarintothirdparty/findbugs/plugin
At this point Farrago's findbugs target should automatically detect the RefObject equality error in addition to all the errors FindBugs normally detects. The findbugs target in Farrago can be adapted to use in other projects.
To focus on RefObject equality errors,
- Extract the file
filter.xmlfrom the Enki FindBugs plugin JAR. - Set the FindBugs Ant task's
includeFilterattribute to refer to the file's location.
Now FindBugs will detect only the RefObject equality error.