blob: cf8729fcf6c90179b25f4f242b221d4259b99fe2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
import org.aspectj.testing.Tester;
public class Breaks {
static boolean sawTrue, sawFalse;
public static void main(String[] args) {
m(true);
Tester.check(sawTrue, "true");
Tester.check(!sawFalse, "!false");
}
static void m(boolean t) {
BLOCK: {
if (t) {
sawTrue = true;
System.out.println("true");
break BLOCK;
} else {
sawFalse = true;
System.out.println("false");
}
}
}
static int m1(boolean t) {
loop: while (true) {
if (t) break loop;
}
return 1;
}
static int m2(boolean t) {
while (true) {
if (t) break;
}
return 1;
}
}
|