Package org.ow2.asm

Examples of org.ow2.asm.MethodVisitor


        } catch (Exception e) {
        }
    }

    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


        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }

    private void nativeMethod(final ClassWriter cw) {
        MethodVisitor mv = cw.visitMethod(ACC_PRIVATE + ACC_NATIVE,
                "nativeMethod",
                "()V",
                null,
                null);
        mv.visitEnd();
    }
View Full Code Here

        } catch (Exception e) {
        }
    }

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

                null);
        mv.visitEnd();
    }

    private void clinitMethod(final ClassWriter cw) {
        MethodVisitor mv = cw.visitMethod(ACC_STATIC,
                "<clinit>",
                "()V",
                null,
                null);
        mv.visitCode();
        mv.visitInsn(ICONST_1);
        mv.visitFieldInsn(PUTSTATIC, "pkg/Insns", "s", "S");
        mv.visitInsn(RETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
View Full Code Here

        } catch (Exception e) {
        }
    }

    public void testIllegalFieldInsnName2() {
        MethodVisitor mv = new CheckMethodAdapter(new EmptyVisitor());
        mv.visitCode();

        try {
            mv.visitFieldInsn(GETFIELD, "C", "a-", "I");
            fail();
        } catch (Exception e) {
        }
    }
View Full Code Here

        } catch (Exception e) {
        }
    }

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

        } catch (Exception e) {
        }
    }

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

        } catch (Exception e) {
        }
    }

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

        } catch (Exception e) {
        }
    }

    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

        } catch (Exception e) {
        }
    }

    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

TOP

Related Classes of org.ow2.asm.MethodVisitor

Copyright © 2018 www.massapicom. 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.