org/objectweb/asm/tree/MethodNode.getLabelNode -- LabelNode has no back-reference to Label
There is a bug introduced in Rev. 1632 -- getLabelNode() method does not
configure Label.info properly, the reference back to Label is missing (no
constructor parameter supplied).
The bug affects version 4.1 (stable)
Please check the following diff: http://websvn.ow2.org/diff.php?
repname=asm&path=%2Ftrunk%2Fasm%2Fsrc%2Forg%2Fobjectweb%2Fasm%2Ftree%2FMethodNo
de.java&rev=1632&peg=1632
Related error stack traces:
1. When verifying generated class with CheckClassAdapter:
java.lang.IllegalStateException: Undefined label used
at org.objectweb.asm.util.CheckMethodAdapter.visitMaxs(Unknown Source)
at
org.apache.commons.javaflow.bytecode.transformation.asm4.ContinuableMethodVisit
or.visitMaxs(ContinuableMethodVisitor.java:340)
at org.objectweb.asm.tree.MethodNode.accept(Unknown Source)
at
org.apache.commons.javaflow.bytecode.transformation.asm4.ContinuableMethodNode.
visitEnd(ContinuableMethodNode.java:144)
2. When writing class file:
java.lang.NullPointerException
at org.objectweb.asm.Frame.a(Unknown Source)
at org.objectweb.asm.MethodWriter.visitMaxs(Unknown Source)
at
org.apache.commons.javaflow.bytecode.transformation.asm4.ContinuableMethodVisit
or.visitMaxs(ContinuableMethodVisitor.java:340)
at org.objectweb.asm.tree.MethodNode.accept(Unknown Source)
at
org.apache.commons.javaflow.bytecode.transformation.asm4.ContinuableMethodNode.
visitEnd(ContinuableMethodNode.java:144)
Workaround: subclass MethodNode and override getLabelNode with code from
revision 1594. Also, subclass ClassNode and override visitMethod to construct
fixed MethodNode-s.