View Javadoc
1   package com.google.checkstyle.test.chapter4formatting.rule4861blockcommentstyle;
2   
3   public class InputCommentsIndentationInEmptyBlock {
4   
5       private void foo1() {
6           int a = 5, b = 3, v = 6;
7           if (a == b
8               && v == b || ( a ==1
9                      /// // warn
10                         /* // warn
11                          * one fine day ... */
12                                 && b == 1)   ) {
13              // Cannot clearly detect user intention of explanation target.
14          }
15      }
16  
17      private void foo2() {
18          int a = 5, b = 3, v = 6;
19          if (a == b
20              && v == b || ( a ==1
21              && b == 1)   ) {
22  
23  
24               // comment
25          }
26      }
27  
28      private void foo3() {
29          int a = 5, b = 3, v = 6;
30          if (a == b
31              && v == b || (a == 1
32              && b == 1)) {
33  // warn
34          }
35      }
36  
37      // Comments here should be ok by Check
38      @SuppressWarnings("unused") // trailing
39      private static void foo4() { // trailing
40          if (true) // trailing comment
41          {
42              // some comment
43          }
44          if (true) { // trailing comment
45  
46          }
47          /**
48           *
49           */
50      }
51  
52      // Comments here should be ok by Check
53      @SuppressWarnings("unused") // trailing
54      private static void foo5() { // trailing
55          if (true) // trailing comment
56          {
57  // warn
58          }
59          if (true) { // trailing comment
60  
61          }
62          /**
63           *
64           */
65      }
66  
67      public void foo6() {
68          try {
69  
70          } catch (Exception e) {
71  // warn
72          }
73      }
74  
75      public void foo7() {
76          try {
77  
78          } catch (Exception e) {
79              // TODO: handle exception here
80          }
81      }
82  
83      private static class MyClass extends Object {
84             // no members
85      }
86  }