1
2
3
4
5
6
7
8
9 package com.puppycrawl.tools.checkstyle.checks.blocks.rightcurly;
10
11 public class InputRightCurlyTestSwitchCase5 {
12
13 public void method() {
14 int x = 0;
15 switch (x) { }
16 switch (x) {
17 } int a;
18 switch (x) {
19 case(1): x = 0; break; }
20 switch (x)
21 {
22 }
23 switch (x)
24 {case(1): x=1;break;
25 } int b;
26 switch (x) {case(2): break; } int c;
27
28 switch (x) { } int d;
29 switch (x) { }
30 }
31
32 public void someMethod2() {
33 int x = 90;
34 if (7>x) {
35 switch (x) { case(1): break;}}
36 }
37
38 public void someMethod3() {
39 int x = 90;
40 if (7>x) {switch (x) {case(1): break;}}
41
42 if (7>x) {switch (x) { }}
43 }
44 }
45
46 class NoViolationOnInputRightCurlyTestSwitchCase5 {
47 public void method() {
48 int x = 0;
49 switch (x) { }
50 switch (x) { default: }
51 switch (x) { case(1): x = 0; break; }
52 switch (x)
53 {
54 }
55 switch (x)
56 {case(1): x=1;break;
57 }
58 int b;
59 switch (x) {case(2): break; }
60 switch (x) { }
61 }
62
63 public void someMethod2() {
64 int x = 90;
65 if (7>x) { switch (x) { case(1): break; } }
66
67 }
68 }