View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="CommentsIndentation"/>
5     </module>
6   </module>
7   */
8   package com.puppycrawl.tools.checkstyle.checks.indentation.commentsindentation;
9   
10  // xdoc section -- start
11  public class Example5 {
12    void testMethod(String a) {
13      switch(a) {
14        case "1":
15          int j = 7;
16          // it is OK
17          break;
18        case "3": // violation 2 lines below 'Comment has incorrect indentation level'
19          if (true) {}
20              //It is not okay
21          break;
22        // fall through (it is OK)
23        case "5":
24          // it is OK
25        case "6":
26       // It is not okay
27        case "7":
28         // violation 2 lines above 'Comment has incorrect indentation level 5'
29        default:
30      }
31    }
32  }
33  // xdoc section -- end