Package org.objectweb.asm.tree

Examples of org.objectweb.asm.tree.ClassNode.accept()


        if( node.version > 50 ) {
          opts = ClassWriter.COMPUTE_FRAMES;
        }
        ClassWriter cw = new ClassWriter( opts );

        node.accept(new ClassVisitor( Opcodes.ASM4, cw) {});
        byte[] result = cw.toByteArray();
//        String postCheck = verify( result );
//        if ( postCheck.trim().length() > 0 ) {
//            log( "Class " + node.name + " failed postcheck:\n " + postCheck );
//            throw new Exception( "Class " + node.name + " failed postcheck:\n" + postCheck );
View Full Code Here


            for (int j = 0; j < classes.size(); ++j) {
                byte[] b = (byte[]) classes.get(j);
                ClassWriter cw = new ClassWriter(0);
                ClassNode cn = new ClassNode();
                new ClassReader(b).accept(cn, 0);
                cn.accept(cw);
                cw.toByteArray();
            }
            t = System.currentTimeMillis() - t;
            System.out.println("Time to deserialize and reserialize "
                    + classes.size() + " classes with tree package = " + t
View Full Code Here

                //getLogger().lifecycle("Stripping method: "+m.name);
            }
        }

        ClassWriter writer = new ClassWriter(0);
        node.accept(writer);
        return writer.toByteArray();
    }

    public File getExceptorCfg()
    {
View Full Code Here

            }
            classNode.visibleAnnotations.add(getSideAnn(isClientOnly));
        }

        ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS);
        classNode.accept(writer);
        byte[] data = writer.toByteArray();

        ZipEntry newEntry = new ZipEntry(entry.getName());
        if (outJar != null)
        {
View Full Code Here

      ClassReader cr = new ClassReader(bytes);
      ClassNode cn = new ClassNode();
      cr.accept(cn, 0);
      if (implement(cn)) {
        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
        cn.accept(cw);
        bytes = cw.toByteArray();
      } else {
        log.debug("Nothing implemented on " + transformedName);
      }
    }
View Full Code Here

      ClassReader cr = new ClassReader(bytes);
      ClassNode cn = new ClassNode();
      cr.accept(cn, 0);
      if (strip(cn)) {
        ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES);
        cn.accept(cw);
        bytes = cw.toByteArray();
      } else {
        log.debug("Nothing stripped from " + transformedName);
      }
    }
View Full Code Here

      if (di == 0)
         break l;

      ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
      cn.accept(cw);
      bytes = cw.toByteArray();
    }

    return bytes;
  }
View Full Code Here

      m.instructions.add(new InsnNode(IRETURN));

      m.localVariables = null;

      ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
      cn.accept(cw);
      bytes = cw.toByteArray();
    }
    return bytes;
  }
View Full Code Here

      if (!updated) {
        break l;
      }

      ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
      cn.accept(cw);
      bytes = cw.toByteArray();
    }
    return bytes;
  }
View Full Code Here

      if (!updated) {
        break l;
      }

      ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS);
      cn.accept(cw);
      bytes = cw.toByteArray();
    }
    return bytes;
  }
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.