Class BugAccumulator
java.lang.Object
edu.umd.cs.findbugs.BugAccumulator
Accumulate warnings that may occur at multiple source locations,
consolidating them into a single warning.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final HashMap<String, BugInstance> private BugInstanceprivate SourceLineAnnotationprivate final Map<BugInstance, BugAccumulator.Data> private final booleanprivate final BugReporter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccumulateBug(BugInstance bug, ClassContext classContext, org.apache.bcel.classfile.Method method, Location location) voidaccumulateBug(BugInstance bug, ClassContext classContext, org.apache.bcel.generic.MethodGen methodGen, String sourceFile, Location location) voidaccumulateBug(BugInstance bug, BytecodeScanningDetector visitor) Accumulate a warning at source location currently being visited by given BytecodeScanningDetector.voidaccumulateBug(BugInstance bug, SourceLineAnnotation sourceLine) Accumulate a warning at given source location.voidClear all accumulated bugs without reporting themvoidIterable<? extends SourceLineAnnotation> locations(BugInstance bug) voidReport accumulated warnings to the BugReporter.voidreportBug(BugInstance bug, BugAccumulator.Data d) Iterable<? extends BugInstance>
-
Field Details
-
reporter
-
performAccumulation
private final boolean performAccumulation -
map
-
hashes
-
lastBug
-
lastSourceLine
-
-
Constructor Details
-
BugAccumulator
Constructor.- Parameters:
reporter- the BugReporter to which warnings should eventually be reported
-
-
Method Details
-
getLastBugLocation
-
forgetLastBug
public void forgetLastBug() -
accumulateBug
Accumulate a warning at given source location.- Parameters:
bug- the warningsourceLine- the source location
-
accumulateBug
Accumulate a warning at source location currently being visited by given BytecodeScanningDetector.- Parameters:
bug- the warningvisitor- the BytecodeScanningDetector
-
uniqueBugs
-
locations
-
reportAccumulatedBugs
public void reportAccumulatedBugs()Report accumulated warnings to the BugReporter. Clears all accumulated warnings as a side-effect. -
reportBug
-
clearBugs
public void clearBugs()Clear all accumulated bugs without reporting them -
accumulateBug
public void accumulateBug(BugInstance bug, ClassContext classContext, org.apache.bcel.classfile.Method method, Location location) -
accumulateBug
public void accumulateBug(BugInstance bug, ClassContext classContext, org.apache.bcel.generic.MethodGen methodGen, String sourceFile, Location location)
-