1 package com.google.checkstyle.test.chapter4formatting.rule412nonemptyblocks;
2
3 class InputRightCurlyOther
4 {
5
6 int foo() throws InterruptedException
7 {
8 int x = 1;
9 int a = 2;
10 while (true)
11 {
12 try
13 {
14 if (x > 0)
15 {
16 break;
17 } else if (x < 0) {
18
19 ;
20 }
21 else
22 {
23 break;
24 }
25 switch (a)
26 {
27 case 0:
28 break;
29 default:
30 break;
31 }
32 }
33 catch (Exception e)
34 {
35 break;
36 }
37 }
38
39 synchronized (this)
40 {
41 do
42 {
43 x = 2;
44 } while (x == 2);
45 }
46
47 this.wait(666
48 );
49
50 for (int k = 0; k < 1; k++)
51 {
52 String innerBlockVariable = "";
53 }
54
55
56 if (System.currentTimeMillis() > 1000)
57 return 1;
58 else
59 return 2;
60 }
61
62
63 static
64 {
65 int x = 1;
66 }
67
68 public enum GreetingsEnum
69 {
70 HELLO,
71 GOODBYE
72 };
73
74 void method2()
75 {
76 boolean flag = true;
77 if (flag) {
78 System.identityHashCode("heh");
79 flag = !flag; } System.
80 identityHashCode("Xe-xe");
81
82
83 if (flag) { System.identityHashCode("some foo"); }
84 }
85 }
86
87
88
89
90
91 class FooCtor
92 {
93 int i;
94 public FooCtor()
95 {
96 i = 1;
97 }}
98
99
100
101
102
103 class FooMethod
104 {
105 public void fooMethod()
106 {
107 int i = 1;
108 }}
109
110
111
112
113
114 class FooInner
115 {
116 class InnerFoo
117 {
118 public void fooInnerMethod ()
119 {
120
121 }
122 }}
123
124 class EnumContainer {
125 private enum Suit { CLUBS, HEARTS, SPADES, DIAMONDS }
126 }
127
128 class WithArrays {
129 String[] s = {""};
130 String[] empty = {};
131 String[] s1 = {
132 "foo", "foo",
133 };
134 String[] s2 =
135 {
136 "foo", "foo",
137 };
138 String[] s3 =
139 {
140 "foo",
141 "foo",
142 };
143 String[] s4 =
144 {"foo", "foo"};
145 }