6807255: LineNumberTable wrong if enhanced-for-loops are used
Summary: end position of iterable for-each loop was not set properly
Reviewed-by: jjg
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java Thu Mar 05 17:24:40 2009 +0000
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java Thu Mar 05 17:25:13 2009 +0000
@@ -3012,6 +3012,7 @@
vardefinit).setType(tree.var.type);
indexDef.sym = tree.var.sym;
JCBlock body = make.Block(0, List.of(indexDef, tree.body));
+ body.endpos = TreeInfo.endPos(tree.body);
result = translate(make.
ForLoop(List.of(init),
cond,