1 public class InputFallThrough 2 { 3 void method(int i, int j, boolean cond) { 4 while (true) { 5 switch (i) { 6 case 0: case 1: 8 i++; 9 break; 10 case 2: 11 i++; 12 case 3: i++; 14 break; 15 case 4: 16 return; 17 case 5: 18 throw new RuntimeException (""); 19 case 6: 20 continue; 21 case 7: { 22 break; 23 } 24 case 8: { 25 return; 26 } 27 case 9: { 28 throw new RuntimeException (""); 29 } 30 case 10: { 31 continue; 32 } 33 case 11: { 34 i++; 35 } 36 case 12: if (false) 38 break; 39 else 40 break; 41 case 13: 42 if (true) { 43 return; 44 } 45 case 14: 46 if (true) { 47 return; 48 } else { 49 } 51 case 15: do { 53 System.out.println("something"); 54 return; 55 } while(true); 56 case 16: 57 for (int j1 = 0; j1 < 10; j1++) { 58 System.err.println("something"); 59 return; 60 } 61 case 17: 62 while (true) 63 throw new RuntimeException (""); 64 case 18: 65 while(cond) { 66 break; 67 } 68 case 19: try { 70 i++; 71 break; 72 } catch (RuntimeException e) { 73 break; 74 } catch (Error e) { 75 return; 76 } 77 case 20: 78 try { 79 i++; 80 break; 81 } catch (RuntimeException e) { 82 } catch (Error e) { 83 return; 84 } 85 case 21: try { 87 i++; 88 } catch (RuntimeException e) { 89 i--; 90 } finally { 91 break; 92 } 93 case 22: 94 try { 95 i++; 96 break; 97 } catch (RuntimeException e) { 98 i--; 99 break; 100 } finally { 101 i++; 102 } 103 case 23: switch (j) { 105 case 1: 106 continue; 107 case 2: 108 return; 109 default: 110 return; 111 } 112 case 24: 113 switch (j) { 114 case 1: 115 continue; 116 case 2: 117 break; 118 default: 119 return; 120 } 121 default: i++; 124 } 125 } 126 } 127 128 129 130 131 void methodFallThru(int i, int j, boolean cond) { 132 while (true) { 133 switch (i) { 134 case -1: 136 case 0: case 1: 138 i++; 139 break; 140 case 2: 141 i++; 142 case 3: 144 i++; 145 break; 146 case 4: 147 return; 148 case 5: 149 throw new RuntimeException (""); 150 case 6: 151 continue; 152 case 7: { 153 break; 154 } 155 case 8: { 156 return; 157 } 158 case 9: { 159 throw new RuntimeException (""); 160 } 161 case 10: { 162 continue; 163 } 164 case 11: { 165 i++; 166 } 167 case 12: 169 if (false) 170 break; 171 else 172 break; 173 case 13: 174 if (true) { 175 return; 176 } 177 case 14: 178 if (true) { 179 return; 180 } else { 181 } 183 case 15: 185 do { 186 System.out.println("something"); 187 return; 188 } while(true); 189 case 16: 190 for (int j1 = 0; j1 < 10; j1++) { 191 System.err.println("something"); 192 return; 193 } 194 case 17: 195 while (cond) 196 throw new RuntimeException (""); 197 case 18: 198 while(cond) { 199 break; 200 } 201 case 19: 203 try { 204 i++; 205 break; 206 } catch (RuntimeException e) { 207 break; 208 } catch (Error e) { 209 return; 210 } 211 case 20: 212 try { 213 i++; 214 break; 215 } catch (RuntimeException e) { 216 } catch (Error e) { 217 return; 218 } 219 case 21: 221 try { 222 i++; 223 } catch (RuntimeException e) { 224 i--; 225 } finally { 226 break; 227 } 228 case 22: 229 try { 230 i++; 231 break; 232 } catch (RuntimeException e) { 233 i--; 234 break; 235 } finally { 236 i++; 237 } 238 239 case 23: 240 switch (j) { 241 case 1: 242 continue; 243 case 2: 244 return; 245 default: 246 return; 247 } 248 case 24: 249 i++; 250 case 25: 251 i++; 252 break; 253 254 case 26: 255 switch (j) { 256 case 1: 257 continue; 258 case 2: 259 break; 260 default: 261 return; 262 } 263 default: 265 i++; 267 } 269 } 270 } 271 272 273 void methodFallThruCC(int i, int j, boolean cond) { 274 while (true) { 275 switch (i){ 276 case 0: 277 i++; 279 case 1: 280 i++; 281 case 2: { 283 i++; 284 } 285 case 3: 287 i++; 288 case 4: 289 break; 290 case 5: 291 i++; 292 } 294 } 295 } 296 297 298 void methodFallThruC(int i, int j, boolean cond) { 299 while (true) { 300 switch (i){ 301 case 0: 302 i++; 303 304 case 1: 305 i++; 306 307 case 2: 308 i++; 309 case 3: 310 break; 311 case 4: 312 i++; 313 314 } 315 } 316 } 317 318 319 void methodFallThruC2(int i, int j, boolean cond) { 320 while (true) { 321 switch (i){ 322 case 0: 323 i++; 324 325 case 1: 326 i++; 327 328 case 2: 329 i++; 330 case 3: 331 break; 332 case 4: 333 i++; 334 335 } 336 } 337 } 338 339 340 void methodFallThruCOtherWords(int i, int j, boolean cond) { 341 while (true) { 342 switch (i){ 343 case 0: 344 i++; 345 346 case 1: 347 i++; 348 349 case 2: 350 i++; 351 case 3: 352 break; 353 case 4: 354 i++; 355 356 } 357 } 358 } 359 360 361 void methodFallThruCCustomWords(int i, int j, boolean cond) { 362 while (true) { 363 switch (i){ 364 case 0: 365 i++; 366 367 case 1: 368 i++; 369 370 case 2: 371 i++; 372 case 3: 373 break; 374 case 4: 375 i++; 376 377 } 378 } 379 } 380 381 void methodFallThruLastCaseGroup(int i, int j, boolean cond) { 382 while (true) { 383 switch (i){ 384 case 0: 385 i++; } 387 switch (i){ 388 case 0: 389 i++; 390 } 392 switch (i){ 393 case 0: 394 i++; 395 } 396 } 397 } 398 399 400 401 } 402 | Popular Tags |