edu.umd.cs.findbugs

Class BugAccumulator

public class BugAccumulator extends Object

Accumulate warnings that may occur at multiple source locations, consolidating them into a single warning.

Author: Bill Pugh David Hovemeyer

Constructor Summary
BugAccumulator(BugReporter reporter)
Constructor.
Method Summary
voidaccumulateBug(BugInstance bug, SourceLineAnnotation sourceLine)
Accumulate a warning at given source location.
voidaccumulateBug(BugInstance bug, BytecodeScanningDetector visitor)
Accumulate a warning at source location currently being visited by given BytecodeScanningDetector.
Iterator<Entry<BugInstance,List<SourceLineAnnotation>>>entrySetIterator()
Get an Iterator over the BugAccumulator's map entry set.
voidreportAccumulatedBugs()
Report accumulated warnings to the BugReporter.

Constructor Detail

BugAccumulator

public BugAccumulator(BugReporter reporter)
Constructor.

Parameters: reporter the BugReporter to which warnings should eventually be reported

Method Detail

accumulateBug

public void accumulateBug(BugInstance bug, SourceLineAnnotation sourceLine)
Accumulate a warning at given source location.

Parameters: bug the warning sourceLine the source location

accumulateBug

public void accumulateBug(BugInstance bug, BytecodeScanningDetector visitor)
Accumulate a warning at source location currently being visited by given BytecodeScanningDetector.

Parameters: bug the warning visitor the BytecodeScanningDetector

entrySetIterator

public Iterator<Entry<BugInstance,List<SourceLineAnnotation>>> entrySetIterator()
Get an Iterator over the BugAccumulator's map entry set. This allows a way to post-process the accumulated warnings to remove some if necessary.

Returns: an Iterator over the BugAccumulator's map entry set

reportAccumulatedBugs

public void reportAccumulatedBugs()
Report accumulated warnings to the BugReporter. Clears all accumulated warnings as a side-effect.
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.