private Method isSelfCall(InvokeInstruction inv, MethodGen mg) { ConstantPoolGen cpg = mg.getConstantPool();
private Method isSelfCall(InvokeInstruction inv) { ConstantPoolGen cpg = classContext.getConstantPoolGen();
	private Method isSelfCall(InvokeInstruction inv, MethodGen mg) {		ConstantPoolGen cpg = mg.getConstantPool();		JavaClass jclass = classContext.getJavaClass();		String calledClassName = inv.getClassName(cpg);		// FIXME: is it possible we would see a superclass name here?		// Not a big deal for now, as we are mostly just interested in calls		// to private methods, for which we will definitely see the right		// called class name.		if (!calledClassName.equals(jclass.getClassName()))			return null;		String calledMethodName = inv.getMethodName(cpg);		String calledMethodSignature = inv.getSignature(cpg);		boolean isStaticCall = (inv instanceof INVOKESTATIC);		// Scan methods for one that matches.		Method[] methods = jclass.getMethods();		for (int i = 0; i < methods.length; ++i) {			Method method = methods[i];			String methodName = method.getName();			String signature = method.getSignature();			boolean isStatic = method.isStatic();			if (methodName.equals(calledMethodName) && 				signature.equals(calledMethodSignature) &&				isStatic == isStaticCall) {				// This method looks like a match.				//MethodGen called = classContext.getMethodGen(method);				return wantCallsFor(method) ? method : null;			}		}		// Hmm...no matching method found.		// This is almost certainly because the named method		// was inherited from a superclass.		if (DEBUG) System.out.println("No method found for " + calledClassName + "." + calledMethodName + " : " + calledMethodSignature);		return null;	}