1 package com.puppycrawl.tools.checkstyle.grammar.antlr4;
2
3 public class InputAntlr4AstRegressionFallThroughDefault {
4 void method(int i, int j, boolean cond) {
5 while (true) {
6 switch (i) {
7 case 0:
8 case 1:
9 i++;
10 break;
11 case 2:
12 i++;
13 case 3:
14 i++;
15 break;
16 case 4:
17 return;
18 case 5:
19 throw new RuntimeException("");
20 case 6:
21 continue;
22 case 7: {
23 break;
24 }
25 case 8: {
26 return;
27 }
28 case 9: {
29 throw new RuntimeException("");
30 }
31 case 10: {
32 continue;
33 }
34 case 11: {
35 i++;
36 }
37 case 12:
38 if (false)
39 break;
40 else
41 break;
42 case 13:
43 if (true) {
44 return;
45 }
46 case 14:
47 if (true) {
48 return;
49 } else {
50
51 }
52 case 15:
53 do {
54 System.identityHashCode("something");
55 return;
56 } while(true);
57 case 16:
58 for (int j1 = 0; j1 < 10; j1++) {
59 String.valueOf("something");
60 return;
61 }
62 case 17:
63 while (true)
64 throw new RuntimeException("");
65 case 18:
66 while(cond) {
67 break;
68 }
69 case 19:
70 try {
71 i++;
72 break;
73 } catch (RuntimeException e) {
74 break;
75 } catch (Error e) {
76 return;
77 }
78 case 20:
79 try {
80 i++;
81 break;
82 } catch (RuntimeException e) {
83 } catch (Error e) {
84 return;
85 }
86 case 21:
87 try {
88 i++;
89 } catch (RuntimeException e) {
90 i--;
91 } finally {
92 break;
93 }
94 case 22:
95 try {
96 i++;
97 break;
98 } catch (RuntimeException e) {
99 i--;
100 break;
101 } finally {
102 i++;
103 }
104 case 23:
105 switch (j) {
106 case 1:
107 continue;
108 case 2:
109 return;
110 default:
111 return;
112 }
113 case 24:
114 switch (j) {
115 case 1:
116 continue;
117 case 2:
118 break;
119 default:
120 return;
121 }
122 default:
123
124 i++;
125 }
126 }
127 }
128
129
130
131
132 void methodFallThru(int i, int j, boolean cond) {
133 while (true) {
134 switch (i) {
135 case -1:
136
137 case 0:
138 case 1:
139 i++;
140 break;
141 case 2:
142 i++;
143
144 case 3:
145 i++;
146 break;
147 case 4:
148 return;
149 case 5:
150 throw new RuntimeException("");
151 case 6:
152 continue;
153 case 7: {
154 break;
155 }
156 case 8: {
157 return;
158 }
159 case 9: {
160 throw new RuntimeException("");
161 }
162 case 10: {
163 continue;
164 }
165 case 11: {
166 i++;
167 }
168
169 case 12:
170 if (false)
171 break;
172 else
173 break;
174 case 13:
175 if (true) {
176 return;
177 }
178 case 14:
179 if (true) {
180 return;
181 } else {
182
183 }
184
185 case 15:
186 do {
187 System.identityHashCode("something");
188 return;
189 } while(true);
190 case 16:
191 for (int j1 = 0; j1 < 10; j1++) {
192 String.valueOf("something");
193 return;
194 }
195 case 17:
196 while (cond)
197 throw new RuntimeException("");
198 case 18:
199 while(cond) {
200 break;
201 }
202
203 case 19:
204 try {
205 i++;
206 break;
207 } catch (RuntimeException e) {
208 break;
209 } catch (Error e) {
210 return;
211 }
212 case 20:
213 try {
214 i++;
215 break;
216 } catch (RuntimeException e) {
217 } catch (Error e) {
218 return;
219 }
220
221 case 21:
222 try {
223 i++;
224 } catch (RuntimeException e) {
225 i--;
226 } finally {
227 break;
228 }
229 case 22:
230 try {
231 i++;
232 break;
233 } catch (RuntimeException e) {
234 i--;
235 break;
236 } finally {
237 i++;
238 }
239
240 case 23:
241 switch (j) {
242 case 1:
243 continue;
244 case 2:
245 return;
246 default:
247 return;
248 }
249 case 24:
250 i++;
251 case 25:
252 i++;
253 break;
254
255 case 26:
256 switch (j) {
257 case 1:
258 continue;
259 case 2:
260 break;
261 default:
262 return;
263 }
264
265 default:
266
267 i++;
268
269 }
270 }
271 }
272
273
274 void methodFallThruCC(int i, int j, boolean cond) {
275 while (true) {
276 switch (i){
277 case 0:
278 i++;
279
280 case 1:
281 i++;
282
283 case 2: {
284 i++;
285 }
286
287 case 3:
288 i++;
289 case 4:
290 break;
291 case 5:
292 i++;
293
294 }
295 }
296 }
297
298
299 void methodFallThruC(int i, int j, boolean cond) {
300 while (true) {
301 switch (i){
302 case 0:
303 i++;
304
305 case 1:
306 i++;
307
308 case 2:
309 i++;
310 case 3:
311 break;
312 case 4:
313 i++;
314
315 }
316 }
317 }
318
319
320 void methodFallThruC2(int i, int j, boolean cond) {
321 while (true) {
322 switch (i){
323 case 0:
324 i++;
325
326 case 1:
327 i++;
328
329 case 2:
330 i++;
331 case 3:
332 break;
333 case 4:
334 i++;
335
336 }
337 }
338 }
339
340
341 void methodFallThruCOtherWords(int i, int j, boolean cond) {
342 while (true) {
343 switch (i){
344 case 0:
345 i++;
346
347 case 1:
348 i++;
349
350 case 2:
351 i++;
352 case 3:
353 break;
354 case 4:
355 i++;
356
357 }
358 }
359 }
360
361
362 void methodFallThruCCustomWords(int i, int j, boolean cond) {
363 while (true) {
364 switch (i){
365 case 0:
366 i++;
367
368 case 1:
369 i++;
370
371 case 2:
372 i++;
373 case 3:
374 break;
375 case 4:
376 i++;
377
378 }
379 }
380 }
381
382 void methodFallThruLastCaseGroup(int i, int j, boolean cond) {
383 while (true) {
384 switch (i){
385 case 0:
386 i++;
387 }
388 switch (i){
389 case 0:
390 i++;
391
392 }
393 switch (i){
394 case 0:
395 i++;
396 }
397 }
398 }
399
400 void method1472228(int i) {
401 switch(i) {
402 case 2:
403
404 break;
405 default:
406 }
407 }
408
409 void nestedSwitches() {
410 switch (hashCode()) {
411 case 1:
412 switch (hashCode()) {
413 case 1:
414 }
415 default:
416 }
417 }
418
419 void nextedSwitches2() {
420 switch(hashCode()) {
421 case 1:
422 switch(hashCode()){}
423 case 2:
424 System.lineSeparator();
425 break;
426 }
427 }
428
429 void ifWithoutBreak() {
430 switch(hashCode()) {
431 case 1:
432 if (true) {
433 System.lineSeparator();
434 }
435 case 2:
436 System.lineSeparator();
437 break;
438 }
439 }
440
441 void noCommentAtTheEnd() {
442 switch(hashCode()) {
443 case 1: System.lineSeparator();
444
445 case 2:
446 System.lineSeparator();
447 break;
448 }
449 }
450
451 void synchronizedStatement() {
452 switch (hashCode()) {
453 case 1:
454 synchronized (this) {
455 break;
456 }
457 case 2:
458
459 if (true) {
460 synchronized (this) {
461 break;
462 }
463 } else {
464 synchronized (this) {
465 break;
466 }
467 }
468 case 3:
469 synchronized (this) {
470 }
471
472 default:
473 break;
474 }
475 }
476
477 void multipleCasesOnOneLine() {
478 int i = 0;
479 switch (i) {
480 case 0: case 1: i *= i;
481 case 2: case 3: i *= i;
482 case 4: case 5: i *= i;
483 case 6: case 7: i *= i;
484 break;
485 default:
486 throw new RuntimeException();
487 }
488 }
489
490
491 void methodFallThruWithDash(int i, int j, boolean cond) {
492 while (true) {
493 switch (i){
494 case 0:
495 i++;
496 case 1:
497 i++;
498 case 2:
499 i++;
500 case 3:
501 i++;
502 case 4:
503 i++;
504 case 5:
505 i++;
506 case 6:
507 i++;
508 case 7:
509 i++;
510 case 8:
511 i++;
512 case 9:
513 i++;
514 case 10:
515 i++;
516 case 11:
517 i++;
518 case 12:
519 i++;
520 case 13:
521 i++;
522 case 14:
523 i++;
524 case 15:
525 i++;
526 case 16:
527 i++;
528 default:
529 throw new RuntimeException();
530 }
531 }
532 }
533 }