public abstract class AbstractBugReporter extends java.lang.Object implements BugReporter
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractBugReporter.Error |
NORMAL, SILENT
Constructor and Description |
---|
AbstractBugReporter() |
Modifier and Type | Method and Description |
---|---|
void |
addObserver(BugReporterObserver observer)
Add an observer.
|
protected abstract void |
doReportBug(BugInstance bugInstance)
Subclasses must override this.
|
protected java.util.Set<java.lang.String> |
getMissingClasses() |
static java.lang.String |
getMissingClassName(java.lang.ClassNotFoundException ex) |
ProjectStats |
getProjectStats()
Get ProjectStats object used to store statistics about the overall
project being analyzed.
|
protected java.util.Set<AbstractBugReporter.Error> |
getQueuedErrors() |
protected boolean |
isRelaxed() |
protected static boolean |
isValidMissingClassMessage(java.lang.String message) |
void |
logError(java.lang.String message)
Log an error that occurs while performing analysis.
|
void |
logError(java.lang.String message,
java.lang.Throwable e)
Log an error that occurs while performing analysis.
|
protected void |
notifyObservers(BugInstance bugInstance)
This should be called when a bug is reported by a subclass.
|
abstract void |
reportAnalysisError(AnalysisError error)
Report a queued error.
|
void |
reportBug(BugInstance bugInstance)
Report a bug.
|
void |
reportBugsFromXml(java.io.InputStream in,
Project theProject) |
void |
reportMissingClass(ClassDescriptor classDescriptor)
Called to report a class lookup failure.
|
void |
reportMissingClass(java.lang.ClassNotFoundException ex)
Called to report a class lookup failure.
|
abstract void |
reportMissingClass(java.lang.String string)
Report a missing class.
|
void |
reportQueuedErrors()
Report any accumulated error messages.
|
void |
reportSkippedAnalysis(MethodDescriptor method)
Report that we skipped some analysis of a method
|
void |
setErrorVerbosity(int level)
Set the error-reporting verbosity level.
|
void |
setIsRelaxed(boolean relaxed) |
void |
setPriorityThreshold(int threshold)
Set the priority threshold.
|
void |
setRankThreshold(int threshold) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
finish, getBugCollection
observeClass
public void setErrorVerbosity(int level)
BugReporter
setErrorVerbosity
in interface BugReporter
level
- the verbosity levelpublic void setPriorityThreshold(int threshold)
BugReporter
setPriorityThreshold
in interface BugReporter
threshold
- bug instances must be at least as important as this priority
to be reportedpublic void setRankThreshold(int threshold)
public void setIsRelaxed(boolean relaxed)
protected boolean isRelaxed()
public final void reportBug(@Nonnull BugInstance bugInstance)
BugReporter
reportBug
in interface BugReporter
bugInstance
- object describing the bug instancepublic final void reportBugsFromXml(@WillClose java.io.InputStream in, Project theProject) throws java.io.IOException, org.dom4j.DocumentException
java.io.IOException
org.dom4j.DocumentException
@CheckForNull @DottedClassName public static java.lang.String getMissingClassName(java.lang.ClassNotFoundException ex)
public void reportMissingClass(java.lang.ClassNotFoundException ex)
IErrorLogger
reportMissingClass
in interface IErrorLogger
ex
- a ClassNotFoundException resulting from the class lookup
failureprotected static final boolean isValidMissingClassMessage(java.lang.String message)
public void reportMissingClass(ClassDescriptor classDescriptor)
IErrorLogger
reportMissingClass
in interface IErrorLogger
classDescriptor
- ClassDescriptor of a missing classpublic void reportSkippedAnalysis(MethodDescriptor method)
reportSkippedAnalysis
in interface IErrorLogger
method
- public void logError(java.lang.String message)
IErrorLogger
logError
in interface IErrorLogger
message
- the error messageprotected java.util.Set<AbstractBugReporter.Error> getQueuedErrors()
protected java.util.Set<java.lang.String> getMissingClasses()
public void logError(java.lang.String message, java.lang.Throwable e)
IErrorLogger
logError
in interface IErrorLogger
message
- the error messagee
- the exception which is the underlying cause of the errorpublic void reportQueuedErrors()
BugReporter
reportQueuedErrors
in interface BugReporter
public void addObserver(BugReporterObserver observer)
BugReporter
addObserver
in interface BugReporter
observer
- the observerpublic ProjectStats getProjectStats()
BugReporter
getProjectStats
in interface BugReporter
protected void notifyObservers(BugInstance bugInstance)
bugInstance
- the bug to inform observers ofprotected abstract void doReportBug(BugInstance bugInstance)
bugInstance
- the bug to reportpublic abstract void reportAnalysisError(AnalysisError error)
error
- the queued errorpublic abstract void reportMissingClass(java.lang.String string)
string
- the name of the classFindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.