0N/A/**
0N/A * @test /nodynamiccopyright/
0N/A * @bug 4986256
610N/A * @compile/ref=FallThrough.noLint.out -XDrawDiagnostics FallThrough.java
610N/A * @compile/ref=FallThrough.lintAll.out -Xlint:all,-path -XDrawDiagnostics FallThrough.java
610N/A * @compile/ref=FallThrough.lintFallThrough.out -Xlint:fallthrough -XDrawDiagnostics FallThrough.java
0N/A */
0N/A
0N/A// control: this class should generate a warning
0N/Aclass FallThrough
0N/A{
0N/A int m1(int i) {
0N/A switch (i) {
0N/A case 1: i++; case 2: i++;
0N/A }
0N/A return i;
0N/A }
0N/A}
0N/A
0N/A// tests: the warnings that would otherwise be generated should all be suppressed
0N/A@SuppressWarnings("fallthrough")
0N/Aclass FallThrough1
0N/A{
0N/A int m1(int i) {
0N/A switch (i) {
0N/A case 1: i++; case 2: i++;
0N/A }
0N/A return i;
0N/A }
0N/A}
0N/A
0N/Aclass FallThrough2
0N/A{
0N/A @SuppressWarnings("fallthrough")
0N/A class Bar {
0N/A int m1(int i) {
0N/A switch (i) {
0N/A case 1: i++; case 2: i++;
0N/A }
0N/A return i;
0N/A }
0N/A }
0N/A
0N/A @SuppressWarnings("fallthrough")
0N/A void m2(int i) {
0N/A switch (i) {
0N/A case 1: i++; case 2: i++;
0N/A }
0N/A }
0N/A
0N/A
0N/A @SuppressWarnings("fallthrough")
0N/A static int x = new FallThrough2() {
0N/A int m1(int i) {
0N/A switch (i) {
0N/A case 1: i++; case 2: i++;
0N/A }
0N/A return i;
0N/A }
0N/A }.m1(0);
0N/A
0N/A}