Package org.ow2.asm

Examples of org.ow2.asm.MethodVisitor.visitCode()


        }
    }

    public void testIllegalMultiANewArrayDims() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitMultiANewArrayInsn("[[I", 0);
            fail();
        } catch (Exception e) {
        }
View Full Code Here


        }
    }

    public void testIllegalMultiANewArrayDims2() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitMultiANewArrayInsn("[[I", 3);
            fail();
        } catch (Exception e) {
        }
View Full Code Here

        }
    }

    public void testIllegalTryCatchBlock() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        Label m = new Label();
        Label n = new Label();
        mv.visitLabel(m);
        try {
            mv.visitTryCatchBlock(m, n, n, null);
View Full Code Here

        MethodVisitor mv = new CheckMethodAdapter(ACC_PUBLIC,
                "m",
                "(I)V",
                new EmptyVisitor(),
                new HashMap<Label, Integer>());
        mv.visitCode();
        mv.visitVarInsn(ILOAD, 1);
        mv.visitInsn(IRETURN);
        mv.visitMaxs(1, 2);
        try {
            mv.visitEnd();
View Full Code Here

        MethodVisitor mv = new CheckMethodAdapter(ACC_PUBLIC,
                "m",
                "(I)I",
                new EmptyVisitor(),
                new HashMap<Label, Integer>());
        mv.visitCode();
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 2);
        try {
            mv.visitEnd();
            fail();
View Full Code Here

        }
    }

    public void testIllegalLocalVariableLabels() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        Label m = new Label();
        Label n = new Label();
        mv.visitLabel(n);
        mv.visitInsn(NOP);
        mv.visitLabel(m);
View Full Code Here

        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC,
                "<init>",
                "()V",
                null,
                null);
        mv.visitCode();
        Label l0 = new Label();
        Label l1 = new Label();
        Label l2 = new Label();
        mv.visitLabel(l0);
        mv.visitLineNumber(3, l0);
View Full Code Here

        }
    }

    public void testIllegalLineNumerLabel() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitLineNumber(0, new Label());
            fail();
        } catch (Exception e) {
        }
View Full Code Here

        }
    }

    public void testIllegalInsnVisitAfterEnd() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        mv.visitMaxs(0, 0);
        try {
            mv.visitInsn(NOP);
            fail();
        } catch (Exception e) {
View Full Code Here

        MethodVisitor mv;

        cw.visit(V1_1, ACC_PUBLIC, "pkg/JSR2", null, "java/lang/Object", null);

        mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
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.