Package edu.umd.cs.findbugs
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
A BugReporter which delegates all method calls to another BugReporter. This
is useful for customizing the behavior of another bug reporter.
- Author:
- David Hovemeyer
-
Field Summary
Fields inherited from interface edu.umd.cs.findbugs.BugReporter
NORMAL, SILENT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addObserver
(BugReporterObserver observer) Add an observer.void
finish()
Finish reporting bugs.Get the bug collection (if any) associated with this bug reporterprotected BugReporter
Get ProjectStats object used to store statistics about the overall project being analyzed.void
Log an error that occurs while performing analysis.void
Log an error that occurs while performing analysis.void
observeClass
(ClassDescriptor classDescriptor) Observe a class being visited.void
reportBug
(BugInstance bugInstance) Report a bug.void
reportMissingClass
(ClassDescriptor classDescriptor) Called to report a class lookup failure.void
Called to report a class lookup failure.void
Report any accumulated error messages.void
Report that we skipped some analysis of a methodvoid
setErrorVerbosity
(int level) Set the error-reporting verbosity level.void
setPriorityThreshold
(int threshold) Set the priority threshold.
-
Constructor Details
-
DelegatingBugReporter
Constructor.- Parameters:
delegate
- another BugReporter to delegate all BugReporter methods to
-
-
Method Details
-
getDelegate
-
setErrorVerbosity
public void setErrorVerbosity(int level) Description copied from interface:BugReporter
Set the error-reporting verbosity level.- Specified by:
setErrorVerbosity
in interfaceBugReporter
- Parameters:
level
- the verbosity level
-
setPriorityThreshold
public void setPriorityThreshold(int threshold) Description copied from interface:BugReporter
Set the priority threshold.- Specified by:
setPriorityThreshold
in interfaceBugReporter
- Parameters:
threshold
- bug instances must be at least as important as this priority to be reported
-
observeClass
Description copied from interface:IClassObserver
Observe a class being visited.- Specified by:
observeClass
in interfaceIClassObserver
- Parameters:
classDescriptor
- class being visited
-
reportBug
Description copied from interface:BugReporter
Report a bug. The implementation may report the bug immediately, or queue it for later.- Specified by:
reportBug
in interfaceBugReporter
- Parameters:
bugInstance
- object describing the bug instance
-
logError
Description copied from interface:IErrorLogger
Log an error that occurs while performing analysis.- Specified by:
logError
in interfaceIErrorLogger
- Parameters:
message
- the error message
-
reportMissingClass
Description copied from interface:IErrorLogger
Called to report a class lookup failure.- Specified by:
reportMissingClass
in interfaceIErrorLogger
- Parameters:
ex
- a ClassNotFoundException resulting from the class lookup failure
-
reportMissingClass
Description copied from interface:IErrorLogger
Called to report a class lookup failure.- Specified by:
reportMissingClass
in interfaceIErrorLogger
- 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 interfaceBugReporter
-
reportQueuedErrors
public void reportQueuedErrors()Description copied from interface:BugReporter
Report any accumulated error messages.- Specified by:
reportQueuedErrors
in interfaceBugReporter
-
addObserver
Description copied from interface:BugReporter
Add an observer.- Specified by:
addObserver
in interfaceBugReporter
- Parameters:
observer
- the observer
-
getProjectStats
Description copied from interface:BugReporter
Get ProjectStats object used to store statistics about the overall project being analyzed.- Specified by:
getProjectStats
in interfaceBugReporter
-
logError
Description copied from interface:IErrorLogger
Log an error that occurs while performing analysis.- Specified by:
logError
in interfaceIErrorLogger
- Parameters:
message
- the error messagee
- the exception which is the underlying cause of the error
-
reportSkippedAnalysis
Report that we skipped some analysis of a method- Specified by:
reportSkippedAnalysis
in interfaceIErrorLogger
- Parameters:
method
-
-
getBugCollection
Description copied from interface:BugReporter
Get the bug collection (if any) associated with this bug reporter- Specified by:
getBugCollection
in interfaceBugReporter
-