Class TextUIBugReporter
java.lang.Object
edu.umd.cs.findbugs.AbstractBugReporter
edu.umd.cs.findbugs.TextUIBugReporter
- All Implemented Interfaces:
RepositoryLookupFailureCallback, BugReporter, IClassObserver, IErrorLogger, ConfigurableBugReporter
- Direct Known Subclasses:
BugCollectionBugReporter, EmacsBugReporter, PrintingBugReporter, SortingBugReporter, XDocsBugReporter
public abstract class TextUIBugReporter
extends AbstractBugReporter
implements ConfigurableBugReporter
Base class for BugReporters which provides convenient formatting and
reporting of warnings and analysis errors.
"TextUIBugReporter" is a bit of a misnomer, since this class is useful in GUIs, too.
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractBugReporter
AbstractBugReporter.Error -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate booleanprivate boolean(package private) static final Stringprotected PrintWriterprivate Stringprivate booleanprivate booleanprivate booleanprivate booleanFields inherited from interface BugReporter
NORMAL, SILENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckBugInstance(BugInstance bugInstance) For debugging: check a BugInstance to make sure it is valid.protected voidEmit one line of the error message report.booleanbooleanbooleanisDuplicateOf(TextUIBugReporter other) protected voidprintBug(BugInstance bugInstance) Print bug in one-line format.voidreportAnalysisError(AnalysisError error) Report a queued error.voidreportMissingClass(String message) Report a missing class.voidReport any accumulated error messages.voidsetApplySuppressions(boolean applySuppressions) voidsetOutputStream(PrintStream outputStream) Set the PrintStream to write bug output to.voidsetOutputTarget(String key) voidsetReportHistory(boolean reportHistory) voidsetReportStackTrace(boolean reportStackTrace) Set whether or not stack traces should be reported in error output.voidsetShowRank(boolean showRank) voidsetUseLongBugCodes(boolean useLongBugCodes) voidsetWriter(PrintWriter writer) Methods inherited from class AbstractBugReporter
addObserver, doReportBug, getMissingClasses, getMissingClassName, getPriorityAdjuster, getProjectStats, getQueuedErrors, isRelaxed, isValidMissingClassMessage, logError, logError, notifyObservers, reportBug, reportBugsFromXml, reportMissingClass, reportMissingClass, reportSkippedAnalysis, setErrorVerbosity, setIsRelaxed, setPriorityAdjuster, setPriorityThreshold, setRankThresholdMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BugReporter
addObserver, finish, getBugCollection, getPriorityAdjuster, getProjectStats, reportBug, setErrorVerbosity, setPriorityAdjuster, setPriorityThresholdMethods inherited from interface ConfigurableBugReporter
setRankThresholdMethods inherited from interface IClassObserver
observeClassMethods inherited from interface IErrorLogger
logError, logError, reportMissingClass, reportMissingClass, reportMissingClass, reportSkippedAnalysis
-
Field Details
-
reportStackTrace
private boolean reportStackTrace -
useLongBugCodes
private boolean useLongBugCodes -
showRank
private boolean showRank -
reportHistory
private boolean reportHistory -
applySuppressions
private boolean applySuppressions -
outputTarget
-
OTHER_CATEGORY_ABBREV
- See Also:
-
outputStream
-
analysisErrors
private boolean analysisErrors -
missingClasses
private boolean missingClasses
-
-
Constructor Details
-
TextUIBugReporter
protected TextUIBugReporter()
-
-
Method Details
-
setOutputStream
Set the PrintStream to write bug output to.- Specified by:
setOutputStreamin interfaceConfigurableBugReporter- Parameters:
outputStream- the PrintStream to write bug output to
-
setWriter
-
setReportStackTrace
public void setReportStackTrace(boolean reportStackTrace) Set whether or not stack traces should be reported in error output.- Parameters:
reportStackTrace- true if stack traces should be reported, false if not
-
printBug
Print bug in one-line format.- Parameters:
bugInstance- the bug to print
-
reportQueuedErrors
public void reportQueuedErrors()Description copied from interface:BugReporterReport any accumulated error messages.- Specified by:
reportQueuedErrorsin interfaceBugReporter- Overrides:
reportQueuedErrorsin classAbstractBugReporter
-
reportAnalysisError
Description copied from class:AbstractBugReporterReport a queued error.- Specified by:
reportAnalysisErrorin classAbstractBugReporter- Parameters:
error- the queued error
-
reportMissingClass
Description copied from class:AbstractBugReporterReport a missing class.- Specified by:
reportMissingClassin classAbstractBugReporter- Parameters:
message- the name of the class
-
emitLine
Emit one line of the error message report. By default, error messages are printed to System.err. Subclasses may override.- Parameters:
line- one line of the error report
-
getUseLongBugCodes
public boolean getUseLongBugCodes() -
setReportHistory
public void setReportHistory(boolean reportHistory) -
setUseLongBugCodes
public void setUseLongBugCodes(boolean useLongBugCodes) - Specified by:
setUseLongBugCodesin interfaceConfigurableBugReporter
-
setShowRank
public void setShowRank(boolean showRank) -
setApplySuppressions
public void setApplySuppressions(boolean applySuppressions) -
getRealBugReporter
-
checkBugInstance
For debugging: check a BugInstance to make sure it is valid.- Parameters:
bugInstance- the BugInstance to check
-
getOutputTarget
-
setOutputTarget
-
isDuplicateOf
-
isApplySuppressions
public boolean isApplySuppressions()
-