Class ClassFactoryContextSelector
java.lang.Object
com.ibm.wala.analysis.reflection.ClassFactoryContextSelector
- All Implemented Interfaces:
ContextSelector
A
ContextSelector
to intercept calls to reflective class factories (e.g. Class.forName())
when the parameter is a string constant-
Field Summary
Modifier and TypeFieldDescriptionstatic final MethodReference
static final Atom
static final MethodReference
static final Atom
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetCalleeTarget
(CGNode caller, CallSiteReference site, IMethod callee, InstanceKey[] receiver) If theCallSiteReference
invokes Class.forName(s) and s is a string constant, return aJavaTypeContext
representing the type named by s, if we can resolve it in theIClassHierarchy
.getRelevantParameters
(CGNode caller, CallSiteReference site) Given a calling node and a call site, return the set of parameters based on which this selector may choose to specialize contexts.int
static boolean
-
Field Details
-
forNameAtom
-
FOR_NAME_REF
-
loadClassAtom
-
LOAD_CLASS_REF
-
-
Constructor Details
-
ClassFactoryContextSelector
public ClassFactoryContextSelector()
-
-
Method Details
-
isClassFactory
-
getUseOfStringParameter
-
getCalleeTarget
public Context getCalleeTarget(CGNode caller, CallSiteReference site, IMethod callee, InstanceKey[] receiver) If theCallSiteReference
invokes Class.forName(s) and s is a string constant, return aJavaTypeContext
representing the type named by s, if we can resolve it in theIClassHierarchy
.- Specified by:
getCalleeTarget
in interfaceContextSelector
- Parameters:
caller
- the node containing the call sitesite
- description of the call sitereceiver
- the abstract objects (InstanceKeys) of parameters of interest to the selector- Returns:
- the Context in which the callee should be evaluated, or null if no information is available.
-
getRelevantParameters
Description copied from interface:ContextSelector
Given a calling node and a call site, return the set of parameters based on which this selector may choose to specialize contexts.- Specified by:
getRelevantParameters
in interfaceContextSelector
- Parameters:
caller
- the calling nodesite
- the specific call site- Returns:
- the set of parameters of interest
-