1 package com.google.checkstyle.test.chapter4formatting.rule4861blockcommentstyle;
2
3
4 public class InputFormattedCommentsIndentationInSwitchBlock {
5
6 private static void fooSwitch() {
7 switch ("") {
8 case "0":
9 case "1":
10
11 foo1();
12 break;
13 case "2":
14
15
16 foo1();
17
18 break;
19 case "3":
20
21
22
23 foo1();
24
25 break;
26 case "5":
27 foo1();
28
29 break;
30 case "6":
31 int k = 7;
32
33 case "7":
34 if (true) {
35
36 }
37
38 break;
39 case "8":
40 break;
41 case "9":
42 foo1();
43
44 case "10":
45
46 {
47 if (true) {
48
49 }
50 }
51
52 case "11":
53
54 {
55 }
56
57 case "28":
58
59 {
60 }
61
62 case "12":
63
64 {
65
66
67 int i;
68 }
69 break;
70 case "13":
71
72 {
73
74 }
75 break;
76 case "14":
77
78 {
79
80
81 }
82 break;
83 case "15":
84
85 {
86 foo1();
87
88 }
89 break;
90 case "16":
91
92 {
93 int a;
94 }
95
96 case "17":
97
98 {
99 int a;
100 }
101
102
103 break;
104 case "18":
105
106 {
107 System.lineSeparator();
108 }
109 break;
110 case "19":
111
112 case "20":
113
114 case "21":
115 default:
116
117 break;
118 }
119 }
120
121 private static void foo1() {
122 if (true) {
123 switch (1) {
124 case 0:
125
126 case 1:
127
128
129 int b = 10;
130 break;
131 default:
132
133 }
134 }
135 }
136
137
138 public void fooDotInCaseBlock() {
139 int i = 0;
140 String s = "";
141
142 switch (i) {
143 case -2:
144
145 i++;
146 break;
147 case 0:
148
149 s.indexOf("ignore");
150 break;
151 case -1:
152
153
154 s.indexOf("no way");
155
156 break;
157 case 1:
158 case 2:
159 i--;
160 break;
161 case 3:
162
163 {
164 }
165
166 default:
167 }
168
169 String breaks =
170 ""
171
172
173 + "</table>"
174
175 + ""
176
177 ;
178 }
179
180
181 public void foo2() {
182 int a = 1;
183 switch (a) {
184 case 1:
185 default:
186
187 }
188 }
189
190
191 public void foo3() {
192 int a = 1;
193 switch (a) {
194 case 1:
195 default:
196
197
198 }
199 }
200
201
202 public void foo4() {
203 int a = 1;
204 switch (a) {
205 case 1:
206 int b;
207
208 break;
209 default:
210 }
211 }
212
213
214 public void foo5() {
215 int a = 1;
216 switch (a) {
217 case 1:
218 int b;
219
220 break;
221 default:
222 }
223 }
224
225
226 public void foo6() {
227 int a = 1;
228 switch (a) {
229 case 1:
230 int b;
231
232 break;
233 default:
234 }
235 }
236
237
238 public void foo7() {
239 int a = 2;
240 String s = "";
241
242 switch (a) {
243
244
245
246 case 1:
247 case 2:
248
249
250 foo1();
251
252 break;
253 case 3:
254
255
256
257
258 case 4:
259
260 case 5:
261 s.toString().toString().toString();
262
263
264
265 break;
266 default:
267 }
268 }
269
270
271 public void foo8() {
272 int a = 2;
273 String s = "";
274
275 switch (a) {
276
277
278
279 case 1:
280 case 2:
281
282
283 foo1();
284
285 break;
286 case 3:
287
288
289 s.toString().toString().toString();
290
291
292 break;
293 case 4:
294
295 default:
296 }
297 }
298
299
300 public void foo9() {
301 int a = 5;
302 switch (a) {
303 case 1:
304 case 2:
305
306 default:
307 }
308 }
309
310
311 public void foo10() {
312 int a = 5;
313 switch (a) {
314 case 1:
315 default:
316
317 }
318 }
319
320
321 public void foo11() {
322 int a = 5;
323 switch (a) {
324 case 1:
325 case 2:
326
327 default:
328 }
329 }
330
331
332 public void foo12() {
333 int a = 5;
334
335 switch (a) {
336
337 case 1:
338 default:
339 }
340 }
341 }