1
2
3
4
5
6
7 package com.puppycrawl.tools.checkstyle.indentation;
8
9
10
11
12
13 public class InputValidIfIndent {
14
15
16
17 public void emptyIfTest()
18 {
19 boolean test = true;
20
21
22 if (test) {
23 }
24
25
26 if (test)
27 {
28 }
29
30
31 if (test) {
32 } else {
33 }
34
35
36 if (test)
37 {
38 }
39 else
40 {
41 }
42
43
44 if (test) {
45 }
46 else
47 {
48 }
49
50
51
52 if (test)
53 {
54 } else
55 {
56 }
57
58
59 if (test)
60 {
61 } else {
62 }
63
64
65 if (test) {
66 }
67 else {
68 }
69
70 if (foo()
71 || test
72 || test)
73 {
74 }
75
76 }
77
78
79 public void populatedIfTest()
80 {
81 boolean test = false;
82
83 if (test)
84 System.getProperty("blah");
85
86
87 if (test)
88 System.getProperty("blah");
89 else
90 System.getProperty("blah");
91
92
93
94 if (test) {
95 System.getProperty("blah");
96 }
97
98
99 if (test)
100 {
101 System.getProperty("blah");
102 }
103
104 if (test) {
105 System.getProperty("blah");
106 } else {
107 System.
108 getProperty("blah");
109 }
110
111
112 if (test)
113 {
114 System.getProperty("blah");
115 System.getProperty("blah");
116 }
117 else
118 {
119 System.getProperty("blah");
120 }
121
122
123 if (test) {
124 System.getProperty("blah");
125 }
126 else
127 {
128 System.getProperty("blah");
129 }
130
131
132
133 if (test)
134 {
135 System.getProperty("blah");
136 } else
137 {
138 System.getProperty("blah");
139 }
140
141
142 if (test)
143 {
144 System.getProperty("blah");
145 } else {
146 System.getProperty("blah");
147 }
148
149
150 if (test) {
151 System.getProperty("blah");
152 }
153 else {
154 System.getProperty("blah");
155 }
156
157 if (test) System.getProperty("blah");
158
159 if (test) System.getProperty("blah");
160 else System.getProperty("foo");
161
162 if (test) System.getProperty("blah");
163 else
164 System.getProperty("foo");
165
166 if (test)
167 System.getProperty("blah");
168 else System.getProperty("foo");
169
170 if (test
171 && 7 < 8 && 8 < 9
172 && 10 < 11) {
173 }
174
175 if (test)
176 return;
177
178
179 if (test) {
180 } else if (7 < 8) {
181 } else if (8 < 9) {
182 }
183
184 if (test) {
185 System.getProperty("blah");
186 } else if (7 < 8) {
187 System.getProperty("blah");
188 } else if (8 < 9) {
189 System.getProperty("blah");
190 }
191
192
193 if (test)
194 System.getProperty("blah");
195 else if (7 < 8)
196 System.getProperty("blah");
197 else if (8 < 9)
198 System.getProperty("blah");
199
200
201
202 if (test) {
203 System.getProperty("blah");
204 } else
205 if (7 < 8) {
206 System.getProperty("blah");
207 } else
208 if (8 < 9) {
209 System.getProperty("blah");
210 }
211
212 }
213
214 public void parenIfTest() {
215 boolean test = true;
216
217 if (test
218 ) {
219 System.getProperty("blah");
220 }
221
222 if (test
223 )
224 {
225 System.getProperty("blah");
226 }
227
228 if
229 (
230 test
231 ) {
232 System.getProperty("blah");
233 }
234
235 if (test
236 )
237 {
238 }
239 }
240
241 boolean foo() {
242 return true;
243 }
244 }
245
246 class FooFoo {
247 void foo42() {
248 boolean test = false;
249 if (test) {
250 System.getProperty("blah");
251 } else if (7 < 8
252 && 8 < 9) {
253 System.getProperty("blah");
254 } else if (8 < 9) {
255 System.getProperty("blah");
256 }
257 }
258 }