|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.findbugs.ba.ClassContext
public class ClassContext
A ClassContext caches all of the auxiliary objects used to analyze the methods of a class. That way, these objects don't need to be created over and over again.
Nested Class Summary | |
---|---|
private class |
ClassContext.AnalysisFactory<Analysis>
Abstract factory class for creating analysis objects. |
private static class |
ClassContext.AnalysisResult<Analysis>
An AnalysisResult stores the result of requesting an analysis from an AnalysisFactory. |
private class |
ClassContext.CFGFactory
|
private class |
ClassContext.NoDataflowAnalysisFactory<AnalysisResult>
|
private class |
ClassContext.NoExceptionAnalysisFactory<AnalysisResult>
|
Fields inherited from interface edu.umd.cs.findbugs.ba.AnalysisFeatures |
---|
CONSERVE_SPACE, WORK_HARD |
Constructor Summary | |
---|---|
ClassContext(org.apache.bcel.classfile.JavaClass jclass,
AnalysisContext analysisContext)
Constructor. |
Method Summary | |
---|---|
AnalysisContext |
getAnalysisContext()
Get the AnalysisContext. |
AssertionMethods |
getAssertionMethods()
Get AssertionMethods for class. |
AssignedFieldMap |
getAssignedFieldMap()
Get the assigned field map for the class. |
Dataflow<BlockType,BlockTypeAnalysis> |
getBlockTypeDataflow(org.apache.bcel.classfile.Method method)
Get BlockType dataflow for given method. |
java.util.BitSet |
getBytecodeSet(org.apache.bcel.classfile.Method method)
Get a BitSet representing the bytecodes that are used in the given method. |
CFG |
getCFG(org.apache.bcel.classfile.Method method)
Get a CFG for given method. |
org.apache.bcel.generic.ConstantPoolGen |
getConstantPoolGen()
Get the ConstantPoolGen used to create the MethodGens for this class. |
DepthFirstSearch |
getDepthFirstSearch(org.apache.bcel.classfile.Method method)
Get a DepthFirstSearch for given method. |
ExceptionSetFactory |
getExceptionSetFactory(org.apache.bcel.classfile.Method method)
Get ExceptionSetFactory for given method. |
IsNullValueDataflow |
getIsNullValueDataflow(org.apache.bcel.classfile.Method method)
Get an IsNullValueDataflow for given method. |
org.apache.bcel.classfile.JavaClass |
getJavaClass()
Get the JavaClass. |
LiveLocalStoreDataflow |
getLiveLocalStoreDataflow(org.apache.bcel.classfile.Method method)
Get LiveLocalStoreAnalysis dataflow for given method. |
LoadedFieldSet |
getLoadedFieldSet(org.apache.bcel.classfile.Method method)
Get the set of fields loaded by given method. |
LockDataflow |
getLockDataflow(org.apache.bcel.classfile.Method method)
Get dataflow for LockAnalysis for given method. |
RepositoryLookupFailureCallback |
getLookupFailureCallback()
Get the RepositoryLookupFailureCallback. |
org.apache.bcel.generic.MethodGen |
getMethodGen(org.apache.bcel.classfile.Method method)
Get a MethodGen object for given method. |
DominatorsAnalysis |
getNonExceptionDominatorsAnalysis(org.apache.bcel.classfile.Method method)
Get DominatorsAnalysis for given method, where exception edges are ignored. |
PostDominatorsAnalysis |
getNonExceptionPostDominatorsAnalysis(org.apache.bcel.classfile.Method method)
Get PostDominatorsAnalysis for given method, where exception edges are ignored. |
java.lang.String[] |
getParameterSignatureList(org.apache.bcel.classfile.Method method)
Get array of type signatures of parameters for given method. |
CFG |
getRawCFG(org.apache.bcel.classfile.Method method)
Get a "raw" CFG for given method. |
ReturnPathDataflow |
getReturnPathDataflow(org.apache.bcel.classfile.Method method)
Get ReturnPathDataflow for method. |
ReverseDepthFirstSearch |
getReverseDepthFirstSearch(org.apache.bcel.classfile.Method method)
Get a ReverseDepthFirstSearch for given method. |
TypeDataflow |
getTypeDataflow(org.apache.bcel.classfile.Method method)
Get a TypeDataflow for given method. |
ValueNumberDataflow |
getValueNumberDataflow(org.apache.bcel.classfile.Method method)
Get a ValueNumberDataflow for given method. |
private static void |
indent()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean PRUNE_INFEASIBLE_EXCEPTION_EDGES
WORK_HARD
analysis feature
is enabled.
public static final boolean PRUNE_UNCONDITIONAL_EXCEPTION_THROWER_EDGES
public static final boolean DEBUG
private static final int PRUNED_INFEASIBLE_EXCEPTIONS
private static final int PRUNED_UNCONDITIONAL_THROWERS
private static final boolean TIME_ANALYSES
private static final boolean DEBUG_CFG
private static int depth
private static final java.util.Set<java.lang.String> busyCFGSet
private org.apache.bcel.classfile.JavaClass jclass
private AnalysisContext analysisContext
private ClassContext.NoExceptionAnalysisFactory<org.apache.bcel.generic.MethodGen> methodGenFactory
private ClassContext.CFGFactory cfgFactory
private ClassContext.AnalysisFactory<ValueNumberDataflow> vnaDataflowFactory
private ClassContext.AnalysisFactory<IsNullValueDataflow> invDataflowFactory
private ClassContext.AnalysisFactory<TypeDataflow> typeDataflowFactory
private ClassContext.NoDataflowAnalysisFactory<DepthFirstSearch> dfsFactory
private ClassContext.NoDataflowAnalysisFactory<ReverseDepthFirstSearch> rdfsFactory
private ClassContext.NoExceptionAnalysisFactory<java.util.BitSet> bytecodeSetFactory
private ClassContext.AnalysisFactory<LockDataflow> lockDataflowFactory
private ClassContext.AnalysisFactory<ReturnPathDataflow> returnPathDataflowFactory
private ClassContext.AnalysisFactory<DominatorsAnalysis> nonExceptionDominatorsAnalysisFactory
private ClassContext.AnalysisFactory<PostDominatorsAnalysis> nonExceptionPostDominatorsAnalysisFactory
private ClassContext.NoExceptionAnalysisFactory<ExceptionSetFactory> exceptionSetFactoryFactory
private ClassContext.NoExceptionAnalysisFactory<java.lang.String[]> parameterSignatureListFactory
private static final java.util.BitSet fieldInstructionOpcodeSet
private ClassContext.NoExceptionAnalysisFactory<LoadedFieldSet> loadedFieldSetFactory
The tricky part is that in addition to fields loaded and stored with get/putfield and get/putstatic, we also try to figure out field accessed through calls to inner-class access methods.
private ClassContext.AnalysisFactory<LiveLocalStoreDataflow> liveLocalStoreDataflowFactory
private ClassContext.AnalysisFactory<Dataflow<BlockType,BlockTypeAnalysis>> blockTypeDataflowFactory
private org.apache.bcel.generic.ClassGen classGen
private AssignedFieldMap assignedFieldMap
private AssertionMethods assertionMethods
Constructor Detail |
---|
public ClassContext(org.apache.bcel.classfile.JavaClass jclass, AnalysisContext analysisContext)
jclass
- the JavaClassMethod Detail |
---|
private static void indent()
public org.apache.bcel.classfile.JavaClass getJavaClass()
public AnalysisContext getAnalysisContext()
public RepositoryLookupFailureCallback getLookupFailureCallback()
public org.apache.bcel.generic.MethodGen getMethodGen(org.apache.bcel.classfile.Method method)
method
- the method
public CFG getRawCFG(org.apache.bcel.classfile.Method method) throws CFGBuilderException
method
- the method
CFGBuilderException
public CFG getCFG(org.apache.bcel.classfile.Method method) throws CFGBuilderException
method
- the method
CFGBuilderException
- if a CFG cannot be constructed for the methodpublic org.apache.bcel.generic.ConstantPoolGen getConstantPoolGen()
public ValueNumberDataflow getValueNumberDataflow(org.apache.bcel.classfile.Method method) throws DataflowAnalysisException, CFGBuilderException
method
- the method
DataflowAnalysisException
CFGBuilderException
public IsNullValueDataflow getIsNullValueDataflow(org.apache.bcel.classfile.Method method) throws DataflowAnalysisException, CFGBuilderException
method
- the method
DataflowAnalysisException
CFGBuilderException
public TypeDataflow getTypeDataflow(org.apache.bcel.classfile.Method method) throws DataflowAnalysisException, CFGBuilderException
method
- the method
DataflowAnalysisException
CFGBuilderException
public DepthFirstSearch getDepthFirstSearch(org.apache.bcel.classfile.Method method) throws CFGBuilderException
method
- the method
CFGBuilderException
public ReverseDepthFirstSearch getReverseDepthFirstSearch(org.apache.bcel.classfile.Method method) throws CFGBuilderException
method
- the method
CFGBuilderException
public java.util.BitSet getBytecodeSet(org.apache.bcel.classfile.Method method)
method
- the method
public LockDataflow getLockDataflow(org.apache.bcel.classfile.Method method) throws CFGBuilderException, DataflowAnalysisException
method
- the method
CFGBuilderException
DataflowAnalysisException
public ReturnPathDataflow getReturnPathDataflow(org.apache.bcel.classfile.Method method) throws CFGBuilderException, DataflowAnalysisException
method
- the method
CFGBuilderException
DataflowAnalysisException
public DominatorsAnalysis getNonExceptionDominatorsAnalysis(org.apache.bcel.classfile.Method method) throws CFGBuilderException, DataflowAnalysisException
method
- the method
CFGBuilderException
DataflowAnalysisException
public PostDominatorsAnalysis getNonExceptionPostDominatorsAnalysis(org.apache.bcel.classfile.Method method) throws CFGBuilderException, DataflowAnalysisException
method
- the method
CFGBuilderException
DataflowAnalysisException
public ExceptionSetFactory getExceptionSetFactory(org.apache.bcel.classfile.Method method)
method
- the method
public java.lang.String[] getParameterSignatureList(org.apache.bcel.classfile.Method method)
method
- the method
public LoadedFieldSet getLoadedFieldSet(org.apache.bcel.classfile.Method method)
method
- the method
public LiveLocalStoreDataflow getLiveLocalStoreDataflow(org.apache.bcel.classfile.Method method) throws DataflowAnalysisException, CFGBuilderException
method
- the method
DataflowAnalysisException
CFGBuilderException
public Dataflow<BlockType,BlockTypeAnalysis> getBlockTypeDataflow(org.apache.bcel.classfile.Method method) throws DataflowAnalysisException, CFGBuilderException
method
- the method
DataflowAnalysisException
CFGBuilderException
public AssignedFieldMap getAssignedFieldMap() throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
- if a class lookup prevents
the class's superclasses from being searched for
assignable fieldspublic AssertionMethods getAssertionMethods()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |