Package org.ow2.asm.commons

Examples of org.ow2.asm.commons.EmptyVisitor


   
    public void testIllegalDataflow() {
        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);
View Full Code Here


   
    public void testIllegalDataflow2() {
        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 {
View Full Code Here

        } catch (Exception e) {
        }
    }

    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);
View Full Code Here

        } catch (Exception e) {
        }
    }

    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

        } catch (Exception e) {
        }
    }

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

        mv.visitMaxs(0, 0);
        mv.visitEnd();
        cw.visitEnd();
        byte[] b = cw.toByteArray();
        ClassReader cr = new ClassReader(b);
        cr.accept(new EmptyVisitor() {
            @Override
            public MethodVisitor visitMethod(
                final int access,
                final String name,
                final String desc,
                final String signature,
                final String[] exceptions)
            {
                if (name.equals("m")) {
                    return new EmptyVisitor() {
                        @Override
                        public void visitMaxs(
                            final int realMaxStack,
                            final int realMaxLocals)
                        {
                            assertEquals("maxStack", maxStack, realMaxStack);
                            assertEquals("maxLocals", maxLocals, realMaxLocals);
                        }
                    };
                } else {
                    return new EmptyVisitor();
                }
            }
        },
                0);
View Full Code Here

        return new ClassReaderTest().getSuite();
    }

    @Override
    public void test() throws Exception {
        new ClassReader(is).accept(new EmptyVisitor(), 0);
    }
View Full Code Here

        @Override
        public AnnotationVisitor visitAnnotation(
            final String desc,
            final boolean visible)
        {
            return new EmptyVisitor();
        }
View Full Code Here

                    exceptions))
            {

                @Override
                public AnnotationVisitor visitAnnotationDefault() {
                    return new EmptyVisitor();
                }

                @Override
                public AnnotationVisitor visitAnnotation(
                    String desc,
                    boolean visible)
                {
                    return new EmptyVisitor();
                }

                @Override
                public AnnotationVisitor visitParameterAnnotation(
                    int parameter,
                    String desc,
                    boolean visible)
                {
                    return new EmptyVisitor();
                }
            };
        }
View Full Code Here

    MethodVisitor mv;

    @Override
    protected void setUp() throws Exception {
        h = new ASMContentHandler(new EmptyVisitor());
        cv = new SAXClassAdapter(h, true);
        cv.visit(V1_5, ACC_PUBLIC, "C", null, "java/lang/Object", null);
    }
View Full Code Here

TOP

Related Classes of org.ow2.asm.commons.EmptyVisitor

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.