提交 208b11e4 编写于 作者: J jlahoda

8020689: Missing LineNumberTable entries in compiled class files

Reviewed-by: ksrini, mcimadamore
上级 75fc3200
......@@ -1820,7 +1820,6 @@ public class Gen extends JCTree.Visitor {
msym.externalType(types).getParameterTypes());
if (!msym.isDynamic()) {
code.statBegin(tree.pos);
code.markStatBegin();
}
result = m.invoke();
}
......
/*
* @test /nodynamiccopyright/
* @bug 8020689
* @summary Making sure the LineNumberTable entry is correctly generated for the leading method invocation in the else section
* @compile T8020689.java
* @run main T8020689
*/
public class T8020689 {
public static void main(String... args) {
if (args.length > 0) {
a();
} else {
b();
}
}
static void a() {
}
static void b() {
assertLine(15);
}
public static void assertLine(int expectedline) {
Exception e = new Exception("expected line#: " + expectedline);
int myline = e.getStackTrace()[2].getLineNumber();
if( myline != expectedline) {
throw new RuntimeException("Incorrect line number " +
"expected: " + expectedline +
", got: " + myline, e);
}
System.out.format("Got expected line number %d correct %n", myline);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册