Class after instrumenting loses first BootstrapMethods entry
Got the following error on loading the processed class:
Fails with Caused by: java.lang.ClassFormatError: Short length on
BootstrapMethods in class file org/zeroturnaround/Erroneous
I think it happens when MethodWriter#resizeInstructions is called (search for
cw.invalidFrames = true) this makes asm process the class again with
skip_frames (see ClassWriter#toByteArray).
After that there is some confusion in ClassWriter#newInvokeDynamicItem where it
seems to believe that it already has a bootstrap method and skips adding it.
For some reason this only seems to affect the first method.
The application to reproduce it can be found at:
https://drive.google.com/file/d/0Bw9yI1S_G81XSDBoLU9jZHFZSVk/view?usp=sharing