Package edu.umd.cs.findbugs
Class AbstractBugReporter
java.lang.Object
edu.umd.cs.findbugs.AbstractBugReporter
- All Implemented Interfaces:
RepositoryLookupFailureCallback,BugReporter,IClassObserver,IErrorLogger
- Direct Known Subclasses:
TextUIBugReporter
An abstract class which provides much of the functionality required of all
BugReporter objects.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface edu.umd.cs.findbugs.BugReporter
NORMAL, SILENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddObserver(BugReporterObserver observer) Add an observer.protected abstract voiddoReportBug(BugInstance bugInstance) Subclasses must override this.static StringGet ProjectStats object used to store statistics about the overall project being analyzed.protected booleanprotected static final booleanisValidMissingClassMessage(String message) voidLog an error that occurs while performing analysis.voidLog an error that occurs while performing analysis.protected voidnotifyObservers(BugInstance bugInstance) This should be called when a bug is reported by a subclass.abstract voidreportAnalysisError(AnalysisError error) Report a queued error.final voidreportBug(BugInstance bugInstance) Report a bug.final voidreportBugsFromXml(InputStream in, Project theProject) voidreportMissingClass(ClassDescriptor classDescriptor) Called to report a class lookup failure.voidCalled to report a class lookup failure.abstract voidreportMissingClass(String string) Report a missing class.voidReport any accumulated error messages.voidReport that we skipped some analysis of a methodvoidsetErrorVerbosity(int level) Set the error-reporting verbosity level.voidsetIsRelaxed(boolean relaxed) voidsetPriorityThreshold(int threshold) Set the priority threshold.voidsetRankThreshold(int threshold) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.umd.cs.findbugs.BugReporter
finish, getBugCollectionMethods inherited from interface edu.umd.cs.findbugs.classfile.IClassObserver
observeClass
-
Constructor Details
-
AbstractBugReporter
public AbstractBugReporter()
-
-
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
-
setRankThreshold
public void setRankThreshold(int threshold) -
setIsRelaxed
public void setIsRelaxed(boolean relaxed) -
isRelaxed
protected boolean isRelaxed() -
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
-
reportBugsFromXml
public final void reportBugsFromXml(@WillClose InputStream in, Project theProject) throws IOException, org.dom4j.DocumentException - Throws:
IOExceptionorg.dom4j.DocumentException
-
getMissingClassName
-
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
-
isValidMissingClassMessage
-
reportMissingClass
Description copied from interface:IErrorLoggerCalled to report a class lookup failure.- Specified by:
reportMissingClassin interfaceIErrorLogger- Parameters:
classDescriptor- ClassDescriptor of a missing class
-
reportSkippedAnalysis
Report that we skipped some analysis of a method- Specified by:
reportSkippedAnalysisin interfaceIErrorLogger- Parameters:
method-
-
logError
Description copied from interface:IErrorLoggerLog an error that occurs while performing analysis.- Specified by:
logErrorin interfaceIErrorLogger- Parameters:
message- the error message
-
getQueuedErrors
- Returns:
- the set with all analysis errors reported so far
-
getMissingClasses
- Returns:
- the set with all missing classes reported so far
-
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
-
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
-
notifyObservers
This should be called when a bug is reported by a subclass.- Parameters:
bugInstance- the bug to inform observers of
-
doReportBug
Subclasses must override this. It will be called only for bugs which meet the priority threshold.- Parameters:
bugInstance- the bug to report
-
reportAnalysisError
Report a queued error.- Parameters:
error- the queued error
-
reportMissingClass
Report a missing class.- Parameters:
string- the name of the class
-