Class ClassHierarchyMethodTargetSelector

java.lang.Object
com.ibm.wala.ipa.callgraph.impl.ClassHierarchyMethodTargetSelector
All Implemented Interfaces:
MethodTargetSelector

public class ClassHierarchyMethodTargetSelector extends Object implements MethodTargetSelector
A MethodTargetSelector that simply looks up the declared type, name and descriptor of a CallSiteReference in the appropriate class hierarchy.
  • Constructor Details

    • 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 Details

    • 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 interface MethodTargetSelector
      Parameters:
      caller - the GCNode in the call graph containing the call
      call - the call site reference of the call site
      receiver - the type of the target object or null
      Returns:
      the method to be called.
      Throws:
      IllegalArgumentException - if call is null
    • mightReturnSyntheticMethod

      public boolean mightReturnSyntheticMethod()