View Javadoc
1   /*
2   MethodParamPad
3   allowLineBreaks = (default)false
4   option = space
5   tokens = (default)CTOR_DEF, LITERAL_NEW, METHOD_CALL, METHOD_DEF, SUPER_CTOR_CALL, \
6            ENUM_CONSTANT_DEF, RECORD_DEF, RECORD_PATTERN_DEF
7   
8   
9   */
10  
11  package com.puppycrawl.tools.checkstyle.checks.whitespace.methodparampad;
12  import java.util.Vector;
13  /** Test input for MethodDefPadCheck */
14  public class InputMethodParamPad3
15  {
16      public InputMethodParamPad3() // violation ''(' is not preceded with whitespace'
17      {
18          super(); // violation ''(' is not preceded with whitespace'
19      }
20  
21      public InputMethodParamPad3 (int aParam)
22      {
23          super ();
24      }
25  
26      public InputMethodParamPad3
27          (double aParam) // violation ''(' should be on the previous line'
28      {
29          super
30              (); // violation ''(' should be on the previous line'
31      }
32  
33      public void method() // violation ''(' is not preceded with whitespace'
34      {
35      }
36  
37      public void method (int aParam)
38      {
39      }
40  
41      public void method
42          (double aParam) // violation ''(' should be on the previous line'
43      {
44          // invoke constructor
45          InputMethodParamPad pad =
46                  new InputMethodParamPad(); // violation ''(' is not preceded with whitespace'
47          pad = new InputMethodParamPad ();
48          pad = new InputMethodParamPad
49              (); // violation ''(' should be on the previous line'
50  
51          // call method
52          method(); // violation ''(' is not preceded with whitespace'
53          method ();
54          method
55              (); // violation ''(' should be on the previous line'
56      }
57  
58      public void dottedCalls() // violation ''(' is not preceded with whitespace'
59      {
60          this.method(); // violation ''(' is not preceded with whitespace'
61          this.method ();
62          this.method
63              (); // violation ''(' should be on the previous line'
64  
65          InputMethodParamPad p =
66                  new InputMethodParamPad(); // violation ''(' is not preceded with whitespace'
67          p.method(); // violation ''(' is not preceded with whitespace'
68          p.method ();
69          p.method
70              (); // violation ''(' should be on the previous line'
71  
72          java.lang.Integer.parseInt("0"); // violation ''(' is not preceded with whitespace'
73          java.lang.Integer.parseInt ("0");
74          java.lang.Integer.parseInt
75              ("0"); // violation ''(' should be on the previous line'
76      }
77  
78      public void newArray() // violation ''(' is not preceded with whitespace'
79      {
80          int[] a = new int[]{0, 1};
81          java.util.Vector<String> v =
82                  new java.util.Vector<String>(); // violation ''(' is not preceded with whitespace'
83          java.util.Vector<String> v1 =
84                  new Vector<String>(); // violation ''(' is not preceded with whitespace'
85      }
86  
87      enum TestEnum {
88          FIRST ()
89              {
90              },
91  
92          SECOND
93              () // violation ''(' should be on the previous line'
94          {
95          }
96      }
97  }