Package org.ow2.asm

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


    public void testIllegalFrameType() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitFrame(123, 0, null, 0, null);
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here


    public void testIllegalFrameLocalCount() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitFrame(F_SAME, 1, new Object[] { INTEGER }, 0, null);
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

    public void testIllegalFrameStackCount() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitFrame(F_SAME, 0, null, 1, new Object[] { INTEGER });
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

    public void testIllegalFrameLocalArray() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitFrame(F_APPEND, 1, new Object[0], 0, null);
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

    public void testIllegalFrameStackArray() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitFrame(F_SAME1, 0, null, 1, new Object[0]);
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

    public void testIllegalFrameValue() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitFrame(F_FULL, 1, new Object[] { "LC;" }, 0, null);
            fail();
        } catch (Exception e) {
        }
        try {
            mv.visitFrame(F_FULL, 1, new Object[] { new Integer(0) }, 0, null);
View Full Code Here

            mv.visitFrame(F_FULL, 1, new Object[] { "LC;" }, 0, null);
            fail();
        } catch (Exception e) {
        }
        try {
            mv.visitFrame(F_FULL, 1, new Object[] { new Integer(0) }, 0, null);
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

        Label l0 = new Label();
        Label l1 = new Label();
        mv.visitTryCatchBlock(l0, l1, l0, null);
        mv.visitInsn(ICONST_0);
        mv.visitInsn(IRETURN);
        mv.visitFrame(F_SAME1,
                0,
                null,
                1,
                new Object[] { "java/lang/Throwable" });
        mv.visitLabel(l0);
View Full Code Here

        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
        mv.visitVarInsn(ASTORE, 1);
        mv.visitLabel(l1);
        Label l6 = new Label();
        mv.visitJumpInsn(GOTO, l6);
        mv.visitFrame(F_SAME1,
                0,
                null,
                1,
                new Object[] { "java/lang/Exception" });
        mv.visitLabel(l2);
View Full Code Here

                new Object[] { "java/lang/Exception" });
        mv.visitLabel(l2);
        mv.visitVarInsn(ASTORE, 2);
        mv.visitLabel(l4);
        mv.visitJumpInsn(GOTO, l6);
        mv.visitFrame(F_SAME1,
                0,
                null,
                1,
                new Object[] { "java/lang/Throwable" });
        mv.visitLabel(l3);
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.