private static String methodInfo(ConstPool pool, int index) { return "#" + index + " = Method " + pool.getMethodrefClassName(index) + "." + pool.getMethodrefName(index) + "(" + pool.getMethodrefType(index) + ")"; }
/** * Get the signature of the constructor * * The signature is represented by a character string * called method descriptor, which is defined in the JVM specification. * * @see javassist.CtBehavior#getSignature() * @see javassist.bytecode.Descriptor * @return the signature */ public String getSignature() { ConstPool constPool = getConstPool(); int methodIndex = iterator.u16bitAt(currentPos + 1); // constructor return constPool.getMethodrefType(methodIndex); }
private static String methodInfo(ConstPool pool, int index) { return "#" + index + " = Method " + pool.getMethodrefClassName(index) + "." + pool.getMethodrefName(index) + "(" + pool.getMethodrefType(index) + ")"; }
/** * Get the signature of the constructor * * The signature is represented by a character string * called method descriptor, which is defined in the JVM specification. * * @see javassist.CtBehavior#getSignature() * @see javassist.bytecode.Descriptor * @return the signature */ public String getSignature() { ConstPool constPool = getConstPool(); int methodIndex = iterator.u16bitAt(currentPos + 1); // constructor return constPool.getMethodrefType(methodIndex); }
/** * Returns the constructor called for creating the object. */ public CtConstructor getConstructor() throws NotFoundException { ConstPool cp = getConstPool(); int index = iterator.u16bitAt(currentPos + 1); String desc = cp.getMethodrefType(index); return getCtClass().getConstructor(desc); }
/** * Returns the constructor called for creating the object. */ public CtConstructor getConstructor() throws NotFoundException { ConstPool cp = getConstPool(); int index = iterator.u16bitAt(currentPos + 1); String desc = cp.getMethodrefType(index); return getCtClass().getConstructor(desc); }
private int doInvokeMethod(int pos, byte[] code, boolean notStatic) throws BadBytecode { int i = ByteArray.readU16bit(code, pos + 1); String desc = cpool.getMethodrefType(i); checkParamTypes(desc, 1); if (notStatic) { String className = cpool.getMethodrefClassName(i); TypeData target = stackTypes[--stackTop]; if (target instanceof TypeData.UninitTypeVar && target.isUninit()) constructorCalled(target, ((TypeData.UninitTypeVar)target).offset()); else if (target instanceof TypeData.UninitData) constructorCalled(target, ((TypeData.UninitData)target).offset()); target.setType(className, classPool); } pushMemberType(desc); return 3; }
private void evalInvokeMethod(int opcode, int index, Frame frame) throws BadBytecode { String desc = constPool.getMethodrefType(index); Type[] types = paramTypesFromDesc(desc); int i = types.length; while (i > 0) verifyAssignable(zeroExtend(types[--i]), simplePop(frame)); if (opcode != INVOKESTATIC) { Type objectType = resolveClassInfo(constPool.getMethodrefClassName(index)); verifyAssignable(objectType, simplePop(frame)); } Type returnType = returnTypeFromDesc(desc); if (returnType != Type.VOID) simplePush(zeroExtend(returnType), frame); }
case INVOKEVIRTUAL : case INVOKESPECIAL : desc = constPool.getMethodrefType(ci.u16bitAt(index + 1)); stack += Descriptor.dataSize(desc) - 1; break; case INVOKESTATIC : desc = constPool.getMethodrefType(ci.u16bitAt(index + 1)); stack += Descriptor.dataSize(desc); break;
private int doInvokeMethod(int pos, byte[] code, boolean notStatic) throws BadBytecode { int i = ByteArray.readU16bit(code, pos + 1); String desc = cpool.getMethodrefType(i); checkParamTypes(desc, 1); if (notStatic) { String className = cpool.getMethodrefClassName(i); TypeData target = stackTypes[--stackTop]; if (target instanceof TypeData.UninitTypeVar && target.isUninit()) constructorCalled(target, ((TypeData.UninitTypeVar)target).offset()); else if (target instanceof TypeData.UninitData) constructorCalled(target, ((TypeData.UninitData)target).offset()); target.setType(className, classPool); } pushMemberType(desc); return 3; }
private void evalInvokeMethod(int opcode, int index, Frame frame) throws BadBytecode { String desc = constPool.getMethodrefType(index); Type[] types = paramTypesFromDesc(desc); int i = types.length; while (i > 0) verifyAssignable(zeroExtend(types[--i]), simplePop(frame)); if (opcode != INVOKESTATIC) { Type objectType = resolveClassInfo(constPool.getMethodrefClassName(index)); verifyAssignable(objectType, simplePop(frame)); } Type returnType = returnTypeFromDesc(desc); if (returnType != Type.VOID) simplePush(zeroExtend(returnType), frame); }
case INVOKEVIRTUAL : case INVOKESPECIAL : desc = constPool.getMethodrefType(ci.u16bitAt(index + 1)); stack += Descriptor.dataSize(desc) - 1; break; case INVOKESTATIC : desc = constPool.getMethodrefType(ci.u16bitAt(index + 1)); stack += Descriptor.dataSize(desc); break;
if (pos >= 0) { int mref = iterator.u16bitAt(pos + 1); String desc = ca.getConstPool().getMethodrefType(mref); int num = Descriptor.numOfParameters(desc) + 1; if (num > 3)
if (pos >= 0) { int mref = iterator.u16bitAt(pos + 1); String desc = ca.getConstPool().getMethodrefType(mref); int num = Descriptor.numOfParameters(desc) + 1; if (num > 3)
int methodIndex = iterator.u16bitAt(pos + 1); // constructor String signature = constPool.getMethodrefType(methodIndex);
int methodIndex = iterator.u16bitAt(pos + 1); // constructor String signature = constPool.getMethodrefType(methodIndex);
classname = constPool.getMethodrefClassName(index); methodname = constPool.getMethodrefName(index); signature = constPool.getMethodrefType(index);
classname = constPool.getMethodrefClassName(index); methodname = constPool.getMethodrefName(index); signature = constPool.getMethodrefType(index);
private static String methodInfo(ConstPool pool, int index) { return "#" + index + " = Method " + pool.getMethodrefClassName(index) + "." + pool.getMethodrefName(index) + "(" + pool.getMethodrefType(index) + ")"; }
private static String methodInfo(ConstPool pool, int index) { return "#" + index + " = Method " + pool.getMethodrefClassName(index) + "." + pool.getMethodrefName(index) + "(" + pool.getMethodrefType(index) + ")"; }