edu.umd.cs.findbugs.ba
Class AnalysisContext

java.lang.Object
  extended by edu.umd.cs.findbugs.ba.AnalysisContext
All Implemented Interfaces:
AnalysisFeatures

public class AnalysisContext
extends java.lang.Object
implements AnalysisFeatures

A context for analysis of a complete project. This serves as the repository for whole-program information and data structures.

Author:
David Hovemeyer

Nested Class Summary
private static class AnalysisContext.ClassContextCache
           
 
Field Summary
 java.util.Map analysisLocals
           
private  AnalysisContext.ClassContextCache classContextCache
           
private static java.lang.InheritableThreadLocal currentAnalysisContext
           
private  RepositoryLookupFailureCallback lookupFailureCallback
           
private static int MAX_SIZE
          The maximum number of ClassContext objects to cache.
private  SourceFinder sourceFinder
           
 
Fields inherited from interface edu.umd.cs.findbugs.ba.AnalysisFeatures
CONSERVE_SPACE, WORK_HARD
 
Constructor Summary
AnalysisContext(RepositoryLookupFailureCallback lookupFailureCallback)
          Constructor.
 
Method Summary
static AnalysisContext currentAnalysisContext()
          Get the AnalysisContext associated with this thread
 ClassContext getClassContext(org.apache.bcel.classfile.JavaClass javaClass)
          Get the ClassContext for a class.
 RepositoryLookupFailureCallback getLookupFailureCallback()
          Get the lookup failure callback.
 SourceFinder getSourceFinder()
          Get the SourceFinder, for finding source files.
 void setSourcePath(java.util.List<java.lang.String> sourcePath)
          Set the source path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lookupFailureCallback

private RepositoryLookupFailureCallback lookupFailureCallback

sourceFinder

private SourceFinder sourceFinder

classContextCache

private AnalysisContext.ClassContextCache classContextCache

analysisLocals

public java.util.Map analysisLocals

currentAnalysisContext

private static java.lang.InheritableThreadLocal currentAnalysisContext

MAX_SIZE

private static final int MAX_SIZE
The maximum number of ClassContext objects to cache. FIXME: need to evaluate this parameter. Need to keep stats about accesses.

Constructor Detail

AnalysisContext

public AnalysisContext(RepositoryLookupFailureCallback lookupFailureCallback)
Constructor.

Method Detail

currentAnalysisContext

public static AnalysisContext currentAnalysisContext()
Get the AnalysisContext associated with this thread


getLookupFailureCallback

public RepositoryLookupFailureCallback getLookupFailureCallback()
Get the lookup failure callback.


setSourcePath

public void setSourcePath(java.util.List<java.lang.String> sourcePath)
Set the source path.


getSourceFinder

public SourceFinder getSourceFinder()
Get the SourceFinder, for finding source files.


getClassContext

public ClassContext getClassContext(org.apache.bcel.classfile.JavaClass javaClass)
Get the ClassContext for a class.

Parameters:
javaClass - the class
Returns:
the ClassContext for that class