/** * Produces codes in which a new object is created and assigned to * the field as the initial value. */ int compile(CtClass type, String name, Bytecode code, CtClass[] parameters, Javac drv) throws CannotCompileException { int stacksize; code.addAload(0); code.addAload(0); if (stringParams == null) stacksize = 2; else stacksize = compileStringParameter(code) + 2; if (withConstructorParams) stacksize += CtNewWrappedMethod.compileParameterList(code, parameters, 1); String typeDesc = Descriptor.of(type); String mDesc = getDescriptor() + typeDesc; code.addInvokestatic(objectType, methodName, mDesc); code.addPutfield(Bytecode.THIS, name, typeDesc); return stacksize; }
/** * Produces codes in which a new object is created and assigned to * the field as the initial value. */ int compile(CtClass type, String name, Bytecode code, CtClass[] parameters, Javac drv) throws CannotCompileException { int stacksize; code.addAload(0); code.addAload(0); if (stringParams == null) stacksize = 2; else stacksize = compileStringParameter(code) + 2; if (withConstructorParams) stacksize += CtNewWrappedMethod.compileParameterList(code, parameters, 1); String typeDesc = Descriptor.of(type); String mDesc = getDescriptor() + typeDesc; code.addInvokestatic(objectType, methodName, mDesc); code.addPutfield(Bytecode.THIS, name, typeDesc); return stacksize; }
/** * Produces codes in which a new object is created and assigned to * the field as the initial value. */ int compile(CtClass type, String name, Bytecode code, CtClass[] parameters, Javac drv) throws CannotCompileException { int stacksize; code.addAload(0); code.addAload(0); if (stringParams == null) stacksize = 2; else stacksize = compileStringParameter(code) + 2; if (withConstructorParams) stacksize += CtNewWrappedMethod.compileParameterList(code, parameters, 1); String typeDesc = Descriptor.of(type); String mDesc = getDescriptor() + typeDesc; code.addInvokestatic(objectType, methodName, mDesc); code.addPutfield(Bytecode.THIS, name, typeDesc); return stacksize; }
/** * Produces codes in which a new object is created and assigned to * the field as the initial value. */ int compile(CtClass type, String name, Bytecode code, CtClass[] parameters, Javac drv) throws CannotCompileException { int stacksize; code.addAload(0); code.addAload(0); if (stringParams == null) stacksize = 2; else stacksize = compileStringParameter(code) + 2; if (withConstructorParams) stacksize += CtNewWrappedMethod.compileParameterList(code, parameters, 1); String typeDesc = Descriptor.of(type); String mDesc = getDescriptor() + typeDesc; code.addInvokestatic(objectType, methodName, mDesc); code.addPutfield(Bytecode.THIS, name, typeDesc); return stacksize; }
/** * Produces codes in which a new object is created and assigned to * the field as the initial value. */ int compile(CtClass type, String name, Bytecode code, CtClass[] parameters, Javac drv) throws CannotCompileException { int stacksize; code.addAload(0); code.addAload(0); if (stringParams == null) stacksize = 2; else stacksize = compileStringParameter(code) + 2; if (withConstructorParams) stacksize += CtNewWrappedMethod.compileParameterList(code, parameters, 1); String typeDesc = Descriptor.of(type); String mDesc = getDescriptor() + typeDesc; code.addInvokestatic(objectType, methodName, mDesc); code.addPutfield(Bytecode.THIS, name, typeDesc); return stacksize; }
/** * Produces codes for a static field. */ int compileIfStatic(CtClass type, String name, Bytecode code, Javac drv) throws CannotCompileException { String desc; int stacksize = 1; if (stringParams == null) desc = "()"; else { desc = "([Ljava/lang/String;)"; stacksize += compileStringParameter(code); } String typeDesc = Descriptor.of(type); code.addInvokestatic(objectType, methodName, desc + typeDesc); code.addPutstatic(Bytecode.THIS, name, typeDesc); return stacksize; } }
/** * Produces codes for a static field. */ int compileIfStatic(CtClass type, String name, Bytecode code, Javac drv) throws CannotCompileException { String desc; int stacksize = 1; if (stringParams == null) desc = "()"; else { desc = "([Ljava/lang/String;)"; stacksize += compileStringParameter(code); } String typeDesc = Descriptor.of(type); code.addInvokestatic(objectType, methodName, desc + typeDesc); code.addPutstatic(Bytecode.THIS, name, typeDesc); return stacksize; } }
/** * Produces codes for a static field. */ int compileIfStatic(CtClass type, String name, Bytecode code, Javac drv) throws CannotCompileException { String desc; int stacksize = 1; if (stringParams == null) desc = "()"; else { desc = "([Ljava/lang/String;)"; stacksize += compileStringParameter(code); } String typeDesc = Descriptor.of(type); code.addInvokestatic(objectType, methodName, desc + typeDesc); code.addPutstatic(Bytecode.THIS, name, typeDesc); return stacksize; } }
/** * Produces codes for a static field. */ int compileIfStatic(CtClass type, String name, Bytecode code, Javac drv) throws CannotCompileException { String desc; int stacksize = 1; if (stringParams == null) desc = "()"; else { desc = "([Ljava/lang/String;)"; stacksize += compileStringParameter(code); } String typeDesc = Descriptor.of(type); code.addInvokestatic(objectType, methodName, desc + typeDesc); code.addPutstatic(Bytecode.THIS, name, typeDesc); return stacksize; } }
/** * Produces codes for a static field. */ int compileIfStatic(CtClass type, String name, Bytecode code, Javac drv) throws CannotCompileException { String desc; int stacksize = 1; if (stringParams == null) desc = "()"; else { desc = "([Ljava/lang/String;)"; stacksize += compileStringParameter(code); } String typeDesc = Descriptor.of(type); code.addInvokestatic(objectType, methodName, desc + typeDesc); code.addPutstatic(Bytecode.THIS, name, typeDesc); return stacksize; } }
/** * Produces codes in which a new object is created and assigned to * the field as the initial value. */ @Override int compile(CtClass type, String name, Bytecode code, CtClass[] parameters, Javac drv) throws CannotCompileException { int stacksize; code.addAload(0); code.addAload(0); if (stringParams == null) stacksize = 2; else stacksize = compileStringParameter(code) + 2; if (withConstructorParams) stacksize += CtNewWrappedMethod.compileParameterList(code, parameters, 1); String typeDesc = Descriptor.of(type); String mDesc = getDescriptor() + typeDesc; code.addInvokestatic(objectType, methodName, mDesc); code.addPutfield(Bytecode.THIS, name, typeDesc); return stacksize; }
/** * Produces codes for a static field. */ @Override int compileIfStatic(CtClass type, String name, Bytecode code, Javac drv) throws CannotCompileException { String desc; int stacksize = 1; if (stringParams == null) desc = "()"; else { desc = "([Ljava/lang/String;)"; stacksize += compileStringParameter(code); } String typeDesc = Descriptor.of(type); code.addInvokestatic(objectType, methodName, desc + typeDesc); code.addPutstatic(Bytecode.THIS, name, typeDesc); return stacksize; } }
/** * Produces codes in which a new object is created and assigned to * the field as the initial value. */ int compile(CtClass type, String name, Bytecode code, CtClass[] parameters, Javac drv) throws CannotCompileException { int stacksize; code.addAload(0); code.addAload(0); if (stringParams == null) stacksize = 2; else stacksize = compileStringParameter(code) + 2; if (withConstructorParams) stacksize += CtNewWrappedMethod.compileParameterList(code, parameters, 1); String typeDesc = Descriptor.of(type); String mDesc = getDescriptor() + typeDesc; code.addInvokestatic(objectType, methodName, mDesc); code.addPutfield(Bytecode.THIS, name, typeDesc); return stacksize; }
/** * Produces codes for a static field. */ int compileIfStatic(CtClass type, String name, Bytecode code, Javac drv) throws CannotCompileException { String desc; int stacksize = 1; if (stringParams == null) desc = "()"; else { desc = "([Ljava/lang/String;)"; stacksize += compileStringParameter(code); } String typeDesc = Descriptor.of(type); code.addInvokestatic(objectType, methodName, desc + typeDesc); code.addPutstatic(Bytecode.THIS, name, typeDesc); return stacksize; } }