1 package com.puppycrawl.tools.checkstyle.grammar.antlr4;
2
3 public class InputAntlr4AstRegressionTrickySwitch {
4
5 private static void fooSwitch() {
6 switch("") {
7 case "0":
8 case "1":
9
10 foo1();
11 break;
12 case "2":
13
14
15 foo1();
16
17 break;
18 case "3":
19
20
21
22 break;
23 case "5":
24 foo1();
25
26 case "6":
27 int k = 7;
28
29 case "7":
30 if (true) {}
31
32 case "8":
33 break;
34 case "9":
35 foo1();
36
37 case "10": {
38 if (true) {}
39
40 }
41 case "11": {
42
43 }
44 case "28": {
45
46 }
47 case "12": {
48
49 int i;
50 }
51 case "13": {
52
53 }
54 case "14": {
55
56 }
57 case "15": {
58 foo1();
59
60 }
61 case "16": {
62 int a;
63 }
64
65 case "17": {
66 int a;
67 }
68
69 case "18": { System.lineSeparator();
70 }
71 case "19":
72
73 case "20":
74
75 case "21":
76 default:
77
78 break;
79 }
80 }
81
82 private static void foo1() {
83 if (true) {
84 switch(1) {
85 case 0:
86
87 case 1:
88
89 int b = 10;
90 default:
91
92 }
93
94 }
95 }
96
97 public void fooDotInCaseBlock() {
98 int i = 0;
99 String s = "";
100
101 switch (i) {
102 case -2:
103
104 i++;
105
106 case 0:
107
108 s.indexOf("ignore");
109
110 case -1:
111
112 s.indexOf("no way");
113
114 case 1:
115 case 2:
116 i--;
117
118 case 3: { }
119
120
121
122 }
123
124 String breaks = ""
125
126 + "</table>"
127
128 + ""
129
130 ;
131 }
132
133 public void foo2() {
134 int a = 1;
135 switch (a) {
136 case 1:
137 default:
138
139 }
140 }
141
142 public void foo3() {
143 int a = 1;
144 switch (a) {
145 case 1:
146 default:
147
148
149 }
150 }
151
152 public void foo4() {
153 int a = 1;
154 switch (a) {
155 case 1:
156 int b;
157
158 default:
159 }
160 }
161
162 public void foo5() {
163 int a = 1;
164 switch (a) {
165 case 1:
166 int b;
167
168 default:
169 }
170 }
171
172 public void foo6() {
173 int a = 1;
174 switch (a) {
175 case 1:
176 int b;
177
178 default:
179 }
180 }
181
182 public void foo7() {
183 int a = 2;
184 String s = "";
185 switch (a) {
186
187
188
189 case 1:
190 case 2:
191
192
193 foo1();
194
195 case 3:
196
197
198
199 case 4:
200
201 case 5:
202 s.toString().toString().toString();
203
204
205
206 default:
207 }
208 }
209
210 public void foo8() {
211 int a = 2;
212 String s = "";
213 switch (a) {
214
215
216
217 case 1:
218 case 2:
219
220
221 foo1();
222
223 case 3:
224
225
226 s.toString().toString().toString();
227
228 case 4:
229
230 default:
231 }
232 }
233
234 public void foo9() {
235 int a = 5;
236 switch (a) {
237 case 1:
238 case 2:
239
240 }
241 }
242
243 public void foo10() {
244 int a = 5;
245 switch (a) {
246 case 1:
247 default:
248
249 }
250 }
251
252 public void foo11() {
253 int a = 5;
254 switch (a) {
255 case 1:
256 case 2:
257
258 }
259 }
260
261 public void foo12() {
262 int a = 5;
263 switch (a) {
264
265 case 1:
266 }
267 }
268 }