1 /**
2 * @test/nodynamiccopyright/
3 * @bug 4952629 4870514
4 * @summary REGRESSION: javac generates a spurious line number entry on } else {
5 *
6 * @author jjh
7 *
8 * @run build VMConnection TargetListener TargetAdapter
9 * @run compile -g LineNumberOnBraceTest.java
10 * @run driver LineNumberOnBraceTest
11 */
12 import com.sun.jdi.*;
13 import com.sun.jdi.event.*;
14 import com.sun.jdi.request.*;
15
16 import java.util.*;
17
18 /********** LINE NUMBER SENSITIVE! *****************************************************************/
19 class LineNumberOnBraceTarg {
20
21 public final static int stopLine = 28; // THIS MUST BE THE LINE NUMBER OF THE // stopline LINE
22 public final static int stopLine2 = 34; // THIS MUST BE THE LINE NUMBER OF THE // stopline2 LINE
23
24
25 public static void main(String[] args){
26 System.out.println("Howdy!");
27 if (args.length == 0) {
28 System.out.println("No args to debuggee"); // stopLine
29 } else {
30 System.out.println("Some args to debuggee");
31 }
32 if (args.length == 0) {
33 boolean b1 = false;
34 if (b1) { // stopLine2
35 System.out.println("In 2nd else"); // bug 4870514 is that we stop here.
36 }
37 } else {
38 System.out.println("In 2nd else");
39 }
40 System.out.println("Goodbye from LineNumberOnBraceTarg!"); // stopLine2 + 6
41 }
42
|
1 /**
2 * @test/nodynamiccopyright/
3 * @bug 4952629 4870514
4 * @summary REGRESSION: javac generates a spurious line number entry on } else {
5 *
6 * @author jjh
7 *
8 * @run build VMConnection TargetListener TargetAdapter
9 * @run compile -g LineNumberOnBraceTest.java
10 * @run driver LineNumberOnBraceTest
11 */
12 import com.sun.jdi.*;
13 import com.sun.jdi.event.*;
14 import com.sun.jdi.request.*;
15
16 import java.util.*;
17
18 /********** LINE NUMBER SENSITIVE! *****************************************************************/
19 class LineNumberOnBraceTarg {
20
21 public final static int stopLine = 29; // THIS MUST BE THE LINE NUMBER OF THE // stopline LINE
22 public final static int stopLine2 = 35; // THIS MUST BE THE LINE NUMBER OF THE // stopline2 LINE
23
24
25 public static void main(String[] args){
26 System.out.println("Howdy!");
27 if (args.length == 0) {
28 System.out.println("No args to debuggee"); // stopLine
29 } else {
30 System.out.println("Some args to debuggee");
31 }
32 if (args.length == 0) {
33 boolean b1 = false;
34 if (b1) { // stopLine2
35 System.out.println("In 2nd else"); // bug 4870514 is that we stop here.
36 }
37 } else {
38 System.out.println("In 2nd else");
39 }
40 System.out.println("Goodbye from LineNumberOnBraceTarg!"); // stopLine2 + 6
41 }
42
|