Package org.ow2.asm.tree

Examples of org.ow2.asm.tree.MethodNode


        for (Iterator<String> i = cn.interfaces.iterator(); i.hasNext();) {
            interfaces.add(Type.getObjectType(i.next()));
        }

        for (int i = 0; i < methods.size(); ++i) {
            MethodNode method = methods.get(i);
            SimpleVerifier verifier = new SimpleVerifier(
                    Type.getObjectType(cn.name), syperType, interfaces,
                    (cn.access & Opcodes.ACC_INTERFACE) != 0);
            Analyzer<BasicValue> a = new Analyzer<BasicValue>(verifier);
            if (loader != null) {
View Full Code Here


     *            a map of already visited labels (in other methods).
     */
    public CheckMethodAdapter(final int access, final String name,
            final String desc, final MethodVisitor cmv,
            final Map<Label, Integer> labels) {
        this(new MethodNode(Opcodes.ASM5, access, name, desc, null, null) {
            @Override
            public void visitEnd() {
                Analyzer<BasicValue> a = new Analyzer<BasicValue>(
                        new BasicVerifier());
                try {
View Full Code Here

        ClassReader cr = new ClassReader(is);
        ClassNode cn = new ClassNode();
        cr.accept(cn, 0);
        List<MethodNode> methods = cn.methods;
        for (int i = 0; i < methods.size(); ++i) {
            MethodNode method = methods.get(i);
            Analyzer<BasicValue> a = new Analyzer<BasicValue>(new BasicInterpreter());
            a.analyze(cn.name, method);
        }
    }
View Full Code Here

                }
                super.visitEnd();
                System.err.println("finished w/ method:" + name);
            }
        };
        exp = new MethodNode(0, "m", "()V", null, null);
    }
View Full Code Here

            String name,
            String desc,
            String signature,
            String[] exceptions)
        {
            return new MethodNode(access, name, desc, signature, exceptions) {
               
                /**
                 * The labels used in this method.
                 */
                Set<LabelNode> usedLabels = new HashSet<LabelNode>();
View Full Code Here

        // assertEquals("Doo", innerClass(cn, 0).innerName);
       
        assertEquals("B1", cn.outerClass);
        assertEquals("([[LB1;LC1;LD1;)LC1;", cn.outerMethodDesc);
       
        MethodNode mn0 = cn.methods.get(0);
        ListIterator<AbstractInsnNode> it = mn0.instructions.iterator();
       
        FieldInsnNode n0 = (FieldInsnNode) it.next();
        assertEquals("D1", n0.owner);
        assertEquals("LB1;", n0.desc);
       
        assertEquals(Type.getType("LB1;"), ((LdcInsnNode) it.next()).cst);
        assertEquals(Type.getType("[LD1;"), ((LdcInsnNode) it.next()).cst);
        assertEquals(Type.getType("[I"), ((LdcInsnNode) it.next()).cst);
        assertEquals(Type.getType("J"), ((LdcInsnNode) it.next()).cst);
       
        assertEquals("B1", ((TypeInsnNode) it.next()).desc);
        assertEquals("[LD1;", ((TypeInsnNode) it.next()).desc);
        assertEquals("[I", ((TypeInsnNode) it.next()).desc);
        assertEquals("J", ((TypeInsnNode) it.next()).desc);
       
        MultiANewArrayInsnNode n3 = (MultiANewArrayInsnNode) it.next();
        assertEquals("[[LB1;", n3.desc);
       
        MethodInsnNode n4 = (MethodInsnNode) it.next();
        assertEquals("D1", n4.owner);
        assertEquals("([[LB1;LC1;LD1;)LC1;", n4.desc);
       
        FrameNode fn0 = (FrameNode) it.next();
        assertEquals(Collections.EMPTY_LIST, fn0.local);
        assertEquals(Collections.EMPTY_LIST, fn0.stack);
       
        assertEquals(Arrays.asList(new Object[] {"B1", "C1", "D1"}), ((FrameNode) it.next()).local);
        assertEquals(Arrays.asList(new Object[] {Opcodes.INTEGER, "C1", Opcodes.INTEGER, "D1"}), ((FrameNode) it.next()).local);
        assertEquals(Arrays.asList(new Object[] {Opcodes.INTEGER, Opcodes.INTEGER}), ((FrameNode) it.next()).local);
        // assertEquals(Collections.EMPTY_LIST, fn0.stack);
       
        TryCatchBlockNode tryCatchBlockNode = mn0.tryCatchBlocks.get(0);
        assertEquals("C1", tryCatchBlockNode.type);
       
        MethodNode mn1 = cn.methods.get(1);
        assertEquals("([[LB1;LC1;LD1;)V", mn1.desc);
        assertEquals(Arrays.asList(new String[] {"I", "J"}), mn1.exceptions);
    }
View Full Code Here

    @Override
    protected void setUp() {
        Type c = Type.getType("LC;");
        Type d = Type.getType("Ljava/lang/Number;");
        a = new Analyzer<BasicValue>(new SimpleVerifier(c, d, false));
        mn = new MethodNode(ACC_PUBLIC, "m", "()V", null, null);
    }
View Full Code Here

        ClassReader cr = new ClassReader(is);
        ClassNode cn = new ClassNode();
        cr.accept(cn, 0);
        List<MethodNode> methods = cn.methods;
        for (int i = 0; i < methods.size(); ++i) {
            MethodNode method = methods.get(i);
            Analyzer<?> a = new Analyzer<BasicValue>(new SimpleVerifier());
            a.analyze(cn.name, method);
        }
    }
View Full Code Here

        ClassReader cr = new ClassReader(is);
        ClassNode cn = new ClassNode();
        cr.accept(cn, 0);
        List<MethodNode> methods = cn.methods;
        for (int i = 0; i < methods.size(); ++i) {
            MethodNode method = methods.get(i);
            Analyzer<?> a = new Analyzer<BasicValue>(new BasicVerifier());
            a.analyze(cn.name, method);
        }
    }
View Full Code Here

                final String desc,
                final String signature,
                final String[] exceptions)
            {
                if (name.equals("m")) {
                    return new MethodNode(access,
                            name,
                            desc,
                            signature,
                            exceptions)
                    {
View Full Code Here

TOP

Related Classes of org.ow2.asm.tree.MethodNode

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.