View Javadoc
1   /*xml
2   <module name="Checker">
3     <module name="TreeWalker">
4       <module name="EmptyLineSeparator">
5         <property name="allowNoEmptyLineBetweenFields" value="true"/>
6         <property name="allowMultipleEmptyLines" value="false"/>
7         <property name="allowMultipleEmptyLinesInsideClassMembers" value="false"/>
8       </module>
9     </module>
10  </module>
11  */
12  
13  package com.puppycrawl.tools.checkstyle.checks.whitespace.emptylineseparator;
14  
15  import org.junit.Ignore;
16  
17  public class InputEmptyLineSeparatorWithJavadoc {
18    /** Some javadoc. */
19    int test0(int badFormat1, int badFormat2, final int badFormat3) throws Exception {
20      return 0;
21    }
22  
23  
24    /**
25     * Test.
26     */
27    void myMethod() {}
28    // violation above "'METHOD_DEF' has more than 1 empty lines before"
29  
30    /** some lines to test the one line javadoc. */
31    void myMethod2() {
32      int tab0 = 1;
33    }
34  
35    /** Some javadoc. */
36    int test1(int badFormat1, int badFormat2, final int badFormat3) throws Exception {
37      return 0;
38    }
39  
40    /** Some javadoc. */
41  
42  
43    int test2(int badFormat1, int badFormat2, final int badFormat3) throws Exception {
44      // violation above "'METHOD_DEF' has more than 1 empty lines before"
45      return 0;
46    }
47  
48  
49    /** Some javadoc. */
50  
51    int test3(int badFormat1, int badFormat2, final int badFormat3) throws Exception {
52      // violation above "'METHOD_DEF' has more than 1 empty lines before"
53      return 0;
54    }
55    /** Some javadoc. */
56    int test4(int badFormat1, int badFormat2, final int badFormat3) throws Exception {
57      // violation above "'METHOD_DEF' should be separated from previous line"
58      return 0;
59    }
60  
61  
62    // test
63    /** Some javadoc. */
64  
65    int test5(int badFormat1, int badFormat2, final int badFormat3) throws Exception {
66      // violation above "'METHOD_DEF' has more than 1 empty lines before"
67      return 0;
68    }
69  
70    // test
71    /** Some javadoc. */
72  
73    int test6(int badFormat1, int badFormat2, final int badFormat3) throws Exception {
74      // violation below "There is more than 1 empty line after this line"
75      return 0;
76  
77  
78    } // test
79  
80    int test7(int badFormat1, int badFormat2, final int badFormat3) throws Exception {
81      return 0;
82    }
83  
84  
85    /** Some javadoc. */
86    int test8(int badFormat1, int badFormat2, final int badFormat3) throws Exception {
87      // violation above "'METHOD_DEF' has more than 1 empty lines before"
88      return 0;
89    } // test
90  
91  
92    /** Some javadoc. */
93    int test9(int badFormat1, int badFormat2, final int badFormat3) throws Exception {
94      // violation above "'METHOD_DEF' has more than 1 empty lines before"
95      return 0;
96    }
97  
98  
99    @Ignore
100   /**
101    * comment
102    */
103   @Deprecated
104   public void foo6() {
105       // violation 6 lines above "'METHOD_DEF' has more than 1 empty lines before"
106       return;
107   }
108 }