Class BugAccumulator

java.lang.Object
edu.umd.cs.findbugs.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 Details

    • BugAccumulator

      public BugAccumulator(BugReporter reporter)
      Constructor.
      Parameters:
      reporter - the BugReporter to which warnings should eventually be reported
  • Method Details

    • getLastBugLocation

      @CheckForNull public SourceLineAnnotation getLastBugLocation()
    • forgetLastBug

      public void forgetLastBug()
    • 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
    • uniqueBugs

      public Iterable<? extends BugInstance> uniqueBugs()
    • locations

      public Iterable<? extends SourceLineAnnotation> locations(BugInstance bug)
    • reportAccumulatedBugs

      public void reportAccumulatedBugs()
      Report accumulated warnings to the BugReporter. Clears all accumulated warnings as a side-effect.
    • reportBug

      public void reportBug(BugInstance bug, edu.umd.cs.findbugs.BugAccumulator.Data d)
    • 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)