KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > puppycrawl > tools > checkstyle > indentation > InputValidForIndent


1 /*
2  * InputValidForIndent.java
3  *
4  * Created on November 10, 2002, 10:04 PM
5  */

6
7 package com.puppycrawl.tools.checkstyle.indentation;
8
9 /**
10  *
11  * @author jrichard
12  */

13 public class InputValidForIndent {
14     
15     /** Creates a new instance of InputValidForIndent */
16     public InputValidForIndent() {
17     }
18     
19     
20     private void method1(int[] indices)
21     {
22         for (int i=0; i<10; i++)
23             System.getProperty("foo");
24         
25         for (int i=0; i<10; i++) System.getProperty("foo");
26
27         for (int i=0; i<10; i++) {
28         }
29
30         for (int i=0; i<10; i++)
31         {
32         }
33
34         for (int i=0; i<10; i++)
35         {
36             System.getProperty("foo");
37         }
38
39         for (int i=0; i<10; i++)
40         {
41             boolean test = true;
42             if (test) { // mixed styles are OK
43
System.getProperty("foo");
44             }
45         }
46         
47         for (
48             int i=0;
49             i<10;
50             i++)
51         {
52         }
53         
54         for (int i=0;
55             i<10 && 4<5
56                 && 7<8;
57             i++)
58         {
59         }
60         
61         for (int i=0; i<10 && 4<5
62                 && 7<8;
63             i++) {
64         }
65
66         for (int i=0; i<10 && 4<5 && 7<8;
67             i++) {
68         }
69
70         
71         for (int i=0;
72             i<10; i++
73         ) {
74             System.getProperty("foo");
75         }
76
77         for ( final int index : indices ) {
78             System.err.println(index);
79         }
80         for ( final int index : indices )
81         {
82             System.err.println(index);
83         }
84     }
85 }
86
Popular Tags