A object of ClassReader can't be created in asm-4.0
<p>I use JDK1.8 and asm-4.0</p>

<hr>

<p>I want to add monitor code into some class,so I use the java agent and asm4 to manipulate the byte code.
The core code as followed:</p>

<pre><code>public class MyClassFileTransformer implements ClassFileTransformer {

    @Override
    public byte[] transform(ClassLoader loader, String className,
            Class&lt;?&gt; classBeingRedefined, ProtectionDomain protectionDomain,
            byte[] classfileBuffer) throws IllegalClassFormatException {

        if (className.startsWith("com/dgl/asm/SleepClass")) {

            ClassReader reader = new ClassReader(classfileBuffer);
            System.out.println("1231231231312");
            ClassWriter cw = new ClassWriter(reader,0);
            ClassVisitor adpter = new AddTimerClassAdpter(Opcodes.ASM4, cw);    
            reader.accept(adpter, 0);
            return cw.toByteArray();
        }
        return classfileBuffer;
    }

}
</code></pre>

<p>However, the code after <code>ClassReader reader = new ClassReader(classfileBuffer)</code> is always unreachable. For example, the code <code>System.out.println("1231231231312")</code> is never be executed. After the <code>ClassReader reader = new ClassReader(classfileBuffer)</code> be executed, the program jumps to the main method directly without any exception! I have used breakpoint and debug it, but can’t find any valued trace.</p>

<p>What should I do? Any idea?</p>

<hr>

<p>I wrote a test class as followed:</p>

<pre><code>public static void main(String [] args) throws InterruptedException, IOException{

    System.out.println("before");
    ClassReader  cr=new ClassReader("com/cn/main/Girl");
    System.out.println("after");

}
</code></pre>

<p>As I assumed, the <code>System.out.println("before")</code> can be executed, but <code>System.out.println("after")</code> can't. It shows error as followed:</p>

<pre><code>Exception in thread "main" java.lang.IllegalArgumentException
    at org.objectweb.asm.ClassReader.&lt;init&gt;(Unknown Source)
    at org.objectweb.asm.ClassReader.&lt;init&gt;(Unknown Source)
    at org.objectweb.asm.ClassReader.&lt;init&gt;(Unknown Source)
</code></pre>

<p>So I replaced <code>new ClassReader("com/cn/main/Girl")</code> with <code>new ClassReader("com.cn.main.Girl")</code>, but the error is still.</p>