public abstract class AbstractAnalysisEngine<I extends InstanceKey,X extends CallGraphBuilder<I>,Y> extends java.lang.Object implements AnalysisEngine
Some clients choose to build on this, but many don't. I usually don't in new code; I usually don't find the re-use enabled by this class compelling. I would probably nuke this except for some legacy code that uses it.
| Modifier and Type | Class and Description |
|---|---|
static interface |
AbstractAnalysisEngine.EntrypointBuilder |
| Modifier and Type | Field and Description |
|---|---|
protected CallGraph |
cg
Governing call graph
|
protected static int |
DEBUG_LEVEL
DEBUG_LEVEL:
0 No output
1 Print some simple stats and warning information
2 Detailed debugging
|
protected Module[] |
j2seLibs
The standard J2SE libraries to analyze
|
protected java.util.Collection<? extends Module> |
moduleFiles
The modules to analyze
|
protected PointerAnalysis<I> |
pointerAnalysis
Results of pointer analysis
|
protected AnalysisScope |
scope
A representation of the analysis scope
|
static java.lang.String |
SYNTHETIC_J2SE_MODEL |
| Constructor and Description |
|---|
AbstractAnalysisEngine() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addApplicationModulesToScope()
Add the application modules to the analysis scope.
|
void |
buildAnalysisScope()
Set up the AnalysisScope object
|
protected X |
buildCallGraph(IClassHierarchy cha,
AnalysisOptions options,
boolean savePointerAnalysis,
com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor) |
IClassHierarchy |
buildClassHierarchy() |
CallGraph |
buildDefaultCallGraph() |
X |
defaultCallGraphBuilder()
Builds the call graph for the analysis scope in effect, using all of the given entry points.
|
IAnalysisCacheView |
getCache() |
protected CallGraph |
getCallGraph() |
protected abstract X |
getCallGraphBuilder(IClassHierarchy cha,
AnalysisOptions options,
IAnalysisCacheView cache2) |
IClassHierarchy |
getClassHierarchy() |
AnalysisOptions |
getDefaultOptions(java.lang.Iterable<Entrypoint> entrypoints)
Get the default analysis options appropriate for this engine
|
java.lang.String |
getExclusionsFile() |
HeapGraph<?> |
getHeapGraph() |
AnalysisOptions |
getOptions() |
PointerAnalysis<? super I> |
getPointerAnalysis() |
protected AnalysisScope |
getScope() |
SDG<? super I> |
getSDG(Slicer.DataDependenceOptions data,
Slicer.ControlDependenceOptions ctrl) |
boolean |
isClosedWorld() |
protected ClassLoaderFactory |
makeClassLoaderFactory(com.ibm.wala.util.config.SetOfClasses exclusions) |
IAnalysisCacheView |
makeDefaultCache() |
protected java.lang.Iterable<Entrypoint> |
makeDefaultEntrypoints(AnalysisScope scope,
IClassHierarchy cha) |
Y |
performAnalysis(PropagationCallGraphBuilder builder) |
protected IClassHierarchy |
setClassHierarchy(IClassHierarchy cha) |
void |
setClosedWorld(boolean b)
Specify whether the engine should or should not employ "closed-world" analysis.
|
void |
setEntrypointBuilder(AbstractAnalysisEngine.EntrypointBuilder builder) |
void |
setExclusionsFile(java.lang.String exclusionsFile) |
void |
setJ2SELibraries(java.util.jar.JarFile[] libs)
Specify the jar files that represent the standard J2SE libraries
|
void |
setJ2SELibraries(Module[] libs)
Specify the mdoules that represent the standard J2SE libraries
|
void |
setModuleFiles(java.util.Collection<? extends Module> moduleFiles)
Specify the list of modules that should be analyzed.
|
public static final java.lang.String SYNTHETIC_J2SE_MODEL
protected static final int DEBUG_LEVEL
protected java.util.Collection<? extends Module> moduleFiles
protected AnalysisScope scope
protected Module[] j2seLibs
protected CallGraph cg
protected PointerAnalysis<I extends InstanceKey> pointerAnalysis
protected abstract X getCallGraphBuilder(IClassHierarchy cha, AnalysisOptions options, IAnalysisCacheView cache2)
protected X buildCallGraph(IClassHierarchy cha, AnalysisOptions options, boolean savePointerAnalysis, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor) throws java.lang.IllegalArgumentException, com.ibm.wala.util.CancelException
java.lang.IllegalArgumentExceptioncom.ibm.wala.util.CancelExceptionpublic void setModuleFiles(java.util.Collection<? extends Module> moduleFiles)
AnalysisEnginesetModuleFiles in interface AnalysisEnginemoduleFiles - A non-null Collection of module files: (EARFile, WARFile,
ApplicationClientFile, EJBJarFile).public void buildAnalysisScope()
throws java.io.IOException
java.io.IOExceptionpublic IClassHierarchy buildClassHierarchy()
protected ClassLoaderFactory makeClassLoaderFactory(com.ibm.wala.util.config.SetOfClasses exclusions)
public IClassHierarchy getClassHierarchy()
protected IClassHierarchy setClassHierarchy(IClassHierarchy cha)
protected CallGraph getCallGraph()
protected void addApplicationModulesToScope()
public void setJ2SELibraries(java.util.jar.JarFile[] libs)
AnalysisEnginesetJ2SELibraries in interface AnalysisEnginelibs - an array of jar files; usually rt.jar for vanilla JDK core.jar, server.jar, and
xml.jar for some WAS runtimespublic void setJ2SELibraries(Module[] libs)
AnalysisEnginesetJ2SELibraries in interface AnalysisEnginelibs - an array of Modules; usually rt.jar for vanilla JDK core.jar, server.jar, and
xml.jar for some WAS runtimespublic void setClosedWorld(boolean b)
AnalysisEngineIn a closed-world analysis, the engine considers only application client main methods and servlet entrypoints to the application.
In an open-world analysis, the engine additionally considers all EJB local and remote interface methods as entrypoints.
By default, this property is false; the default analysis is open-world
setClosedWorld in interface AnalysisEngineb - whether to use closed-world analysispublic boolean isClosedWorld()
protected AnalysisScope getScope()
public PointerAnalysis<? super I> getPointerAnalysis()
public HeapGraph<?> getHeapGraph()
public SDG<? super I> getSDG(Slicer.DataDependenceOptions data, Slicer.ControlDependenceOptions ctrl)
public java.lang.String getExclusionsFile()
public void setExclusionsFile(java.lang.String exclusionsFile)
public AnalysisOptions getDefaultOptions(java.lang.Iterable<Entrypoint> entrypoints)
AnalysisEnginegetDefaultOptions in interface AnalysisEnginepublic IAnalysisCacheView makeDefaultCache()
protected java.lang.Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope, IClassHierarchy cha)
public void setEntrypointBuilder(AbstractAnalysisEngine.EntrypointBuilder builder)
public X defaultCallGraphBuilder() throws java.lang.IllegalArgumentException, java.io.IOException
java.lang.IllegalArgumentExceptionjava.io.IOExceptionpublic CallGraph buildDefaultCallGraph() throws java.lang.IllegalArgumentException, com.ibm.wala.util.CancelException, java.io.IOException
java.lang.IllegalArgumentExceptioncom.ibm.wala.util.CancelExceptionjava.io.IOExceptionpublic IAnalysisCacheView getCache()
public AnalysisOptions getOptions()
public Y performAnalysis(PropagationCallGraphBuilder builder) throws com.ibm.wala.util.CancelException
com.ibm.wala.util.CancelException