An instance of a bug pattern. A BugInstance consists of several parts:
- the type, which is a string indicating what kind of bug it is; used as a key for the FindBugsMessages resource bundle
- the priority; how likely this instance is to actually be a bug
- a list of annotations
The annotations describe classes, methods, fields, source locations, and other relevant context information about the bug instance. Every BugInstance must have at least one ClassAnnotation, which describes the class in which the instance was found. This is the "primary class annotation".
BugInstance objects are built up by calling a string of add
methods. (These methods all "return this", so they can be chained). Some of the add methods are specialized to get information automatically from a BetterVisitor or DismantleBytecode object.
@author David Hovemeyer
@see BugAnnotation