Thu, 07 Jun 2012 20:30:57 -0700
7170079: Adjustments to build-infra makefiles
Reviewed-by: ohair, ohrstrom, ihse, jonas
Contributed-by: jonas <jonas.oreland@oracle.com>, erikj <erik.joelsson@oracle.com>, ihse <magnus.ihse.bursie@oracle.com>, tgranat <torbjorn.granat@oracle.com>, ykantser <yekaterina.kantserova@oracle.com>
1 /**
2 * @test /nodynamiccopyright/
3 * @bug 4986256
4 * @compile/ref=FallThrough.noLint.out -XDrawDiagnostics FallThrough.java
5 * @compile/ref=FallThrough.lintAll.out -Xlint:all,-path -XDrawDiagnostics FallThrough.java
6 * @compile/ref=FallThrough.lintFallThrough.out -Xlint:fallthrough -XDrawDiagnostics FallThrough.java
7 */
9 // control: this class should generate a warning
10 class FallThrough
11 {
12 int m1(int i) {
13 switch (i) {
14 case 1: i++; case 2: i++;
15 }
16 return i;
17 }
18 }
20 // tests: the warnings that would otherwise be generated should all be suppressed
21 @SuppressWarnings("fallthrough")
22 class FallThrough1
23 {
24 int m1(int i) {
25 switch (i) {
26 case 1: i++; case 2: i++;
27 }
28 return i;
29 }
30 }
32 class FallThrough2
33 {
34 @SuppressWarnings("fallthrough")
35 class Bar {
36 int m1(int i) {
37 switch (i) {
38 case 1: i++; case 2: i++;
39 }
40 return i;
41 }
42 }
44 @SuppressWarnings("fallthrough")
45 void m2(int i) {
46 switch (i) {
47 case 1: i++; case 2: i++;
48 }
49 }
52 @SuppressWarnings("fallthrough")
53 static int x = new FallThrough2() {
54 int m1(int i) {
55 switch (i) {
56 case 1: i++; case 2: i++;
57 }
58 return i;
59 }
60 }.m1(0);
62 }