public abstract class AbstractBugReporter extends 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 Set<String> |
getMissingClasses() |
static String |
getMissingClassName(ClassNotFoundException ex) |
ProjectStats |
getProjectStats()
Get ProjectStats object used to store statistics about the overall
project being analyzed.
|
protected Set<AbstractBugReporter.Error> |
getQueuedErrors() |
protected boolean |
isRelaxed() |
protected static boolean |
isValidMissingClassMessage(String message) |
void |
logError(String message)
Log an error that occurs while performing analysis.
|
void |
logError(String message,
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(InputStream in,
Project theProject) |
void |
reportMissingClass(ClassDescriptor classDescriptor)
Called to report a class lookup failure.
|
void |
reportMissingClass(ClassNotFoundException ex)
Called to report a class lookup failure.
|
abstract void |
reportMissingClass(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 InputStream in, Project theProject) throws IOException, org.dom4j.DocumentException
IOException
org.dom4j.DocumentException
@CheckForNull @DottedClassName public static String getMissingClassName(ClassNotFoundException ex)
public void reportMissingClass(ClassNotFoundException ex)
IErrorLogger
reportMissingClass
in interface IErrorLogger
ex
- a ClassNotFoundException resulting from the class lookup
failureprotected static final boolean isValidMissingClassMessage(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(String message)
IErrorLogger
logError
in interface IErrorLogger
message
- the error messageprotected Set<AbstractBugReporter.Error> getQueuedErrors()
protected Set<String> getMissingClasses()
public void logError(String message, 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(String string)
string
- the name of the classCopyright © 2003–2015. All rights reserved.