Class DelegatingBugReporter

java.lang.Object
edu.umd.cs.findbugs.DelegatingBugReporter
All Implemented Interfaces:
RepositoryLookupFailureCallback, BugReporter, IClassObserver, IErrorLogger
Direct Known Subclasses:
BugReporterDecorator, CategoryFilteringBugReporter, ErrorCountingBugReporter, ExcludingHashesBugReporter, FilterBugReporter

public class DelegatingBugReporter extends Object implements BugReporter
A BugReporter which delegates all method calls to another BugReporter. This is useful for customizing the behavior of another bug reporter.
Author:
David Hovemeyer
  • Constructor Details

    • DelegatingBugReporter

      public DelegatingBugReporter(BugReporter delegate)
      Constructor.
      Parameters:
      delegate - another BugReporter to delegate all BugReporter methods to
  • Method Details

    • getDelegate

      protected BugReporter getDelegate()
    • setErrorVerbosity

      public void setErrorVerbosity(int level)
      Description copied from interface: BugReporter
      Set the error-reporting verbosity level.
      Specified by:
      setErrorVerbosity in interface BugReporter
      Parameters:
      level - the verbosity level
    • setPriorityThreshold

      public void setPriorityThreshold(int threshold)
      Description copied from interface: BugReporter
      Set the priority threshold.
      Specified by:
      setPriorityThreshold in interface BugReporter
      Parameters:
      threshold - bug instances must be at least as important as this priority to be reported
    • observeClass

      public void observeClass(ClassDescriptor classDescriptor)
      Description copied from interface: IClassObserver
      Observe a class being visited.
      Specified by:
      observeClass in interface IClassObserver
      Parameters:
      classDescriptor - class being visited
    • reportBug

      public void reportBug(@Nonnull BugInstance bugInstance)
      Description copied from interface: BugReporter
      Report a bug. The implementation may report the bug immediately, or queue it for later.
      Specified by:
      reportBug in interface BugReporter
      Parameters:
      bugInstance - object describing the bug instance
    • logError

      public void logError(String message)
      Description copied from interface: IErrorLogger
      Log an error that occurs while performing analysis.
      Specified by:
      logError in interface IErrorLogger
      Parameters:
      message - the error message
    • reportMissingClass

      public void reportMissingClass(ClassNotFoundException ex)
      Description copied from interface: IErrorLogger
      Called to report a class lookup failure.
      Specified by:
      reportMissingClass in interface IErrorLogger
      Parameters:
      ex - a ClassNotFoundException resulting from the class lookup failure
    • reportMissingClass

      public void reportMissingClass(ClassDescriptor classDescriptor)
      Description copied from interface: IErrorLogger
      Called to report a class lookup failure.
      Specified by:
      reportMissingClass in interface IErrorLogger
      Parameters:
      classDescriptor - ClassDescriptor of a missing class
    • finish

      public void finish()
      Description copied from interface: BugReporter
      Finish reporting bugs. If any bug reports have been queued, calling this method will flush them.
      Specified by:
      finish in interface BugReporter
    • reportQueuedErrors

      public void reportQueuedErrors()
      Description copied from interface: BugReporter
      Report any accumulated error messages.
      Specified by:
      reportQueuedErrors in interface BugReporter
    • addObserver

      public void addObserver(BugReporterObserver observer)
      Description copied from interface: BugReporter
      Add an observer.
      Specified by:
      addObserver in interface BugReporter
      Parameters:
      observer - the observer
    • getProjectStats

      public ProjectStats getProjectStats()
      Description copied from interface: BugReporter
      Get ProjectStats object used to store statistics about the overall project being analyzed.
      Specified by:
      getProjectStats in interface BugReporter
    • logError

      public void logError(String message, Throwable e)
      Description copied from interface: IErrorLogger
      Log an error that occurs while performing analysis.
      Specified by:
      logError in interface IErrorLogger
      Parameters:
      message - the error message
      e - the exception which is the underlying cause of the error
    • reportSkippedAnalysis

      public void reportSkippedAnalysis(MethodDescriptor method)
      Report that we skipped some analysis of a method
      Specified by:
      reportSkippedAnalysis in interface IErrorLogger
      Parameters:
      method -
    • getBugCollection

      @CheckForNull public BugCollection getBugCollection()
      Description copied from interface: BugReporter
      Get the bug collection (if any) associated with this bug reporter
      Specified by:
      getBugCollection in interface BugReporter