Package com.ibm.wala.ipa.callgraph.impl
Class ClassHierarchyMethodTargetSelector
- java.lang.Object
-
- com.ibm.wala.ipa.callgraph.impl.ClassHierarchyMethodTargetSelector
-
- All Implemented Interfaces:
MethodTargetSelector
public class ClassHierarchyMethodTargetSelector extends Object implements MethodTargetSelector
AMethodTargetSelector
that simply looks up the declared type, name and descriptor of aCallSiteReference
in the appropriate class hierarchy.
-
-
Constructor Summary
Constructors Constructor Description ClassHierarchyMethodTargetSelector(IClassHierarchy cha)
Initialization.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IMethod
getCalleeTarget(CGNode caller, CallSiteReference call, IClass receiver)
This target selector searches the class hierarchy for the method matching the signature of the call that is appropriate for the receiver type.boolean
mightReturnSyntheticMethod(CGNode caller, CallSiteReference site)
boolean
mightReturnSyntheticMethod(MethodReference declaredTarget)
-
-
-
Constructor Detail
-
ClassHierarchyMethodTargetSelector
public ClassHierarchyMethodTargetSelector(IClassHierarchy cha)
Initialization. The class hierarchy is needed for lookups and the warnings are used when the lookups fails (which should never happen).- Parameters:
cha
- The class hierarchy to use.
-
-
Method Detail
-
getCalleeTarget
public IMethod getCalleeTarget(CGNode caller, CallSiteReference call, IClass receiver)
This target selector searches the class hierarchy for the method matching the signature of the call that is appropriate for the receiver type.- Specified by:
getCalleeTarget
in interfaceMethodTargetSelector
- Parameters:
caller
- the GCNode in the call graph containing the callcall
- the call site reference of the call sitereceiver
- the type of the target object or null- Returns:
- the method to be called.
- Throws:
IllegalArgumentException
- if call is null
-
mightReturnSyntheticMethod
public boolean mightReturnSyntheticMethod(CGNode caller, CallSiteReference site)
-
mightReturnSyntheticMethod
public boolean mightReturnSyntheticMethod(MethodReference declaredTarget)
-
-