View Javadoc
1   /*
2   CommentsIndentation
3   tokens = (default)SINGLE_LINE_COMMENT, BLOCK_COMMENT_BEGIN
4   
5   
6   */
7   
8   package com.puppycrawl.tools.checkstyle.checks.indentation.commentsindentation;
9   
10  
11  
12  
13  /**
14   * Contains examples of using comments at the end of the block.
15   */
16  public class InputCommentsIndentationCommentIsAtTheEndOfBlockOne {
17  
18      public void foo1() {
19          foo2();
20          // OOOO: missing functionality
21      }
22  
23      public void foo2() {
24          foo3();
25                           //violation '.* incorrect .* level 25, expected is 8,.*same.*as line 24.'
26      }
27  
28      public void foo3() {
29          foo2();
30          // refreshDisplay();
31      }
32  
33      public void foo4() {
34          foooooooooooooooooooooooooooooooooooooooooo();
35          // ^-- some hint
36      }
37  
38      public void foooooooooooooooooooooooooooooooooooooooooo() { }
39       // violation below '.* incorrect .* level 5, expected is 4, .* same .* as line 42.'
40       /////////////////////////////// (a single-line border to separate a group of methods)
41  
42      public void foo7() {
43          int a = 0;
44  // violation '.* incorrect .* level 0, expected is 8, .* same .* as line 43.'
45      }
46  
47      /////////////////////////////// (a single-line border to separate a group of methods)
48  
49      public void foo8() {}
50  
51      public class TestClass {
52          public void test() {
53              int a = 0;
54                 //violation '.* incorrect .* level 15, expected is 12, .* same .* as line 53.'
55          }
56            //violation '.* incorrect .* level 10, expected is 8, .* same .* as line 52.'
57      }
58  
59      public void foo9() {
60          this.foo1();
61               //violation '.* incorrect .* level 13, expected is 8, .* same .* as line 60.'
62      }
63  
64      //    public void foo10() {
65      //
66      //    }
67  
68      public void foo11() {
69          String
70                  .valueOf(new Integer(0))
71                  .trim()
72                  .length();
73          // comment
74      }
75  
76      public void foo12() {
77          String
78              .valueOf(new Integer(0))
79              .trim()
80              .length();
81                    //violation '.* incorrect .* level 18, expected is 8, .* same .* as line 77.'
82      }
83  
84      public void foo13() {
85          String.valueOf(new Integer(0))
86                  .trim()
87                  .length();
88          // comment
89      }
90  
91      public void foo14() {
92          String.valueOf(new Integer(0))
93                  .trim()
94                  .length();
95                                 //violation '.* incorrect .* level 31, expected is 8,.*as line 92.'
96      }
97  
98      public void foo15() {
99          String
100                 .valueOf(new Integer(0));
101         // comment
102     }
103 
104     public void foo16() {
105         String
106             .valueOf(new Integer(0));
107                      //violation '.* incorrect .* level 21, expected is 8,.* same .* as line 105.'
108     }
109 
110     public void foo17() {
111         String
112                 .valueOf(new Integer(0))
113                 .trim()
114                 // comment
115                 .length();
116     }
117 }