1
2
3
4
5
6
7
8
9 package com.puppycrawl.tools.checkstyle.checks.coding.fallthrough;
10
11 public class InputFallThroughLastLineCommentCheck {
12
13 public void method(int i) {
14 switch (i) {
15 case 1:
16 if (true) {
17 }
18
19
20
21 case 2:
22 break;
23 case 3:
24 break;
25 }
26 }
27
28 public void method2(int i) {
29 switch (i) {
30 case 1:
31 i++;
32
33 case 2:
34
35 i++;
36
37 }
38 }
39
40 public void method3(int i) {
41 switch (i) {
42 case 1:
43 break;
44 case 2:
45
46 i++;
47
48 }
49 }
50
51 public void method4(int i) {
52 switch (i) {
53 case 1:
54 break;
55 case 2:
56
57 i++;
58
59 }
60 }
61
62 void methodFallThruCC(int i) {
63 while (true) {
64 switch (i){
65 case 5:
66 i++;
67
68 }
69 }
70 }
71
72 void method4(int i, int j, boolean cond) {
73 while (true) {
74 switch (i){
75 case 5:
76 i++;
77
78 }
79 }
80 }
81
82 void method5(int i, int j, boolean cond) {
83 while (true) {
84 switch (i){
85 case 5:
86 i++;
87
88
89 }
90 }
91 }
92
93 void method6(String str) {
94 switch (str) {
95 case "9": String s = "s🥳d🥳s";
96
97
98 case "10": String s2 = "s🥳d🥳s";
99 default: str.toUpperCase();
100
101 }
102 }
103
104 void method7(int i, int j, boolean cond) {
105 while (true) {
106 switch (i){
107 case 5:
108 i++;
109 i++;
110 }
111 }
112 }
113 }