Reused LabelNodes in MethodNode
The getLabelNode(final Label l) method of class MethodNode reuses LabelNodes
of the given Label. This can lead to unexpected behaviour when the Labels carry
LabelNodes from another MethodNode.
See attached TestCase and proposed diff.
diff -w -u -r1.29 MethodNode.java
--- MethodNode.java 17 Jun 2007 18:34:17 -0000 1.29
+++ MethodNode.java 7 Sep 2007 11:14:16 -0000
@@ -365,9 +365,7 @@
* @return the LabelNode corresponding to l.
*/
protected LabelNode getLabelNode(final Label l) {
- if (!(l.info instanceof LabelNode)) {
l.info = new LabelNode(l);
- }
return (LabelNode) l.info;
}