View Javadoc
1   /*
2   RightCurly
3   option = ALONE
4   tokens = LITERAL_SWITCH, METHOD_DEF, LITERAL_WHILE, LITERAL_IF
5   
6   
7   */
8   
9   package com.puppycrawl.tools.checkstyle.checks.blocks.rightcurly;
10  
11  public class InputRightCurlyTestWithComment {
12      void m1(int mode) {
13          switch (mode) {
14              default:
15                  int x = 0; // violation below ''}' at column 66 should be alone on a line'
16                  /* block comment here is counted as violation */ }
17      }
18  
19      void m2() {
20          int a = 0;
21          if (a > 2) {
22              System.out.println();  // violation below ''}' at column 61 should be alone on a line'
23              /* block comment here is counted as violation*/ }
24          /* block comment here is counted as violation*/ }
25          // violation above ''}' at column 57 should be alone on a line'
26  
27      void method() {
28          int a = 0;
29          if (a > 2) {
30              System.out.println("no");
31          /* comment */ } // violation ''}' at column 23 should be alone on a line'
32      /* commrnt */ } // violation ''}' at column 19 should be alone on a line'
33  
34      void loop() {
35          while(true) {
36              System.out.println("Checkstyle");
37          /* comment */ } // violation ''}' at column 23 should be alone on a line'
38      /* comment */ /* comment */ } // violation ''}' at column 33 should be alone on a line'
39  }