View Javadoc
1   /*
2   CommentsIndentation
3   tokens = (default)SINGLE_LINE_COMMENT, BLOCK_COMMENT_BEGIN
4   
5   
6   */
7   
8   // comment
9   package com.puppycrawl.tools.checkstyle.checks.indentation.commentsindentation;
10  
11  // some
12  
13  public class InputCommentsIndentationSurroundingCodeTwo {
14  
15      public void foo8() {
16          String s = new String(); // comment
17                                   // ...
18                                   // block
19                                   // ...
20                                   // violation '.* incorrect.*level 33, expected is 8,.*as line 21.'
21          String someStr = new String();
22      }
23  
24  
25      public String foo9(String s1, String s2, String s3) {
26          return "";
27      }
28  
29      public void foo10()
30              throws Exception {
31  
32          final String pattern = "^foo$";
33  
34          final String[] expected = {
35                  "7:13: " + foo9("", "", ""),
36                  // comment
37          };
38      }
39  
40      public void foo11() {
41          // violation below '.* incorrect .* level 12, expected is 8, .* same .* as line 43.'
42              /* empty */
43          hashCode();
44      }
45  
46      public void foo12() {
47          // violation below '.* incorrect .* level 4, expected is 8, .* same .* as line 49.'
48      /* empty */
49          hashCode();
50      }
51  
52      public void foo13() {
53          hashCode();
54          // violation below '.* incorrect .* level 4, expected is 8, .* same .* as line 53.'
55      /* empty */
56      }
57  
58      public void foo14() {
59          hashCode();
60          /*
61  
62          Test
63          */
64          // Test
65      }
66  
67      public InputCommentsIndentationSurroundingCodeTwo() {
68      }
69  
70      // Test
71  }// The Check should not throw NPE here!
72  // The Check should not throw NPE here!