Package org.objectweb.asm.tree

Examples of org.objectweb.asm.tree.MethodNode


        Type syperType = cn.superName == null
                ? null
                : Type.getObjectType(cn.superName);
        List methods = cn.methods;
        for (int i = 0; i < methods.size(); ++i) {
            MethodNode method = (MethodNode) methods.get(i);
            Analyzer a = new Analyzer(new SimpleVerifier(Type.getObjectType(cn.name),
                    syperType,
                    false));
            try {
                a.analyze(cn.name, method);
View Full Code Here


        ClassNode cn = new ClassNode();
        cr.accept(new CheckClassAdapter(cn), ClassReader.SKIP_DEBUG);

        List methods = cn.methods;
        for (int i = 0; i < methods.size(); ++i) {
            MethodNode method = (MethodNode) methods.get(i);
            Analyzer a = new Analyzer(new SimpleVerifier(Type.getObjectType(cn.name),
                    Type.getObjectType(cn.superName),
                    false));
            try {
                a.analyze(cn.name, method);
View Full Code Here

                ClassReader cr = new ClassReader(b);
                ClassNode cn = new ClassNode();
                cr.accept(cn, ClassReader.SKIP_DEBUG);
                List methods = cn.methods;
                for (int k = 0; k < methods.size(); ++k) {
                    MethodNode method = (MethodNode) methods.get(k);
                    Analyzer a = new Analyzer(new SimpleVerifier());
                    try {
                        a.analyze(cn.name, method);
                    } catch (Throwable th) {
                        ++errors;
View Full Code Here

                    - startmem)));
            for (int j = 0; j < limit; j++) {
                ClassNode clazz = (ClassNode) result.get(j);
                List l = clazz.methods;
                for (int k = 0, lim = l.size(); k < lim; k++) {
                    MethodNode m = (MethodNode) l.get(k);
                    InsnList insn = m.instructions;
                    if (insn != null) {
                        insn.clear();
                    }
                }
View Full Code Here

        // assertEquals("Doo", innerClass(cn, 0).innerName);
       
        assertEquals("B1", cn.outerClass);
        assertEquals("([[LB1;LC1;LD1;)LC1;", cn.outerMethodDesc);
       
        MethodNode mn0 = (MethodNode) cn.methods.get(0);
        Iterator 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 = (TryCatchBlockNode) mn0.tryCatchBlocks.get(0);
        assertEquals("C1", tryCatchBlockNode.type);
       
        MethodNode mn1 = (MethodNode) cn.methods.get(1);
        assertEquals("([[LB1;LC1;LD1;)V", mn1.desc);
        assertEquals(Arrays.asList(new String[] {"I", "J"}), mn1.exceptions);
    }
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

    protected void setUp() {
        Type c = Type.getType("LC;");
        Type d = Type.getType("Ljava/lang/Number;");
        a = new Analyzer(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 methods = cn.methods;
        for (int i = 0; i < methods.size(); ++i) {
            MethodNode method = (MethodNode) methods.get(i);
            Analyzer a = new Analyzer(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 methods = cn.methods;
        for (int i = 0; i < methods.size(); ++i) {
            MethodNode method = (MethodNode) methods.get(i);
            Analyzer a = new Analyzer(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.objectweb.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.