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 InputEmptyLineSeparatorPostFixCornerCases {
16  
17      protected void foo1() throws Exception {
18          int a = 25;
19          // violation above 'There is more than 1 empty line after this line.'
20  
21  
22          foo(a);
23      }
24  
25      void foo(int a) {
26          System.out.println(a);
27      }
28  
29      protected void foo() {
30  
31          Object[] defaults = new Object[] {
32                  "String One",
33                  // violation above 'There is more than 1 empty line after this line.'
34  
35  
36                  "String Two",
37  
38          };
39      }
40  
41      protected void foo2() {
42          Object[] defaults = new Object[] { // violation below '.*more than 1 empty line after.*'
43              "String One", 13,
44  
45  
46              "String Two", // violation above this line.
47          };
48      }
49  }