Package org.ow2.easybeans.asm

Examples of org.ow2.easybeans.asm.MethodVisitor.visitFieldInsn()


    public void testIllegalFieldInsnArrayDesc() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitFieldInsn(GETFIELD, "C", "i", "[");
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here


    public void testIllegalFieldInsnReferenceDesc() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitFieldInsn(GETFIELD, "C", "i", "L");
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

    public void testIllegalFieldInsnReferenceDesc2() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitFieldInsn(GETFIELD, "C", "i", "L-;");
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

        mv.visitVarInsn(FSTORE, 4);
        // I2B
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ILOAD, 1);
        mv.visitInsn(I2B);
        mv.visitFieldInsn(PUTFIELD, "pkg/Insns", "b", "B");
        // I2C
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ILOAD, 1);
        mv.visitInsn(I2C);
        mv.visitFieldInsn(PUTFIELD, "pkg/Insns", "c", "C");
View Full Code Here

        mv.visitFieldInsn(PUTFIELD, "pkg/Insns", "b", "B");
        // I2C
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ILOAD, 1);
        mv.visitInsn(I2C);
        mv.visitFieldInsn(PUTFIELD, "pkg/Insns", "c", "C");
        // I2S
        mv.visitVarInsn(ILOAD, 1);
        mv.visitInsn(I2S);
        mv.visitFieldInsn(PUTSTATIC, "pkg/Insns", "s", "S");
        // checkcast
View Full Code Here

        mv.visitInsn(I2C);
        mv.visitFieldInsn(PUTFIELD, "pkg/Insns", "c", "C");
        // I2S
        mv.visitVarInsn(ILOAD, 1);
        mv.visitInsn(I2S);
        mv.visitFieldInsn(PUTSTATIC, "pkg/Insns", "s", "S");
        // checkcast
        mv.visitInsn(ACONST_NULL);
        mv.visitTypeInsn(CHECKCAST, "java/lang/String");
        mv.visitInsn(ACONST_NULL);
        mv.visitTypeInsn(CHECKCAST, "[[I");
View Full Code Here

                "values",
                "()[Lpkg/Enum;",
                null,
                null);
        mv.visitCode();
        mv.visitFieldInsn(GETSTATIC, "pkg/Enum", "$VALUES", "[Lpkg/Enum;");
        mv.visitMethodInsn(INVOKEVIRTUAL,
                "[Lpkg/Enum;",
                "clone",
                "()Ljava/lang/Object;");
        mv.visitTypeInsn(CHECKCAST, "[Lpkg/Enum;");
View Full Code Here

       
        MethodVisitor mv;
       
        mv = cv.visitMethod(0, "foo", "()V", null, null);
        mv.visitCode();
        mv.visitFieldInsn(GETFIELD, "Doo", "boo", "LBoo;");

        mv.visitLdcInsn(Type.getType("LBoo;"));
        mv.visitLdcInsn(Type.getType("[LDoo;"));
        mv.visitLdcInsn(Type.getType("[I"));
        mv.visitLdcInsn(Type.getType("J"));
View Full Code Here

        mv.visitInsn(ICONST_0);
        mv.visitMethodInsn(INVOKESPECIAL,
                "pkg/Enum",
                "<init>",
                "(Ljava/lang/String;I)V");
        mv.visitFieldInsn(PUTSTATIC, "pkg/Enum", "V0", "Lpkg/Enum;");
        mv.visitTypeInsn(NEW, "pkg/Enum");
        mv.visitInsn(DUP);
        mv.visitLdcInsn("V1");
        mv.visitInsn(ICONST_1);
        mv.visitMethodInsn(INVOKESPECIAL,
View Full Code Here

        mv.visitInsn(ICONST_1);
        mv.visitMethodInsn(INVOKESPECIAL,
                "pkg/Enum",
                "<init>",
                "(Ljava/lang/String;I)V");
        mv.visitFieldInsn(PUTSTATIC, "pkg/Enum", "V1", "Lpkg/Enum;");
        mv.visitTypeInsn(NEW, "pkg/Enum");
        mv.visitInsn(DUP);
        mv.visitLdcInsn("V2");
        mv.visitInsn(ICONST_2);
        mv.visitMethodInsn(INVOKESPECIAL,
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.