Examples of addAnewarray()


Examples of javassist.bytecode.Bytecode.addAnewarray()

        finfo.setAccessFlags(AccessFlag.PRIVATE | AccessFlag.STATIC);
        cf.addField(finfo);
        MethodInfo minfo = new MethodInfo(cp, "<clinit>", "()V");
        Bytecode code = new Bytecode(cp, 0, 0);
        code.addIconst(size * 2);
        code.addAnewarray("java.lang.reflect.Method");
        code.addPutstatic(classname, HOLDER, HOLDER_TYPE);
        code.addOpcode(Bytecode.RETURN);
        minfo.setCodeAttribute(code.toCodeAttribute());
        cf.addMethod(minfo);
    }
View Full Code Here

Examples of javassist.bytecode.Bytecode.addAnewarray()

        String[] types = DescriptorUtils.descriptorStringToParameterArray(mInfo.getDescriptor());
        // create a new array the same size as the parameter array
        int index = proxyBytecode.getConstPool().addIntegerInfo(types.length);
        proxyBytecode.addLdc(index);
        // create new array to use to pass our parameters
        proxyBytecode.addAnewarray("java.lang.Object");
        int locals = types.length + paramOffset;
        for (int i = 0; i < types.length; ++i) {
            // duplicate the array reference on the stack
            proxyBytecode.add(Opcode.DUP);
            // load the array index into the stack
View Full Code Here

Examples of javassist.bytecode.Bytecode.addAnewarray()

        b.addIconst(nbParameters);
        if(subject == null)
            b.add(Opcode.ACONST_NULL);
        else b.addLdc(subject);
        b.addIconst(names.length);
        b.addAnewarray("java.lang.String");
        for(int i = 0; i < names.length; i++) {
            if(names[i] != null)
                b.add(Opcode.DUP);
        }
        for(int i = 0; i < names.length; i++) {
View Full Code Here

Examples of javassist.bytecode.Bytecode.addAnewarray()

/*  857 */     cf.addField(finfo);
/*  858 */     MethodInfo minfo = new MethodInfo(cp, "<clinit>", "()V");
/*  859 */     minfo.setAccessFlags(8);
/*  860 */     Bytecode code = new Bytecode(cp, 0, 0);
/*  861 */     code.addIconst(size * 2);
/*  862 */     code.addAnewarray("java.lang.reflect.Method");
/*  863 */     code.addPutstatic(classname, "_methods_", "[Ljava/lang/reflect/Method;");
/*      */
/*  865 */     code.addLconst(-1L);
/*  866 */     code.addPutstatic(classname, "serialVersionUID", "J");
/*  867 */     code.addOpcode(177);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.