View Javadoc
1   /*
2   CommentsIndentation
3   tokens = (default)SINGLE_LINE_COMMENT, BLOCK_COMMENT_BEGIN
4   
5   
6   */
7   package com.puppycrawl.tools.checkstyle.checks.indentation.commentsindentation;
8   
9   
10  
11  
12  
13  /**
14   * Contains examples of using comments at the end of the block.
15   */
16  public class InputCommentsIndentationCommentIsAtTheEndOfBlockFive {
17  
18      void foo61() {
19          new InputCommentsIndentationCommentIsAtTheEndOfBlockOne().foo1();
20  
21          /*
22           * comment
23           */
24          /*
25           * comment
26           */
27      }
28      void foo62() {
29          if (true) {
30              String.CASE_INSENSITIVE_ORDER.equals("");
31          }
32          else {
33  
34          }
35          /*
36           comment
37           */
38          /*
39           comment
40           */
41      }
42      void foo63() {
43          try {
44              String.CASE_INSENSITIVE_ORDER.equals("");
45          }
46          catch (Exception e){
47  
48          }
49  
50          /*
51           comment
52           */
53          /*
54           comment
55           */
56      }
57  
58      void foo64()  {
59          new InputCommentsIndentationCommentIsAtTheEndOfBlockOne().foo1();
60  
61  //  violation '.* incorrect .* level 0, expected is 8, .* same .* as line 59.'
62      }
63  
64      void foo65() {
65          int i = 1
66                  + 1
67                  + 1;
68          // comment
69          // comment
70      }
71  
72      void foo66()  {
73          if (true) {
74              getClass();
75          }
76          //violation below '.* incorrect .* level 10, expected is 8, .* same .* as line 73.'
77            /* violation */
78      }
79  
80      void foo67()  {
81          try {
82              getClass();
83          } finally {
84              hashCode();
85          }
86          //violation below '.* incorrect .* level 10, expected is 8, .* same .* as line 81.'
87            /* violation */
88      }
89  
90      void foo68()  {
91          for (int i = 0; i < 0; i++) {
92              getClass();
93          }
94          //violation below '.* incorrect .* level 10, expected is 8, .* same .* as line 91.'
95            /* violation */
96      }
97  
98      void foo69()  {
99          while (true) {
100             getClass();
101         }
102         //violation below '.* incorrect .* level 10, expected is 8, .* same .* as line 99.'
103           /* violation */
104     }
105 
106     void foo70()  {
107         do {
108             getClass();
109         } while (true);
110         //violation below '.* incorrect .* level 10, expected is 8, .* same .* as line 107.'
111           /* violation */
112     }
113 
114 }