edu.umd.cs.findbugs

Class FindBugs2

public class FindBugs2 extends Object implements IFindBugsEngine

FindBugs driver class. Experimental version to use the new bytecode-framework-neutral codebase/classpath/classfile infrastructure. Supports all features of the original FindBugs driver.

Author: David Hovemeyer

Field Summary
static booleanDEBUG
Constructor Summary
FindBugs2()
Constructor.
Method Summary
voidaddClassObserver(IClassObserver classObserver)
voidaddFilter(String filterFileName, boolean include)
booleanemitTrainingOutput()
voidenableTrainingInput(String trainingInputDir)
voidenableTrainingOutput(String trainingOutputDir)
voidexecute()
Execute the analysis.
intgetBugCount()
BugReportergetBugReporter()
StringgetCurrentClass()
intgetErrorCount()
intgetMissingClassCount()
ProjectgetProject()
StringgetProjectName()
StringgetReleaseName()
StringgetTrainingInputDir()
StringgetTrainingOutputDir()
UserPreferencesgetUserPreferences()
static voidmain(String[] args)
voidsetAbridgedMessages(boolean xmlWithAbridgedMessages)
voidsetAnalysisFeatureSettings(AnalysisFeatureSetting[] settingList)
voidsetBugReporter(BugReporter bugReporter)
voidsetClassScreener(IClassScreener classScreener)
voidsetDetectorFactoryCollection(DetectorFactoryCollection detectorFactoryCollection)
Set the detector factory collection to be used by this FindBugs2 engine.
voidsetProgressCallback(FindBugsProgress progressCallback)
voidsetProject(Project project)
voidsetProjectName(String name)
voidsetRelaxedReportingMode(boolean relaxedReportingMode)
voidsetReleaseName(String releaseName)
voidsetScanNestedArchives(boolean scanNestedArchives)
voidsetSourceInfoFile(String sourceInfoFile)
voidsetUserPreferences(UserPreferences userPreferences)
List<ClassDescriptor>sortByCallGraph(Collection<ClassDescriptor> classList)
booleanuseTrainingInput()

Field Detail

DEBUG

public static final boolean DEBUG

Constructor Detail

FindBugs2

public FindBugs2()
Constructor.

Method Detail

addClassObserver

public void addClassObserver(IClassObserver classObserver)

addFilter

public void addFilter(String filterFileName, boolean include)

emitTrainingOutput

public boolean emitTrainingOutput()

enableTrainingInput

public void enableTrainingInput(String trainingInputDir)

enableTrainingOutput

public void enableTrainingOutput(String trainingOutputDir)

execute

public void execute()
Execute the analysis. For obscure reasons, CheckedAnalysisExceptions are re-thrown as IOExceptions. However, these can only happen during the setup phase where we scan codebases for classes.

Throws: IOException InterruptedException

getBugCount

public int getBugCount()

getBugReporter

public BugReporter getBugReporter()

getCurrentClass

public String getCurrentClass()

getErrorCount

public int getErrorCount()

getMissingClassCount

public int getMissingClassCount()

getProject

public Project getProject()

getProjectName

public String getProjectName()

getReleaseName

public String getReleaseName()

getTrainingInputDir

public String getTrainingInputDir()

getTrainingOutputDir

public String getTrainingOutputDir()

getUserPreferences

public UserPreferences getUserPreferences()

main

public static void main(String[] args)

setAbridgedMessages

public void setAbridgedMessages(boolean xmlWithAbridgedMessages)

setAnalysisFeatureSettings

public void setAnalysisFeatureSettings(AnalysisFeatureSetting[] settingList)

setBugReporter

public void setBugReporter(BugReporter bugReporter)

setClassScreener

public void setClassScreener(IClassScreener classScreener)

setDetectorFactoryCollection

public void setDetectorFactoryCollection(DetectorFactoryCollection detectorFactoryCollection)
Set the detector factory collection to be used by this FindBugs2 engine. This method should be called before the execute() method is called.

Parameters: detectorFactoryCollection The detectorFactoryCollection to set.

setProgressCallback

public void setProgressCallback(FindBugsProgress progressCallback)

setProject

public void setProject(Project project)

setProjectName

public void setProjectName(String name)

setRelaxedReportingMode

public void setRelaxedReportingMode(boolean relaxedReportingMode)

setReleaseName

public void setReleaseName(String releaseName)

setScanNestedArchives

public void setScanNestedArchives(boolean scanNestedArchives)

setSourceInfoFile

public void setSourceInfoFile(String sourceInfoFile)

setUserPreferences

public void setUserPreferences(UserPreferences userPreferences)

sortByCallGraph

public List<ClassDescriptor> sortByCallGraph(Collection<ClassDescriptor> classList)

useTrainingInput

public boolean useTrainingInput()
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.