Package edu.umd.cs.findbugs
Class BugCollectionBugReporter
- java.lang.Object
-
- edu.umd.cs.findbugs.AbstractBugReporter
-
- edu.umd.cs.findbugs.TextUIBugReporter
-
- edu.umd.cs.findbugs.BugCollectionBugReporter
-
- All Implemented Interfaces:
Debug,RepositoryLookupFailureCallback,BugReporter,IClassObserver,IErrorLogger,ConfigurableBugReporter
- Direct Known Subclasses:
HTMLBugReporter,SarifBugReporter,XMLBugReporter
public class BugCollectionBugReporter extends TextUIBugReporter implements Debug
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class edu.umd.cs.findbugs.AbstractBugReporter
AbstractBugReporter.Error
-
-
Field Summary
Fields Modifier and Type Field Description private SortedBugCollectionbugCollectionprivate Projectprojectprivate @Nullable java.io.PrintWriterwriter-
Fields inherited from class edu.umd.cs.findbugs.TextUIBugReporter
OTHER_CATEGORY_ABBREV, outputStream
-
Fields inherited from interface edu.umd.cs.findbugs.BugReporter
NORMAL, SILENT
-
Fields inherited from interface edu.umd.cs.findbugs.ba.Debug
VERIFY_INTEGRITY
-
-
Constructor Summary
Constructors Constructor Description BugCollectionBugReporter(Project project)BugCollectionBugReporter(Project project, @Nullable java.io.PrintWriter writer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoReportBug(BugInstance bugInstance)Subclasses must override this.protected voidemitLine(java.lang.String line)Emit one line of the error message report.voidfinish()Finish reporting bugs.@NonNull BugCollectiongetBugCollection()Get the bug collection (if any) associated with this bug reporterProjectgetProject()BugReportergetRealBugReporter()voidlogError(java.lang.String message)Log an error that occurs while performing analysis.voidlogError(java.lang.String message, java.lang.Throwable e)Log an error that occurs while performing analysis.voidobserveClass(ClassDescriptor classDescriptor)Observe a class being visited.voidreportMissingClass(ClassDescriptor classDescriptor)Called to report a class lookup failure.voidreportMissingClass(java.lang.ClassNotFoundException ex)Called to report a class lookup failure.-
Methods inherited from class edu.umd.cs.findbugs.TextUIBugReporter
checkBugInstance, getOutputTarget, getUseLongBugCodes, isApplySuppressions, isDuplicateOf, printBug, reportAnalysisError, reportMissingClass, reportQueuedErrors, setApplySuppressions, setOutputStream, setOutputTarget, setReportHistory, setReportStackTrace, setShowRank, setUseLongBugCodes, setWriter
-
Methods inherited from class edu.umd.cs.findbugs.AbstractBugReporter
addObserver, getMissingClasses, getMissingClassName, getPriorityAdjuster, getProjectStats, getQueuedErrors, isRelaxed, isValidMissingClassMessage, notifyObservers, reportBug, reportBugsFromXml, reportSkippedAnalysis, setErrorVerbosity, setIsRelaxed, setPriorityAdjuster, setPriorityThreshold, setRankThreshold
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface edu.umd.cs.findbugs.BugReporter
addObserver, getPriorityAdjuster, getProjectStats, reportBug, setErrorVerbosity, setPriorityAdjuster, setPriorityThreshold
-
Methods inherited from interface edu.umd.cs.findbugs.ConfigurableBugReporter
setRankThreshold
-
Methods inherited from interface edu.umd.cs.findbugs.classfile.IErrorLogger
reportMissingClass, reportSkippedAnalysis
-
-
-
-
Field Detail
-
bugCollection
private final SortedBugCollection bugCollection
-
project
private final Project project
-
writer
private final @Nullable java.io.PrintWriter writer
-
-
Method Detail
-
getProject
public Project getProject()
-
getBugCollection
public @NonNull BugCollection getBugCollection()
Description copied from interface:BugReporterGet the bug collection (if any) associated with this bug reporter- Specified by:
getBugCollectionin interfaceBugReporter
-
observeClass
public void observeClass(ClassDescriptor classDescriptor)
Description copied from interface:IClassObserverObserve a class being visited.- Specified by:
observeClassin interfaceIClassObserver- Parameters:
classDescriptor- class being visited
-
logError
public void logError(java.lang.String message)
Description copied from interface:IErrorLoggerLog an error that occurs while performing analysis.- Specified by:
logErrorin interfaceIErrorLogger- Overrides:
logErrorin classAbstractBugReporter- Parameters:
message- the error message
-
logError
public void logError(java.lang.String message, java.lang.Throwable e)Description copied from interface:IErrorLoggerLog an error that occurs while performing analysis.- Specified by:
logErrorin interfaceIErrorLogger- Overrides:
logErrorin classAbstractBugReporter- Parameters:
message- the error messagee- the exception which is the underlying cause of the error
-
reportMissingClass
public void reportMissingClass(java.lang.ClassNotFoundException ex)
Description copied from interface:IErrorLoggerCalled to report a class lookup failure.- Specified by:
reportMissingClassin interfaceIErrorLogger- Overrides:
reportMissingClassin classAbstractBugReporter- Parameters:
ex- a ClassNotFoundException resulting from the class lookup failure
-
reportMissingClass
public void reportMissingClass(ClassDescriptor classDescriptor)
Description copied from interface:IErrorLoggerCalled to report a class lookup failure.- Specified by:
reportMissingClassin interfaceIErrorLogger- Overrides:
reportMissingClassin classAbstractBugReporter- Parameters:
classDescriptor- ClassDescriptor of a missing class
-
doReportBug
public void doReportBug(BugInstance bugInstance)
Description copied from class:AbstractBugReporterSubclasses must override this. It will be called only for bugs which meet the priority threshold.- Specified by:
doReportBugin classAbstractBugReporter- Parameters:
bugInstance- the bug to report
-
getRealBugReporter
public BugReporter getRealBugReporter()
- Overrides:
getRealBugReporterin classTextUIBugReporter
-
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
-
emitLine
protected void emitLine(java.lang.String line)
Emit one line of the error message report. By default, error messages are printed to System.err. Subclasses may override.- Overrides:
emitLinein classTextUIBugReporter- Parameters:
line- one line of the error report
-
-