1
2
3
4
5
6
7
8
9
10
11 package com.puppycrawl.tools.checkstyle.checks.blocks.rightcurly;
12
13 class InputRightCurlyTestWithAnnotations
14 {
15
16 @Deprecated
17 @Override
18 public boolean equals(Object other) { boolean flag = true; return flag; }
19
20 @Override
21 public String toString() { String s = "toString"; return s; }
22
23 @Override
24 @SuppressWarnings("unused")
25 public int hashCode()
26 {
27 int a = 10;
28 return 1;
29 }
30
31 @SuppressWarnings("unused")
32 private void foo2() { int a = 9; return; }
33
34 @SuppressWarnings("unused")
35 private void foo3()
36 { int var1 = 5; var2 = 6; }
37
38 @Deprecated
39 private void foo4() { return; }
40
41 @SuppressWarnings("unused")
42 private int foo5() { return 1; }
43
44 @SuppressWarnings("unused")
45 private String foo6() { return toString();
46 }
47
48 private String foo7() { String s = toString(); return s.toString(); }
49
50 private void foo8() { ; return; }
51
52 private int var1; private int v1;
53 private int var2; private int v2;
54 @SuppressWarnings("unused")
55 public InputRightCurlyTestWithAnnotations() { this.var1 = 1; }
56
57 @SuppressWarnings("unused")
58 public InputRightCurlyTestWithAnnotations(int v1, int v2) {this.var1 = v1; this.var2 = v2; }
59
60 @SuppressWarnings("unused")
61 private void foo9() { ;; }
62
63 @SuppressWarnings("unused")
64 private void foo10() { ; }
65
66 @SuppressWarnings("unused")
67 private void foo11() { }
68
69 @SuppressWarnings("unused")
70 private void foo12() {
71 try { int i = 5; int b = 10; }
72 catch (Exception e) { }
73 }
74
75 @Deprecated
76 @SuppressWarnings("unused")
77 private void foo13() {
78 for (int i = 0; i < 10; i++) { int a = 5; int b = 6; }
79
80 do
81 {
82 var1 = 2;
83 }
84 while (var2 == 2);
85 }
86
87 static { int a; int b; }
88
89 static { int a; }
90
91 { int c; int d;}
92
93 { int c; }
94
95 @Deprecated
96 private void foo14() {
97 if (var1 > 0) {
98 return;
99 }
100 }
101
102 @Deprecated
103 private void foo15() {
104 class A { int a; } var1++;
105 class B { }
106 if(true) {
107
108 }
109 else;
110 }
111
112 @Deprecated
113 private void foo16() {
114 if (true) { return; } else { }
115 if (false) {
116 }
117
118 if (true) { return; } else { }
119 }
120
121 @Deprecated
122 void foo17() { int v1 = 5; v2 = 6; } @Deprecated void foo18() {int v1 = 5; v2 = 6; }
123
124 private void foo19() {int var1 = 5;
125 var2 = 6;}
126
127 @SuppressWarnings("Hello, world!")
128 private String foo20() {
129 do { var2 ++; }
130 while (var2 < 15);
131
132 while (var1 < 10) { var1++; }
133
134 do { var2++; var1++; } while (var2 < 15); return ""+0xCAFEBABE;
135 }
136
137 private void foo21() {
138 new Object() { @Override protected void finalize() { "".toString(); }};
139 }
140
141 @SuppressWarnings("All")
142 void foo22() {
143 long startTime = System.nanoTime();
144 try {
145 int a = 5;
146 toString();
147 } catch (Exception e) {
148 throw new RuntimeException(e);
149 } finally { toString(); }
150 }
151
152 @SuppressWarnings("")
153 void doDoubleBraceInitialization() {
154 java.util.Map<String, String> map = new java.util.LinkedHashMap<String, String>() {{
155 put("Hello", "World");
156 put("first", "second");
157 put("polygene", "lubricants");
158 put("alpha", "betical");
159 }};
160
161 Thread t = new Thread() {@Override public void run() {super.run();}};
162 new Object() { public int hashCode() { return 1; } { int a = 5; }};
163 new Object() { public int hashCode() { return 1; } int b = 10; };
164
165 new Object() { public int hashCode() { return 1; } { int c = 5; } int d = 8; };
166
167 java.util.Map<String, String> map2 = new java.util.LinkedHashMap<String, String>() {{
168 put("Hello", "World");
169 put("first", "second");
170 put("polygene", "lubricants");
171 put("alpha", "betical");}
172 };
173
174 java.util.Map<String, String> map3 = new java.util.LinkedHashMap<String, String>() {{
175 put("Hello", "World");
176 put("first", "second");
177 put("polygene", "lubricants");
178 put("alpha", "betical");}};
179
180 java.util.Map<String, String> map4 = new java.util.LinkedHashMap<String, String>() {{
181 put("Hello", "World");
182 put("first", "second");
183 put("polygene", "lubricants");
184 put("alpha", "betical");
185 }
186 };
187
188 foo23(new java.util.HashSet<String>() {{
189 add("XZ13s");
190 add("AB21/X");
191 add("YYLEX");
192 add("AR5E");
193 }});
194
195 foo23(new java.util.HashSet<String>() {{
196 add("XZ13s");
197 add("AB21/X");
198 add("YYLEX");
199 add("AR5E");
200 }});}
201
202 void foo23(java.util.HashSet<String> set) {
203 }
204
205 void foo25() {
206 for (int i = 0; i < 10; i++) {
207 System.identityHashCode("Hello, world!");
208 }}
209
210 void foo26() {
211 for (int i = 0; i < 10; i++) {
212 System.identityHashCode("Hello, world!");}}
213
214 void foo27() {
215 for (int i = 0; i < 10; i++) {for (int j = 0; j < 15; j++) {int a;}}}
216
217 private java.util.ArrayList<Integer> foo28(int delta) {
218 return new java.util.ArrayList<Integer>() {
219 @Override public int size() { return Math.max(0, super.size() + 1);};
220 };
221 }
222
223 private void foo29() {
224 boolean flag = true;
225 if (flag) {
226 System.identityHashCode("heh");
227 flag = !flag; } String.
228 CASE_INSENSITIVE_ORDER.equals("Xe-xe");
229 }
230
231 public void testMethod() {};
232
233 public void testMethod1() {
234 };
235
236 public class TestClass {};
237
238 public class TestClass1 {
239 };
240
241 public class TestClass2 {
242 public TestClass2() {};
243
244 public TestClass2(String someValue) {
245 };
246 }
247
248 public @interface TestAnnotation {}
249
250 public @interface TestAnnotation1{ String value(); }
251
252 public @interface TestAnnotation2 {
253 String value();}
254
255 public @interface TestAnnotation3 {
256 String value();
257 }
258
259 public @interface TestAnnottation4 { String value();
260 }
261
262 public @interface TestAnnnotation5 {
263 String someValue(); };
264
265 public @interface TestAnnotation6 {};
266
267 public @interface TestAnnotation7 {
268 String someValue();
269 };
270
271 public @interface TestAnnotation8 { String someValue();
272 };
273
274 public @interface TestAnnotation9 { String someValue(); };
275
276 }