Mercurial > hg > openjdk > jdk8 > langtools
changeset 1922:8c4b2987edac
8020689: Missing LineNumberTable entries in compiled class files
Reviewed-by: ksrini, mcimadamore
author | jlahoda |
---|---|
date | Sun, 28 Jul 2013 10:17:45 +0200 |
parents | 37048aa3ac19 |
children | cd9e8cea1b3c |
files | src/share/classes/com/sun/tools/javac/jvm/Gen.java test/tools/javac/jvm/T8020689.java |
diffstat | 2 files changed, 36 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/javac/jvm/Gen.java Fri Jul 26 14:08:37 2013 -0700 +++ b/src/share/classes/com/sun/tools/javac/jvm/Gen.java Sun Jul 28 10:17:45 2013 +0200 @@ -1820,7 +1820,6 @@ msym.externalType(types).getParameterTypes()); if (!msym.isDynamic()) { code.statBegin(tree.pos); - code.markStatBegin(); } result = m.invoke(); }
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/tools/javac/jvm/T8020689.java Sun Jul 28 10:17:45 2013 +0200 @@ -0,0 +1,36 @@ +/* + * @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); + } +}