View Javadoc
1   /*
2   EmptyLineSeparator
3   allowNoEmptyLineBetweenFields = (default)false
4   allowMultipleEmptyLines = (default)true
5   allowMultipleEmptyLinesInsideClassMembers = false
6   tokens = (default)PACKAGE_DEF, IMPORT, STATIC_IMPORT, CLASS_DEF, INTERFACE_DEF, ENUM_DEF, \
7            STATIC_INIT, INSTANCE_INIT, METHOD_DEF, CTOR_DEF, VARIABLE_DEF, RECORD_DEF, \
8            COMPACT_CTOR_DEF
9   
10  
11  */
12  
13  package com.puppycrawl.tools.checkstyle.checks.whitespace.emptylineseparator;
14  
15  public class InputEmptyLineSeparatorPreviousLineEmptiness {
16      private static final int MULTIPLICATOR;
17  
18      private int base;
19  
20      static {
21          MULTIPLICATOR = 5; // violation 'There is more than 1 empty line after this line.'
22  
23  
24      }
25  
26      { // violation 'There is more than 1 empty line after this line.'
27  
28  
29          base = 33;
30      }
31  
32      public InputEmptyLineSeparatorPreviousLineEmptiness(int base) { // violation '.*1 empty line.*'
33  
34  
35          this.base = base;
36      }
37  
38      public InputEmptyLineSeparatorPreviousLineEmptiness() {
39      }
40  
41      public static int increment(int value) { // violation '.*more than 1 empty line after.*'
42  
43  
44          return value * MULTIPLICATOR + 1;
45      }
46  
47      void foo2() { // ok
48      }
49  
50  
51      void foo3() { // violation 'There is more than 1 empty line after this line.'
52  
53  
54      }
55  }