KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > puppycrawl > tools > checkstyle > InputForWhitespace


1 ////////////////////////////////////////////////////////////////////////////////
2
// Test case file for FOR_ITERATION and whitespace.
3
// Created: 2003
4
////////////////////////////////////////////////////////////////////////////////
5
package com.puppycrawl.tools.checkstyle;
6
7 class InputForWhitespace
8 {
9     void method1()
10     {
11         for (int i = 0; i < 1; i++) {
12         }
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;) {
24             i++;
25         }
26
27         for (int i = 0; i < 1; ) {
28             i++;
29         }
30         
31         // test eol, there is no space after second SEMI
32
for (int i = 0; i < 1;
33             ) {
34             i++;
35         }
36     }
37
38     void method2()
39     {
40         for ( int i = 0; i < 1; i++ ) {
41         }
42         
43         for ( int i = 0; i < 1; ) {
44             i++;
45         }
46
47         int i = 0;
48         for ( ; i < 1; i++ ) {
49         }
50
51         for (; i < 2; i++ ) {
52         }
53     }
54 }
55
Popular Tags