Package edu.umd.cs.findbugs.ba
Class AnalysisCacheToAnalysisContextAdapter
- java.lang.Object
-
- edu.umd.cs.findbugs.ba.AnalysisContext
-
- edu.umd.cs.findbugs.ba.AnalysisCacheToAnalysisContextAdapter
-
public class AnalysisCacheToAnalysisContextAdapter extends AnalysisContext
An AnalysisContext implementation that uses the IAnalysisCache. This class must only be used by FindBugs2, not the original FindBugs driver.- Author:
- David Hovemeyer
-
-
Field Summary
-
Fields inherited from class edu.umd.cs.findbugs.ba.AnalysisContext
DEBUG, DEFAULT_CHECK_FOR_NULL_PARAM_DATABASE_FILENAME, DEFAULT_NONNULL_PARAM_DATABASE_FILENAME, DEFAULT_NULL_RETURN_VALUE_ANNOTATION_DATABASE, DEFAULT_NULL_RETURN_VALUE_DB_FILENAME, IGNORE_BUILTIN_MODELS, NONNULL_RETURN_DB_FILENAME, NONNULL_RETURN_DB_RESOURCE, project, UNCONDITIONAL_DEREF_DB_FILENAME, UNCONDITIONAL_DEREF_DB_RESOURCE
-
-
Constructor Summary
Constructors Constructor Description AnalysisCacheToAnalysisContextAdapter()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddClasspathEntry(java.lang.String url)Add an entry to the Repository's classpath.voidclearClassContextCache()Clear the ClassContext cache.voidclearRepository()Clear the BCEL Repository in preparation for analysis.AnnotationRetentionDatabasegetAnnotationRetentionDatabase()CheckReturnAnnotationDatabasegetCheckReturnAnnotationDatabase()ClassContextgetClassContext(org.apache.bcel.classfile.JavaClass javaClass)Get the ClassContext for a class.java.lang.StringgetClassContextStats()Get stats about hit rate for ClassContext cache.DirectlyRelevantTypeQualifiersDatabasegetDirectlyRelevantTypeQualifiersDatabase()FieldStoreTypeDatabasegetFieldStoreTypeDatabase()Get the property database recording the types of values stored into fields.InnerClassAccessMapgetInnerClassAccessMap()JCIPAnnotationDatabasegetJCIPAnnotationDatabase()RepositoryLookupFailureCallbackgetLookupFailureCallback()Get the lookup failure callback.INullnessAnnotationDatabasegetNullnessAnnotationDatabase()ReturnValueNullnessPropertyDatabasegetReturnValueNullnessPropertyDatabase()Get the property database recording which methods always return nonnull valuesSourceFindergetSourceFinder()Get the SourceFinder, for finding source files.SourceInfoMapgetSourceInfoMap()Get the SourceInfoMap.Subtypes2getSubtypes2()Get the Subtypes2 inheritance hierarchy database.ParameterNullnessPropertyDatabasegetUnconditionalDerefParamDatabase()Get the property database recording which methods unconditionally dereference parameters.voidinitDatabases()Instantiate the CheckReturnAnnotationDatabase.org.apache.bcel.classfile.JavaClasslookupClass(java.lang.String className)Lookup a class.voidsetAppClassList(java.util.List<ClassDescriptor> appClassCollection)Set the collection of class descriptors identifying all application classes.voidupdateDatabases(int pass)After a pass has been completed, allow the analysis context to update information.-
Methods inherited from class edu.umd.cs.findbugs.ba.AnalysisContext
currentAnalysisContext, currentXFactory, getBoolProperty, getClassSummary, getDatabaseInputDir, getDatabaseOutputDir, getEqualsKindSummary, getFieldSummary, getUnreadFields, getXClassCollection, isApplicationClass, isApplicationClass, isApplicationClass, isTooBig, loadDefaultInterproceduralDatabases, loadInterproceduralDatabases, loadPropertyDatabase, loadPropertyDatabaseFromResource, logError, logError, lookupClass, lookupSourceFile, lookupSystemClass, removeCurrentAnalysisContext, reportMissingClass, setBoolProperty, setClassSummary, setCurrentAnalysisContext, setDatabaseInputDir, setDatabaseOutputDir, setFieldSummary, setMissingClassWarningsSuppressed, setProject, setUnreadFields, storePropertyDatabase, unreadFieldsAvailable
-
-
-
-
Method Detail
-
addClasspathEntry
public void addClasspathEntry(java.lang.String url) throws java.io.IOExceptionDescription copied from class:AnalysisContextAdd an entry to the Repository's classpath.- Specified by:
addClasspathEntryin classAnalysisContext- Parameters:
url- the classpath entry URL- Throws:
java.io.IOException
-
clearClassContextCache
public void clearClassContextCache()
Description copied from class:AnalysisContextClear the ClassContext cache. This should be done between analysis passes.- Specified by:
clearClassContextCachein classAnalysisContext
-
clearRepository
public void clearRepository()
Description copied from class:AnalysisContextClear the BCEL Repository in preparation for analysis.- Specified by:
clearRepositoryin classAnalysisContext
-
getAnnotationRetentionDatabase
public AnnotationRetentionDatabase getAnnotationRetentionDatabase()
- Specified by:
getAnnotationRetentionDatabasein classAnalysisContext
-
getCheckReturnAnnotationDatabase
public CheckReturnAnnotationDatabase getCheckReturnAnnotationDatabase()
- Specified by:
getCheckReturnAnnotationDatabasein classAnalysisContext
-
getClassContext
public ClassContext getClassContext(org.apache.bcel.classfile.JavaClass javaClass)
Description copied from class:AnalysisContextGet the ClassContext for a class.- Specified by:
getClassContextin classAnalysisContext- Parameters:
javaClass- the class- Returns:
- the ClassContext for that class
-
getClassContextStats
public java.lang.String getClassContextStats()
Description copied from class:AnalysisContextGet stats about hit rate for ClassContext cache.- Specified by:
getClassContextStatsin classAnalysisContext- Returns:
- stats about hit rate for ClassContext cache
-
getFieldStoreTypeDatabase
public FieldStoreTypeDatabase getFieldStoreTypeDatabase()
Description copied from class:AnalysisContextGet the property database recording the types of values stored into fields.- Specified by:
getFieldStoreTypeDatabasein classAnalysisContext- Returns:
- the database, or null if there is no database available
-
getJCIPAnnotationDatabase
public JCIPAnnotationDatabase getJCIPAnnotationDatabase()
- Specified by:
getJCIPAnnotationDatabasein classAnalysisContext
-
getLookupFailureCallback
public RepositoryLookupFailureCallback getLookupFailureCallback()
Description copied from class:AnalysisContextGet the lookup failure callback.- Specified by:
getLookupFailureCallbackin classAnalysisContext
-
getNullnessAnnotationDatabase
public INullnessAnnotationDatabase getNullnessAnnotationDatabase()
- Specified by:
getNullnessAnnotationDatabasein classAnalysisContext
-
getSourceFinder
public SourceFinder getSourceFinder()
Description copied from class:AnalysisContextGet the SourceFinder, for finding source files.- Specified by:
getSourceFinderin classAnalysisContext
-
getSourceInfoMap
public SourceInfoMap getSourceInfoMap()
Description copied from class:AnalysisContextGet the SourceInfoMap.- Specified by:
getSourceInfoMapin classAnalysisContext
-
getUnconditionalDerefParamDatabase
public ParameterNullnessPropertyDatabase getUnconditionalDerefParamDatabase()
Description copied from class:AnalysisContextGet the property database recording which methods unconditionally dereference parameters.- Specified by:
getUnconditionalDerefParamDatabasein classAnalysisContext- Returns:
- the database, or null if there is no database available
-
initDatabases
public void initDatabases()
Description copied from class:AnalysisContextInstantiate the CheckReturnAnnotationDatabase. Do this after the repository has been set up.- Specified by:
initDatabasesin classAnalysisContext
-
lookupClass
public org.apache.bcel.classfile.JavaClass lookupClass(@DottedClassName java.lang.String className) throws java.lang.ClassNotFoundException
Description copied from class:AnalysisContextLookup a class. Use this method instead of Repository.lookupClass().- Specified by:
lookupClassin classAnalysisContext- Parameters:
className- the name of the class- Returns:
- the JavaClass representing the class
- Throws:
java.lang.ClassNotFoundException- (but not really)
-
getInnerClassAccessMap
public InnerClassAccessMap getInnerClassAccessMap()
- Specified by:
getInnerClassAccessMapin classAnalysisContext
-
setAppClassList
public void setAppClassList(java.util.List<ClassDescriptor> appClassCollection) throws CheckedAnalysisException
Set the collection of class descriptors identifying all application classes.- Parameters:
appClassCollection- List of ClassDescriptors identifying application classes- Throws:
CheckedAnalysisException
-
updateDatabases
public void updateDatabases(int pass)
Description copied from class:AnalysisContextAfter a pass has been completed, allow the analysis context to update information.- Specified by:
updateDatabasesin classAnalysisContext- Parameters:
pass- -- the first pass is pass 0
-
getReturnValueNullnessPropertyDatabase
public ReturnValueNullnessPropertyDatabase getReturnValueNullnessPropertyDatabase()
Description copied from class:AnalysisContextGet the property database recording which methods always return nonnull values- Specified by:
getReturnValueNullnessPropertyDatabasein classAnalysisContext- Returns:
- the database, or null if there is no database available
-
getSubtypes2
public Subtypes2 getSubtypes2()
Description copied from class:AnalysisContextGet the Subtypes2 inheritance hierarchy database.- Specified by:
getSubtypes2in classAnalysisContext
-
getDirectlyRelevantTypeQualifiersDatabase
public DirectlyRelevantTypeQualifiersDatabase getDirectlyRelevantTypeQualifiersDatabase()
- Specified by:
getDirectlyRelevantTypeQualifiersDatabasein classAnalysisContext
-
-