I am iterating over one class using ASM code without manipulating any byte code. But when I am converting classwriter to bytearray(cw.toByteArray()), I am getting Method co
Certain methods in Java are already quite large, and instrumenting them increases their size further causing the exception that you observe. If i am not wrong the JVM imposes a size of 65535 bytes on the size of any method.
One solution/project that tries to overcome this problem looks at splitting the offending methods ... here is the link to its git repository: https://bitbucket.org/sperber/asm-method-size. It is based off ASM itself. Hope this helps.