private boolean find(JavaClass target, String name, String signature) throws ClassNotFoundException { if (target == null) return false; String ref = getMemberName(target.getClassName(), name, signature); if (defined.contains(ref)) return true; if (find(target.getSuperClass(), name, signature)) return true; for (JavaClass i : target.getInterfaces()) if (find(i, name, signature)) return true; return false; }
public static @CheckForNull JavaClassAndMethod findInvocationLeastUpperBound( JavaClass jClass, String methodName, String methodSig, JavaClassAndMethodChooser methodChooser, boolean invokeInterface) throws ClassNotFoundException { JavaClassAndMethod result = findMethod(jClass, methodName, methodSig, methodChooser); if (result != null) return result; if (invokeInterface) for (JavaClass i : jClass.getInterfaces()) { result = findInvocationLeastUpperBound(i, methodName, methodSig, methodChooser, invokeInterface); if (result != null) return null; } else { JavaClass sClass = jClass.getSuperClass(); if (sClass != null) return findInvocationLeastUpperBound( sClass, methodName, methodSig, methodChooser, invokeInterface); } return null; }