1 package com.puppycrawl.tools.checkstyle.grammar.antlr4;
2
3 public class InputAntlr4AstRegressionKeywordsAndOperators {
4
5 private int mVar1=1;
6
7 private int mVar2 =1;
8
9 private int mVar3 = 1;
10
11
12 void method1()
13 {
14 final int a = 1;
15 int b= 1;
16 b=1;
17 b+=1;
18 b -=- 1 + (+ b);
19 b = b ++ + b --;
20 b = ++ b - -- b;
21 }
22
23
24 void method2()
25 {
26 synchronized(this) {
27 }
28 try{
29 }
30 catch(RuntimeException e){
31 }
32 }
33
34
35
36
37
38
39
40 private int mVar4 = 1;
41
42
43
44 private void fastExit()
45 {
46 boolean complicatedStuffNeeded = true;
47 if( !complicatedStuffNeeded )
48 {
49 return;
50 }
51 else
52 {
53
54 }
55 }
56
57
58
59
60
61 private int nonVoid()
62 {
63 if ( true )
64 {
65 return(2);
66 }
67 else
68 {
69 return 2;
70 }
71 }
72
73
74 private void testCasts()
75 {
76 Object o = (Object) new Object();
77 o = (Object)o;
78 o = ( Object ) o;
79 o = (Object)
80 o;
81 }
82
83
84 private void testQuestions()
85 {
86 boolean b = (1 == 2)?true:false;
87 b = (1==2) ? false : true;
88 }
89
90
91 private void starTest()
92 {
93 int x = 2 *3* 4;
94 }
95
96
97 private void boolTest()
98 {
99 boolean a = true;
100 boolean x = ! a;
101 int z = ~1 + ~ 2;
102 }
103
104
105 private void divTest()
106 {
107 int a = 4 % 2;
108 int b = 4% 2;
109 int c = 4 %2;
110 int d = 4%2;
111 int e = 4 / 2;
112 int f = 4/ 2;
113 int g = 4 /2;
114 int h = 4/2;
115 }
116
117
118 private java .lang. String dotTest()
119 {
120 Object o = new java.lang.Object();
121 o.
122 toString();
123 o
124 .toString();
125 o . toString();
126 return o.toString();
127 }
128
129
130 public void assertTest()
131 {
132
133 assert true;
134
135
136 assert true : "Whups";
137
138
139 assert "OK".equals(null) ? false : true : "Whups";
140
141
142 assert(true);
143
144
145 assert true:"Whups";
146 }
147
148
149 void donBradman(Runnable aRun)
150 {
151 donBradman(new Runnable() {
152 public void run() {
153 }
154 });
155
156 final Runnable r = new Runnable() {
157 public void run() {
158 }
159 };
160 }
161
162
163 void rfe521323()
164 {
165 doStuff() ;
166
167 for (int i = 0 ; i < 5; i++) {
168
169 }
170 }
171
172
173
174 private int i ;
175
176 private int i1, i2, i3 ;
177
178 private int i4, i5, i6;
179
180
181 void bug806243()
182 {
183 Object o = new InputAntlr4AstRegressionKeywordsAndOperators() {
184 private int j ;
185
186 };
187 }
188
189 void doStuff() {
190 }
191 }
192
193
194
195
196
197
198 interface IFoo
199 {
200 void foo() ;
201
202 }
203
204
205
206
207
208
209 class SpecialCasesInForLoop
210 {
211 void forIterator()
212 {
213
214 for (int i = 0; i++ < 5;) {
215
216 }
217
218
219
220 int i = 0;
221 for ( ; i < 5; i++ ) {
222
223 }
224 for (int anInt : getSomeInts()) {
225
226 }
227 }
228
229 int[] getSomeInts() {
230 int i = (int) ( 2 / 3 );
231 return null;
232 }
233
234 public void myMethod() {
235 new Thread() {
236 public void run() {
237 }
238 }.start();
239 }
240
241 public void foo(java.util.List<? extends String[]> bar, Comparable<? super Object[]> baz) { }
242
243 public void mySuperMethod() {
244 Runnable[] runs = new Runnable[] {new Runnable() {
245 public void run() {
246 }
247 },
248 new Runnable() {
249 public void run() {
250 }
251 }};
252 runs[0]
253 .
254 run()
255 ;
256 }
257
258 public void testNullSemi() {
259 return ;
260 }
261
262 public void register(Object obj) { }
263
264 public void doSomething(String args[]) {
265 register(boolean[].class);
266 register( args );
267 }
268
269 public void parentheses() {
270 testNullSemi
271 (
272 )
273 ;
274 }
275
276 public static void testNoWhitespaceBeforeEllipses(String ... args) {
277 }
278 public String test() {
279 int pc = 0;
280 return ((100000+pc)+"").substring(1);
281 }
282 }