View Javadoc
1   /*
2   EmptyForIteratorPad
3   option = (default)nospace
4   
5   
6   */
7   
8   package com.puppycrawl.tools.checkstyle.checks.whitespace.emptyforiteratorpad;
9   
10  class InputEmptyForIteratorPad
11  {
12      void method1()
13      {
14          for (int i = 0; i < 1; i++) {
15          }
16  
17          for (int i = 0; i < 1;i++) {
18          }
19  
20          for (int i = 0; i < 1;i++ ) {
21          }
22  
23          for (int i = 0; i < 1; i++ ) {
24          }
25  
26          for (int i = 0; i < 1;) {
27              i++;
28          }
29  
30          for (int i = 0; i < 1; ) { // violation '';' is followed by whitespace'
31              i++;
32          }
33  
34          // test eol, there is no space after second SEMI
35          for (int i = 0; i < 1;
36              ) {
37              i++;
38          }
39      }
40  
41      void method2()
42      {
43          for ( int i = 0; i < 1; i++ ) {
44          }
45  
46          for ( int i = 0; i < 1; ) { // violation '';' is followed by whitespace'
47              i++;
48          }
49  
50          int i = 0;
51          for ( ; i < 1; i++ ) {
52          }
53  
54          for (; i < 2; i++ ) {
55          }
56  
57          for (
58          ;; ) { // violation '';' is followed by whitespace'
59          }
60      }
61  }