View Javadoc
1   /*
2   MethodParamPad
3   allowLineBreaks = true
4   option = (default)nospace
5   tokens = (default)CTOR_DEF, LITERAL_NEW, METHOD_CALL, METHOD_DEF, SUPER_CTOR_CALL, \
6            CTOR_CALL, ENUM_CONSTANT_DEF, RECORD_DEF, RECORD_PATTERN_DEF
7   
8   
9   */
10  
11  package com.puppycrawl.tools.checkstyle.checks.whitespace.methodparampad;
12  
13  import java.util.ArrayList;
14  
15  public class InputMethodParamPadCheckConstructors extends ArrayList {
16      public InputMethodParamPadCheckConstructors() {
17          super(); // ok, no whitespace
18      }
19  
20      public InputMethodParamPadCheckConstructors(Object b) {
21          super (10); // violation ''(' is preceded with whitespace.'
22      }
23  
24      public InputMethodParamPadCheckConstructors(int a) {
25          this (); // violation ''(' is preceded with whitespace.'
26      }
27  
28      public InputMethodParamPadCheckConstructors(int a, String b) {
29          this (a + b.length()); // violation ''(' is preceded with whitespace.'
30      }
31  
32      public InputMethodParamPadCheckConstructors(String a, String b) {
33          this
34              (a.length() + b.length()); // line break is ok, no violation
35      }
36  
37      public InputMethodParamPadCheckConstructors(String a, String b, Object c) {
38          this(a.length() + b.length()); // ok, no whitespace
39      }
40  }