/** * This target selector searches the class hierarchy for the method matching the signature of the call that is appropriate for the * receiver type. * * @throws IllegalArgumentException if call is null */ @Override public IMethod getCalleeTarget(CGNode caller, CallSiteReference call, IClass receiver) { if (call == null) { throw new IllegalArgumentException("call is null"); } IClass klass; TypeReference targetType = call.getDeclaredTarget().getDeclaringClass(); // java virtual calls if (call.isDispatch()) { assert receiver != null : "null receiver for " + call; klass = receiver; // java static calls } else if (call.isFixed()) { klass = classHierarchy.lookupClass(targetType); if (klass == null) { return null; } // anything else } else { return null; } return classHierarchy.resolveMethod(klass, call.getDeclaredTarget().getSelector()); }
/** * This target selector searches the class hierarchy for the method matching the signature of the call that is appropriate for the * receiver type. * * @throws IllegalArgumentException if call is null */ @Override public IMethod getCalleeTarget(CGNode caller, CallSiteReference call, IClass receiver) { if (call == null) { throw new IllegalArgumentException("call is null"); } IClass klass; TypeReference targetType = call.getDeclaredTarget().getDeclaringClass(); // java virtual calls if (call.isDispatch()) { assert receiver != null : "null receiver for " + call; klass = receiver; // java static calls } else if (call.isFixed()) { klass = classHierarchy.lookupClass(targetType); if (klass == null) { return null; } // anything else } else { return null; } return classHierarchy.resolveMethod(klass, call.getDeclaredTarget().getSelector()); }