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