1
2
3
4
5
6
7
8
9
10 package com.puppycrawl.tools.checkstyle.checks.blocks.rightcurly;
11
12 class InputRightCurlyLeftTestSame
13 {
14
15 int foo() throws InterruptedException
16 {
17 int x = 1;
18 int a = 2;
19 while (true)
20 {
21 try
22 {
23 if (x > 0)
24 {
25 break;
26 }
27 else if (x < 0) {
28 ;
29 }
30 else
31 {
32 break;
33 }
34 switch (a)
35 {
36 case 0:
37 break;
38 default:
39 break;
40 }
41 }
42 catch (Exception e)
43 {
44 break;
45 }
46 finally
47 {
48 break;
49 }
50 }
51
52 synchronized (this)
53 {
54 do
55 {
56 x = 2;
57 } while (x == 2);
58 }
59
60 this.wait(666
61 );
62
63 for (int k = 0; k < 1; k++)
64 {
65 String innerBlockVariable = "";
66 }
67
68
69 if (System.currentTimeMillis() > 1000)
70 return 1;
71 else
72 return 2;
73 }
74
75
76 static
77 {
78 int x = 1;
79 }
80
81
82
83 public enum GreetingsEnum
84 {
85 HELLO,
86 GOODBYE
87 };
88
89 void method2()
90 {
91 boolean flag = true;
92 if (flag) {
93 System.identityHashCode("heh");
94 flag = !flag; } String.
95 CASE_INSENSITIVE_ORDER.equals("Xe-xe");
96
97
98 if (flag) { String.CASE_INSENSITIVE_ORDER.equals("it is ok."); }
99 }
100 }
101
102
103
104
105
106 class FooCtorTestSame
107 {
108 int i;
109 public void FooCtor()
110 {
111 i = 1;
112 }}
113
114
115
116
117
118 class FooMethodTestSame
119 {
120 public void fooMethod()
121 {
122 int i = 1;
123 }}
124
125
126
127
128
129 class FooInnerTestSame
130 {
131 class InnerFoo
132 {
133 public void fooInnerMethod ()
134 {
135
136 }
137 }}
138
139
140
141
142
143 class Absent_CustomFieldSerializer3TestSame {
144
145 public static void serialize() {}
146 }
147
148 class Absent_CustomFieldSerializer4TestSame
149 {
150 public void Absent_CustomFieldSerializer4() {}
151 }
152
153 class EmptyClass2TestSame {}
154
155 interface EmptyInterface3TestSame {}
156
157 class ClassWithStaticInitializersTestSame
158 {
159 static {
160 }
161 static
162 {}
163
164 static class Inner
165 {
166 static {
167 int i = 1;
168 }
169 }
170
171 public void emptyBlocks() {
172 try {
173
174 } catch (RuntimeException e) {
175 new Object();
176 } catch (Exception e) {
177
178 } catch (Throwable e) {
179 } finally {
180
181 }
182
183 do {
184 } while (true);
185 }
186
187 public void codeAfterLastRightCurly() {
188 while (new Object().equals(new Object())) {
189 };
190 for (int i = 0; i < 1; i++) { ; };
191 }
192
193 static final java.util.concurrent.ThreadFactory threadFactory
194 = new java.util.concurrent.ThreadFactory() {
195 @Override
196 public Thread newThread(final Runnable r) {
197 return new Thread(r);
198 }};
199
200 interface Interface1
201 {
202 int i = 1;
203 public void meth1(); }
204
205 interface Interface2
206 { int i = 1; public void meth1(); }
207
208 interface Interface3 {
209 void display();
210 interface Interface4 {
211 void myMethod();
212 }}
213 }