JavaClassAndMethod result;  if (DEBUG_METHOD_LOOKUP) { System.out.println("Find prototype method for " + SignatureConverter.convertMethodSignature(inv,cpg)); }  short opcode = inv.getOpcode();  if (methodChooser != ANY_METHOD) { methodChooser = new CompoundMethodChooser(new JavaClassAndMethodChooser[]{ methodChooser, opcode == Constants.INVOKESTATIC ? STATIC_METHOD : INSTANCE_METHOD }); }   if (opcode == Constants.INVOKESPECIAL) {  result = findExactMethod(inv, cpg, methodChooser); } else { String className = inv.getClassName(cpg); String methodName = inv.getName(cpg); String methodSig = inv.getSignature(cpg); if (DEBUG_METHOD_LOOKUP) { System.out.println("[Class name is " + className + "]"); System.out.println("[Method name is " + methodName + "]"); System.out.println("[Method signature is " + methodSig + "]"); }  if (className.startsWith("[")) {  className= "java.lang.Object"; }  if (opcode == Constants.INVOKEVIRTUAL || opcode == Constants.INVOKESTATIC) { if (DEBUG_METHOD_LOOKUP) { System.out.println("[invokevirtual or invokestatic]"); }   result = findMethod(Repository.lookupClass(className), methodName, methodSig, methodChooser); if (result == null) { if (DEBUG_METHOD_LOOKUP) { System.out.println("[not in class, checking superclasses...]"); } JavaClass[] superClassList = Repository.getSuperClasses(className); result = findMethod(superClassList, methodName, methodSig, methodChooser); } } else {  result = findMethod(Repository.lookupClass(className), methodName, methodSig, methodChooser); if (result == null) { JavaClass[] interfaceList = Repository.getInterfaces(className); result = findMethod(interfaceList, methodName, methodSig, methodChooser); } } }  return result;
return findInvocationLeastUpperBound(inv, cpg, ANY_METHOD);
	public static JavaClassAndMethod findInvocationLeastUpperBound(			InvokeInstruction inv, ConstantPoolGen cpg, JavaClassAndMethodChooser methodChooser)	        throws ClassNotFoundException {		JavaClassAndMethod result;				if (DEBUG_METHOD_LOOKUP) {			System.out.println("Find prototype method for " +					SignatureConverter.convertMethodSignature(inv,cpg));		}				short opcode = inv.getOpcode();				if (methodChooser != ANY_METHOD) {			methodChooser = new CompoundMethodChooser(new JavaClassAndMethodChooser[]{					methodChooser, opcode == Constants.INVOKESTATIC ? STATIC_METHOD : INSTANCE_METHOD			});		}		// Find the method		if (opcode == Constants.INVOKESPECIAL) {			// Non-virtual dispatch			result = findExactMethod(inv, cpg, methodChooser);		} else {			String className = inv.getClassName(cpg);			String methodName = inv.getName(cpg);			String methodSig = inv.getSignature(cpg);			if (DEBUG_METHOD_LOOKUP) {				System.out.println("[Class name is " + className + "]");				System.out.println("[Method name is " + methodName + "]");				System.out.println("[Method signature is " + methodSig + "]");			}						if (className.startsWith("[")) {				// Java 1.5 allows array classes to appear as the class name				className= "java.lang.Object";			}			if (opcode == Constants.INVOKEVIRTUAL || opcode == Constants.INVOKESTATIC) {				if (DEBUG_METHOD_LOOKUP) {					System.out.println("[invokevirtual or invokestatic]");				}				// Dispatch where the class hierarchy is searched				// Check superclasses				result = findMethod(Repository.lookupClass(className), methodName, methodSig, methodChooser);				if (result == null) {					if (DEBUG_METHOD_LOOKUP) {						System.out.println("[not in class, checking superclasses...]");					}					JavaClass[] superClassList = Repository.getSuperClasses(className);					result = findMethod(superClassList, methodName, methodSig, methodChooser);				}			} else {				// Check superinterfaces				result = findMethod(Repository.lookupClass(className), methodName, methodSig, methodChooser);				if (result == null) {					JavaClass[] interfaceList = Repository.getInterfaces(className);					result = findMethod(interfaceList, methodName, methodSig, methodChooser);				}			}		}		return result;	}