Class BugReportDispatcher
java.lang.Object
edu.umd.cs.findbugs.BugReportDispatcher
- All Implemented Interfaces:
RepositoryLookupFailureCallback, BugReporter, IClassObserver, IErrorLogger, ConfigurableBugReporter
Bug reporter delegate actual operation to each bug reporter in the list.
It is designed to output multiple reports in batch.
-
Field Summary
FieldsFields inherited from interface BugReporter
NORMAL, SILENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddObserver(BugReporterObserver observer) Add an observer.voidfinish()Finish reporting bugs.private voidforEach(Consumer<TextUIBugReporter> consumer) Consume each reporter one by one, and throw an exception if some of them.Get the bug collection (if any) associated with this bug reporterGet ProjectStats object used to store statistics about the overall project being analyzed.voidLog an error that occurs while performing analysis.voidLog an error that occurs while performing analysis.voidobserveClass(ClassDescriptor classDescriptor) Observe a class being visited.voidreportBug(BugInstance bugInstance) Report a bug.voidreportMissingClass(ClassDescriptor classDescriptor) Called to report a class lookup failure.voidCalled to report a class lookup failure.voidReport any accumulated error messages.voidReport that we skipped some analysis of a methodvoidsetErrorVerbosity(int level) Set the error-reporting verbosity level.voidsetOutputStream(PrintStream outputStream) voidsetPriorityAdjuster(PriorityAdjuster priorityAdjuster) Set an optional priority adjuster.voidsetPriorityThreshold(int threshold) Set the priority threshold.voidsetRankThreshold(int threshold) voidsetUseLongBugCodes(boolean useLongBugCodes) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BugReporter
getPriorityAdjusterMethods inherited from interface IErrorLogger
reportMissingClass
-
Field Details
-
reporters
-
-
Constructor Details
-
BugReportDispatcher
-
-
Method Details
-
setErrorVerbosity
public void setErrorVerbosity(int level) Description copied from interface:BugReporterSet the error-reporting verbosity level.- Specified by:
setErrorVerbosityin interfaceBugReporter- Parameters:
level- the verbosity level
-
setPriorityThreshold
public void setPriorityThreshold(int threshold) Description copied from interface:BugReporterSet the priority threshold.- Specified by:
setPriorityThresholdin interfaceBugReporter- Parameters:
threshold- bug instances must be at least as important as this priority to be reported
-
setPriorityAdjuster
Description copied from interface:BugReporterSet an optional priority adjuster.- Specified by:
setPriorityAdjusterin interfaceBugReporter- Parameters:
priorityAdjuster- the priority adjuster
-
finish
public void finish()Description copied from interface:BugReporterFinish reporting bugs. If any bug reports have been queued, calling this method will flush them.- Specified by:
finishin interfaceBugReporter
-
reportQueuedErrors
public void reportQueuedErrors()Description copied from interface:BugReporterReport any accumulated error messages.- Specified by:
reportQueuedErrorsin interfaceBugReporter
-
addObserver
Description copied from interface:BugReporterAdd an observer.- Specified by:
addObserverin interfaceBugReporter- Parameters:
observer- the observer
-
getProjectStats
Description copied from interface:BugReporterGet ProjectStats object used to store statistics about the overall project being analyzed.- Specified by:
getProjectStatsin interfaceBugReporter
-
reportBug
Description copied from interface:BugReporterReport a bug. The implementation may report the bug immediately, or queue it for later.- Specified by:
reportBugin interfaceBugReporter- Parameters:
bugInstance- object describing the bug instance
-
getBugCollection
Description copied from interface:BugReporterGet the bug collection (if any) associated with this bug reporter- Specified by:
getBugCollectionin interfaceBugReporter
-
observeClass
Description copied from interface:IClassObserverObserve a class being visited.- Specified by:
observeClassin interfaceIClassObserver- Parameters:
classDescriptor- class being visited
-
reportMissingClass
Description copied from interface:IErrorLoggerCalled to report a class lookup failure.- Specified by:
reportMissingClassin interfaceIErrorLogger- Parameters:
ex- a ClassNotFoundException resulting from the class lookup failure
-
reportMissingClass
Description copied from interface:IErrorLoggerCalled to report a class lookup failure.- Specified by:
reportMissingClassin interfaceIErrorLogger- Parameters:
classDescriptor- ClassDescriptor of a missing class
-
logError
Description copied from interface:IErrorLoggerLog an error that occurs while performing analysis.- Specified by:
logErrorin interfaceIErrorLogger- Parameters:
message- the error message
-
logError
Description copied from interface:IErrorLoggerLog an error that occurs while performing analysis.- Specified by:
logErrorin interfaceIErrorLogger- Parameters:
message- the error messagee- the exception which is the underlying cause of the error
-
reportSkippedAnalysis
Description copied from interface:IErrorLoggerReport that we skipped some analysis of a method- Specified by:
reportSkippedAnalysisin interfaceIErrorLogger- Parameters:
method- the method we skipped
-
setRankThreshold
public void setRankThreshold(int threshold) - Specified by:
setRankThresholdin interfaceConfigurableBugReporter
-
setUseLongBugCodes
public void setUseLongBugCodes(boolean useLongBugCodes) - Specified by:
setUseLongBugCodesin interfaceConfigurableBugReporter
-
setOutputStream
- Specified by:
setOutputStreamin interfaceConfigurableBugReporter
-
forEach
Consume each reporter one by one, and throw an exception if some of them.- Parameters:
consumer- Operation to handle each reporter.
-