You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We noticed that the line numbering produced by using the --debug-line-numbers flag are incorrect for lambda expressions, consider the following example:
Original code:
import java.util.ArrayList;
public class Main {
public static void main(String[] argv) {
ArrayList<String> test = new ArrayList<>();
test.add("a");
test.add("b");
test.add("c");
test.forEach(str -> {
System.out.println(str);
});
}
}
Decompiled code:
{
public static void main(final String[] array) {
final ArrayList list = /*EL:5*/new ArrayList();
/*SL:6*/list.add("a");
/*SL:7*/list.add("b");
/*SL:8*/list.add("c");
/*SL:9*/list.forEach(x -> System.out.println(x));
}
}
As can be seen the decompiled code shows that the call to System.out.println happens in line 9, while in fact it happened in line 13.
We have an idea why this happening but we are not sure, our analysis shows that the parsing of the LineNumberTable structures from the class files bytecode refers to the wrapping function (in this case main) and not the lambda expression which leads to the incorrect line numbering report.
Please let us know your thoughts on this, and whether we could expect a fix for this issue.
Thanks.
The text was updated successfully, but these errors were encountered:
Hi,
We noticed that the line numbering produced by using the
--debug-line-numbers
flag are incorrect for lambda expressions, consider the following example:Original code:
Decompiled code:
As can be seen the decompiled code shows that the call to System.out.println happens in line 9, while in fact it happened in line 13.
We have an idea why this happening but we are not sure, our analysis shows that the parsing of the LineNumberTable structures from the class files bytecode refers to the wrapping function (in this case main) and not the lambda expression which leads to the incorrect line numbering report.
Please let us know your thoughts on this, and whether we could expect a fix for this issue.
Thanks.
The text was updated successfully, but these errors were encountered: