Consider this source code:
-----
package test;
public class LambdaLNT {
public static void main(String... args) {
Runnable r = () -> {
int i = args.length;
};
r.run();
}
}
-----
When compiled with -g, the LineNumberTable for the lambda method looks like this:
LineNumberTable:
line 1: 0
line 7: 3
That is undoubtedly wrong: the first statement of the lambda does not start at line 1. As a consequence, debuggers would likely misbehave.
This appears to be caused by a missing TreeMaker.at in LambdaToMethod.visitVarDef.
-----
package test;
public class LambdaLNT {
public static void main(String... args) {
Runnable r = () -> {
int i = args.length;
};
r.run();
}
}
-----
When compiled with -g, the LineNumberTable for the lambda method looks like this:
LineNumberTable:
line 1: 0
line 7: 3
That is undoubtedly wrong: the first statement of the lambda does not start at line 1. As a consequence, debuggers would likely misbehave.
This appears to be caused by a missing TreeMaker.at in LambdaToMethod.visitVarDef.
- relates to
-
JDK-8027191 Fix for JDK-8026861 refers to an incorrect bug number
- Resolved
-
JDK-8026508 Invokedynamic instructions don't get line number table entries
- Resolved
-
JDK-8027142 Invokedynamic instructions don't get line number table entries
- Closed
-
JDK-8027141 Verify LambdaToMethod generates trees with correct positions
- Open