Type producedType = Const.CONSTRUCTOR_NAME.equals(methodName) ? inv.getReferenceType(cpg) : inv.getReturnType(cpg);
Type returnType = obj.getReturnType(getCPG());
/** @return return type of referenced method. */ @Override public Type getType( final ConstantPoolGen cpg ) { return getReturnType(cpg); }
/** @return return type of referenced method. */ public Type getType(ConstantPoolGen cpg) { return getReturnType(cpg); }
/** * Also works for instructions whose stack effect depends on the * constant pool entry they reference. * @return Number of words produced onto stack by this instruction */ public int produceStack(ConstantPoolGen cpg) { return getReturnType(cpg).getSize(); }
public void visitInvokeInstruction(InvokeInstruction i) { short opcode = i.getOpcode(); String class_name = i.getClassName(_cp); String method_name = i.getMethodName(_cp); Type type = i.getReturnType(_cp); Type[] arg_types = i.getArgumentTypes(_cp); _out.println("il.append(_factory.createInvoke(\"" + class_name + "\", \"" + method_name + "\", " + BCELifier.printType(type) + ", " + BCELifier.printArgumentTypes(arg_types) + ", " + "Constants." + Constants.OPCODE_NAMES[opcode].toUpperCase() + "));"); }
@Override public void visitInvokeInstruction( final InvokeInstruction i ) { final short opcode = i.getOpcode(); final String class_name = i.getClassName(_cp); final String method_name = i.getMethodName(_cp); final Type type = i.getReturnType(_cp); final Type[] arg_types = i.getArgumentTypes(_cp); _out.println("il.append(_factory.createInvoke(\"" + class_name + "\", \"" + method_name + "\", " + BCELifier.printType(type) + ", " + BCELifier.printArgumentTypes(arg_types) + ", " + CONSTANT_PREFIX + Const.getOpcodeName(opcode).toUpperCase(Locale.ENGLISH) + "));"); }
Type producedType = "<init>".equals(methodName) ? inv.getReferenceType(cpg) : inv.getReturnType(cpg);
final InvokeInstruction invoke = (InvokeInstruction) instructions[i]; try { field = T.getField(invoke.getReferenceType(constantPoolGen), invoke.getMethodName(constantPoolGen), invoke.getReturnType(constantPoolGen), invoke.getArgumentTypes(constantPoolGen)); } catch (ClassNotFoundException e) { throw new RuntimeReflectionException(e);
/** * Looks for the method referenced by the given invoke instruction in the given class. * @param jc the class that defines the referenced method * @param invoke the instruction that references the method * @return the referenced method or null if not found. */ private Method getMethod(final JavaClass jc, final InvokeInstruction invoke) { final Method[] ms = jc.getMethods(); for (final Method element : ms) { if ( (element.getName().equals(invoke.getMethodName(cpg))) && (Type.getReturnType(element.getSignature()).equals(invoke.getReturnType(cpg))) && (objarrayequals(Type.getArgumentTypes(element.getSignature()), invoke.getArgumentTypes(cpg))) ) { return element; } } return null; }
Type t = o.getReturnType(cpg); if (t instanceof ArrayType) { t = ((ArrayType) t).getBasicType();
Type t = o.getReturnType(cpg); if (t instanceof ArrayType){ t = ((ArrayType) t).getBasicType();
Type returnType = obj.getReturnType(getCPG());