Thu, 10 Oct 2013 14:58:04 +0200
8001931: The new build system whitespace cleanup
Reviewed-by: tbell, simonis, erikj
1 /*
2 * @test /nodynamiccopyright/
3 * @bug 8020689
4 * @summary Making sure the LineNumberTable entry is correctly generated for the leading method invocation in the else section
5 * @compile T8020689.java
6 * @run main T8020689
7 */
9 public class T8020689 {
11 public static void main(String... args) {
12 if (args.length > 0) {
13 a();
14 } else {
15 b();
16 }
17 }
19 static void a() {
20 }
22 static void b() {
23 assertLine(15);
24 }
26 public static void assertLine(int expectedline) {
27 Exception e = new Exception("expected line#: " + expectedline);
28 int myline = e.getStackTrace()[2].getLineNumber();
29 if( myline != expectedline) {
30 throw new RuntimeException("Incorrect line number " +
31 "expected: " + expectedline +
32 ", got: " + myline, e);
33 }
34 System.out.format("Got expected line number %d correct %n", myline);
35 }
36 }