Package org.ow2.asm

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


        }
    }

    public void testIllegalTableSwitchParameters4() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitTableSwitchInsn(0, 1, new Label(), new Label[0]);
            fail();
        } catch (Exception e) {
        }
View Full Code Here


        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC + ACC_VARARGS + ACC_STRICT,
                "varargMethod",
                "([Ljava/lang/Object;)V",
                "([Ljava/lang/Object;)V^TF;",
                new String[] { "java/lang/Exception" });
        mv.visitCode();
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
View Full Code Here

        }
    }

    public void testIllegalLookupSwitchParameters1() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitLookupSwitchInsn(new Label(), null, new Label[0]);
            fail();
        } catch (Exception e) {
        }
View Full Code Here

        MethodVisitor mv = cw.visitMethod(ACC_PUBLIC,
                "get",
                "(I)Ljava/lang/String;",
                null,
                null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ILOAD, 1);
        mv.visitMethodInsn(INVOKESPECIAL,
                "java/util/ArrayList",
                "get",
View Full Code Here

        }
    }

    public void testIllegalLookupSwitchParameters2() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitLookupSwitchInsn(new Label(), new int[0], null);
            fail();
        } catch (Exception e) {
        }
View Full Code Here

        }
    }

    public void testIllegalLookupSwitchParameters3() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitLookupSwitchInsn(new Label(), new int[0], new Label[1]);
            fail();
        } catch (Exception e) {
        }
View Full Code Here

        mv = cw.visitMethod(ACC_PUBLIC + ACC_BRIDGE + ACC_SYNTHETIC,
                "get",
                "(I)Ljava/lang/Object;",
                "(I)TE;",
                null);
        mv.visitCode();
        mv.visitVarInsn(ALOAD, 0);
        mv.visitVarInsn(ILOAD, 1);
        mv.visitMethodInsn(INVOKEVIRTUAL,
                "pkg/Insns",
                "get",
View Full Code Here

        }
    }

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

        }
    }

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

        }
    }

    public void testIllegalFieldInsnNullName() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();
        try {
            mv.visitFieldInsn(GETFIELD, "C", null, "I");
            fail();
        } catch (Exception e) {
        }
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.