View Javadoc
1   package com.google.checkstyle.test.chapter4formatting.rule4843defaultcasepresent;
2   
3   public class InputMissingSwitchDefault {
4       public void foo() {
5           int i = 1;
6           switch (i) {
7           case 1: i++; break;
8           case 2: i--; break;
9           default: return;
10          }
11          switch (i) { // warn
12          }
13      }
14  }
15  
16  class bad_test {
17      public void foo() {
18          int i = 1;
19          switch (i) { // warn
20          case 1: i++; break;
21          case 2: i--; break; 
22          }
23          switch (i) { // warn
24          }
25      }
26  
27      class inner
28      {
29          public void foo1() {
30              int i = 1;
31              switch (i) { // warn
32              case 1: i++; break;
33              case 2: i--; break; 
34          }
35              Foo foo = new Foo() {
36                  public void foo() {
37                      int i = 1;
38                      switch (i) { // warn
39                      case 1: i++; break;
40                      case 2: i--; break; 
41                      }
42                      switch (i) { // warn
43                      }
44                  }
45              };
46          }
47      }
48  }
49  
50  interface Foo {
51      public void foo();
52  }