Lines Matching refs:buf

101 		StringBuffer buf= new StringBuffer();  in testStaticMethodRequestedInSameType1()  local
102 buf.append("package test1;\n"); in testStaticMethodRequestedInSameType1()
103 buf.append("public class E {\n"); in testStaticMethodRequestedInSameType1()
104 buf.append(" public void xoo() {\n"); in testStaticMethodRequestedInSameType1()
105 buf.append(" }\n"); in testStaticMethodRequestedInSameType1()
106 buf.append(" public static void foo() {\n"); in testStaticMethodRequestedInSameType1()
107 buf.append(" xoo();\n"); in testStaticMethodRequestedInSameType1()
108 buf.append(" }\n"); in testStaticMethodRequestedInSameType1()
109 buf.append("}\n"); in testStaticMethodRequestedInSameType1()
110 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testStaticMethodRequestedInSameType1()
120 buf= new StringBuffer(); in testStaticMethodRequestedInSameType1()
121 buf.append("package test1;\n"); in testStaticMethodRequestedInSameType1()
122 buf.append("public class E {\n"); in testStaticMethodRequestedInSameType1()
123 buf.append(" public static void xoo() {\n"); in testStaticMethodRequestedInSameType1()
124 buf.append(" }\n"); in testStaticMethodRequestedInSameType1()
125 buf.append(" public static void foo() {\n"); in testStaticMethodRequestedInSameType1()
126 buf.append(" xoo();\n"); in testStaticMethodRequestedInSameType1()
127 buf.append(" }\n"); in testStaticMethodRequestedInSameType1()
128 buf.append("}\n"); in testStaticMethodRequestedInSameType1()
129 assertEqualString(preview, buf.toString()); in testStaticMethodRequestedInSameType1()
135 StringBuffer buf= new StringBuffer(); in testStaticMethodRequestedInSameType2() local
136 buf.append("package test1;\n"); in testStaticMethodRequestedInSameType2()
137 buf.append("public class E {\n"); in testStaticMethodRequestedInSameType2()
138 buf.append(" public void xoo() {\n"); in testStaticMethodRequestedInSameType2()
139 buf.append(" }\n"); in testStaticMethodRequestedInSameType2()
140 buf.append(" public static void foo() {\n"); in testStaticMethodRequestedInSameType2()
141 buf.append(" E.xoo();\n"); in testStaticMethodRequestedInSameType2()
142 buf.append(" }\n"); in testStaticMethodRequestedInSameType2()
143 buf.append("}\n"); in testStaticMethodRequestedInSameType2()
144 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testStaticMethodRequestedInSameType2()
154 buf= new StringBuffer(); in testStaticMethodRequestedInSameType2()
155 buf.append("package test1;\n"); in testStaticMethodRequestedInSameType2()
156 buf.append("public class E {\n"); in testStaticMethodRequestedInSameType2()
157 buf.append(" public static void xoo() {\n"); in testStaticMethodRequestedInSameType2()
158 buf.append(" }\n"); in testStaticMethodRequestedInSameType2()
159 buf.append(" public static void foo() {\n"); in testStaticMethodRequestedInSameType2()
160 buf.append(" E.xoo();\n"); in testStaticMethodRequestedInSameType2()
161 buf.append(" }\n"); in testStaticMethodRequestedInSameType2()
162 buf.append("}\n"); in testStaticMethodRequestedInSameType2()
163 assertEqualString(preview, buf.toString()); in testStaticMethodRequestedInSameType2()
170 StringBuffer buf= new StringBuffer(); in testStaticMethodRequestedInSameGenericType() local
171 buf.append("package test1;\n"); in testStaticMethodRequestedInSameGenericType()
172 buf.append("public class E<T> {\n"); in testStaticMethodRequestedInSameGenericType()
173 buf.append(" public <M> void xoo(M m) {\n"); in testStaticMethodRequestedInSameGenericType()
174 buf.append(" }\n"); in testStaticMethodRequestedInSameGenericType()
175 buf.append(" public static void foo() {\n"); in testStaticMethodRequestedInSameGenericType()
176 buf.append(" xoo(Boolean.TRUE);\n"); in testStaticMethodRequestedInSameGenericType()
177 buf.append(" }\n"); in testStaticMethodRequestedInSameGenericType()
178 buf.append("}\n"); in testStaticMethodRequestedInSameGenericType()
179 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testStaticMethodRequestedInSameGenericType()
189 buf= new StringBuffer(); in testStaticMethodRequestedInSameGenericType()
190 buf.append("package test1;\n"); in testStaticMethodRequestedInSameGenericType()
191 buf.append("public class E<T> {\n"); in testStaticMethodRequestedInSameGenericType()
192 buf.append(" public static <M> void xoo(M m) {\n"); in testStaticMethodRequestedInSameGenericType()
193 buf.append(" }\n"); in testStaticMethodRequestedInSameGenericType()
194 buf.append(" public static void foo() {\n"); in testStaticMethodRequestedInSameGenericType()
195 buf.append(" xoo(Boolean.TRUE);\n"); in testStaticMethodRequestedInSameGenericType()
196 buf.append(" }\n"); in testStaticMethodRequestedInSameGenericType()
197 buf.append("}\n"); in testStaticMethodRequestedInSameGenericType()
198 assertEqualString(preview, buf.toString()); in testStaticMethodRequestedInSameGenericType()
204 StringBuffer buf= new StringBuffer(); in testStaticMethodRequestedInOtherType() local
205 buf.append("package test1;\n"); in testStaticMethodRequestedInOtherType()
206 buf.append("public class X {\n"); in testStaticMethodRequestedInOtherType()
207 buf.append(" public void xoo() {\n"); in testStaticMethodRequestedInOtherType()
208 buf.append(" }\n"); in testStaticMethodRequestedInOtherType()
209 buf.append("}\n"); in testStaticMethodRequestedInOtherType()
210 pack1.createCompilationUnit("X.java", buf.toString(), false, null); in testStaticMethodRequestedInOtherType()
212 buf= new StringBuffer(); in testStaticMethodRequestedInOtherType()
213 buf.append("package test1;\n"); in testStaticMethodRequestedInOtherType()
214 buf.append("public class E {\n"); in testStaticMethodRequestedInOtherType()
215 buf.append(" public void foo() {\n"); in testStaticMethodRequestedInOtherType()
216 buf.append(" X.xoo();\n"); in testStaticMethodRequestedInOtherType()
217 buf.append(" }\n"); in testStaticMethodRequestedInOtherType()
218 buf.append("}\n"); in testStaticMethodRequestedInOtherType()
219 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testStaticMethodRequestedInOtherType()
229 buf= new StringBuffer(); in testStaticMethodRequestedInOtherType()
230 buf.append("package test1;\n"); in testStaticMethodRequestedInOtherType()
231 buf.append("public class X {\n"); in testStaticMethodRequestedInOtherType()
232 buf.append(" public static void xoo() {\n"); in testStaticMethodRequestedInOtherType()
233 buf.append(" }\n"); in testStaticMethodRequestedInOtherType()
234 buf.append("}\n"); in testStaticMethodRequestedInOtherType()
235 assertEqualString(preview, buf.toString()); in testStaticMethodRequestedInOtherType()
241 StringBuffer buf= new StringBuffer(); in testInvisibleMethodRequestedInSuperType() local
242 buf.append("package test1;\n"); in testInvisibleMethodRequestedInSuperType()
243 buf.append("public class C {\n"); in testInvisibleMethodRequestedInSuperType()
244 buf.append(" private void xoo() {\n"); in testInvisibleMethodRequestedInSuperType()
245 buf.append(" }\n"); in testInvisibleMethodRequestedInSuperType()
246 buf.append("}\n"); in testInvisibleMethodRequestedInSuperType()
247 pack1.createCompilationUnit("C.java", buf.toString(), false, null); in testInvisibleMethodRequestedInSuperType()
249 buf= new StringBuffer(); in testInvisibleMethodRequestedInSuperType()
250 buf.append("package test1;\n"); in testInvisibleMethodRequestedInSuperType()
251 buf.append("public class E extends C {\n"); in testInvisibleMethodRequestedInSuperType()
252 buf.append(" public void foo() {\n"); in testInvisibleMethodRequestedInSuperType()
253 buf.append(" xoo();\n"); in testInvisibleMethodRequestedInSuperType()
254 buf.append(" }\n"); in testInvisibleMethodRequestedInSuperType()
255 buf.append("}\n"); in testInvisibleMethodRequestedInSuperType()
256 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvisibleMethodRequestedInSuperType()
266 buf= new StringBuffer(); in testInvisibleMethodRequestedInSuperType()
267 buf.append("package test1;\n"); in testInvisibleMethodRequestedInSuperType()
268 buf.append("public class C {\n"); in testInvisibleMethodRequestedInSuperType()
269 buf.append(" protected void xoo() {\n"); in testInvisibleMethodRequestedInSuperType()
270 buf.append(" }\n"); in testInvisibleMethodRequestedInSuperType()
271 buf.append("}\n"); in testInvisibleMethodRequestedInSuperType()
272 assertEqualString(preview, buf.toString()); in testInvisibleMethodRequestedInSuperType()
278 StringBuffer buf= new StringBuffer(); in testInvisibleSuperMethodRequestedInSuperType() local
279 buf.append("package test1;\n"); in testInvisibleSuperMethodRequestedInSuperType()
280 buf.append("public class C {\n"); in testInvisibleSuperMethodRequestedInSuperType()
281 buf.append(" private void xoo() {\n"); in testInvisibleSuperMethodRequestedInSuperType()
282 buf.append(" }\n"); in testInvisibleSuperMethodRequestedInSuperType()
283 buf.append("}\n"); in testInvisibleSuperMethodRequestedInSuperType()
284 pack1.createCompilationUnit("C.java", buf.toString(), false, null); in testInvisibleSuperMethodRequestedInSuperType()
286 buf= new StringBuffer(); in testInvisibleSuperMethodRequestedInSuperType()
287 buf.append("package test1;\n"); in testInvisibleSuperMethodRequestedInSuperType()
288 buf.append("public class E extends C {\n"); in testInvisibleSuperMethodRequestedInSuperType()
289 buf.append(" public void foo() {\n"); in testInvisibleSuperMethodRequestedInSuperType()
290 buf.append(" super.xoo();\n"); in testInvisibleSuperMethodRequestedInSuperType()
291 buf.append(" }\n"); in testInvisibleSuperMethodRequestedInSuperType()
292 buf.append("}\n"); in testInvisibleSuperMethodRequestedInSuperType()
293 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvisibleSuperMethodRequestedInSuperType()
303 buf= new StringBuffer(); in testInvisibleSuperMethodRequestedInSuperType()
304 buf.append("package test1;\n"); in testInvisibleSuperMethodRequestedInSuperType()
305 buf.append("public class C {\n"); in testInvisibleSuperMethodRequestedInSuperType()
306 buf.append(" protected void xoo() {\n"); in testInvisibleSuperMethodRequestedInSuperType()
307 buf.append(" }\n"); in testInvisibleSuperMethodRequestedInSuperType()
308 buf.append("}\n"); in testInvisibleSuperMethodRequestedInSuperType()
309 assertEqualString(preview, buf.toString()); in testInvisibleSuperMethodRequestedInSuperType()
315 StringBuffer buf= new StringBuffer(); in testInvisibleSuperMethodRequestedInGenericSuperType() local
316 buf.append("package test1;\n"); in testInvisibleSuperMethodRequestedInGenericSuperType()
317 buf.append("public class C<T> {\n"); in testInvisibleSuperMethodRequestedInGenericSuperType()
318 buf.append(" private void xoo(T... t) {\n"); in testInvisibleSuperMethodRequestedInGenericSuperType()
319 buf.append(" }\n"); in testInvisibleSuperMethodRequestedInGenericSuperType()
320 buf.append("}\n"); in testInvisibleSuperMethodRequestedInGenericSuperType()
321 pack1.createCompilationUnit("C.java", buf.toString(), false, null); in testInvisibleSuperMethodRequestedInGenericSuperType()
323 buf= new StringBuffer(); in testInvisibleSuperMethodRequestedInGenericSuperType()
324 buf.append("package test1;\n"); in testInvisibleSuperMethodRequestedInGenericSuperType()
325 buf.append("public class E extends C<Boolean> {\n"); in testInvisibleSuperMethodRequestedInGenericSuperType()
326 buf.append(" public void foo() {\n"); in testInvisibleSuperMethodRequestedInGenericSuperType()
327 buf.append(" super.xoo(Boolean.TRUE);\n"); in testInvisibleSuperMethodRequestedInGenericSuperType()
328 buf.append(" }\n"); in testInvisibleSuperMethodRequestedInGenericSuperType()
329 buf.append("}\n"); in testInvisibleSuperMethodRequestedInGenericSuperType()
330 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvisibleSuperMethodRequestedInGenericSuperType()
340 buf= new StringBuffer(); in testInvisibleSuperMethodRequestedInGenericSuperType()
341 buf.append("package test1;\n"); in testInvisibleSuperMethodRequestedInGenericSuperType()
342 buf.append("public class C<T> {\n"); in testInvisibleSuperMethodRequestedInGenericSuperType()
343 buf.append(" protected void xoo(T... t) {\n"); in testInvisibleSuperMethodRequestedInGenericSuperType()
344 buf.append(" }\n"); in testInvisibleSuperMethodRequestedInGenericSuperType()
345 buf.append("}\n"); in testInvisibleSuperMethodRequestedInGenericSuperType()
346 assertEqualString(preview, buf.toString()); in testInvisibleSuperMethodRequestedInGenericSuperType()
352 StringBuffer buf= new StringBuffer(); in testInvisibleMethodRequestedInOtherPackage() local
353 buf.append("package test2;\n"); in testInvisibleMethodRequestedInOtherPackage()
354 buf.append("import java.util.List;\n"); in testInvisibleMethodRequestedInOtherPackage()
355 buf.append("public class C {\n"); in testInvisibleMethodRequestedInOtherPackage()
356 buf.append(" private void xoo() {\n"); in testInvisibleMethodRequestedInOtherPackage()
357 buf.append(" }\n"); in testInvisibleMethodRequestedInOtherPackage()
358 buf.append("}\n"); in testInvisibleMethodRequestedInOtherPackage()
359 pack2.createCompilationUnit("C.java", buf.toString(), false, null); in testInvisibleMethodRequestedInOtherPackage()
362 buf= new StringBuffer(); in testInvisibleMethodRequestedInOtherPackage()
363 buf.append("package test1;\n"); in testInvisibleMethodRequestedInOtherPackage()
364 buf.append("import test2.C;\n"); in testInvisibleMethodRequestedInOtherPackage()
365 buf.append("public class E {\n"); in testInvisibleMethodRequestedInOtherPackage()
366 buf.append(" public void foo(C c) {\n"); in testInvisibleMethodRequestedInOtherPackage()
367 buf.append(" c.xoo();\n"); in testInvisibleMethodRequestedInOtherPackage()
368 buf.append(" }\n"); in testInvisibleMethodRequestedInOtherPackage()
369 buf.append("}\n"); in testInvisibleMethodRequestedInOtherPackage()
370 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvisibleMethodRequestedInOtherPackage()
380 buf= new StringBuffer(); in testInvisibleMethodRequestedInOtherPackage()
381 buf.append("package test2;\n"); in testInvisibleMethodRequestedInOtherPackage()
382 buf.append("import java.util.List;\n"); in testInvisibleMethodRequestedInOtherPackage()
383 buf.append("public class C {\n"); in testInvisibleMethodRequestedInOtherPackage()
384 buf.append(" public void xoo() {\n"); in testInvisibleMethodRequestedInOtherPackage()
385 buf.append(" }\n"); in testInvisibleMethodRequestedInOtherPackage()
386 buf.append("}\n"); in testInvisibleMethodRequestedInOtherPackage()
387 assertEqualString(preview, buf.toString()); in testInvisibleMethodRequestedInOtherPackage()
393 StringBuffer buf= new StringBuffer(); in testInvisibleConstructorRequestedInOtherType() local
394 buf.append("package test1;\n"); in testInvisibleConstructorRequestedInOtherType()
395 buf.append("public class C {\n"); in testInvisibleConstructorRequestedInOtherType()
396 buf.append(" private C() {\n"); in testInvisibleConstructorRequestedInOtherType()
397 buf.append(" }\n"); in testInvisibleConstructorRequestedInOtherType()
398 buf.append("}\n"); in testInvisibleConstructorRequestedInOtherType()
399 pack1.createCompilationUnit("C.java", buf.toString(), false, null); in testInvisibleConstructorRequestedInOtherType()
401 buf= new StringBuffer(); in testInvisibleConstructorRequestedInOtherType()
402 buf.append("package test1;\n"); in testInvisibleConstructorRequestedInOtherType()
403 buf.append("public class E {\n"); in testInvisibleConstructorRequestedInOtherType()
404 buf.append(" public void foo() {\n"); in testInvisibleConstructorRequestedInOtherType()
405 buf.append(" C c= new C();\n"); in testInvisibleConstructorRequestedInOtherType()
406 buf.append(" }\n"); in testInvisibleConstructorRequestedInOtherType()
407 buf.append("}\n"); in testInvisibleConstructorRequestedInOtherType()
408 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvisibleConstructorRequestedInOtherType()
418 buf= new StringBuffer(); in testInvisibleConstructorRequestedInOtherType()
419 buf.append("package test1;\n"); in testInvisibleConstructorRequestedInOtherType()
420 buf.append("public class C {\n"); in testInvisibleConstructorRequestedInOtherType()
421 buf.append(" C() {\n"); in testInvisibleConstructorRequestedInOtherType()
422 buf.append(" }\n"); in testInvisibleConstructorRequestedInOtherType()
423 buf.append("}\n"); in testInvisibleConstructorRequestedInOtherType()
424 assertEqualString(preview, buf.toString()); in testInvisibleConstructorRequestedInOtherType()
430 StringBuffer buf= new StringBuffer(); in testInvisibleDefaultConstructorRequestedInOtherType() local
431 buf.append("package test1;\n"); in testInvisibleDefaultConstructorRequestedInOtherType()
432 buf.append("public class C {\n"); in testInvisibleDefaultConstructorRequestedInOtherType()
433 buf.append(" protected class Inner{\n"); in testInvisibleDefaultConstructorRequestedInOtherType()
434 buf.append(" }\n"); in testInvisibleDefaultConstructorRequestedInOtherType()
435 buf.append("}\n"); in testInvisibleDefaultConstructorRequestedInOtherType()
436 pack1.createCompilationUnit("C.java", buf.toString(), false, null); in testInvisibleDefaultConstructorRequestedInOtherType()
439 buf= new StringBuffer(); in testInvisibleDefaultConstructorRequestedInOtherType()
440 buf.append("package test2;\n"); in testInvisibleDefaultConstructorRequestedInOtherType()
441 buf.append("public class E extends test1.C {\n"); in testInvisibleDefaultConstructorRequestedInOtherType()
442 buf.append(" Object o= new Inner();\n"); in testInvisibleDefaultConstructorRequestedInOtherType()
443 buf.append("}\n"); in testInvisibleDefaultConstructorRequestedInOtherType()
444 ICompilationUnit cu= pack2.createCompilationUnit("E.java", buf.toString(), false, null); in testInvisibleDefaultConstructorRequestedInOtherType()
454 buf= new StringBuffer(); in testInvisibleDefaultConstructorRequestedInOtherType()
455 buf.append("package test1;\n"); in testInvisibleDefaultConstructorRequestedInOtherType()
456 buf.append("public class C {\n"); in testInvisibleDefaultConstructorRequestedInOtherType()
457 buf.append(" protected class Inner{\n"); in testInvisibleDefaultConstructorRequestedInOtherType()
458 buf.append("\n"); in testInvisibleDefaultConstructorRequestedInOtherType()
459 buf.append(" public Inner() {\n"); in testInvisibleDefaultConstructorRequestedInOtherType()
460 buf.append(" }\n"); in testInvisibleDefaultConstructorRequestedInOtherType()
461 buf.append(" }\n"); in testInvisibleDefaultConstructorRequestedInOtherType()
462 buf.append("}\n"); in testInvisibleDefaultConstructorRequestedInOtherType()
463 assertEqualString(preview, buf.toString()); in testInvisibleDefaultConstructorRequestedInOtherType()
469 StringBuffer buf= new StringBuffer(); in testInvisibleConstructorRequestedInSuperType() local
470 buf.append("package test1;\n"); in testInvisibleConstructorRequestedInSuperType()
471 buf.append("public class C {\n"); in testInvisibleConstructorRequestedInSuperType()
472 buf.append(" private C() {\n"); in testInvisibleConstructorRequestedInSuperType()
473 buf.append(" }\n"); in testInvisibleConstructorRequestedInSuperType()
474 buf.append("}\n"); in testInvisibleConstructorRequestedInSuperType()
475 pack1.createCompilationUnit("C.java", buf.toString(), false, null); in testInvisibleConstructorRequestedInSuperType()
477 buf= new StringBuffer(); in testInvisibleConstructorRequestedInSuperType()
478 buf.append("package test1;\n"); in testInvisibleConstructorRequestedInSuperType()
479 buf.append("public class E extends C {\n"); in testInvisibleConstructorRequestedInSuperType()
480 buf.append(" public E() {\n"); in testInvisibleConstructorRequestedInSuperType()
481 buf.append(" super();\n"); in testInvisibleConstructorRequestedInSuperType()
482 buf.append(" }\n"); in testInvisibleConstructorRequestedInSuperType()
483 buf.append("}\n"); in testInvisibleConstructorRequestedInSuperType()
484 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvisibleConstructorRequestedInSuperType()
494 buf= new StringBuffer(); in testInvisibleConstructorRequestedInSuperType()
495 buf.append("package test1;\n"); in testInvisibleConstructorRequestedInSuperType()
496 buf.append("public class C {\n"); in testInvisibleConstructorRequestedInSuperType()
497 buf.append(" protected C() {\n"); in testInvisibleConstructorRequestedInSuperType()
498 buf.append(" }\n"); in testInvisibleConstructorRequestedInSuperType()
499 buf.append("}\n"); in testInvisibleConstructorRequestedInSuperType()
500 assertEqualString(preview, buf.toString()); in testInvisibleConstructorRequestedInSuperType()
506 StringBuffer buf= new StringBuffer(); in testInvisibleFieldRequestedInSamePackage1() local
507 buf.append("package test1;\n"); in testInvisibleFieldRequestedInSamePackage1()
508 buf.append("public class C {\n"); in testInvisibleFieldRequestedInSamePackage1()
509 buf.append(" private int fXoo;\n"); in testInvisibleFieldRequestedInSamePackage1()
510 buf.append("}\n"); in testInvisibleFieldRequestedInSamePackage1()
511 pack1.createCompilationUnit("C.java", buf.toString(), false, null); in testInvisibleFieldRequestedInSamePackage1()
513 buf= new StringBuffer(); in testInvisibleFieldRequestedInSamePackage1()
514 buf.append("package test1;\n"); in testInvisibleFieldRequestedInSamePackage1()
515 buf.append("public class E {\n"); in testInvisibleFieldRequestedInSamePackage1()
516 buf.append(" public void foo(C c) {\n"); in testInvisibleFieldRequestedInSamePackage1()
517 buf.append(" c.fXoo= 1;\n"); in testInvisibleFieldRequestedInSamePackage1()
518 buf.append(" }\n"); in testInvisibleFieldRequestedInSamePackage1()
519 buf.append("}\n"); in testInvisibleFieldRequestedInSamePackage1()
520 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvisibleFieldRequestedInSamePackage1()
530 buf= new StringBuffer(); in testInvisibleFieldRequestedInSamePackage1()
531 buf.append("package test1;\n"); in testInvisibleFieldRequestedInSamePackage1()
532 buf.append("public class C {\n"); in testInvisibleFieldRequestedInSamePackage1()
533 buf.append(" int fXoo;\n"); in testInvisibleFieldRequestedInSamePackage1()
534 buf.append("}\n"); in testInvisibleFieldRequestedInSamePackage1()
536 assertEqualString(preview, buf.toString()); in testInvisibleFieldRequestedInSamePackage1()
543 StringBuffer buf= new StringBuffer(); in testInvisibleFieldRequestedInSamePackage2() local
544 buf.append("package test1;\n"); in testInvisibleFieldRequestedInSamePackage2()
545 buf.append("public class C {\n"); in testInvisibleFieldRequestedInSamePackage2()
546 buf.append(" private int fXoo;\n"); in testInvisibleFieldRequestedInSamePackage2()
547 buf.append("}\n"); in testInvisibleFieldRequestedInSamePackage2()
548 pack1.createCompilationUnit("C.java", buf.toString(), false, null); in testInvisibleFieldRequestedInSamePackage2()
550 buf= new StringBuffer(); in testInvisibleFieldRequestedInSamePackage2()
551 buf.append("package test1;\n"); in testInvisibleFieldRequestedInSamePackage2()
552 buf.append("public class E extends C {\n"); in testInvisibleFieldRequestedInSamePackage2()
553 buf.append(" public void foo() {\n"); in testInvisibleFieldRequestedInSamePackage2()
554 buf.append(" fXoo= 1;\n"); in testInvisibleFieldRequestedInSamePackage2()
555 buf.append(" }\n"); in testInvisibleFieldRequestedInSamePackage2()
556 buf.append("}\n"); in testInvisibleFieldRequestedInSamePackage2()
557 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvisibleFieldRequestedInSamePackage2()
567 buf= new StringBuffer(); in testInvisibleFieldRequestedInSamePackage2()
568 buf.append("package test1;\n"); in testInvisibleFieldRequestedInSamePackage2()
569 buf.append("public class C {\n"); in testInvisibleFieldRequestedInSamePackage2()
570 buf.append(" protected int fXoo;\n"); in testInvisibleFieldRequestedInSamePackage2()
571 buf.append("}\n"); in testInvisibleFieldRequestedInSamePackage2()
572 String expected1= buf.toString(); in testInvisibleFieldRequestedInSamePackage2()
577 buf= new StringBuffer(); in testInvisibleFieldRequestedInSamePackage2()
578 buf.append("package test1;\n"); in testInvisibleFieldRequestedInSamePackage2()
579 buf.append("public class E extends C {\n"); in testInvisibleFieldRequestedInSamePackage2()
580 buf.append(" private int fXoo;\n"); in testInvisibleFieldRequestedInSamePackage2()
581 buf.append("\n"); in testInvisibleFieldRequestedInSamePackage2()
582 buf.append(" public void foo() {\n"); in testInvisibleFieldRequestedInSamePackage2()
583 buf.append(" fXoo= 1;\n"); in testInvisibleFieldRequestedInSamePackage2()
584 buf.append(" }\n"); in testInvisibleFieldRequestedInSamePackage2()
585 buf.append("}\n"); in testInvisibleFieldRequestedInSamePackage2()
586 String expected2= buf.toString(); in testInvisibleFieldRequestedInSamePackage2()
591 buf= new StringBuffer(); in testInvisibleFieldRequestedInSamePackage2()
592 buf.append("package test1;\n"); in testInvisibleFieldRequestedInSamePackage2()
593 buf.append("public class E extends C {\n"); in testInvisibleFieldRequestedInSamePackage2()
594 buf.append(" public void foo(int fXoo) {\n"); in testInvisibleFieldRequestedInSamePackage2()
595 buf.append(" fXoo= 1;\n"); in testInvisibleFieldRequestedInSamePackage2()
596 buf.append(" }\n"); in testInvisibleFieldRequestedInSamePackage2()
597 buf.append("}\n"); in testInvisibleFieldRequestedInSamePackage2()
598 String expected3= buf.toString(); in testInvisibleFieldRequestedInSamePackage2()
603 buf= new StringBuffer(); in testInvisibleFieldRequestedInSamePackage2()
604 buf.append("package test1;\n"); in testInvisibleFieldRequestedInSamePackage2()
605 buf.append("public class E extends C {\n"); in testInvisibleFieldRequestedInSamePackage2()
606 buf.append(" public void foo() {\n"); in testInvisibleFieldRequestedInSamePackage2()
607 buf.append(" int fXoo = 1;\n"); in testInvisibleFieldRequestedInSamePackage2()
608 buf.append(" }\n"); in testInvisibleFieldRequestedInSamePackage2()
609 buf.append("}\n"); in testInvisibleFieldRequestedInSamePackage2()
610 String expected4= buf.toString(); in testInvisibleFieldRequestedInSamePackage2()
615 buf= new StringBuffer(); in testInvisibleFieldRequestedInSamePackage2()
616 buf.append("package test1;\n"); in testInvisibleFieldRequestedInSamePackage2()
617 buf.append("public class E extends C {\n"); in testInvisibleFieldRequestedInSamePackage2()
618 buf.append(" public void foo() {\n"); in testInvisibleFieldRequestedInSamePackage2()
619 buf.append(" }\n"); in testInvisibleFieldRequestedInSamePackage2()
620 buf.append("}\n"); in testInvisibleFieldRequestedInSamePackage2()
621 String expected5= buf.toString(); in testInvisibleFieldRequestedInSamePackage2()
631 StringBuffer buf= new StringBuffer(); in testNonStaticMethodRequestedInConstructor() local
632 buf= new StringBuffer(); in testNonStaticMethodRequestedInConstructor()
633 buf.append("package test1;\n"); in testNonStaticMethodRequestedInConstructor()
634 buf.append("public class E {\n"); in testNonStaticMethodRequestedInConstructor()
635 buf.append(" private int xoo() { return 1; };\n"); in testNonStaticMethodRequestedInConstructor()
636 buf.append(" public E(int val) {\n"); in testNonStaticMethodRequestedInConstructor()
637 buf.append(" }\n"); in testNonStaticMethodRequestedInConstructor()
638 buf.append(" public E() {\n"); in testNonStaticMethodRequestedInConstructor()
639 buf.append(" this(xoo());\n"); in testNonStaticMethodRequestedInConstructor()
640 buf.append(" }\n"); in testNonStaticMethodRequestedInConstructor()
641 buf.append("}\n"); in testNonStaticMethodRequestedInConstructor()
642 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testNonStaticMethodRequestedInConstructor()
652 buf= new StringBuffer(); in testNonStaticMethodRequestedInConstructor()
653 buf.append("package test1;\n"); in testNonStaticMethodRequestedInConstructor()
654 buf.append("public class E {\n"); in testNonStaticMethodRequestedInConstructor()
655 buf.append(" private static int xoo() { return 1; };\n"); in testNonStaticMethodRequestedInConstructor()
656 buf.append(" public E(int val) {\n"); in testNonStaticMethodRequestedInConstructor()
657 buf.append(" }\n"); in testNonStaticMethodRequestedInConstructor()
658 buf.append(" public E() {\n"); in testNonStaticMethodRequestedInConstructor()
659 buf.append(" this(xoo());\n"); in testNonStaticMethodRequestedInConstructor()
660 buf.append(" }\n"); in testNonStaticMethodRequestedInConstructor()
661 buf.append("}\n"); in testNonStaticMethodRequestedInConstructor()
662 assertEqualString(preview, buf.toString()); in testNonStaticMethodRequestedInConstructor()
668 StringBuffer buf= new StringBuffer(); in testNonStaticFieldRequestedInConstructor() local
669 buf= new StringBuffer(); in testNonStaticFieldRequestedInConstructor()
670 buf.append("package test1;\n"); in testNonStaticFieldRequestedInConstructor()
671 buf.append("public class E {\n"); in testNonStaticFieldRequestedInConstructor()
672 buf.append(" private int fXoo= 1;\n"); in testNonStaticFieldRequestedInConstructor()
673 buf.append(" public E(int val) {\n"); in testNonStaticFieldRequestedInConstructor()
674 buf.append(" }\n"); in testNonStaticFieldRequestedInConstructor()
675 buf.append(" public E() {\n"); in testNonStaticFieldRequestedInConstructor()
676 buf.append(" this(fXoo);\n"); in testNonStaticFieldRequestedInConstructor()
677 buf.append(" }\n"); in testNonStaticFieldRequestedInConstructor()
678 buf.append("}\n"); in testNonStaticFieldRequestedInConstructor()
679 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testNonStaticFieldRequestedInConstructor()
689 buf= new StringBuffer(); in testNonStaticFieldRequestedInConstructor()
690 buf.append("package test1;\n"); in testNonStaticFieldRequestedInConstructor()
691 buf.append("public class E {\n"); in testNonStaticFieldRequestedInConstructor()
692 buf.append(" private static int fXoo= 1;\n"); in testNonStaticFieldRequestedInConstructor()
693 buf.append(" public E(int val) {\n"); in testNonStaticFieldRequestedInConstructor()
694 buf.append(" }\n"); in testNonStaticFieldRequestedInConstructor()
695 buf.append(" public E() {\n"); in testNonStaticFieldRequestedInConstructor()
696 buf.append(" this(fXoo);\n"); in testNonStaticFieldRequestedInConstructor()
697 buf.append(" }\n"); in testNonStaticFieldRequestedInConstructor()
698 buf.append("}\n"); in testNonStaticFieldRequestedInConstructor()
699 assertEqualString(preview, buf.toString()); in testNonStaticFieldRequestedInConstructor()
705 StringBuffer buf= new StringBuffer(); in testInvisibleTypeRequestedInDifferentPackage() local
706 buf.append("package test2;\n"); in testInvisibleTypeRequestedInDifferentPackage()
707 buf.append("class C {\n"); in testInvisibleTypeRequestedInDifferentPackage()
708 buf.append("}\n"); in testInvisibleTypeRequestedInDifferentPackage()
709 pack2.createCompilationUnit("C.java", buf.toString(), false, null); in testInvisibleTypeRequestedInDifferentPackage()
712 buf= new StringBuffer(); in testInvisibleTypeRequestedInDifferentPackage()
713 buf.append("package test1;\n"); in testInvisibleTypeRequestedInDifferentPackage()
714 buf.append("public class E {\n"); in testInvisibleTypeRequestedInDifferentPackage()
715 buf.append(" public void foo() {\n"); in testInvisibleTypeRequestedInDifferentPackage()
716 buf.append(" test2.C c= null;\n"); in testInvisibleTypeRequestedInDifferentPackage()
717 buf.append(" }\n"); in testInvisibleTypeRequestedInDifferentPackage()
718 buf.append("}\n"); in testInvisibleTypeRequestedInDifferentPackage()
719 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvisibleTypeRequestedInDifferentPackage()
729 buf= new StringBuffer(); in testInvisibleTypeRequestedInDifferentPackage()
730 buf.append("package test2;\n"); in testInvisibleTypeRequestedInDifferentPackage()
731 buf.append("public class C {\n"); in testInvisibleTypeRequestedInDifferentPackage()
732 buf.append("}\n"); in testInvisibleTypeRequestedInDifferentPackage()
733 assertEqualString(preview, buf.toString()); in testInvisibleTypeRequestedInDifferentPackage()
739 StringBuffer buf= new StringBuffer(); in testInvisibleTypeRequestedInGenericType() local
740 buf.append("package test2;\n"); in testInvisibleTypeRequestedInGenericType()
741 buf.append("class C<T> {\n"); in testInvisibleTypeRequestedInGenericType()
742 buf.append("}\n"); in testInvisibleTypeRequestedInGenericType()
743 pack2.createCompilationUnit("C.java", buf.toString(), false, null); in testInvisibleTypeRequestedInGenericType()
746 buf= new StringBuffer(); in testInvisibleTypeRequestedInGenericType()
747 buf.append("package test1;\n"); in testInvisibleTypeRequestedInGenericType()
748 buf.append("public class E {\n"); in testInvisibleTypeRequestedInGenericType()
749 buf.append(" public void foo() {\n"); in testInvisibleTypeRequestedInGenericType()
750 buf.append(" test2.C<String> c= null;\n"); in testInvisibleTypeRequestedInGenericType()
751 buf.append(" }\n"); in testInvisibleTypeRequestedInGenericType()
752 buf.append("}\n"); in testInvisibleTypeRequestedInGenericType()
753 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvisibleTypeRequestedInGenericType()
763 buf= new StringBuffer(); in testInvisibleTypeRequestedInGenericType()
764 buf.append("package test2;\n"); in testInvisibleTypeRequestedInGenericType()
765 buf.append("public class C<T> {\n"); in testInvisibleTypeRequestedInGenericType()
766 buf.append("}\n"); in testInvisibleTypeRequestedInGenericType()
767 assertEqualString(preview, buf.toString()); in testInvisibleTypeRequestedInGenericType()
774 StringBuffer buf= new StringBuffer(); in testInvisibleTypeRequestedFromSuperClass() local
775 buf.append("package test1;\n"); in testInvisibleTypeRequestedFromSuperClass()
776 buf.append("public class C {\n"); in testInvisibleTypeRequestedFromSuperClass()
777 buf.append(" private class CInner {\n"); in testInvisibleTypeRequestedFromSuperClass()
778 buf.append(" }\n"); in testInvisibleTypeRequestedFromSuperClass()
779 buf.append("}\n"); in testInvisibleTypeRequestedFromSuperClass()
780 pack1.createCompilationUnit("C.java", buf.toString(), false, null); in testInvisibleTypeRequestedFromSuperClass()
782 buf= new StringBuffer(); in testInvisibleTypeRequestedFromSuperClass()
783 buf.append("package test1;\n"); in testInvisibleTypeRequestedFromSuperClass()
784 buf.append("public class E extends C {\n"); in testInvisibleTypeRequestedFromSuperClass()
785 buf.append(" public void foo() {\n"); in testInvisibleTypeRequestedFromSuperClass()
786 buf.append(" CInner c= null;\n"); in testInvisibleTypeRequestedFromSuperClass()
787 buf.append(" }\n"); in testInvisibleTypeRequestedFromSuperClass()
788 buf.append("}\n"); in testInvisibleTypeRequestedFromSuperClass()
789 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvisibleTypeRequestedFromSuperClass()
799 buf= new StringBuffer(); in testInvisibleTypeRequestedFromSuperClass()
800 buf.append("package test1;\n"); in testInvisibleTypeRequestedFromSuperClass()
801 buf.append("public class C {\n"); in testInvisibleTypeRequestedFromSuperClass()
802 buf.append(" class CInner {\n"); in testInvisibleTypeRequestedFromSuperClass()
803 buf.append(" }\n"); in testInvisibleTypeRequestedFromSuperClass()
804 buf.append("}\n"); in testInvisibleTypeRequestedFromSuperClass()
805 assertEqualString(preview, buf.toString()); in testInvisibleTypeRequestedFromSuperClass()
812 StringBuffer buf= new StringBuffer(); in testInvisibleImport() local
813 buf.append("package test2;\n"); in testInvisibleImport()
814 buf.append("class C {\n"); in testInvisibleImport()
815 buf.append("}\n"); in testInvisibleImport()
816 pack2.createCompilationUnit("C.java", buf.toString(), false, null); in testInvisibleImport()
819 buf= new StringBuffer(); in testInvisibleImport()
820 buf.append("package test1;\n"); in testInvisibleImport()
821 buf.append("public class E {\n"); in testInvisibleImport()
822 buf.append(" public void foo() {\n"); in testInvisibleImport()
823 buf.append(" test2.C c= null;\n"); in testInvisibleImport()
824 buf.append(" }\n"); in testInvisibleImport()
825 buf.append("}\n"); in testInvisibleImport()
826 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvisibleImport()
836 buf= new StringBuffer(); in testInvisibleImport()
837 buf.append("package test2;\n"); in testInvisibleImport()
838 buf.append("public class C {\n"); in testInvisibleImport()
839 buf.append("}\n"); in testInvisibleImport()
840 assertEqualString(preview, buf.toString()); in testInvisibleImport()
846 StringBuffer buf= new StringBuffer(); in testAbstractMethodWithBody() local
847 buf.append("package test1;\n"); in testAbstractMethodWithBody()
848 buf.append("public abstract class E {\n"); in testAbstractMethodWithBody()
849 buf.append(" public abstract void foo() {\n"); in testAbstractMethodWithBody()
850 buf.append(" }\n"); in testAbstractMethodWithBody()
851 buf.append("}\n"); in testAbstractMethodWithBody()
852 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testAbstractMethodWithBody()
862 buf= new StringBuffer(); in testAbstractMethodWithBody()
863 buf.append("package test1;\n"); in testAbstractMethodWithBody()
864 buf.append("public abstract class E {\n"); in testAbstractMethodWithBody()
865 buf.append(" public void foo() {\n"); in testAbstractMethodWithBody()
866 buf.append(" }\n"); in testAbstractMethodWithBody()
867 buf.append("}\n"); in testAbstractMethodWithBody()
868 String expected1= buf.toString(); in testAbstractMethodWithBody()
873 buf= new StringBuffer(); in testAbstractMethodWithBody()
874 buf.append("package test1;\n"); in testAbstractMethodWithBody()
875 buf.append("public abstract class E {\n"); in testAbstractMethodWithBody()
876 buf.append(" public abstract void foo();\n"); in testAbstractMethodWithBody()
877 buf.append("}\n"); in testAbstractMethodWithBody()
878 String expected2= buf.toString(); in testAbstractMethodWithBody()
887 StringBuffer buf= new StringBuffer(); in testAbstractMethodWithBody2() local
888 buf.append("package test1;\n"); in testAbstractMethodWithBody2()
889 buf.append("abstract class C {\n"); in testAbstractMethodWithBody2()
890 buf.append(" public abstract strictfp void foo() {}\n"); in testAbstractMethodWithBody2()
891 buf.append("}\n"); in testAbstractMethodWithBody2()
892 ICompilationUnit cu= pack1.createCompilationUnit("C.java", buf.toString(), false, null); in testAbstractMethodWithBody2()
902 buf= new StringBuffer(); in testAbstractMethodWithBody2()
903 buf.append("package test1;\n"); in testAbstractMethodWithBody2()
904 buf.append("abstract class C {\n"); in testAbstractMethodWithBody2()
905 buf.append(" public strictfp void foo() {}\n"); in testAbstractMethodWithBody2()
906 buf.append("}\n"); in testAbstractMethodWithBody2()
907 String expected1= buf.toString(); in testAbstractMethodWithBody2()
912 buf= new StringBuffer(); in testAbstractMethodWithBody2()
913 buf.append("package test1;\n"); in testAbstractMethodWithBody2()
914 buf.append("abstract class C {\n"); in testAbstractMethodWithBody2()
915 buf.append(" public abstract void foo();\n"); in testAbstractMethodWithBody2()
916 buf.append("}\n"); in testAbstractMethodWithBody2()
917 String expected2= buf.toString(); in testAbstractMethodWithBody2()
926 StringBuffer buf= new StringBuffer(); in testAbstractMethodWithBody3() local
927 buf.append("package test1;\n"); in testAbstractMethodWithBody3()
928 buf.append("\n"); in testAbstractMethodWithBody3()
929 buf.append("enum E {\n"); in testAbstractMethodWithBody3()
930 buf.append(" A {\n"); in testAbstractMethodWithBody3()
931 buf.append(" public void foo() {}\n"); in testAbstractMethodWithBody3()
932 buf.append(" };\n"); in testAbstractMethodWithBody3()
933 buf.append(" public abstract void foo() {}\n"); in testAbstractMethodWithBody3()
934 buf.append("}\n"); in testAbstractMethodWithBody3()
935 ICompilationUnit cu= pack1.createCompilationUnit("Snippet.java", buf.toString(), false, null); in testAbstractMethodWithBody3()
944 buf= new StringBuffer(); in testAbstractMethodWithBody3()
945 buf.append("package test1;\n"); in testAbstractMethodWithBody3()
946 buf.append("\n"); in testAbstractMethodWithBody3()
947 buf.append("enum E {\n"); in testAbstractMethodWithBody3()
948 buf.append(" A {\n"); in testAbstractMethodWithBody3()
949 buf.append(" public void foo() {}\n"); in testAbstractMethodWithBody3()
950 buf.append(" };\n"); in testAbstractMethodWithBody3()
951 buf.append(" public abstract void foo();\n"); in testAbstractMethodWithBody3()
952 buf.append("}\n"); in testAbstractMethodWithBody3()
953 expected[0]= buf.toString(); in testAbstractMethodWithBody3()
961 StringBuffer buf= new StringBuffer(); in testAbstractMethodInNonAbstractClass() local
962 buf.append("package test1;\n"); in testAbstractMethodInNonAbstractClass()
963 buf.append("public class E {\n"); in testAbstractMethodInNonAbstractClass()
964 buf.append(" public abstract int foo();\n"); in testAbstractMethodInNonAbstractClass()
965 buf.append("}\n"); in testAbstractMethodInNonAbstractClass()
966 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testAbstractMethodInNonAbstractClass()
980 buf= new StringBuffer(); in testAbstractMethodInNonAbstractClass()
981 buf.append("package test1;\n"); in testAbstractMethodInNonAbstractClass()
982 buf.append("public abstract class E {\n"); in testAbstractMethodInNonAbstractClass()
983 buf.append(" public abstract int foo();\n"); in testAbstractMethodInNonAbstractClass()
984 buf.append("}\n"); in testAbstractMethodInNonAbstractClass()
985 String expectedMakeClassAbstract= buf.toString(); in testAbstractMethodInNonAbstractClass()
998 buf= new StringBuffer(); in testAbstractMethodInNonAbstractClass()
999 buf.append("package test1;\n"); in testAbstractMethodInNonAbstractClass()
1000 buf.append("public class E {\n"); in testAbstractMethodInNonAbstractClass()
1001 buf.append(" public int foo() {\n"); in testAbstractMethodInNonAbstractClass()
1002 buf.append(" return 0;\n"); in testAbstractMethodInNonAbstractClass()
1003 buf.append(" }\n"); in testAbstractMethodInNonAbstractClass()
1004 buf.append("}\n"); in testAbstractMethodInNonAbstractClass()
1005 String expected1= buf.toString(); in testAbstractMethodInNonAbstractClass()
1016 StringBuffer buf= new StringBuffer(); in testNativeMethodWithBody() local
1017 buf.append("package test1;\n"); in testNativeMethodWithBody()
1018 buf.append("public class E {\n"); in testNativeMethodWithBody()
1019 buf.append(" public native void foo() {\n"); in testNativeMethodWithBody()
1020 buf.append(" }\n"); in testNativeMethodWithBody()
1021 buf.append("}\n"); in testNativeMethodWithBody()
1022 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testNativeMethodWithBody()
1032 buf= new StringBuffer(); in testNativeMethodWithBody()
1033 buf.append("package test1;\n"); in testNativeMethodWithBody()
1034 buf.append("public class E {\n"); in testNativeMethodWithBody()
1035 buf.append(" public void foo() {\n"); in testNativeMethodWithBody()
1036 buf.append(" }\n"); in testNativeMethodWithBody()
1037 buf.append("}\n"); in testNativeMethodWithBody()
1038 String expected1= buf.toString(); in testNativeMethodWithBody()
1043 buf= new StringBuffer(); in testNativeMethodWithBody()
1044 buf.append("package test1;\n"); in testNativeMethodWithBody()
1045 buf.append("public class E {\n"); in testNativeMethodWithBody()
1046 buf.append(" public native void foo();\n"); in testNativeMethodWithBody()
1047 buf.append("}\n"); in testNativeMethodWithBody()
1048 String expected2= buf.toString(); in testNativeMethodWithBody()
1057 StringBuffer buf= new StringBuffer(); in testOuterLocalMustBeFinal() local
1058 buf.append("package test1;\n"); in testOuterLocalMustBeFinal()
1059 buf.append("public class E {\n"); in testOuterLocalMustBeFinal()
1060 buf.append(" public void foo() {\n"); in testOuterLocalMustBeFinal()
1061 buf.append(" int i= 9;\n"); in testOuterLocalMustBeFinal()
1062 buf.append(" Runnable run= new Runnable() {\n"); in testOuterLocalMustBeFinal()
1063 buf.append(" public void run() {\n"); in testOuterLocalMustBeFinal()
1064 buf.append(" int x= i;\n"); in testOuterLocalMustBeFinal()
1065 buf.append(" }\n"); in testOuterLocalMustBeFinal()
1066 buf.append(" };\n"); in testOuterLocalMustBeFinal()
1067 buf.append(" }\n"); in testOuterLocalMustBeFinal()
1068 buf.append("}\n"); in testOuterLocalMustBeFinal()
1069 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testOuterLocalMustBeFinal()
1079 buf= new StringBuffer(); in testOuterLocalMustBeFinal()
1080 buf.append("package test1;\n"); in testOuterLocalMustBeFinal()
1081 buf.append("public class E {\n"); in testOuterLocalMustBeFinal()
1082 buf.append(" public void foo() {\n"); in testOuterLocalMustBeFinal()
1083 buf.append(" final int i= 9;\n"); in testOuterLocalMustBeFinal()
1084 buf.append(" Runnable run= new Runnable() {\n"); in testOuterLocalMustBeFinal()
1085 buf.append(" public void run() {\n"); in testOuterLocalMustBeFinal()
1086 buf.append(" int x= i;\n"); in testOuterLocalMustBeFinal()
1087 buf.append(" }\n"); in testOuterLocalMustBeFinal()
1088 buf.append(" };\n"); in testOuterLocalMustBeFinal()
1089 buf.append(" }\n"); in testOuterLocalMustBeFinal()
1090 buf.append("}\n"); in testOuterLocalMustBeFinal()
1091 assertEqualString(preview, buf.toString()); in testOuterLocalMustBeFinal()
1098 StringBuffer buf= new StringBuffer(); in testOuterLocalMustBeFinal2() local
1099 buf.append("package test1;\n"); in testOuterLocalMustBeFinal2()
1100 buf.append("import java.util.List;\n"); in testOuterLocalMustBeFinal2()
1101 buf.append("public class E {\n"); in testOuterLocalMustBeFinal2()
1102 buf.append(" public void foo() {\n"); in testOuterLocalMustBeFinal2()
1103 buf.append(" List<String> i= null, j= null;\n"); in testOuterLocalMustBeFinal2()
1104 buf.append(" Runnable run= new Runnable() {\n"); in testOuterLocalMustBeFinal2()
1105 buf.append(" public void run() {\n"); in testOuterLocalMustBeFinal2()
1106 buf.append(" Object x= i;\n"); in testOuterLocalMustBeFinal2()
1107 buf.append(" }\n"); in testOuterLocalMustBeFinal2()
1108 buf.append(" };\n"); in testOuterLocalMustBeFinal2()
1109 buf.append(" }\n"); in testOuterLocalMustBeFinal2()
1110 buf.append("}\n"); in testOuterLocalMustBeFinal2()
1111 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testOuterLocalMustBeFinal2()
1121 buf= new StringBuffer(); in testOuterLocalMustBeFinal2()
1122 buf.append("package test1;\n"); in testOuterLocalMustBeFinal2()
1123 buf.append("import java.util.List;\n"); in testOuterLocalMustBeFinal2()
1124 buf.append("public class E {\n"); in testOuterLocalMustBeFinal2()
1125 buf.append(" public void foo() {\n"); in testOuterLocalMustBeFinal2()
1126 buf.append(" final List<String> i= null;\n"); in testOuterLocalMustBeFinal2()
1127 buf.append(" List<String> j= null;\n"); in testOuterLocalMustBeFinal2()
1128 buf.append(" Runnable run= new Runnable() {\n"); in testOuterLocalMustBeFinal2()
1129 buf.append(" public void run() {\n"); in testOuterLocalMustBeFinal2()
1130 buf.append(" Object x= i;\n"); in testOuterLocalMustBeFinal2()
1131 buf.append(" }\n"); in testOuterLocalMustBeFinal2()
1132 buf.append(" };\n"); in testOuterLocalMustBeFinal2()
1133 buf.append(" }\n"); in testOuterLocalMustBeFinal2()
1134 buf.append("}\n"); in testOuterLocalMustBeFinal2()
1135 assertEqualString(preview, buf.toString()); in testOuterLocalMustBeFinal2()
1142 StringBuffer buf= new StringBuffer(); in testOuterParameterMustBeFinal() local
1143 buf.append("package test1;\n"); in testOuterParameterMustBeFinal()
1144 buf.append("public class E {\n"); in testOuterParameterMustBeFinal()
1145 buf.append(" public void foo(int i) {\n"); in testOuterParameterMustBeFinal()
1146 buf.append(" Runnable run= new Runnable() {\n"); in testOuterParameterMustBeFinal()
1147 buf.append(" public void run() {\n"); in testOuterParameterMustBeFinal()
1148 buf.append(" int x= i;\n"); in testOuterParameterMustBeFinal()
1149 buf.append(" }\n"); in testOuterParameterMustBeFinal()
1150 buf.append(" };\n"); in testOuterParameterMustBeFinal()
1151 buf.append(" }\n"); in testOuterParameterMustBeFinal()
1152 buf.append("}\n"); in testOuterParameterMustBeFinal()
1153 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testOuterParameterMustBeFinal()
1163 buf= new StringBuffer(); in testOuterParameterMustBeFinal()
1164 buf.append("package test1;\n"); in testOuterParameterMustBeFinal()
1165 buf.append("public class E {\n"); in testOuterParameterMustBeFinal()
1166 buf.append(" public void foo(final int i) {\n"); in testOuterParameterMustBeFinal()
1167 buf.append(" Runnable run= new Runnable() {\n"); in testOuterParameterMustBeFinal()
1168 buf.append(" public void run() {\n"); in testOuterParameterMustBeFinal()
1169 buf.append(" int x= i;\n"); in testOuterParameterMustBeFinal()
1170 buf.append(" }\n"); in testOuterParameterMustBeFinal()
1171 buf.append(" };\n"); in testOuterParameterMustBeFinal()
1172 buf.append(" }\n"); in testOuterParameterMustBeFinal()
1173 buf.append("}\n"); in testOuterParameterMustBeFinal()
1174 assertEqualString(preview, buf.toString()); in testOuterParameterMustBeFinal()
1180 StringBuffer buf= new StringBuffer(); in testOuterForParamMustBeFinal() local
1181 buf.append("package test1;\n"); in testOuterForParamMustBeFinal()
1182 buf.append("public class E {\n"); in testOuterForParamMustBeFinal()
1183 buf.append(" public void foo() {\n"); in testOuterForParamMustBeFinal()
1184 buf.append(" for (int i= 1; true;) {\n"); in testOuterForParamMustBeFinal()
1185 buf.append(" Runnable run= new Runnable() {\n"); in testOuterForParamMustBeFinal()
1186 buf.append(" public void run() {\n"); in testOuterForParamMustBeFinal()
1187 buf.append(" int x= i;\n"); in testOuterForParamMustBeFinal()
1188 buf.append(" }\n"); in testOuterForParamMustBeFinal()
1189 buf.append(" };\n"); in testOuterForParamMustBeFinal()
1190 buf.append(" }\n"); in testOuterForParamMustBeFinal()
1191 buf.append(" }\n"); in testOuterForParamMustBeFinal()
1192 buf.append("}\n"); in testOuterForParamMustBeFinal()
1193 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testOuterForParamMustBeFinal()
1203 buf= new StringBuffer(); in testOuterForParamMustBeFinal()
1204 buf.append("package test1;\n"); in testOuterForParamMustBeFinal()
1205 buf.append("public class E {\n"); in testOuterForParamMustBeFinal()
1206 buf.append(" public void foo() {\n"); in testOuterForParamMustBeFinal()
1207 buf.append(" for (final int i= 1; true;) {\n"); in testOuterForParamMustBeFinal()
1208 buf.append(" Runnable run= new Runnable() {\n"); in testOuterForParamMustBeFinal()
1209 buf.append(" public void run() {\n"); in testOuterForParamMustBeFinal()
1210 buf.append(" int x= i;\n"); in testOuterForParamMustBeFinal()
1211 buf.append(" }\n"); in testOuterForParamMustBeFinal()
1212 buf.append(" };\n"); in testOuterForParamMustBeFinal()
1213 buf.append(" }\n"); in testOuterForParamMustBeFinal()
1214 buf.append(" }\n"); in testOuterForParamMustBeFinal()
1215 buf.append("}\n"); in testOuterForParamMustBeFinal()
1216 assertEqualString(preview, buf.toString()); in testOuterForParamMustBeFinal()
1223 StringBuffer buf= new StringBuffer(); in testMethodRequiresBody() local
1224 buf.append("package test1;\n"); in testMethodRequiresBody()
1225 buf.append("public class E {\n"); in testMethodRequiresBody()
1226 buf.append(" public void foo();\n"); in testMethodRequiresBody()
1227 buf.append("}\n"); in testMethodRequiresBody()
1228 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testMethodRequiresBody()
1238 buf= new StringBuffer(); in testMethodRequiresBody()
1239 buf.append("package test1;\n"); in testMethodRequiresBody()
1240 buf.append("public class E {\n"); in testMethodRequiresBody()
1241 buf.append(" public void foo() {\n"); in testMethodRequiresBody()
1242 buf.append(" }\n"); in testMethodRequiresBody()
1243 buf.append("}\n"); in testMethodRequiresBody()
1244 String expected1= buf.toString(); in testMethodRequiresBody()
1249 buf= new StringBuffer(); in testMethodRequiresBody()
1250 buf.append("package test1;\n"); in testMethodRequiresBody()
1251 buf.append("public class E {\n"); in testMethodRequiresBody()
1252 buf.append(" public abstract void foo();\n"); in testMethodRequiresBody()
1253 buf.append("}\n"); in testMethodRequiresBody()
1254 String expected2= buf.toString(); in testMethodRequiresBody()
1263 StringBuffer buf= new StringBuffer(); in testMethodRequiresBody2() local
1264 buf.append("package test1;\n"); in testMethodRequiresBody2()
1265 buf.append("public class E {\n"); in testMethodRequiresBody2()
1266 buf.append(" public int foo();\n"); in testMethodRequiresBody2()
1267 buf.append("}\n"); in testMethodRequiresBody2()
1268 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testMethodRequiresBody2()
1278 buf= new StringBuffer(); in testMethodRequiresBody2()
1279 buf.append("package test1;\n"); in testMethodRequiresBody2()
1280 buf.append("public class E {\n"); in testMethodRequiresBody2()
1281 buf.append(" public int foo() {\n"); in testMethodRequiresBody2()
1282 buf.append(" return 0;\n"); in testMethodRequiresBody2()
1283 buf.append(" }\n"); in testMethodRequiresBody2()
1284 buf.append("}\n"); in testMethodRequiresBody2()
1285 String expected1= buf.toString(); in testMethodRequiresBody2()
1290 buf= new StringBuffer(); in testMethodRequiresBody2()
1291 buf.append("package test1;\n"); in testMethodRequiresBody2()
1292 buf.append("public class E {\n"); in testMethodRequiresBody2()
1293 buf.append(" public abstract int foo();\n"); in testMethodRequiresBody2()
1294 buf.append("}\n"); in testMethodRequiresBody2()
1295 String expected2= buf.toString(); in testMethodRequiresBody2()
1307 StringBuffer buf= new StringBuffer(); in testNeedToEmulateMethodAccess() local
1308 buf.append("package test1;\n"); in testNeedToEmulateMethodAccess()
1309 buf.append("public class E {\n"); in testNeedToEmulateMethodAccess()
1310 buf.append(" public void x() {\n"); in testNeedToEmulateMethodAccess()
1311 buf.append(" Runnable r= new Runnable() {\n"); in testNeedToEmulateMethodAccess()
1312 buf.append(" public void run() {\n"); in testNeedToEmulateMethodAccess()
1313 buf.append(" foo();\n"); in testNeedToEmulateMethodAccess()
1314 buf.append(" }\n"); in testNeedToEmulateMethodAccess()
1315 buf.append(" };\n"); in testNeedToEmulateMethodAccess()
1316 buf.append(" }\n"); in testNeedToEmulateMethodAccess()
1317 buf.append(" private void foo() {\n"); in testNeedToEmulateMethodAccess()
1318 buf.append(" }\n"); in testNeedToEmulateMethodAccess()
1319 buf.append("}\n"); in testNeedToEmulateMethodAccess()
1320 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testNeedToEmulateMethodAccess()
1330 buf= new StringBuffer(); in testNeedToEmulateMethodAccess()
1331 buf.append("package test1;\n"); in testNeedToEmulateMethodAccess()
1332 buf.append("public class E {\n"); in testNeedToEmulateMethodAccess()
1333 buf.append(" public void x() {\n"); in testNeedToEmulateMethodAccess()
1334 buf.append(" Runnable r= new Runnable() {\n"); in testNeedToEmulateMethodAccess()
1335 buf.append(" public void run() {\n"); in testNeedToEmulateMethodAccess()
1336 buf.append(" foo();\n"); in testNeedToEmulateMethodAccess()
1337 buf.append(" }\n"); in testNeedToEmulateMethodAccess()
1338 buf.append(" };\n"); in testNeedToEmulateMethodAccess()
1339 buf.append(" }\n"); in testNeedToEmulateMethodAccess()
1340 buf.append(" void foo() {\n"); in testNeedToEmulateMethodAccess()
1341 buf.append(" }\n"); in testNeedToEmulateMethodAccess()
1342 buf.append("}\n"); in testNeedToEmulateMethodAccess()
1343 assertEqualString(preview, buf.toString()); in testNeedToEmulateMethodAccess()
1353 StringBuffer buf= new StringBuffer(); in testNeedToEmulateConstructorAccess() local
1354 buf.append("package test1;\n"); in testNeedToEmulateConstructorAccess()
1355 buf.append("public class E {\n"); in testNeedToEmulateConstructorAccess()
1356 buf.append(" public void x() {\n"); in testNeedToEmulateConstructorAccess()
1357 buf.append(" Runnable r= new Runnable() {\n"); in testNeedToEmulateConstructorAccess()
1358 buf.append(" public void run() {\n"); in testNeedToEmulateConstructorAccess()
1359 buf.append(" E e= new E();\n"); in testNeedToEmulateConstructorAccess()
1360 buf.append(" }\n"); in testNeedToEmulateConstructorAccess()
1361 buf.append(" };\n"); in testNeedToEmulateConstructorAccess()
1362 buf.append(" }\n"); in testNeedToEmulateConstructorAccess()
1363 buf.append(" private E() {\n"); in testNeedToEmulateConstructorAccess()
1364 buf.append(" }\n"); in testNeedToEmulateConstructorAccess()
1365 buf.append("}\n"); in testNeedToEmulateConstructorAccess()
1366 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testNeedToEmulateConstructorAccess()
1376 buf= new StringBuffer(); in testNeedToEmulateConstructorAccess()
1377 buf.append("package test1;\n"); in testNeedToEmulateConstructorAccess()
1378 buf.append("public class E {\n"); in testNeedToEmulateConstructorAccess()
1379 buf.append(" public void x() {\n"); in testNeedToEmulateConstructorAccess()
1380 buf.append(" Runnable r= new Runnable() {\n"); in testNeedToEmulateConstructorAccess()
1381 buf.append(" public void run() {\n"); in testNeedToEmulateConstructorAccess()
1382 buf.append(" E e= new E();\n"); in testNeedToEmulateConstructorAccess()
1383 buf.append(" }\n"); in testNeedToEmulateConstructorAccess()
1384 buf.append(" };\n"); in testNeedToEmulateConstructorAccess()
1385 buf.append(" }\n"); in testNeedToEmulateConstructorAccess()
1386 buf.append(" E() {\n"); in testNeedToEmulateConstructorAccess()
1387 buf.append(" }\n"); in testNeedToEmulateConstructorAccess()
1388 buf.append("}\n"); in testNeedToEmulateConstructorAccess()
1389 assertEqualString(preview, buf.toString()); in testNeedToEmulateConstructorAccess()
1399 StringBuffer buf= new StringBuffer(); in testNeedToEmulateFieldRead() local
1400 buf.append("package test1;\n"); in testNeedToEmulateFieldRead()
1401 buf.append("public class E {\n"); in testNeedToEmulateFieldRead()
1402 buf.append(" public void x() {\n"); in testNeedToEmulateFieldRead()
1403 buf.append(" Runnable r= new Runnable() {\n"); in testNeedToEmulateFieldRead()
1404 buf.append(" public void run() {\n"); in testNeedToEmulateFieldRead()
1405 buf.append(" int x= fCount;\n"); in testNeedToEmulateFieldRead()
1406 buf.append(" }\n"); in testNeedToEmulateFieldRead()
1407 buf.append(" };\n"); in testNeedToEmulateFieldRead()
1408 buf.append(" }\n"); in testNeedToEmulateFieldRead()
1409 buf.append(" private int fCount; {\n"); in testNeedToEmulateFieldRead()
1410 buf.append(" }\n"); in testNeedToEmulateFieldRead()
1411 buf.append("}\n"); in testNeedToEmulateFieldRead()
1412 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testNeedToEmulateFieldRead()
1422 buf= new StringBuffer(); in testNeedToEmulateFieldRead()
1423 buf.append("package test1;\n"); in testNeedToEmulateFieldRead()
1424 buf.append("public class E {\n"); in testNeedToEmulateFieldRead()
1425 buf.append(" public void x() {\n"); in testNeedToEmulateFieldRead()
1426 buf.append(" Runnable r= new Runnable() {\n"); in testNeedToEmulateFieldRead()
1427 buf.append(" public void run() {\n"); in testNeedToEmulateFieldRead()
1428 buf.append(" int x= fCount;\n"); in testNeedToEmulateFieldRead()
1429 buf.append(" }\n"); in testNeedToEmulateFieldRead()
1430 buf.append(" };\n"); in testNeedToEmulateFieldRead()
1431 buf.append(" }\n"); in testNeedToEmulateFieldRead()
1432 buf.append(" int fCount; {\n"); in testNeedToEmulateFieldRead()
1433 buf.append(" }\n"); in testNeedToEmulateFieldRead()
1434 buf.append("}\n"); in testNeedToEmulateFieldRead()
1435 assertEqualString(preview, buf.toString()); in testNeedToEmulateFieldRead()
1445 StringBuffer buf= new StringBuffer(); in testNeedToEmulateFieldReadInGeneric() local
1446 buf.append("package test1;\n"); in testNeedToEmulateFieldReadInGeneric()
1447 buf.append("public class E<T> {\n"); in testNeedToEmulateFieldReadInGeneric()
1448 buf.append(" public void x() {\n"); in testNeedToEmulateFieldReadInGeneric()
1449 buf.append(" Runnable r= new Runnable() {\n"); in testNeedToEmulateFieldReadInGeneric()
1450 buf.append(" public void run() {\n"); in testNeedToEmulateFieldReadInGeneric()
1451 buf.append(" T x= fCount;\n"); in testNeedToEmulateFieldReadInGeneric()
1452 buf.append(" }\n"); in testNeedToEmulateFieldReadInGeneric()
1453 buf.append(" };\n"); in testNeedToEmulateFieldReadInGeneric()
1454 buf.append(" }\n"); in testNeedToEmulateFieldReadInGeneric()
1455 buf.append(" private T fCount; {\n"); in testNeedToEmulateFieldReadInGeneric()
1456 buf.append(" }\n"); in testNeedToEmulateFieldReadInGeneric()
1457 buf.append("}\n"); in testNeedToEmulateFieldReadInGeneric()
1458 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testNeedToEmulateFieldReadInGeneric()
1468 buf= new StringBuffer(); in testNeedToEmulateFieldReadInGeneric()
1469 buf.append("package test1;\n"); in testNeedToEmulateFieldReadInGeneric()
1470 buf.append("public class E<T> {\n"); in testNeedToEmulateFieldReadInGeneric()
1471 buf.append(" public void x() {\n"); in testNeedToEmulateFieldReadInGeneric()
1472 buf.append(" Runnable r= new Runnable() {\n"); in testNeedToEmulateFieldReadInGeneric()
1473 buf.append(" public void run() {\n"); in testNeedToEmulateFieldReadInGeneric()
1474 buf.append(" T x= fCount;\n"); in testNeedToEmulateFieldReadInGeneric()
1475 buf.append(" }\n"); in testNeedToEmulateFieldReadInGeneric()
1476 buf.append(" };\n"); in testNeedToEmulateFieldReadInGeneric()
1477 buf.append(" }\n"); in testNeedToEmulateFieldReadInGeneric()
1478 buf.append(" T fCount; {\n"); in testNeedToEmulateFieldReadInGeneric()
1479 buf.append(" }\n"); in testNeedToEmulateFieldReadInGeneric()
1480 buf.append("}\n"); in testNeedToEmulateFieldReadInGeneric()
1481 assertEqualString(preview, buf.toString()); in testNeedToEmulateFieldReadInGeneric()
1491 StringBuffer buf= new StringBuffer(); in testNeedToEmulateFieldWrite() local
1492 buf.append("package test1;\n"); in testNeedToEmulateFieldWrite()
1493 buf.append("public class E {\n"); in testNeedToEmulateFieldWrite()
1494 buf.append(" public void x() {\n"); in testNeedToEmulateFieldWrite()
1495 buf.append(" Runnable r= new Runnable() {\n"); in testNeedToEmulateFieldWrite()
1496 buf.append(" public void run() {\n"); in testNeedToEmulateFieldWrite()
1497 buf.append(" fCount= 2;\n"); in testNeedToEmulateFieldWrite()
1498 buf.append(" }\n"); in testNeedToEmulateFieldWrite()
1499 buf.append(" };\n"); in testNeedToEmulateFieldWrite()
1500 buf.append(" }\n"); in testNeedToEmulateFieldWrite()
1501 buf.append(" private int fCount; {\n"); in testNeedToEmulateFieldWrite()
1502 buf.append(" }\n"); in testNeedToEmulateFieldWrite()
1503 buf.append("}\n"); in testNeedToEmulateFieldWrite()
1504 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testNeedToEmulateFieldWrite()
1514 buf= new StringBuffer(); in testNeedToEmulateFieldWrite()
1515 buf.append("package test1;\n"); in testNeedToEmulateFieldWrite()
1516 buf.append("public class E {\n"); in testNeedToEmulateFieldWrite()
1517 buf.append(" public void x() {\n"); in testNeedToEmulateFieldWrite()
1518 buf.append(" Runnable r= new Runnable() {\n"); in testNeedToEmulateFieldWrite()
1519 buf.append(" public void run() {\n"); in testNeedToEmulateFieldWrite()
1520 buf.append(" fCount= 2;\n"); in testNeedToEmulateFieldWrite()
1521 buf.append(" }\n"); in testNeedToEmulateFieldWrite()
1522 buf.append(" };\n"); in testNeedToEmulateFieldWrite()
1523 buf.append(" }\n"); in testNeedToEmulateFieldWrite()
1524 buf.append(" int fCount; {\n"); in testNeedToEmulateFieldWrite()
1525 buf.append(" }\n"); in testNeedToEmulateFieldWrite()
1526 buf.append("}\n"); in testNeedToEmulateFieldWrite()
1527 assertEqualString(preview, buf.toString()); in testNeedToEmulateFieldWrite()
1533 StringBuffer buf= new StringBuffer(); in testSetFinalVariable1() local
1534 buf.append("package test1;\n"); in testSetFinalVariable1()
1535 buf.append("public class E {\n"); in testSetFinalVariable1()
1536 buf.append(" private final int x= 9;\n"); in testSetFinalVariable1()
1537 buf.append(" public void foo() {\n"); in testSetFinalVariable1()
1538 buf.append(" x= 8;\n"); in testSetFinalVariable1()
1539 buf.append(" }\n"); in testSetFinalVariable1()
1540 buf.append("}\n"); in testSetFinalVariable1()
1541 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testSetFinalVariable1()
1551 buf= new StringBuffer(); in testSetFinalVariable1()
1552 buf.append("package test1;\n"); in testSetFinalVariable1()
1553 buf.append("public class E {\n"); in testSetFinalVariable1()
1554 buf.append(" private int x= 9;\n"); in testSetFinalVariable1()
1555 buf.append(" public void foo() {\n"); in testSetFinalVariable1()
1556 buf.append(" x= 8;\n"); in testSetFinalVariable1()
1557 buf.append(" }\n"); in testSetFinalVariable1()
1558 buf.append("}\n"); in testSetFinalVariable1()
1559 assertEqualString(preview, buf.toString()); in testSetFinalVariable1()
1565 StringBuffer buf= new StringBuffer(); in testSetFinalVariable2() local
1566 buf.append("package test1;\n"); in testSetFinalVariable2()
1567 buf.append("public class E {\n"); in testSetFinalVariable2()
1568 buf.append(" private final int x;\n"); in testSetFinalVariable2()
1569 buf.append(" public E() {\n"); in testSetFinalVariable2()
1570 buf.append(" x= 8;\n"); in testSetFinalVariable2()
1571 buf.append(" x= 9;\n"); in testSetFinalVariable2()
1572 buf.append(" }\n"); in testSetFinalVariable2()
1573 buf.append("}\n"); in testSetFinalVariable2()
1574 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testSetFinalVariable2()
1584 buf= new StringBuffer(); in testSetFinalVariable2()
1585 buf.append("package test1;\n"); in testSetFinalVariable2()
1586 buf.append("public class E {\n"); in testSetFinalVariable2()
1587 buf.append(" private int x;\n"); in testSetFinalVariable2()
1588 buf.append(" public E() {\n"); in testSetFinalVariable2()
1589 buf.append(" x= 8;\n"); in testSetFinalVariable2()
1590 buf.append(" x= 9;\n"); in testSetFinalVariable2()
1591 buf.append(" }\n"); in testSetFinalVariable2()
1592 buf.append("}\n"); in testSetFinalVariable2()
1593 assertEqualString(preview, buf.toString()); in testSetFinalVariable2()
1599 StringBuffer buf= new StringBuffer(); in testSetFinalVariable3() local
1600 buf.append("package test1;\n"); in testSetFinalVariable3()
1601 buf.append("public class E {\n"); in testSetFinalVariable3()
1602 buf.append(" public E() {\n"); in testSetFinalVariable3()
1603 buf.append(" final int x= 8;\n"); in testSetFinalVariable3()
1604 buf.append(" x= 9;\n"); in testSetFinalVariable3()
1605 buf.append(" }\n"); in testSetFinalVariable3()
1606 buf.append("}\n"); in testSetFinalVariable3()
1607 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testSetFinalVariable3()
1617 buf= new StringBuffer(); in testSetFinalVariable3()
1618 buf.append("package test1;\n"); in testSetFinalVariable3()
1619 buf.append("public class E {\n"); in testSetFinalVariable3()
1620 buf.append(" public E() {\n"); in testSetFinalVariable3()
1621 buf.append(" int x= 8;\n"); in testSetFinalVariable3()
1622 buf.append(" x= 9;\n"); in testSetFinalVariable3()
1623 buf.append(" }\n"); in testSetFinalVariable3()
1624 buf.append("}\n"); in testSetFinalVariable3()
1625 assertEqualString(preview, buf.toString()); in testSetFinalVariable3()
1631 StringBuffer buf= new StringBuffer(); in testSetFinalVariable4() local
1632 buf.append("package test1;\n"); in testSetFinalVariable4()
1633 buf.append("import java.util.ArrayList;\n"); in testSetFinalVariable4()
1634 buf.append("import java.util.List;\n"); in testSetFinalVariable4()
1635 buf.append("public class E {\n"); in testSetFinalVariable4()
1636 buf.append(" final List<String> a= null, x= a, y= a;\n"); in testSetFinalVariable4()
1637 buf.append(" public void foo() {\n"); in testSetFinalVariable4()
1638 buf.append(" x= new ArrayList<String>();\n"); in testSetFinalVariable4()
1639 buf.append(" }\n"); in testSetFinalVariable4()
1640 buf.append("}\n"); in testSetFinalVariable4()
1641 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testSetFinalVariable4()
1651 buf= new StringBuffer(); in testSetFinalVariable4()
1652 buf.append("package test1;\n"); in testSetFinalVariable4()
1653 buf.append("import java.util.ArrayList;\n"); in testSetFinalVariable4()
1654 buf.append("import java.util.List;\n"); in testSetFinalVariable4()
1655 buf.append("public class E {\n"); in testSetFinalVariable4()
1656 buf.append(" final List<String> a= null;\n"); in testSetFinalVariable4()
1657 buf.append(" List<String> x= a;\n"); in testSetFinalVariable4()
1658 buf.append(" final List<String> y= a;\n"); in testSetFinalVariable4()
1659 buf.append(" public void foo() {\n"); in testSetFinalVariable4()
1660 buf.append(" x= new ArrayList<String>();\n"); in testSetFinalVariable4()
1661 buf.append(" }\n"); in testSetFinalVariable4()
1662 buf.append("}\n"); in testSetFinalVariable4()
1663 assertEqualString(preview, buf.toString()); in testSetFinalVariable4()
1669 StringBuffer buf= new StringBuffer(); in testSetFinalVariableInGeneric() local
1670 buf.append("package test2;\n"); in testSetFinalVariableInGeneric()
1671 buf.append("public class C<T> {\n"); in testSetFinalVariableInGeneric()
1672 buf.append(" T x;\n"); in testSetFinalVariableInGeneric()
1673 buf.append("}\n"); in testSetFinalVariableInGeneric()
1674 pack2.createCompilationUnit("C.java", buf.toString(), false, null); in testSetFinalVariableInGeneric()
1677 buf= new StringBuffer(); in testSetFinalVariableInGeneric()
1678 buf.append("package test1;\n"); in testSetFinalVariableInGeneric()
1679 buf.append("public class E {\n"); in testSetFinalVariableInGeneric()
1680 buf.append(" public void foo(test2.C<String> c) {\n"); in testSetFinalVariableInGeneric()
1681 buf.append(" c.x= null;\n"); in testSetFinalVariableInGeneric()
1682 buf.append(" }\n"); in testSetFinalVariableInGeneric()
1683 buf.append("}\n"); in testSetFinalVariableInGeneric()
1684 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testSetFinalVariableInGeneric()
1694 buf= new StringBuffer(); in testSetFinalVariableInGeneric()
1695 buf.append("package test2;\n"); in testSetFinalVariableInGeneric()
1696 buf.append("public class C<T> {\n"); in testSetFinalVariableInGeneric()
1697 buf.append(" public T x;\n"); in testSetFinalVariableInGeneric()
1698 buf.append("}\n"); in testSetFinalVariableInGeneric()
1699 assertEqualString(preview, buf.toString()); in testSetFinalVariableInGeneric()
1707 StringBuffer buf= new StringBuffer(); in testOverrideFinalMethod() local
1708 buf.append("package test1;\n"); in testOverrideFinalMethod()
1709 buf.append("public class C {\n"); in testOverrideFinalMethod()
1710 buf.append(" protected final void foo() {\n"); in testOverrideFinalMethod()
1711 buf.append(" }\n"); in testOverrideFinalMethod()
1712 buf.append("}\n"); in testOverrideFinalMethod()
1713 pack1.createCompilationUnit("C.java", buf.toString(), false, null); in testOverrideFinalMethod()
1715 buf= new StringBuffer(); in testOverrideFinalMethod()
1716 buf.append("package test1;\n"); in testOverrideFinalMethod()
1717 buf.append("public class E extends C {\n"); in testOverrideFinalMethod()
1718 buf.append(" protected void foo() {\n"); in testOverrideFinalMethod()
1719 buf.append(" }\n"); in testOverrideFinalMethod()
1720 buf.append("}\n"); in testOverrideFinalMethod()
1721 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testOverrideFinalMethod()
1731 buf= new StringBuffer(); in testOverrideFinalMethod()
1732 buf.append("package test1;\n"); in testOverrideFinalMethod()
1733 buf.append("public class C {\n"); in testOverrideFinalMethod()
1734 buf.append(" protected void foo() {\n"); in testOverrideFinalMethod()
1735 buf.append(" }\n"); in testOverrideFinalMethod()
1736 buf.append("}\n"); in testOverrideFinalMethod()
1737 assertEqualString(preview, buf.toString()); in testOverrideFinalMethod()
1745 StringBuffer buf= new StringBuffer(); in testOverridesNonVisibleMethod() local
1746 buf.append("package test2;\n"); in testOverridesNonVisibleMethod()
1747 buf.append("public class C {\n"); in testOverridesNonVisibleMethod()
1748 buf.append(" void foo() {\n"); in testOverridesNonVisibleMethod()
1749 buf.append(" }\n"); in testOverridesNonVisibleMethod()
1750 buf.append("}\n"); in testOverridesNonVisibleMethod()
1751 pack2.createCompilationUnit("C.java", buf.toString(), false, null); in testOverridesNonVisibleMethod()
1754 buf= new StringBuffer(); in testOverridesNonVisibleMethod()
1755 buf.append("package test1;\n"); in testOverridesNonVisibleMethod()
1756 buf.append("import test2.C;\n"); in testOverridesNonVisibleMethod()
1757 buf.append("public class E extends C {\n"); in testOverridesNonVisibleMethod()
1758 buf.append(" public void foo() {\n"); in testOverridesNonVisibleMethod()
1759 buf.append(" }\n"); in testOverridesNonVisibleMethod()
1760 buf.append("}\n"); in testOverridesNonVisibleMethod()
1761 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testOverridesNonVisibleMethod()
1771 buf= new StringBuffer(); in testOverridesNonVisibleMethod()
1772 buf.append("package test2;\n"); in testOverridesNonVisibleMethod()
1773 buf.append("public class C {\n"); in testOverridesNonVisibleMethod()
1774 buf.append(" public void foo() {\n"); in testOverridesNonVisibleMethod()
1775 buf.append(" }\n"); in testOverridesNonVisibleMethod()
1776 buf.append("}\n"); in testOverridesNonVisibleMethod()
1777 assertEqualString(preview, buf.toString()); in testOverridesNonVisibleMethod()
1784 StringBuffer buf= new StringBuffer(); in testOverridesStaticMethod() local
1785 buf.append("package test2;\n"); in testOverridesStaticMethod()
1786 buf.append("public class C {\n"); in testOverridesStaticMethod()
1787 buf.append(" public static void foo() {\n"); in testOverridesStaticMethod()
1788 buf.append(" }\n"); in testOverridesStaticMethod()
1789 buf.append("}\n"); in testOverridesStaticMethod()
1790 pack2.createCompilationUnit("C.java", buf.toString(), false, null); in testOverridesStaticMethod()
1793 buf= new StringBuffer(); in testOverridesStaticMethod()
1794 buf.append("package test1;\n"); in testOverridesStaticMethod()
1795 buf.append("import test2.C;\n"); in testOverridesStaticMethod()
1796 buf.append("public class E extends C {\n"); in testOverridesStaticMethod()
1797 buf.append(" public void foo() {\n"); in testOverridesStaticMethod()
1798 buf.append(" }\n"); in testOverridesStaticMethod()
1799 buf.append("}\n"); in testOverridesStaticMethod()
1800 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testOverridesStaticMethod()
1810 buf= new StringBuffer(); in testOverridesStaticMethod()
1811 buf.append("package test2;\n"); in testOverridesStaticMethod()
1812 buf.append("public class C {\n"); in testOverridesStaticMethod()
1813 buf.append(" public void foo() {\n"); in testOverridesStaticMethod()
1814 buf.append(" }\n"); in testOverridesStaticMethod()
1815 buf.append("}\n"); in testOverridesStaticMethod()
1816 assertEqualString(preview, buf.toString()); in testOverridesStaticMethod()
1823 StringBuffer buf= new StringBuffer(); in testStaticOverridesMethod() local
1824 buf.append("package test2;\n"); in testStaticOverridesMethod()
1825 buf.append("public class C {\n"); in testStaticOverridesMethod()
1826 buf.append(" public void foo() {\n"); in testStaticOverridesMethod()
1827 buf.append(" }\n"); in testStaticOverridesMethod()
1828 buf.append("}\n"); in testStaticOverridesMethod()
1829 pack2.createCompilationUnit("C.java", buf.toString(), false, null); in testStaticOverridesMethod()
1832 buf= new StringBuffer(); in testStaticOverridesMethod()
1833 buf.append("package test1;\n"); in testStaticOverridesMethod()
1834 buf.append("import test2.C;\n"); in testStaticOverridesMethod()
1835 buf.append("public class E extends C {\n"); in testStaticOverridesMethod()
1836 buf.append(" public static void foo() {\n"); in testStaticOverridesMethod()
1837 buf.append(" }\n"); in testStaticOverridesMethod()
1838 buf.append("}\n"); in testStaticOverridesMethod()
1839 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testStaticOverridesMethod()
1849 buf= new StringBuffer(); in testStaticOverridesMethod()
1850 buf.append("package test1;\n"); in testStaticOverridesMethod()
1851 buf.append("import test2.C;\n"); in testStaticOverridesMethod()
1852 buf.append("public class E extends C {\n"); in testStaticOverridesMethod()
1853 buf.append(" public void foo() {\n"); in testStaticOverridesMethod()
1854 buf.append(" }\n"); in testStaticOverridesMethod()
1855 buf.append("}\n"); in testStaticOverridesMethod()
1856 assertEqualString(preview, buf.toString()); in testStaticOverridesMethod()
1863 StringBuffer buf= new StringBuffer(); in testOverridesMoreVisibleMethod() local
1864 buf.append("package test2;\n"); in testOverridesMoreVisibleMethod()
1865 buf.append("public class C {\n"); in testOverridesMoreVisibleMethod()
1866 buf.append(" public void foo() {\n"); in testOverridesMoreVisibleMethod()
1867 buf.append(" }\n"); in testOverridesMoreVisibleMethod()
1868 buf.append("}\n"); in testOverridesMoreVisibleMethod()
1869 pack2.createCompilationUnit("C.java", buf.toString(), false, null); in testOverridesMoreVisibleMethod()
1872 buf= new StringBuffer(); in testOverridesMoreVisibleMethod()
1873 buf.append("package test1;\n"); in testOverridesMoreVisibleMethod()
1874 buf.append("import test2.C;\n"); in testOverridesMoreVisibleMethod()
1875 buf.append("public class E extends C {\n"); in testOverridesMoreVisibleMethod()
1876 buf.append(" protected void foo() {\n"); in testOverridesMoreVisibleMethod()
1877 buf.append(" }\n"); in testOverridesMoreVisibleMethod()
1878 buf.append("}\n"); in testOverridesMoreVisibleMethod()
1879 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testOverridesMoreVisibleMethod()
1889 buf= new StringBuffer(); in testOverridesMoreVisibleMethod()
1890 buf.append("package test2;\n"); in testOverridesMoreVisibleMethod()
1891 buf.append("public class C {\n"); in testOverridesMoreVisibleMethod()
1892 buf.append(" protected void foo() {\n"); in testOverridesMoreVisibleMethod()
1893 buf.append(" }\n"); in testOverridesMoreVisibleMethod()
1894 buf.append("}\n"); in testOverridesMoreVisibleMethod()
1895 String expected1= buf.toString(); in testOverridesMoreVisibleMethod()
1900 buf= new StringBuffer(); in testOverridesMoreVisibleMethod()
1901 buf.append("package test1;\n"); in testOverridesMoreVisibleMethod()
1902 buf.append("import test2.C;\n"); in testOverridesMoreVisibleMethod()
1903 buf.append("public class E extends C {\n"); in testOverridesMoreVisibleMethod()
1904 buf.append(" public void foo() {\n"); in testOverridesMoreVisibleMethod()
1905 buf.append(" }\n"); in testOverridesMoreVisibleMethod()
1906 buf.append("}\n"); in testOverridesMoreVisibleMethod()
1907 String expected2= buf.toString(); in testOverridesMoreVisibleMethod()
1917 StringBuffer buf= new StringBuffer(); in testOverridesMoreVisibleMethodInGeneric() local
1918 buf.append("package test2;\n"); in testOverridesMoreVisibleMethodInGeneric()
1919 buf.append("public class C<T> {\n"); in testOverridesMoreVisibleMethodInGeneric()
1920 buf.append(" public <M> T foo(M m) {\n"); in testOverridesMoreVisibleMethodInGeneric()
1921 buf.append(" }\n"); in testOverridesMoreVisibleMethodInGeneric()
1922 buf.append("}\n"); in testOverridesMoreVisibleMethodInGeneric()
1923 pack2.createCompilationUnit("C.java", buf.toString(), false, null); in testOverridesMoreVisibleMethodInGeneric()
1926 buf= new StringBuffer(); in testOverridesMoreVisibleMethodInGeneric()
1927 buf.append("package test1;\n"); in testOverridesMoreVisibleMethodInGeneric()
1928 buf.append("import test2.C;\n"); in testOverridesMoreVisibleMethodInGeneric()
1929 buf.append("public class E extends C<String> {\n"); in testOverridesMoreVisibleMethodInGeneric()
1930 buf.append(" protected <M> String foo(M m) {\n"); in testOverridesMoreVisibleMethodInGeneric()
1931 buf.append(" }\n"); in testOverridesMoreVisibleMethodInGeneric()
1932 buf.append("}\n"); in testOverridesMoreVisibleMethodInGeneric()
1933 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testOverridesMoreVisibleMethodInGeneric()
1943 buf= new StringBuffer(); in testOverridesMoreVisibleMethodInGeneric()
1944 buf.append("package test2;\n"); in testOverridesMoreVisibleMethodInGeneric()
1945 buf.append("public class C<T> {\n"); in testOverridesMoreVisibleMethodInGeneric()
1946 buf.append(" protected <M> T foo(M m) {\n"); in testOverridesMoreVisibleMethodInGeneric()
1947 buf.append(" }\n"); in testOverridesMoreVisibleMethodInGeneric()
1948 buf.append("}\n"); in testOverridesMoreVisibleMethodInGeneric()
1949 String expected1= buf.toString(); in testOverridesMoreVisibleMethodInGeneric()
1954 buf= new StringBuffer(); in testOverridesMoreVisibleMethodInGeneric()
1955 buf.append("package test1;\n"); in testOverridesMoreVisibleMethodInGeneric()
1956 buf.append("import test2.C;\n"); in testOverridesMoreVisibleMethodInGeneric()
1957 buf.append("public class E extends C<String> {\n"); in testOverridesMoreVisibleMethodInGeneric()
1958 buf.append(" public <M> String foo(M m) {\n"); in testOverridesMoreVisibleMethodInGeneric()
1959 buf.append(" }\n"); in testOverridesMoreVisibleMethodInGeneric()
1960 buf.append("}\n"); in testOverridesMoreVisibleMethodInGeneric()
1961 String expected2= buf.toString(); in testOverridesMoreVisibleMethodInGeneric()
1972 StringBuffer buf= new StringBuffer(); in testInvalidInterfaceModifiers() local
1973 buf.append("package test1;\n"); in testInvalidInterfaceModifiers()
1974 buf.append("public static interface E {\n"); in testInvalidInterfaceModifiers()
1975 buf.append(" public void foo();\n"); in testInvalidInterfaceModifiers()
1976 buf.append("}\n"); in testInvalidInterfaceModifiers()
1977 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvalidInterfaceModifiers()
1987 buf= new StringBuffer(); in testInvalidInterfaceModifiers()
1988 buf.append("package test1;\n"); in testInvalidInterfaceModifiers()
1989 buf.append("public interface E {\n"); in testInvalidInterfaceModifiers()
1990 buf.append(" public void foo();\n"); in testInvalidInterfaceModifiers()
1991 buf.append("}\n"); in testInvalidInterfaceModifiers()
1992 assertEqualString(preview, buf.toString()); in testInvalidInterfaceModifiers()
1999 StringBuffer buf= new StringBuffer(); in testInvalidMemberInterfaceModifiers() local
2000 buf.append("package test1;\n"); in testInvalidMemberInterfaceModifiers()
2001 buf.append("public interface E {\n"); in testInvalidMemberInterfaceModifiers()
2002 buf.append(" private interface Inner {\n"); in testInvalidMemberInterfaceModifiers()
2003 buf.append(" }\n"); in testInvalidMemberInterfaceModifiers()
2004 buf.append("}\n"); in testInvalidMemberInterfaceModifiers()
2005 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvalidMemberInterfaceModifiers()
2015 buf= new StringBuffer(); in testInvalidMemberInterfaceModifiers()
2016 buf.append("package test1;\n"); in testInvalidMemberInterfaceModifiers()
2017 buf.append("public interface E {\n"); in testInvalidMemberInterfaceModifiers()
2018 buf.append(" interface Inner {\n"); in testInvalidMemberInterfaceModifiers()
2019 buf.append(" }\n"); in testInvalidMemberInterfaceModifiers()
2020 buf.append("}\n"); in testInvalidMemberInterfaceModifiers()
2021 assertEqualString(preview, buf.toString()); in testInvalidMemberInterfaceModifiers()
2028 StringBuffer buf= new StringBuffer(); in testInvalidInterfaceFieldModifiers() local
2029 buf.append("package test1;\n"); in testInvalidInterfaceFieldModifiers()
2030 buf.append("public interface E {\n"); in testInvalidInterfaceFieldModifiers()
2031 buf.append(" public native int i;\n"); in testInvalidInterfaceFieldModifiers()
2032 buf.append("}\n"); in testInvalidInterfaceFieldModifiers()
2033 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvalidInterfaceFieldModifiers()
2043 buf= new StringBuffer(); in testInvalidInterfaceFieldModifiers()
2044 buf.append("package test1;\n"); in testInvalidInterfaceFieldModifiers()
2045 buf.append("public interface E {\n"); in testInvalidInterfaceFieldModifiers()
2046 buf.append(" public int i;\n"); in testInvalidInterfaceFieldModifiers()
2047 buf.append("}\n"); in testInvalidInterfaceFieldModifiers()
2048 assertEqualString(preview, buf.toString()); in testInvalidInterfaceFieldModifiers()
2055 StringBuffer buf= new StringBuffer(); in testInvalidInterfaceMethodModifiers() local
2056 buf.append("package test1;\n"); in testInvalidInterfaceMethodModifiers()
2057 buf.append("public interface E {\n"); in testInvalidInterfaceMethodModifiers()
2058 buf.append(" private strictfp void foo();\n"); in testInvalidInterfaceMethodModifiers()
2059 buf.append("}\n"); in testInvalidInterfaceMethodModifiers()
2060 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvalidInterfaceMethodModifiers()
2070 buf= new StringBuffer(); in testInvalidInterfaceMethodModifiers()
2071 buf.append("package test1;\n"); in testInvalidInterfaceMethodModifiers()
2072 buf.append("public interface E {\n"); in testInvalidInterfaceMethodModifiers()
2073 buf.append(" void foo();\n"); in testInvalidInterfaceMethodModifiers()
2074 buf.append("}\n"); in testInvalidInterfaceMethodModifiers()
2075 assertEqualString(preview, buf.toString()); in testInvalidInterfaceMethodModifiers()
2082 StringBuffer buf= new StringBuffer(); in testInvalidClassModifiers() local
2083 buf.append("package test1;\n"); in testInvalidClassModifiers()
2084 buf.append("public volatile class E {\n"); in testInvalidClassModifiers()
2085 buf.append(" public void foo() {\n"); in testInvalidClassModifiers()
2086 buf.append(" }\n"); in testInvalidClassModifiers()
2087 buf.append("}\n"); in testInvalidClassModifiers()
2088 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvalidClassModifiers()
2098 buf= new StringBuffer(); in testInvalidClassModifiers()
2099 buf.append("package test1;\n"); in testInvalidClassModifiers()
2100 buf.append("public class E {\n"); in testInvalidClassModifiers()
2101 buf.append(" public void foo() {\n"); in testInvalidClassModifiers()
2102 buf.append(" }\n"); in testInvalidClassModifiers()
2103 buf.append("}\n"); in testInvalidClassModifiers()
2104 assertEqualString(preview, buf.toString()); in testInvalidClassModifiers()
2112 StringBuffer buf= new StringBuffer(); in testInvalidMemberClassModifiers() local
2113 buf.append("package test1;\n"); in testInvalidMemberClassModifiers()
2114 buf.append("public interface E {\n"); in testInvalidMemberClassModifiers()
2115 buf.append(" private class Inner {\n"); in testInvalidMemberClassModifiers()
2116 buf.append(" }\n"); in testInvalidMemberClassModifiers()
2117 buf.append("}\n"); in testInvalidMemberClassModifiers()
2118 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvalidMemberClassModifiers()
2128 buf= new StringBuffer(); in testInvalidMemberClassModifiers()
2129 buf.append("package test1;\n"); in testInvalidMemberClassModifiers()
2130 buf.append("public interface E {\n"); in testInvalidMemberClassModifiers()
2131 buf.append(" class Inner {\n"); in testInvalidMemberClassModifiers()
2132 buf.append(" }\n"); in testInvalidMemberClassModifiers()
2133 buf.append("}\n"); in testInvalidMemberClassModifiers()
2134 assertEqualString(preview, buf.toString()); in testInvalidMemberClassModifiers()
2141 StringBuffer buf= new StringBuffer(); in testInvalidLocalClassModifiers() local
2142 buf.append("package test1;\n"); in testInvalidLocalClassModifiers()
2143 buf.append("public class E {\n"); in testInvalidLocalClassModifiers()
2144 buf.append(" private void foo() {\n"); in testInvalidLocalClassModifiers()
2145 buf.append(" static class Local {\n"); in testInvalidLocalClassModifiers()
2146 buf.append(" }\n"); in testInvalidLocalClassModifiers()
2147 buf.append(" }\n"); in testInvalidLocalClassModifiers()
2148 buf.append("}\n"); in testInvalidLocalClassModifiers()
2149 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvalidLocalClassModifiers()
2159 buf= new StringBuffer(); in testInvalidLocalClassModifiers()
2160 buf.append("package test1;\n"); in testInvalidLocalClassModifiers()
2161 buf.append("public class E {\n"); in testInvalidLocalClassModifiers()
2162 buf.append(" private void foo() {\n"); in testInvalidLocalClassModifiers()
2163 buf.append(" class Local {\n"); in testInvalidLocalClassModifiers()
2164 buf.append(" }\n"); in testInvalidLocalClassModifiers()
2165 buf.append(" }\n"); in testInvalidLocalClassModifiers()
2166 buf.append("}\n"); in testInvalidLocalClassModifiers()
2167 assertEqualString(preview, buf.toString()); in testInvalidLocalClassModifiers()
2174 StringBuffer buf= new StringBuffer(); in testInvalidClassFieldModifiers() local
2175 buf.append("package test1;\n"); in testInvalidClassFieldModifiers()
2176 buf.append("public class E {\n"); in testInvalidClassFieldModifiers()
2177 buf.append(" strictfp public native int i;\n"); in testInvalidClassFieldModifiers()
2178 buf.append("}\n"); in testInvalidClassFieldModifiers()
2179 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvalidClassFieldModifiers()
2189 buf= new StringBuffer(); in testInvalidClassFieldModifiers()
2190 buf.append("package test1;\n"); in testInvalidClassFieldModifiers()
2191 buf.append("public class E {\n"); in testInvalidClassFieldModifiers()
2192 buf.append(" public int i;\n"); in testInvalidClassFieldModifiers()
2193 buf.append("}\n"); in testInvalidClassFieldModifiers()
2194 assertEqualString(preview, buf.toString()); in testInvalidClassFieldModifiers()
2201 StringBuffer buf= new StringBuffer(); in testInvalidClassMethodModifiers() local
2202 buf.append("package test1;\n"); in testInvalidClassMethodModifiers()
2203 buf.append("public abstract class E {\n"); in testInvalidClassMethodModifiers()
2204 buf.append(" volatile abstract void foo();\n"); in testInvalidClassMethodModifiers()
2205 buf.append("}\n"); in testInvalidClassMethodModifiers()
2206 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvalidClassMethodModifiers()
2216 buf= new StringBuffer(); in testInvalidClassMethodModifiers()
2217 buf.append("package test1;\n"); in testInvalidClassMethodModifiers()
2218 buf.append("public abstract class E {\n"); in testInvalidClassMethodModifiers()
2219 buf.append(" abstract void foo();\n"); in testInvalidClassMethodModifiers()
2220 buf.append("}\n"); in testInvalidClassMethodModifiers()
2221 assertEqualString(preview, buf.toString()); in testInvalidClassMethodModifiers()
2227 StringBuffer buf= new StringBuffer(); in testInvalidConstructorModifiers() local
2228 buf.append("package pack;\n"); in testInvalidConstructorModifiers()
2229 buf.append("\n"); in testInvalidConstructorModifiers()
2230 buf.append("public class Bug {\n"); in testInvalidConstructorModifiers()
2231 buf.append(" public static Bug() {\n"); in testInvalidConstructorModifiers()
2232 buf.append(" }\n"); in testInvalidConstructorModifiers()
2233 buf.append("}\n"); in testInvalidConstructorModifiers()
2234 ICompilationUnit cu= pack1.createCompilationUnit("Bug.java", buf.toString(), false, null); in testInvalidConstructorModifiers()
2243 buf= new StringBuffer(); in testInvalidConstructorModifiers()
2244 buf.append("package pack;\n"); in testInvalidConstructorModifiers()
2245 buf.append("\n"); in testInvalidConstructorModifiers()
2246 buf.append("public class Bug {\n"); in testInvalidConstructorModifiers()
2247 buf.append(" public Bug() {\n"); in testInvalidConstructorModifiers()
2248 buf.append(" }\n"); in testInvalidConstructorModifiers()
2249 buf.append("}\n"); in testInvalidConstructorModifiers()
2250 expected[0]= buf.toString(); in testInvalidConstructorModifiers()
2260 StringBuffer buf= new StringBuffer(); in testInvalidParamModifiers() local
2261 buf.append("package test1;\n"); in testInvalidParamModifiers()
2262 buf.append("public class E {\n"); in testInvalidParamModifiers()
2263 buf.append(" private void foo(private int x) {\n"); in testInvalidParamModifiers()
2264 buf.append(" }\n"); in testInvalidParamModifiers()
2265 buf.append("}\n"); in testInvalidParamModifiers()
2266 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvalidParamModifiers()
2276 buf= new StringBuffer(); in testInvalidParamModifiers()
2277 buf.append("package test1;\n"); in testInvalidParamModifiers()
2278 buf.append("public class E {\n"); in testInvalidParamModifiers()
2279 buf.append(" private void foo(int x) {\n"); in testInvalidParamModifiers()
2280 buf.append(" }\n"); in testInvalidParamModifiers()
2281 buf.append("}\n"); in testInvalidParamModifiers()
2282 assertEqualString(preview, buf.toString()); in testInvalidParamModifiers()
2289 StringBuffer buf= new StringBuffer(); in testInvalidVariableModifiers() local
2290 buf.append("package test1;\n"); in testInvalidVariableModifiers()
2291 buf.append("public class E {\n"); in testInvalidVariableModifiers()
2292 buf.append(" private void foo() {\n"); in testInvalidVariableModifiers()
2293 buf.append(" native int x;\n"); in testInvalidVariableModifiers()
2294 buf.append(" }\n"); in testInvalidVariableModifiers()
2295 buf.append("}\n"); in testInvalidVariableModifiers()
2296 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvalidVariableModifiers()
2306 buf= new StringBuffer(); in testInvalidVariableModifiers()
2307 buf.append("package test1;\n"); in testInvalidVariableModifiers()
2308 buf.append("public class E {\n"); in testInvalidVariableModifiers()
2309 buf.append(" private void foo() {\n"); in testInvalidVariableModifiers()
2310 buf.append(" int x;\n"); in testInvalidVariableModifiers()
2311 buf.append(" }\n"); in testInvalidVariableModifiers()
2312 buf.append("}\n"); in testInvalidVariableModifiers()
2313 assertEqualString(preview, buf.toString()); in testInvalidVariableModifiers()
2320 StringBuffer buf= new StringBuffer(); in testInvalidMultiVariableModifiers() local
2321 buf.append("package test1;\n"); in testInvalidMultiVariableModifiers()
2322 buf.append("public class E {\n"); in testInvalidMultiVariableModifiers()
2323 buf.append(" public E() {\n"); in testInvalidMultiVariableModifiers()
2324 buf.append(" @Deprecated final @SuppressWarnings(\"all\") int a, b, c;\n"); in testInvalidMultiVariableModifiers()
2325 buf.append(" a = 0; b = 0; c = 12;\n"); in testInvalidMultiVariableModifiers()
2326 buf.append(" b = 5;\n"); in testInvalidMultiVariableModifiers()
2327 buf.append(" }\n"); in testInvalidMultiVariableModifiers()
2328 buf.append("}\n"); in testInvalidMultiVariableModifiers()
2329 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvalidMultiVariableModifiers()
2339 buf= new StringBuffer(); in testInvalidMultiVariableModifiers()
2340 buf.append("package test1;\n"); in testInvalidMultiVariableModifiers()
2341 buf.append("public class E {\n"); in testInvalidMultiVariableModifiers()
2342 buf.append(" public E() {\n"); in testInvalidMultiVariableModifiers()
2343 buf.append(" @Deprecated final @SuppressWarnings(\"all\") int a;\n"); in testInvalidMultiVariableModifiers()
2344 buf.append(" @Deprecated @SuppressWarnings(\"all\") int b;\n"); in testInvalidMultiVariableModifiers()
2345 buf.append(" @Deprecated final @SuppressWarnings(\"all\") int c;\n"); in testInvalidMultiVariableModifiers()
2346 buf.append(" a = 0; b = 0; c = 12;\n"); in testInvalidMultiVariableModifiers()
2347 buf.append(" b = 5;\n"); in testInvalidMultiVariableModifiers()
2348 buf.append(" }\n"); in testInvalidMultiVariableModifiers()
2349 buf.append("}\n"); in testInvalidMultiVariableModifiers()
2350 assertEqualString(preview, buf.toString()); in testInvalidMultiVariableModifiers()
2357 StringBuffer buf= new StringBuffer(); in testInvalidMultiFieldModifiers() local
2358 buf.append("package test1;\n"); in testInvalidMultiFieldModifiers()
2359 buf.append("public class E {\n"); in testInvalidMultiFieldModifiers()
2360 buf.append(" private final int a, b;\n"); in testInvalidMultiFieldModifiers()
2361 buf.append(" public E() {\n"); in testInvalidMultiFieldModifiers()
2362 buf.append(" a = 0; b = 0;\n"); in testInvalidMultiFieldModifiers()
2363 buf.append(" a = 5;\n"); in testInvalidMultiFieldModifiers()
2364 buf.append(" }\n"); in testInvalidMultiFieldModifiers()
2365 buf.append("}\n"); in testInvalidMultiFieldModifiers()
2366 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvalidMultiFieldModifiers()
2376 buf= new StringBuffer(); in testInvalidMultiFieldModifiers()
2377 buf.append("package test1;\n"); in testInvalidMultiFieldModifiers()
2378 buf.append("public class E {\n"); in testInvalidMultiFieldModifiers()
2379 buf.append(" private int a;\n"); in testInvalidMultiFieldModifiers()
2380 buf.append(" private final int b;\n"); in testInvalidMultiFieldModifiers()
2381 buf.append(" public E() {\n"); in testInvalidMultiFieldModifiers()
2382 buf.append(" a = 0; b = 0;\n"); in testInvalidMultiFieldModifiers()
2383 buf.append(" a = 5;\n"); in testInvalidMultiFieldModifiers()
2384 buf.append(" }\n"); in testInvalidMultiFieldModifiers()
2385 buf.append("}\n"); in testInvalidMultiFieldModifiers()
2386 assertEqualString(preview, buf.toString()); in testInvalidMultiFieldModifiers()
2393 StringBuffer buf= new StringBuffer(); in testInvalidMultiFieldModifiers2() local
2394 buf.append("package test1;\n"); in testInvalidMultiFieldModifiers2()
2395 buf.append("public class E {\n"); in testInvalidMultiFieldModifiers2()
2396 buf.append(" private final int b, a;\n"); in testInvalidMultiFieldModifiers2()
2397 buf.append(" public E() {\n"); in testInvalidMultiFieldModifiers2()
2398 buf.append(" a = 0; b = 0;\n"); in testInvalidMultiFieldModifiers2()
2399 buf.append(" a = 5;\n"); in testInvalidMultiFieldModifiers2()
2400 buf.append(" }\n"); in testInvalidMultiFieldModifiers2()
2401 buf.append("}\n"); in testInvalidMultiFieldModifiers2()
2402 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvalidMultiFieldModifiers2()
2412 buf= new StringBuffer(); in testInvalidMultiFieldModifiers2()
2413 buf.append("package test1;\n"); in testInvalidMultiFieldModifiers2()
2414 buf.append("public class E {\n"); in testInvalidMultiFieldModifiers2()
2415 buf.append(" private final int b;\n"); in testInvalidMultiFieldModifiers2()
2416 buf.append(" private int a;\n"); in testInvalidMultiFieldModifiers2()
2417 buf.append(" public E() {\n"); in testInvalidMultiFieldModifiers2()
2418 buf.append(" a = 0; b = 0;\n"); in testInvalidMultiFieldModifiers2()
2419 buf.append(" a = 5;\n"); in testInvalidMultiFieldModifiers2()
2420 buf.append(" }\n"); in testInvalidMultiFieldModifiers2()
2421 buf.append("}\n"); in testInvalidMultiFieldModifiers2()
2422 assertEqualString(preview, buf.toString()); in testInvalidMultiFieldModifiers2()
2429 StringBuffer buf= new StringBuffer(); in testExtendsFinalClass() local
2430 buf.append("package test1;\n"); in testExtendsFinalClass()
2431 buf.append("public final class C {\n"); in testExtendsFinalClass()
2432 buf.append(" protected void foo() {\n"); in testExtendsFinalClass()
2433 buf.append(" }\n"); in testExtendsFinalClass()
2434 buf.append("}\n"); in testExtendsFinalClass()
2435 pack1.createCompilationUnit("C.java", buf.toString(), false, null); in testExtendsFinalClass()
2437 buf= new StringBuffer(); in testExtendsFinalClass()
2438 buf.append("package test1;\n"); in testExtendsFinalClass()
2439 buf.append("public class E extends C {\n"); in testExtendsFinalClass()
2440 buf.append(" protected void foo() {\n"); in testExtendsFinalClass()
2441 buf.append(" }\n"); in testExtendsFinalClass()
2442 buf.append("}\n"); in testExtendsFinalClass()
2443 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testExtendsFinalClass()
2453 buf= new StringBuffer(); in testExtendsFinalClass()
2454 buf.append("package test1;\n"); in testExtendsFinalClass()
2455 buf.append("public class C {\n"); in testExtendsFinalClass()
2456 buf.append(" protected void foo() {\n"); in testExtendsFinalClass()
2457 buf.append(" }\n"); in testExtendsFinalClass()
2458 buf.append("}\n"); in testExtendsFinalClass()
2459 assertEqualString(preview, buf.toString()); in testExtendsFinalClass()
2466 StringBuffer buf= new StringBuffer(); in testExtendsFinalClass2() local
2467 buf.append("package test1;\n"); in testExtendsFinalClass2()
2468 buf.append("public final class C {\n"); in testExtendsFinalClass2()
2469 buf.append(" protected void foo() {\n"); in testExtendsFinalClass2()
2470 buf.append(" }\n"); in testExtendsFinalClass2()
2471 buf.append("}\n"); in testExtendsFinalClass2()
2472 pack1.createCompilationUnit("C.java", buf.toString(), false, null); in testExtendsFinalClass2()
2474 buf= new StringBuffer(); in testExtendsFinalClass2()
2475 buf.append("package test1;\n"); in testExtendsFinalClass2()
2476 buf.append("public class E {\n"); in testExtendsFinalClass2()
2477 buf.append(" protected void foo() {\n"); in testExtendsFinalClass2()
2478 buf.append(" C c= new C() { };\n"); in testExtendsFinalClass2()
2479 buf.append(" }\n"); in testExtendsFinalClass2()
2480 buf.append("}\n"); in testExtendsFinalClass2()
2481 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testExtendsFinalClass2()
2491 buf= new StringBuffer(); in testExtendsFinalClass2()
2492 buf.append("package test1;\n"); in testExtendsFinalClass2()
2493 buf.append("public class C {\n"); in testExtendsFinalClass2()
2494 buf.append(" protected void foo() {\n"); in testExtendsFinalClass2()
2495 buf.append(" }\n"); in testExtendsFinalClass2()
2496 buf.append("}\n"); in testExtendsFinalClass2()
2497 assertEqualString(preview, buf.toString()); in testExtendsFinalClass2()
2509 StringBuffer buf= new StringBuffer(); in testMissingOverrideAnnotation() local
2510 buf.append("package test1;\n"); in testMissingOverrideAnnotation()
2511 buf.append("public final class C {\n"); in testMissingOverrideAnnotation()
2512 buf.append(" public String toString() {\n"); in testMissingOverrideAnnotation()
2513 buf.append(" return null;\n"); in testMissingOverrideAnnotation()
2514 buf.append(" }\n"); in testMissingOverrideAnnotation()
2515 buf.append("}\n"); in testMissingOverrideAnnotation()
2516 ICompilationUnit cu= pack1.createCompilationUnit("C.java", buf.toString(), false, null); in testMissingOverrideAnnotation()
2526 buf= new StringBuffer(); in testMissingOverrideAnnotation()
2527 buf.append("package test1;\n"); in testMissingOverrideAnnotation()
2528 buf.append("public final class C {\n"); in testMissingOverrideAnnotation()
2529 buf.append(" @Override\n"); in testMissingOverrideAnnotation()
2530 buf.append(" public String toString() {\n"); in testMissingOverrideAnnotation()
2531 buf.append(" return null;\n"); in testMissingOverrideAnnotation()
2532 buf.append(" }\n"); in testMissingOverrideAnnotation()
2533 buf.append("}\n"); in testMissingOverrideAnnotation()
2534 assertEqualString(preview, buf.toString()); in testMissingOverrideAnnotation()
2545 StringBuffer buf= new StringBuffer(); in testMissingTypeDeprecationAnnotation() local
2546 buf.append("package test1;\n"); in testMissingTypeDeprecationAnnotation()
2547 buf.append("/**\n"); in testMissingTypeDeprecationAnnotation()
2548 buf.append(" * @deprecated\n"); in testMissingTypeDeprecationAnnotation()
2549 buf.append(" */\n"); in testMissingTypeDeprecationAnnotation()
2550 buf.append("public final class C {\n"); in testMissingTypeDeprecationAnnotation()
2551 buf.append("}\n"); in testMissingTypeDeprecationAnnotation()
2552 ICompilationUnit cu= pack1.createCompilationUnit("C.java", buf.toString(), false, null); in testMissingTypeDeprecationAnnotation()
2562 buf= new StringBuffer(); in testMissingTypeDeprecationAnnotation()
2563 buf.append("package test1;\n"); in testMissingTypeDeprecationAnnotation()
2564 buf.append("/**\n"); in testMissingTypeDeprecationAnnotation()
2565 buf.append(" * @deprecated\n"); in testMissingTypeDeprecationAnnotation()
2566 buf.append(" */\n"); in testMissingTypeDeprecationAnnotation()
2567 buf.append("@Deprecated\n"); in testMissingTypeDeprecationAnnotation()
2568 buf.append("public final class C {\n"); in testMissingTypeDeprecationAnnotation()
2569 buf.append("}\n"); in testMissingTypeDeprecationAnnotation()
2570 assertEqualString(preview, buf.toString()); in testMissingTypeDeprecationAnnotation()
2581 StringBuffer buf= new StringBuffer(); in testMissingMethodDeprecationAnnotation() local
2582 buf.append("package test1;\n"); in testMissingMethodDeprecationAnnotation()
2583 buf.append("public final class C {\n"); in testMissingMethodDeprecationAnnotation()
2584 buf.append(" /**\n"); in testMissingMethodDeprecationAnnotation()
2585 buf.append(" * @deprecated\n"); in testMissingMethodDeprecationAnnotation()
2586 buf.append(" */\n"); in testMissingMethodDeprecationAnnotation()
2587 buf.append(" @Override\n"); in testMissingMethodDeprecationAnnotation()
2588 buf.append(" public String toString() {\n"); in testMissingMethodDeprecationAnnotation()
2589 buf.append(" return null;\n"); in testMissingMethodDeprecationAnnotation()
2590 buf.append(" }\n"); in testMissingMethodDeprecationAnnotation()
2591 buf.append("}\n"); in testMissingMethodDeprecationAnnotation()
2592 ICompilationUnit cu= pack1.createCompilationUnit("C.java", buf.toString(), false, null); in testMissingMethodDeprecationAnnotation()
2602 buf= new StringBuffer(); in testMissingMethodDeprecationAnnotation()
2603 buf.append("package test1;\n"); in testMissingMethodDeprecationAnnotation()
2604 buf.append("public final class C {\n"); in testMissingMethodDeprecationAnnotation()
2605 buf.append(" /**\n"); in testMissingMethodDeprecationAnnotation()
2606 buf.append(" * @deprecated\n"); in testMissingMethodDeprecationAnnotation()
2607 buf.append(" */\n"); in testMissingMethodDeprecationAnnotation()
2608 buf.append(" @Deprecated\n"); in testMissingMethodDeprecationAnnotation()
2609 buf.append(" @Override\n"); in testMissingMethodDeprecationAnnotation()
2610 buf.append(" public String toString() {\n"); in testMissingMethodDeprecationAnnotation()
2611 buf.append(" return null;\n"); in testMissingMethodDeprecationAnnotation()
2612 buf.append(" }\n"); in testMissingMethodDeprecationAnnotation()
2613 buf.append("}\n"); in testMissingMethodDeprecationAnnotation()
2614 assertEqualString(preview, buf.toString()); in testMissingMethodDeprecationAnnotation()
2626 StringBuffer buf= new StringBuffer(); in testMissingFieldDeprecationAnnotation() local
2627 buf.append("package test1;\n"); in testMissingFieldDeprecationAnnotation()
2628 buf.append("public final class C {\n"); in testMissingFieldDeprecationAnnotation()
2629 buf.append(" /**\n"); in testMissingFieldDeprecationAnnotation()
2630 buf.append(" * @deprecated\n"); in testMissingFieldDeprecationAnnotation()
2631 buf.append(" */\n"); in testMissingFieldDeprecationAnnotation()
2632 buf.append(" public String name;\n"); in testMissingFieldDeprecationAnnotation()
2633 buf.append("}\n"); in testMissingFieldDeprecationAnnotation()
2634 ICompilationUnit cu= pack1.createCompilationUnit("C.java", buf.toString(), false, null); in testMissingFieldDeprecationAnnotation()
2644 buf= new StringBuffer(); in testMissingFieldDeprecationAnnotation()
2645 buf.append("package test1;\n"); in testMissingFieldDeprecationAnnotation()
2646 buf.append("public final class C {\n"); in testMissingFieldDeprecationAnnotation()
2647 buf.append(" /**\n"); in testMissingFieldDeprecationAnnotation()
2648 buf.append(" * @deprecated\n"); in testMissingFieldDeprecationAnnotation()
2649 buf.append(" */\n"); in testMissingFieldDeprecationAnnotation()
2650 buf.append(" @Deprecated\n"); in testMissingFieldDeprecationAnnotation()
2651 buf.append(" public String name;\n"); in testMissingFieldDeprecationAnnotation()
2652 buf.append("}\n"); in testMissingFieldDeprecationAnnotation()
2653 assertEqualString(preview, buf.toString()); in testMissingFieldDeprecationAnnotation()
2664 StringBuffer buf= new StringBuffer(); in testSuppressNLSWarningAnnotation1() local
2665 buf.append("package test1;\n"); in testSuppressNLSWarningAnnotation1()
2666 buf.append("public class E {\n"); in testSuppressNLSWarningAnnotation1()
2667 buf.append(" static {\n"); in testSuppressNLSWarningAnnotation1()
2668 buf.append(" @SuppressWarnings(\"unused\") String str= \"foo\";"); in testSuppressNLSWarningAnnotation1()
2669 buf.append(" }\n"); in testSuppressNLSWarningAnnotation1()
2670 buf.append("}\n"); in testSuppressNLSWarningAnnotation1()
2671 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testSuppressNLSWarningAnnotation1()
2679 buf= new StringBuffer(); in testSuppressNLSWarningAnnotation1()
2680 buf.append("package test1;\n"); in testSuppressNLSWarningAnnotation1()
2681 buf.append("public class E {\n"); in testSuppressNLSWarningAnnotation1()
2682 buf.append(" static {\n"); in testSuppressNLSWarningAnnotation1()
2683 buf.append(" @SuppressWarnings({\"unused\", \"nls\"}) String str= \"foo\";"); in testSuppressNLSWarningAnnotation1()
2684 buf.append(" }\n"); in testSuppressNLSWarningAnnotation1()
2685 buf.append("}\n"); in testSuppressNLSWarningAnnotation1()
2686 expected[0]= buf.toString(); in testSuppressNLSWarningAnnotation1()
2688 buf= new StringBuffer(); in testSuppressNLSWarningAnnotation1()
2689 buf.append("package test1;\n"); in testSuppressNLSWarningAnnotation1()
2690 buf.append("@SuppressWarnings(\"nls\")\n"); in testSuppressNLSWarningAnnotation1()
2691 buf.append("public class E {\n"); in testSuppressNLSWarningAnnotation1()
2692 buf.append(" static {\n"); in testSuppressNLSWarningAnnotation1()
2693 buf.append(" @SuppressWarnings(\"unused\") String str= \"foo\";"); in testSuppressNLSWarningAnnotation1()
2694 buf.append(" }\n"); in testSuppressNLSWarningAnnotation1()
2695 buf.append("}\n"); in testSuppressNLSWarningAnnotation1()
2696 expected[1]= buf.toString(); in testSuppressNLSWarningAnnotation1()
2708 StringBuffer buf= new StringBuffer(); in testSuppressNLSWarningAnnotation2() local
2709 buf.append("package test1; \n"); in testSuppressNLSWarningAnnotation2()
2710 buf.append("public class E {\n"); in testSuppressNLSWarningAnnotation2()
2711 buf.append(" private class Q {\n"); in testSuppressNLSWarningAnnotation2()
2712 buf.append(" String s = \"\";\n"); in testSuppressNLSWarningAnnotation2()
2713 buf.append(" }\n"); in testSuppressNLSWarningAnnotation2()
2714 buf.append("}\n"); in testSuppressNLSWarningAnnotation2()
2715 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testSuppressNLSWarningAnnotation2()
2723 buf= new StringBuffer(); in testSuppressNLSWarningAnnotation2()
2724 buf.append("package test1; \n"); in testSuppressNLSWarningAnnotation2()
2725 buf.append("public class E {\n"); in testSuppressNLSWarningAnnotation2()
2726 buf.append(" private class Q {\n"); in testSuppressNLSWarningAnnotation2()
2727 buf.append(" @SuppressWarnings(\"nls\")\n"); in testSuppressNLSWarningAnnotation2()
2728 buf.append(" String s = \"\";\n"); in testSuppressNLSWarningAnnotation2()
2729 buf.append(" }\n"); in testSuppressNLSWarningAnnotation2()
2730 buf.append("}\n"); in testSuppressNLSWarningAnnotation2()
2731 assertExpectedExistInProposals(proposals, new String[] {buf.toString()}); in testSuppressNLSWarningAnnotation2()
2742 StringBuffer buf= new StringBuffer(); in testSuppressNLSWarningAnnotation3() local
2743 buf.append("package test1; \n"); in testSuppressNLSWarningAnnotation3()
2744 buf.append("public class E {\n"); in testSuppressNLSWarningAnnotation3()
2745 buf.append(" String s = \"\";\n"); in testSuppressNLSWarningAnnotation3()
2746 buf.append("}\n"); in testSuppressNLSWarningAnnotation3()
2747 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testSuppressNLSWarningAnnotation3()
2755 buf= new StringBuffer(); in testSuppressNLSWarningAnnotation3()
2756 buf.append("package test1; \n"); in testSuppressNLSWarningAnnotation3()
2757 buf.append("public class E {\n"); in testSuppressNLSWarningAnnotation3()
2758 buf.append(" @SuppressWarnings(\"nls\")\n"); in testSuppressNLSWarningAnnotation3()
2759 buf.append(" String s = \"\";\n"); in testSuppressNLSWarningAnnotation3()
2760 buf.append("}\n"); in testSuppressNLSWarningAnnotation3()
2761 assertExpectedExistInProposals(proposals, new String[] {buf.toString()}); in testSuppressNLSWarningAnnotation3()
2772 StringBuffer buf= new StringBuffer(); in testSuppressNLSWarningAnnotation4() local
2773 buf.append("package test1; \n"); in testSuppressNLSWarningAnnotation4()
2774 buf.append("public class E {\n"); in testSuppressNLSWarningAnnotation4()
2775 buf.append(" public void foo() {\n"); in testSuppressNLSWarningAnnotation4()
2776 buf.append(" @SuppressWarnings(\"unused\") String s = \"\";\n"); in testSuppressNLSWarningAnnotation4()
2777 buf.append(" }\n"); in testSuppressNLSWarningAnnotation4()
2778 buf.append("}\n"); in testSuppressNLSWarningAnnotation4()
2779 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testSuppressNLSWarningAnnotation4()
2787 buf= new StringBuffer(); in testSuppressNLSWarningAnnotation4()
2788 buf.append("package test1; \n"); in testSuppressNLSWarningAnnotation4()
2789 buf.append("public class E {\n"); in testSuppressNLSWarningAnnotation4()
2790 buf.append(" public void foo() {\n"); in testSuppressNLSWarningAnnotation4()
2791 buf.append(" @SuppressWarnings({\"unused\", \"nls\"}) String s = \"\";\n"); in testSuppressNLSWarningAnnotation4()
2792 buf.append(" }\n"); in testSuppressNLSWarningAnnotation4()
2793 buf.append("}\n"); in testSuppressNLSWarningAnnotation4()
2794 expected[0]= buf.toString(); in testSuppressNLSWarningAnnotation4()
2796 buf= new StringBuffer(); in testSuppressNLSWarningAnnotation4()
2797 buf.append("package test1; \n"); in testSuppressNLSWarningAnnotation4()
2798 buf.append("public class E {\n"); in testSuppressNLSWarningAnnotation4()
2799 buf.append(" @SuppressWarnings(\"nls\")\n"); in testSuppressNLSWarningAnnotation4()
2800 buf.append(" public void foo() {\n"); in testSuppressNLSWarningAnnotation4()
2801 buf.append(" @SuppressWarnings(\"unused\") String s = \"\";\n"); in testSuppressNLSWarningAnnotation4()
2802 buf.append(" }\n"); in testSuppressNLSWarningAnnotation4()
2803 buf.append("}\n"); in testSuppressNLSWarningAnnotation4()
2804 expected[1]= buf.toString(); in testSuppressNLSWarningAnnotation4()
2817 StringBuffer buf= new StringBuffer(); in testSuppressNLSWarningAnnotation5() local
2818 buf.append("package test1; \n"); in testSuppressNLSWarningAnnotation5()
2819 buf.append("import java.util.ArrayList;\n"); in testSuppressNLSWarningAnnotation5()
2820 buf.append("\n"); in testSuppressNLSWarningAnnotation5()
2821 buf.append("public class A {\n"); in testSuppressNLSWarningAnnotation5()
2822 buf.append(" public void foo(ArrayList<String> c) {\n"); in testSuppressNLSWarningAnnotation5()
2823 buf.append(" new ArrayList(c);\n"); // two warnings on this -> only one proposal! in testSuppressNLSWarningAnnotation5()
2824 buf.append(" }\n"); in testSuppressNLSWarningAnnotation5()
2825 buf.append("}\n"); in testSuppressNLSWarningAnnotation5()
2826 ICompilationUnit cu= pack1.createCompilationUnit("A.java", buf.toString(), false, null); in testSuppressNLSWarningAnnotation5()
2835 buf= new StringBuffer(); in testSuppressNLSWarningAnnotation5()
2836 buf.append("package test1; \n"); in testSuppressNLSWarningAnnotation5()
2837 buf.append("import java.util.ArrayList;\n"); in testSuppressNLSWarningAnnotation5()
2838 buf.append("\n"); in testSuppressNLSWarningAnnotation5()
2839 buf.append("public class A {\n"); in testSuppressNLSWarningAnnotation5()
2840 buf.append(" @SuppressWarnings(\"unchecked\")\n"); in testSuppressNLSWarningAnnotation5()
2841 buf.append(" public void foo(ArrayList<String> c) {\n"); in testSuppressNLSWarningAnnotation5()
2842 buf.append(" new ArrayList(c);\n"); in testSuppressNLSWarningAnnotation5()
2843 buf.append(" }\n"); in testSuppressNLSWarningAnnotation5()
2844 buf.append("}\n"); in testSuppressNLSWarningAnnotation5()
2845 expected[0]= buf.toString(); in testSuppressNLSWarningAnnotation5()
2858 StringBuffer buf= new StringBuffer(); in testSuppressWarningsForLocalVariables() local
2859 buf.append("package test1; \n"); in testSuppressWarningsForLocalVariables()
2860 buf.append("import java.util.ArrayList;\n"); in testSuppressWarningsForLocalVariables()
2861 buf.append("\n"); in testSuppressWarningsForLocalVariables()
2862 buf.append("public class A {\n"); in testSuppressWarningsForLocalVariables()
2863 buf.append(" public void foo() {\n"); in testSuppressWarningsForLocalVariables()
2864 buf.append(" @SuppressWarnings(\"unused\")\n"); in testSuppressWarningsForLocalVariables()
2865 buf.append(" ArrayList localVar= new ArrayList();"); in testSuppressWarningsForLocalVariables()
2866 buf.append(" }\n"); in testSuppressWarningsForLocalVariables()
2867 buf.append("}\n"); in testSuppressWarningsForLocalVariables()
2868 ICompilationUnit cu= pack1.createCompilationUnit("A.java", buf.toString(), false, null); in testSuppressWarningsForLocalVariables()
2876 buf= new StringBuffer(); in testSuppressWarningsForLocalVariables()
2877 buf.append("package test1; \n"); in testSuppressWarningsForLocalVariables()
2878 buf.append("import java.util.ArrayList;\n"); in testSuppressWarningsForLocalVariables()
2879 buf.append("\n"); in testSuppressWarningsForLocalVariables()
2880 buf.append("public class A {\n"); in testSuppressWarningsForLocalVariables()
2881 buf.append(" public void foo() {\n"); in testSuppressWarningsForLocalVariables()
2882 buf.append(" @SuppressWarnings({\"unused\", \"rawtypes\"})\n"); in testSuppressWarningsForLocalVariables()
2883 buf.append(" ArrayList localVar= new ArrayList();"); in testSuppressWarningsForLocalVariables()
2884 buf.append(" }\n"); in testSuppressWarningsForLocalVariables()
2885 buf.append("}\n"); in testSuppressWarningsForLocalVariables()
2886 expected[0]= buf.toString(); in testSuppressWarningsForLocalVariables()
2888 buf= new StringBuffer(); in testSuppressWarningsForLocalVariables()
2889 buf.append("package test1; \n"); in testSuppressWarningsForLocalVariables()
2890 buf.append("import java.util.ArrayList;\n"); in testSuppressWarningsForLocalVariables()
2891 buf.append("\n"); in testSuppressWarningsForLocalVariables()
2892 buf.append("public class A {\n"); in testSuppressWarningsForLocalVariables()
2893 buf.append(" @SuppressWarnings(\"rawtypes\")\n"); in testSuppressWarningsForLocalVariables()
2894 buf.append(" public void foo() {\n"); in testSuppressWarningsForLocalVariables()
2895 buf.append(" @SuppressWarnings(\"unused\")\n"); in testSuppressWarningsForLocalVariables()
2896 buf.append(" ArrayList localVar= new ArrayList();"); in testSuppressWarningsForLocalVariables()
2897 buf.append(" }\n"); in testSuppressWarningsForLocalVariables()
2898 buf.append("}\n"); in testSuppressWarningsForLocalVariables()
2899 expected[1]= buf.toString(); in testSuppressWarningsForLocalVariables()
2911 StringBuffer buf= new StringBuffer(); in testSuppressWarningsForFieldVariables() local
2912 buf.append("package test1; \n"); in testSuppressWarningsForFieldVariables()
2913 buf.append("import java.util.*;\n"); in testSuppressWarningsForFieldVariables()
2914 buf.append("\n"); in testSuppressWarningsForFieldVariables()
2915 buf.append("public class A {\n"); in testSuppressWarningsForFieldVariables()
2916 buf.append(" List<String> myList = new ArrayList();\n"); in testSuppressWarningsForFieldVariables()
2917 buf.append("}\n"); in testSuppressWarningsForFieldVariables()
2918 ICompilationUnit cu= pack1.createCompilationUnit("A.java", buf.toString(), false, null); in testSuppressWarningsForFieldVariables()
2927 buf= new StringBuffer(); in testSuppressWarningsForFieldVariables()
2928 buf.append("package test1; \n"); in testSuppressWarningsForFieldVariables()
2929 buf.append("import java.util.*;\n"); in testSuppressWarningsForFieldVariables()
2930 buf.append("\n"); in testSuppressWarningsForFieldVariables()
2931 buf.append("public class A {\n"); in testSuppressWarningsForFieldVariables()
2932 buf.append(" @SuppressWarnings(\"unchecked\")\n"); in testSuppressWarningsForFieldVariables()
2933 buf.append(" List<String> myList = new ArrayList();\n"); in testSuppressWarningsForFieldVariables()
2934 buf.append("}\n"); in testSuppressWarningsForFieldVariables()
2935 expected[0]= buf.toString(); in testSuppressWarningsForFieldVariables()
2948 StringBuffer buf= new StringBuffer(); in testSuppressWarningsForFieldVariables2() local
2949 buf.append("package test1; \n"); in testSuppressWarningsForFieldVariables2()
2950 buf.append("import java.util.ArrayList;\n"); in testSuppressWarningsForFieldVariables2()
2951 buf.append("\n"); in testSuppressWarningsForFieldVariables2()
2952 buf.append("class A {\n"); in testSuppressWarningsForFieldVariables2()
2953 buf.append(" @SuppressWarnings(\"rawtypes\")\n"); in testSuppressWarningsForFieldVariables2()
2954 buf.append(" ArrayList array;\n"); in testSuppressWarningsForFieldVariables2()
2955 buf.append(" boolean a= array.add(1), b= array.add(1);\n"); in testSuppressWarningsForFieldVariables2()
2956 buf.append("}\n"); in testSuppressWarningsForFieldVariables2()
2957 ICompilationUnit cu= pack1.createCompilationUnit("A.java", buf.toString(), false, null); in testSuppressWarningsForFieldVariables2()
2966 buf= new StringBuffer(); in testSuppressWarningsForFieldVariables2()
2967 buf.append("package test1; \n"); in testSuppressWarningsForFieldVariables2()
2968 buf.append("import java.util.ArrayList;\n"); in testSuppressWarningsForFieldVariables2()
2969 buf.append("\n"); in testSuppressWarningsForFieldVariables2()
2970 buf.append("class A {\n"); in testSuppressWarningsForFieldVariables2()
2971 buf.append(" @SuppressWarnings(\"rawtypes\")\n"); in testSuppressWarningsForFieldVariables2()
2972 buf.append(" ArrayList array;\n"); in testSuppressWarningsForFieldVariables2()
2973 buf.append(" @SuppressWarnings(\"unchecked\")\n"); in testSuppressWarningsForFieldVariables2()
2974 buf.append(" boolean a= array.add(1), b= array.add(1);\n"); in testSuppressWarningsForFieldVariables2()
2975 buf.append("}\n"); in testSuppressWarningsForFieldVariables2()
2976 expected[0]= buf.toString(); in testSuppressWarningsForFieldVariables2()
2989 StringBuffer buf= new StringBuffer(); in testSuppressWarningsForMethodParameters() local
2990 buf.append("package test1; \n"); in testSuppressWarningsForMethodParameters()
2991 buf.append("import java.util.*;\n"); in testSuppressWarningsForMethodParameters()
2992 buf.append("\n"); in testSuppressWarningsForMethodParameters()
2993 buf.append("public class A {\n"); in testSuppressWarningsForMethodParameters()
2994 buf.append(" public int foo(int param1, List param2) {\n"); in testSuppressWarningsForMethodParameters()
2995 buf.append(" return param1;\n"); in testSuppressWarningsForMethodParameters()
2996 buf.append(" }\n"); in testSuppressWarningsForMethodParameters()
2997 buf.append("}\n"); in testSuppressWarningsForMethodParameters()
2998 ICompilationUnit cu= pack1.createCompilationUnit("A.java", buf.toString(), false, null); in testSuppressWarningsForMethodParameters()
3006 buf= new StringBuffer(); in testSuppressWarningsForMethodParameters()
3007 buf.append("package test1; \n"); in testSuppressWarningsForMethodParameters()
3008 buf.append("import java.util.*;\n"); in testSuppressWarningsForMethodParameters()
3009 buf.append("\n"); in testSuppressWarningsForMethodParameters()
3010 buf.append("public class A {\n"); in testSuppressWarningsForMethodParameters()
3011 buf.append(" public int foo(int param1, @SuppressWarnings(\"rawtypes\") List param2) {\n"); in testSuppressWarningsForMethodParameters()
3012 buf.append(" return param1;\n"); in testSuppressWarningsForMethodParameters()
3013 buf.append(" }\n"); in testSuppressWarningsForMethodParameters()
3014 buf.append("}\n"); in testSuppressWarningsForMethodParameters()
3015 expected[0]= buf.toString(); in testSuppressWarningsForMethodParameters()
3017 buf= new StringBuffer(); in testSuppressWarningsForMethodParameters()
3018 buf.append("package test1; \n"); in testSuppressWarningsForMethodParameters()
3019 buf.append("import java.util.*;\n"); in testSuppressWarningsForMethodParameters()
3020 buf.append("\n"); in testSuppressWarningsForMethodParameters()
3021 buf.append("public class A {\n"); in testSuppressWarningsForMethodParameters()
3022 buf.append(" @SuppressWarnings(\"rawtypes\")\n"); in testSuppressWarningsForMethodParameters()
3023 buf.append(" public int foo(int param1, List param2) {\n"); in testSuppressWarningsForMethodParameters()
3024 buf.append(" return param1;\n"); in testSuppressWarningsForMethodParameters()
3025 buf.append(" }\n"); in testSuppressWarningsForMethodParameters()
3026 buf.append("}\n"); in testSuppressWarningsForMethodParameters()
3027 expected[1]= buf.toString(); in testSuppressWarningsForMethodParameters()
3040 StringBuffer buf= new StringBuffer(); in testSuppressWarningsAnonymousClass1() local
3041 buf.append("package test1; \n"); in testSuppressWarningsAnonymousClass1()
3042 buf.append("import java.util.*;\n"); in testSuppressWarningsAnonymousClass1()
3043 buf.append("\n"); in testSuppressWarningsAnonymousClass1()
3044 buf.append("public class A {\n"); in testSuppressWarningsAnonymousClass1()
3045 buf.append(" public void foo() {\n"); in testSuppressWarningsAnonymousClass1()
3046 buf.append(" @SuppressWarnings(\"unused\")\n"); in testSuppressWarningsAnonymousClass1()
3047 buf.append(" final Object object = new Object() {\n"); in testSuppressWarningsAnonymousClass1()
3048 buf.append(" {\n"); in testSuppressWarningsAnonymousClass1()
3049 buf.append(" for (List l = new ArrayList(), x = new Vector();;) {\n"); in testSuppressWarningsAnonymousClass1()
3050 buf.append(" if (l == x)\n"); in testSuppressWarningsAnonymousClass1()
3051 buf.append(" break;\n"); in testSuppressWarningsAnonymousClass1()
3052 buf.append(" }\n"); in testSuppressWarningsAnonymousClass1()
3053 buf.append(" }\n"); in testSuppressWarningsAnonymousClass1()
3054 buf.append(" };\n"); in testSuppressWarningsAnonymousClass1()
3055 buf.append(" };\n"); in testSuppressWarningsAnonymousClass1()
3056 buf.append("};\n"); in testSuppressWarningsAnonymousClass1()
3057 ICompilationUnit cu= pack1.createCompilationUnit("A.java", buf.toString(), false, null); in testSuppressWarningsAnonymousClass1()
3066 buf= new StringBuffer(); in testSuppressWarningsAnonymousClass1()
3067 buf.append("package test1; \n"); in testSuppressWarningsAnonymousClass1()
3068 buf.append("import java.util.*;\n"); in testSuppressWarningsAnonymousClass1()
3069 buf.append("\n"); in testSuppressWarningsAnonymousClass1()
3070 buf.append("public class A {\n"); in testSuppressWarningsAnonymousClass1()
3071 buf.append(" public void foo() {\n"); in testSuppressWarningsAnonymousClass1()
3072 buf.append(" @SuppressWarnings(\"unused\")\n"); in testSuppressWarningsAnonymousClass1()
3073 buf.append(" final Object object = new Object() {\n"); in testSuppressWarningsAnonymousClass1()
3074 buf.append(" {\n"); in testSuppressWarningsAnonymousClass1()
3075 buf.append(" for (@SuppressWarnings(\"rawtypes\")\n"); in testSuppressWarningsAnonymousClass1()
3076 buf.append(" List l = new ArrayList(), x = new Vector();;) {\n"); in testSuppressWarningsAnonymousClass1()
3077 buf.append(" if (l == x)\n"); in testSuppressWarningsAnonymousClass1()
3078 buf.append(" break;\n"); in testSuppressWarningsAnonymousClass1()
3079 buf.append(" }\n"); in testSuppressWarningsAnonymousClass1()
3080 buf.append(" }\n"); in testSuppressWarningsAnonymousClass1()
3081 buf.append(" };\n"); in testSuppressWarningsAnonymousClass1()
3082 buf.append(" };\n"); in testSuppressWarningsAnonymousClass1()
3083 buf.append("};\n"); in testSuppressWarningsAnonymousClass1()
3084 expected[0]= buf.toString(); in testSuppressWarningsAnonymousClass1()
3086 buf= new StringBuffer(); in testSuppressWarningsAnonymousClass1()
3087 buf.append("package test1; \n"); in testSuppressWarningsAnonymousClass1()
3088 buf.append("import java.util.*;\n"); in testSuppressWarningsAnonymousClass1()
3089 buf.append("\n"); in testSuppressWarningsAnonymousClass1()
3090 buf.append("public class A {\n"); in testSuppressWarningsAnonymousClass1()
3091 buf.append(" public void foo() {\n"); in testSuppressWarningsAnonymousClass1()
3092 buf.append(" @SuppressWarnings({\"unused\", \"rawtypes\"})\n"); in testSuppressWarningsAnonymousClass1()
3093 buf.append(" final Object object = new Object() {\n"); in testSuppressWarningsAnonymousClass1()
3094 buf.append(" {\n"); in testSuppressWarningsAnonymousClass1()
3095 buf.append(" for (List l = new ArrayList(), x = new Vector();;) {\n"); in testSuppressWarningsAnonymousClass1()
3096 buf.append(" if (l == x)\n"); in testSuppressWarningsAnonymousClass1()
3097 buf.append(" break;\n"); in testSuppressWarningsAnonymousClass1()
3098 buf.append(" }\n"); in testSuppressWarningsAnonymousClass1()
3099 buf.append(" }\n"); in testSuppressWarningsAnonymousClass1()
3100 buf.append(" };\n"); in testSuppressWarningsAnonymousClass1()
3101 buf.append(" };\n"); in testSuppressWarningsAnonymousClass1()
3102 buf.append("};\n"); in testSuppressWarningsAnonymousClass1()
3103 expected[1]= buf.toString(); in testSuppressWarningsAnonymousClass1()
3105 buf= new StringBuffer(); in testSuppressWarningsAnonymousClass1()
3106 buf.append("package test1; \n"); in testSuppressWarningsAnonymousClass1()
3107 buf.append("import java.util.*;\n"); in testSuppressWarningsAnonymousClass1()
3108 buf.append("\n"); in testSuppressWarningsAnonymousClass1()
3109 buf.append("public class A {\n"); in testSuppressWarningsAnonymousClass1()
3110 buf.append(" @SuppressWarnings(\"rawtypes\")\n"); in testSuppressWarningsAnonymousClass1()
3111 buf.append(" public void foo() {\n"); in testSuppressWarningsAnonymousClass1()
3112 buf.append(" @SuppressWarnings(\"unused\")\n"); in testSuppressWarningsAnonymousClass1()
3113 buf.append(" final Object object = new Object() {\n"); in testSuppressWarningsAnonymousClass1()
3114 buf.append(" {\n"); in testSuppressWarningsAnonymousClass1()
3115 buf.append(" for (List l = new ArrayList(), x = new Vector();;) {\n"); in testSuppressWarningsAnonymousClass1()
3116 buf.append(" if (l == x)\n"); in testSuppressWarningsAnonymousClass1()
3117 buf.append(" break;\n"); in testSuppressWarningsAnonymousClass1()
3118 buf.append(" }\n"); in testSuppressWarningsAnonymousClass1()
3119 buf.append(" }\n"); in testSuppressWarningsAnonymousClass1()
3120 buf.append(" };\n"); in testSuppressWarningsAnonymousClass1()
3121 buf.append(" };\n"); in testSuppressWarningsAnonymousClass1()
3122 buf.append("};\n"); in testSuppressWarningsAnonymousClass1()
3123 expected[1]= buf.toString(); in testSuppressWarningsAnonymousClass1()
3135 StringBuffer buf= new StringBuffer(); in testSuppressWarningsAnonymousClass2() local
3136 buf.append("package test1; \n"); in testSuppressWarningsAnonymousClass2()
3137 buf.append("import java.util.*;\n"); in testSuppressWarningsAnonymousClass2()
3138 buf.append("\n"); in testSuppressWarningsAnonymousClass2()
3139 buf.append("public class A {\n"); in testSuppressWarningsAnonymousClass2()
3140 buf.append(" final Runnable r= new Runnable() {\n"); in testSuppressWarningsAnonymousClass2()
3141 buf.append(" public void run() {\n"); in testSuppressWarningsAnonymousClass2()
3142 buf.append(" boolean b;\n"); in testSuppressWarningsAnonymousClass2()
3143 buf.append(" for (b = new ArrayList().add(1);;) {\n"); in testSuppressWarningsAnonymousClass2()
3144 buf.append(" if (b)\n"); in testSuppressWarningsAnonymousClass2()
3145 buf.append(" return;\n"); in testSuppressWarningsAnonymousClass2()
3146 buf.append(" break;\n"); in testSuppressWarningsAnonymousClass2()
3147 buf.append(" }\n"); in testSuppressWarningsAnonymousClass2()
3148 buf.append(" }\n"); in testSuppressWarningsAnonymousClass2()
3149 buf.append(" };\n"); in testSuppressWarningsAnonymousClass2()
3150 buf.append("}\n"); in testSuppressWarningsAnonymousClass2()
3151 ICompilationUnit cu= pack1.createCompilationUnit("A.java", buf.toString(), false, null); in testSuppressWarningsAnonymousClass2()
3159 buf= new StringBuffer(); in testSuppressWarningsAnonymousClass2()
3160 buf.append("package test1; \n"); in testSuppressWarningsAnonymousClass2()
3161 buf.append("import java.util.*;\n"); in testSuppressWarningsAnonymousClass2()
3162 buf.append("\n"); in testSuppressWarningsAnonymousClass2()
3163 buf.append("public class A {\n"); in testSuppressWarningsAnonymousClass2()
3164 buf.append(" final Runnable r= new Runnable() {\n"); in testSuppressWarningsAnonymousClass2()
3165 buf.append(" @SuppressWarnings(\"unchecked\")\n"); in testSuppressWarningsAnonymousClass2()
3166 buf.append(" public void run() {\n"); in testSuppressWarningsAnonymousClass2()
3167 buf.append(" boolean b;\n"); in testSuppressWarningsAnonymousClass2()
3168 buf.append(" for (b = new ArrayList().add(1);;) {\n"); in testSuppressWarningsAnonymousClass2()
3169 buf.append(" if (b)\n"); in testSuppressWarningsAnonymousClass2()
3170 buf.append(" return;\n"); in testSuppressWarningsAnonymousClass2()
3171 buf.append(" break;\n"); in testSuppressWarningsAnonymousClass2()
3172 buf.append(" }\n"); in testSuppressWarningsAnonymousClass2()
3173 buf.append(" }\n"); in testSuppressWarningsAnonymousClass2()
3174 buf.append(" };\n"); in testSuppressWarningsAnonymousClass2()
3175 buf.append("}\n"); in testSuppressWarningsAnonymousClass2()
3176 expected[0]= buf.toString(); in testSuppressWarningsAnonymousClass2()
3183 StringBuffer buf= new StringBuffer(); in testMisspelledSuppressToken() local
3184 buf.append("package a;\n"); in testMisspelledSuppressToken()
3185 buf.append("\n"); in testMisspelledSuppressToken()
3186 buf.append("public class A {\n"); in testMisspelledSuppressToken()
3187 buf.append(" @SuppressWarnings(\"unusd\")\n"); in testMisspelledSuppressToken()
3188 buf.append(" public static void main(String[] args) {\n"); in testMisspelledSuppressToken()
3189 buf.append(" }\n"); in testMisspelledSuppressToken()
3190 buf.append("}\n"); in testMisspelledSuppressToken()
3191 ICompilationUnit cu= pack1.createCompilationUnit("A.java", buf.toString(), false, null); in testMisspelledSuppressToken()
3200 buf= new StringBuffer(); in testMisspelledSuppressToken()
3201 buf.append("package a;\n"); in testMisspelledSuppressToken()
3202 buf.append("\n"); in testMisspelledSuppressToken()
3203 buf.append("public class A {\n"); in testMisspelledSuppressToken()
3204 buf.append(" @SuppressWarnings(\"unused\")\n"); in testMisspelledSuppressToken()
3205 buf.append(" public static void main(String[] args) {\n"); in testMisspelledSuppressToken()
3206 buf.append(" }\n"); in testMisspelledSuppressToken()
3207 buf.append("}\n"); in testMisspelledSuppressToken()
3208 expected[0]= buf.toString(); in testMisspelledSuppressToken()
3210 buf= new StringBuffer(); in testMisspelledSuppressToken()
3211 buf.append("package a;\n"); in testMisspelledSuppressToken()
3212 buf.append("\n"); in testMisspelledSuppressToken()
3213 buf.append("public class A {\n"); in testMisspelledSuppressToken()
3214 buf.append(" public static void main(String[] args) {\n"); in testMisspelledSuppressToken()
3215 buf.append(" }\n"); in testMisspelledSuppressToken()
3216 buf.append("}\n"); in testMisspelledSuppressToken()
3217 expected[1]= buf.toString(); in testMisspelledSuppressToken()
3226 StringBuffer buf= new StringBuffer(); in testSuppressBug169446() local
3227 buf.append("package other; \n"); in testSuppressBug169446()
3228 buf.append("\n"); in testSuppressBug169446()
3229 buf.append("public @interface SuppressWarnings {\n"); in testSuppressBug169446()
3230 buf.append(" String value();\n"); in testSuppressBug169446()
3231 buf.append("}\n"); in testSuppressBug169446()
3232 other.createCompilationUnit("SuppressWarnings.java", buf.toString(), false, null); in testSuppressBug169446()
3236 buf= new StringBuffer(); in testSuppressBug169446()
3237 buf.append("package a.b;\n"); in testSuppressBug169446()
3238 buf.append("\n"); in testSuppressBug169446()
3239 buf.append("public class E {\n"); in testSuppressBug169446()
3240 buf.append(" @Deprecated()\n"); in testSuppressBug169446()
3241 buf.append(" public void foo() {\n"); in testSuppressBug169446()
3242 buf.append(" }\n"); in testSuppressBug169446()
3243 buf.append("}\n"); in testSuppressBug169446()
3244 pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testSuppressBug169446()
3246 buf= new StringBuffer(); in testSuppressBug169446()
3247 buf.append("package a.b;\n"); in testSuppressBug169446()
3248 buf.append("\n"); in testSuppressBug169446()
3249 buf.append("import other.SuppressWarnings;\n"); in testSuppressBug169446()
3250 buf.append("\n"); in testSuppressBug169446()
3251 buf.append("public class Test {\n"); in testSuppressBug169446()
3252 buf.append(" @SuppressWarnings(\"BC\")\n"); in testSuppressBug169446()
3253 buf.append(" public void foo() {\n"); in testSuppressBug169446()
3254 buf.append(" new E().foo();\n"); in testSuppressBug169446()
3255 buf.append(" }\n"); in testSuppressBug169446()
3256 buf.append("}\n"); in testSuppressBug169446()
3257 ICompilationUnit cu= pack1.createCompilationUnit("Test.java", buf.toString(), false, null); in testSuppressBug169446()
3266 buf= new StringBuffer(); in testSuppressBug169446()
3267 buf.append("package a.b;\n"); in testSuppressBug169446()
3268 buf.append("\n"); in testSuppressBug169446()
3269 buf.append("import other.SuppressWarnings;\n"); in testSuppressBug169446()
3270 buf.append("\n"); in testSuppressBug169446()
3271 buf.append("public class Test {\n"); in testSuppressBug169446()
3272 buf.append(" @java.lang.SuppressWarnings(\"deprecation\")\n"); in testSuppressBug169446()
3273 buf.append(" @SuppressWarnings(\"BC\")\n"); in testSuppressBug169446()
3274 buf.append(" public void foo() {\n"); in testSuppressBug169446()
3275 buf.append(" new E().foo();\n"); in testSuppressBug169446()
3276 buf.append(" }\n"); in testSuppressBug169446()
3277 buf.append("}\n"); in testSuppressBug169446()
3278 expected[0]= buf.toString(); in testSuppressBug169446()
3286 StringBuffer buf= new StringBuffer(); in testSuppressWarningInImports() local
3287 buf.append("package p;\n"); in testSuppressWarningInImports()
3288 buf.append("\n"); in testSuppressWarningInImports()
3289 buf.append("import java.util.Vector;\n"); in testSuppressWarningInImports()
3290 buf.append("\n"); in testSuppressWarningInImports()
3291 buf.append("public class A {\n"); in testSuppressWarningInImports()
3292 buf.append("}\n"); in testSuppressWarningInImports()
3293 ICompilationUnit cu= pack1.createCompilationUnit("A.java", buf.toString(), false, null); in testSuppressWarningInImports()
3302 buf= new StringBuffer(); in testSuppressWarningInImports()
3303 buf.append("package p;\n"); in testSuppressWarningInImports()
3304 buf.append("\n"); in testSuppressWarningInImports()
3305 buf.append("import java.util.Vector;\n"); in testSuppressWarningInImports()
3306 buf.append("\n"); in testSuppressWarningInImports()
3307 buf.append("@SuppressWarnings(\"unused\")\n"); in testSuppressWarningInImports()
3308 buf.append("public class A {\n"); in testSuppressWarningInImports()
3309 buf.append("}\n"); in testSuppressWarningInImports()
3310 expected[0]= buf.toString(); in testSuppressWarningInImports()
3323 StringBuffer buf= new StringBuffer(); in testUnusedSuppressWarnings1() local
3324 buf.append("package p;\n"); in testUnusedSuppressWarnings1()
3325 buf.append("\n"); in testUnusedSuppressWarnings1()
3326 buf.append("@SuppressWarnings(value=\"unused\")\n"); in testUnusedSuppressWarnings1()
3327 buf.append("public class E {\n"); in testUnusedSuppressWarnings1()
3328 buf.append("\n"); in testUnusedSuppressWarnings1()
3329 buf.append("}\n"); in testUnusedSuppressWarnings1()
3330 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testUnusedSuppressWarnings1()
3339 buf= new StringBuffer(); in testUnusedSuppressWarnings1()
3340 buf.append("package p;\n"); in testUnusedSuppressWarnings1()
3341 buf.append("\n"); in testUnusedSuppressWarnings1()
3342 buf.append("public class E {\n"); in testUnusedSuppressWarnings1()
3343 buf.append("\n"); in testUnusedSuppressWarnings1()
3344 buf.append("}\n"); in testUnusedSuppressWarnings1()
3345 expected[0]= buf.toString(); in testUnusedSuppressWarnings1()
3357 StringBuffer buf= new StringBuffer(); in testUnusedSuppressWarnings2() local
3358 buf.append("package p;\n"); in testUnusedSuppressWarnings2()
3359 buf.append("\n"); in testUnusedSuppressWarnings2()
3360 buf.append("@SuppressWarnings(\"unused\")\n"); in testUnusedSuppressWarnings2()
3361 buf.append("public class E {\n"); in testUnusedSuppressWarnings2()
3362 buf.append("\n"); in testUnusedSuppressWarnings2()
3363 buf.append("}\n"); in testUnusedSuppressWarnings2()
3364 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testUnusedSuppressWarnings2()
3373 buf= new StringBuffer(); in testUnusedSuppressWarnings2()
3374 buf.append("package p;\n"); in testUnusedSuppressWarnings2()
3375 buf.append("\n"); in testUnusedSuppressWarnings2()
3376 buf.append("public class E {\n"); in testUnusedSuppressWarnings2()
3377 buf.append("\n"); in testUnusedSuppressWarnings2()
3378 buf.append("}\n"); in testUnusedSuppressWarnings2()
3379 expected[0]= buf.toString(); in testUnusedSuppressWarnings2()
3391 StringBuffer buf= new StringBuffer(); in testUnusedSuppressWarnings3() local
3392 buf.append("package p;\n"); in testUnusedSuppressWarnings3()
3393 buf.append("\n"); in testUnusedSuppressWarnings3()
3394 buf.append("@SuppressWarnings({ \"unused\", \"X\" })\n"); in testUnusedSuppressWarnings3()
3395 buf.append("public class E {\n"); in testUnusedSuppressWarnings3()
3396 buf.append("\n"); in testUnusedSuppressWarnings3()
3397 buf.append("}\n"); in testUnusedSuppressWarnings3()
3398 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testUnusedSuppressWarnings3()
3407 buf= new StringBuffer(); in testUnusedSuppressWarnings3()
3408 buf.append("package p;\n"); in testUnusedSuppressWarnings3()
3409 buf.append("\n"); in testUnusedSuppressWarnings3()
3410 buf.append("@SuppressWarnings({ \"X\" })\n"); in testUnusedSuppressWarnings3()
3411 buf.append("public class E {\n"); in testUnusedSuppressWarnings3()
3412 buf.append("\n"); in testUnusedSuppressWarnings3()
3413 buf.append("}\n"); in testUnusedSuppressWarnings3()
3414 expected[0]= buf.toString(); in testUnusedSuppressWarnings3()
3423 StringBuffer buf= new StringBuffer(); in testMakeFinalBug129165() local
3424 buf.append("package test1;\n"); in testMakeFinalBug129165()
3425 buf.append("import java.io.Serializable;\n"); in testMakeFinalBug129165()
3426 buf.append("public class E {\n"); in testMakeFinalBug129165()
3427 buf.append(" @SuppressWarnings(\"serial\")\n"); in testMakeFinalBug129165()
3428 buf.append(" public void foo() {\n"); in testMakeFinalBug129165()
3429 buf.append(" int i= 1, j= i + 1, h= j + 1;\n"); in testMakeFinalBug129165()
3430 buf.append(" Serializable ser= new Serializable() {\n"); in testMakeFinalBug129165()
3431 buf.append(" public void bar() {\n"); in testMakeFinalBug129165()
3432 buf.append(" System.out.println(j);\n"); in testMakeFinalBug129165()
3433 buf.append(" }\n"); in testMakeFinalBug129165()
3434 buf.append(" };\n"); in testMakeFinalBug129165()
3435 buf.append(" }\n"); in testMakeFinalBug129165()
3436 buf.append("}\n"); in testMakeFinalBug129165()
3437 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testMakeFinalBug129165()
3447 buf= new StringBuffer(); in testMakeFinalBug129165()
3448 buf.append("package test1;\n"); in testMakeFinalBug129165()
3449 buf.append("import java.io.Serializable;\n"); in testMakeFinalBug129165()
3450 buf.append("public class E {\n"); in testMakeFinalBug129165()
3451 buf.append(" @SuppressWarnings(\"serial\")\n"); in testMakeFinalBug129165()
3452 buf.append(" public void foo() {\n"); in testMakeFinalBug129165()
3453 buf.append(" int i= 1;\n"); in testMakeFinalBug129165()
3454 buf.append(" final int j= i + 1;\n"); in testMakeFinalBug129165()
3455 buf.append(" int h= j + 1;\n"); in testMakeFinalBug129165()
3456 buf.append(" Serializable ser= new Serializable() {\n"); in testMakeFinalBug129165()
3457 buf.append(" public void bar() {\n"); in testMakeFinalBug129165()
3458 buf.append(" System.out.println(j);\n"); in testMakeFinalBug129165()
3459 buf.append(" }\n"); in testMakeFinalBug129165()
3460 buf.append(" };\n"); in testMakeFinalBug129165()
3461 buf.append(" }\n"); in testMakeFinalBug129165()
3462 buf.append("}\n"); in testMakeFinalBug129165()
3463 assertEqualString(preview, buf.toString()); in testMakeFinalBug129165()
3469 StringBuffer buf= new StringBuffer(); in testStaticFieldInInnerClass() local
3470 buf.append("package pack;\n"); in testStaticFieldInInnerClass()
3471 buf.append("\n"); in testStaticFieldInInnerClass()
3472 buf.append("public class E {\n"); in testStaticFieldInInnerClass()
3473 buf.append(" class F {\n"); in testStaticFieldInInnerClass()
3474 buf.append(" static int x;\n"); in testStaticFieldInInnerClass()
3475 buf.append(" }\n"); in testStaticFieldInInnerClass()
3476 buf.append("}\n"); in testStaticFieldInInnerClass()
3477 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testStaticFieldInInnerClass()
3486 buf= new StringBuffer(); in testStaticFieldInInnerClass()
3487 buf.append("package pack;\n"); in testStaticFieldInInnerClass()
3488 buf.append("\n"); in testStaticFieldInInnerClass()
3489 buf.append("public class E {\n"); in testStaticFieldInInnerClass()
3490 buf.append(" class F {\n"); in testStaticFieldInInnerClass()
3491 buf.append(" int x;\n"); in testStaticFieldInInnerClass()
3492 buf.append(" }\n"); in testStaticFieldInInnerClass()
3493 buf.append("}\n"); in testStaticFieldInInnerClass()
3494 expected[0]= buf.toString(); in testStaticFieldInInnerClass()
3496 buf= new StringBuffer(); in testStaticFieldInInnerClass()
3497 buf.append("package pack;\n"); in testStaticFieldInInnerClass()
3498 buf.append("\n"); in testStaticFieldInInnerClass()
3499 buf.append("public class E {\n"); in testStaticFieldInInnerClass()
3500 buf.append(" static class F {\n"); in testStaticFieldInInnerClass()
3501 buf.append(" static int x;\n"); in testStaticFieldInInnerClass()
3502 buf.append(" }\n"); in testStaticFieldInInnerClass()
3503 buf.append("}\n"); in testStaticFieldInInnerClass()
3504 expected[1]= buf.toString(); in testStaticFieldInInnerClass()
3512 StringBuffer buf= new StringBuffer(); in testStaticMethodInInnerClass() local
3513 buf.append("package pack;\n"); in testStaticMethodInInnerClass()
3514 buf.append("\n"); in testStaticMethodInInnerClass()
3515 buf.append("public class E {\n"); in testStaticMethodInInnerClass()
3516 buf.append(" class F {\n"); in testStaticMethodInInnerClass()
3517 buf.append(" static int foo() {\n"); in testStaticMethodInInnerClass()
3518 buf.append(" }\n"); in testStaticMethodInInnerClass()
3519 buf.append(" }\n"); in testStaticMethodInInnerClass()
3520 buf.append("}\n"); in testStaticMethodInInnerClass()
3521 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testStaticMethodInInnerClass()
3530 buf= new StringBuffer(); in testStaticMethodInInnerClass()
3531 buf.append("package pack;\n"); in testStaticMethodInInnerClass()
3532 buf.append("\n"); in testStaticMethodInInnerClass()
3533 buf.append("public class E {\n"); in testStaticMethodInInnerClass()
3534 buf.append(" class F {\n"); in testStaticMethodInInnerClass()
3535 buf.append(" int foo() {\n"); in testStaticMethodInInnerClass()
3536 buf.append(" }\n"); in testStaticMethodInInnerClass()
3537 buf.append(" }\n"); in testStaticMethodInInnerClass()
3538 buf.append("}\n"); in testStaticMethodInInnerClass()
3539 expected[0]= buf.toString(); in testStaticMethodInInnerClass()
3541 buf= new StringBuffer(); in testStaticMethodInInnerClass()
3542 buf.append("package pack;\n"); in testStaticMethodInInnerClass()
3543 buf.append("\n"); in testStaticMethodInInnerClass()
3544 buf.append("public class E {\n"); in testStaticMethodInInnerClass()
3545 buf.append(" static class F {\n"); in testStaticMethodInInnerClass()
3546 buf.append(" static int foo() {\n"); in testStaticMethodInInnerClass()
3547 buf.append(" }\n"); in testStaticMethodInInnerClass()
3548 buf.append(" }\n"); in testStaticMethodInInnerClass()
3549 buf.append("}\n"); in testStaticMethodInInnerClass()
3550 expected[1]= buf.toString(); in testStaticMethodInInnerClass()
3558 StringBuffer buf= new StringBuffer(); in testFinalVolatileField() local
3559 buf.append("package pack;\n"); in testFinalVolatileField()
3560 buf.append("\n"); in testFinalVolatileField()
3561 buf.append("public class E {\n"); in testFinalVolatileField()
3562 buf.append(" class F {\n"); in testFinalVolatileField()
3563 buf.append(" volatile final int x;\n"); in testFinalVolatileField()
3564 buf.append(" }\n"); in testFinalVolatileField()
3565 buf.append("}\n"); in testFinalVolatileField()
3566 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testFinalVolatileField()
3575 buf= new StringBuffer(); in testFinalVolatileField()
3576 buf.append("package pack;\n"); in testFinalVolatileField()
3577 buf.append("\n"); in testFinalVolatileField()
3578 buf.append("public class E {\n"); in testFinalVolatileField()
3579 buf.append(" class F {\n"); in testFinalVolatileField()
3580 buf.append(" final int x;\n"); in testFinalVolatileField()
3581 buf.append(" }\n"); in testFinalVolatileField()
3582 buf.append("}\n"); in testFinalVolatileField()
3583 expected[0]= buf.toString(); in testFinalVolatileField()
3585 buf= new StringBuffer(); in testFinalVolatileField()
3586 buf.append("package pack;\n"); in testFinalVolatileField()
3587 buf.append("\n"); in testFinalVolatileField()
3588 buf.append("public class E {\n"); in testFinalVolatileField()
3589 buf.append(" class F {\n"); in testFinalVolatileField()
3590 buf.append(" volatile int x;\n"); in testFinalVolatileField()
3591 buf.append(" }\n"); in testFinalVolatileField()
3592 buf.append("}\n"); in testFinalVolatileField()
3593 expected[1]= buf.toString(); in testFinalVolatileField()
3603 StringBuffer buf= new StringBuffer(); in testOverrideAnnotationButNotOverriding() local
3604 buf.append("package pack;\n"); in testOverrideAnnotationButNotOverriding()
3605 buf.append("\n"); in testOverrideAnnotationButNotOverriding()
3606 buf.append("public class OtherMachine {\n"); in testOverrideAnnotationButNotOverriding()
3607 buf.append("}\n"); in testOverrideAnnotationButNotOverriding()
3608 pack1.createCompilationUnit("OtherMachine.java", buf.toString(), false, null); in testOverrideAnnotationButNotOverriding()
3610 buf= new StringBuffer(); in testOverrideAnnotationButNotOverriding()
3611 buf.append("package pack;\n"); in testOverrideAnnotationButNotOverriding()
3612 buf.append("\n"); in testOverrideAnnotationButNotOverriding()
3613 buf.append("import java.io.IOException;\n"); in testOverrideAnnotationButNotOverriding()
3614 buf.append("\n"); in testOverrideAnnotationButNotOverriding()
3615 buf.append("public class Machine extends OtherMachine {\n"); in testOverrideAnnotationButNotOverriding()
3616 buf.append(" @Override\n"); in testOverrideAnnotationButNotOverriding()
3617 buf.append(" public boolean isAlive(OtherMachine m) throws IOException {\n"); in testOverrideAnnotationButNotOverriding()
3618 buf.append(" return true;\n"); in testOverrideAnnotationButNotOverriding()
3619 buf.append(" }\n"); in testOverrideAnnotationButNotOverriding()
3620 buf.append("}\n"); in testOverrideAnnotationButNotOverriding()
3621 ICompilationUnit cu= pack1.createCompilationUnit("Machine.java", buf.toString(), false, null); in testOverrideAnnotationButNotOverriding()
3630 buf= new StringBuffer(); in testOverrideAnnotationButNotOverriding()
3631 buf.append("package pack;\n"); in testOverrideAnnotationButNotOverriding()
3632 buf.append("\n"); in testOverrideAnnotationButNotOverriding()
3633 buf.append("import java.io.IOException;\n"); in testOverrideAnnotationButNotOverriding()
3634 buf.append("\n"); in testOverrideAnnotationButNotOverriding()
3635 buf.append("public class Machine extends OtherMachine {\n"); in testOverrideAnnotationButNotOverriding()
3636 buf.append(" public boolean isAlive(OtherMachine m) throws IOException {\n"); in testOverrideAnnotationButNotOverriding()
3637 buf.append(" return true;\n"); in testOverrideAnnotationButNotOverriding()
3638 buf.append(" }\n"); in testOverrideAnnotationButNotOverriding()
3639 buf.append("}\n"); in testOverrideAnnotationButNotOverriding()
3640 expected[0]= buf.toString(); in testOverrideAnnotationButNotOverriding()
3642 buf= new StringBuffer(); in testOverrideAnnotationButNotOverriding()
3643 buf.append("package pack;\n"); in testOverrideAnnotationButNotOverriding()
3644 buf.append("\n"); in testOverrideAnnotationButNotOverriding()
3645 buf.append("import java.io.IOException;\n"); in testOverrideAnnotationButNotOverriding()
3646 buf.append("\n"); in testOverrideAnnotationButNotOverriding()
3647 buf.append("public class OtherMachine {\n"); in testOverrideAnnotationButNotOverriding()
3648 buf.append("\n"); in testOverrideAnnotationButNotOverriding()
3649 buf.append(" public boolean isAlive(OtherMachine m) throws IOException {\n"); in testOverrideAnnotationButNotOverriding()
3650 buf.append(" return false;\n"); in testOverrideAnnotationButNotOverriding()
3651 buf.append(" }\n"); in testOverrideAnnotationButNotOverriding()
3652 buf.append("}\n"); in testOverrideAnnotationButNotOverriding()
3653 expected[1]= buf.toString(); in testOverrideAnnotationButNotOverriding()
3662 StringBuffer buf= new StringBuffer(); in testCreateMethodWhenOverrideAnnotation() local
3663 buf.append("package pack;\n"); in testCreateMethodWhenOverrideAnnotation()
3664 buf.append("\n"); in testCreateMethodWhenOverrideAnnotation()
3665 buf.append("public abstract class OtherMachine {\n"); in testCreateMethodWhenOverrideAnnotation()
3666 buf.append("}\n"); in testCreateMethodWhenOverrideAnnotation()
3667 pack1.createCompilationUnit("OtherMachine.java", buf.toString(), false, null); in testCreateMethodWhenOverrideAnnotation()
3669 buf= new StringBuffer(); in testCreateMethodWhenOverrideAnnotation()
3670 buf.append("package pack;\n"); in testCreateMethodWhenOverrideAnnotation()
3671 buf.append("\n"); in testCreateMethodWhenOverrideAnnotation()
3672 buf.append("public abstract class Machine extends OtherMachine {\n"); in testCreateMethodWhenOverrideAnnotation()
3673 buf.append(" @Override\n"); in testCreateMethodWhenOverrideAnnotation()
3674 buf.append(" public abstract void m1();\n"); in testCreateMethodWhenOverrideAnnotation()
3675 buf.append("}\n"); in testCreateMethodWhenOverrideAnnotation()
3676 ICompilationUnit cu= pack1.createCompilationUnit("Machine.java", buf.toString(), false, null); in testCreateMethodWhenOverrideAnnotation()
3685 buf= new StringBuffer(); in testCreateMethodWhenOverrideAnnotation()
3686 buf.append("package pack;\n"); in testCreateMethodWhenOverrideAnnotation()
3687 buf.append("\n"); in testCreateMethodWhenOverrideAnnotation()
3688 buf.append("public abstract class OtherMachine {\n"); in testCreateMethodWhenOverrideAnnotation()
3689 buf.append("\n"); in testCreateMethodWhenOverrideAnnotation()
3690 buf.append(" public abstract void m1();\n"); in testCreateMethodWhenOverrideAnnotation()
3691 buf.append("}\n"); in testCreateMethodWhenOverrideAnnotation()
3692 expected[0]= buf.toString(); in testCreateMethodWhenOverrideAnnotation()
3694 buf= new StringBuffer(); in testCreateMethodWhenOverrideAnnotation()
3695 buf.append("package pack;\n"); in testCreateMethodWhenOverrideAnnotation()
3696 buf.append("\n"); in testCreateMethodWhenOverrideAnnotation()
3697 buf.append("public abstract class Machine extends OtherMachine {\n"); in testCreateMethodWhenOverrideAnnotation()
3698 buf.append(" public abstract void m1();\n"); in testCreateMethodWhenOverrideAnnotation()
3699 buf.append("}\n"); in testCreateMethodWhenOverrideAnnotation()
3700 expected[1]= buf.toString(); in testCreateMethodWhenOverrideAnnotation()
3712 StringBuffer buf= new StringBuffer(); in testMethodOverrideDeprecated1() local
3713 buf.append("package pack;\n"); in testMethodOverrideDeprecated1()
3714 buf.append("public class E {\n"); in testMethodOverrideDeprecated1()
3715 buf.append(" @Deprecated\n"); in testMethodOverrideDeprecated1()
3716 buf.append(" public void foo() {\n"); in testMethodOverrideDeprecated1()
3717 buf.append(" }\n"); in testMethodOverrideDeprecated1()
3718 buf.append("} \n"); in testMethodOverrideDeprecated1()
3719 buf.append("\n"); in testMethodOverrideDeprecated1()
3720 buf.append("class F extends E {\n"); in testMethodOverrideDeprecated1()
3721 buf.append(" public void foo() {\n"); in testMethodOverrideDeprecated1()
3722 buf.append(" }\n"); in testMethodOverrideDeprecated1()
3723 buf.append("}\n"); in testMethodOverrideDeprecated1()
3724 buf.append("\n"); in testMethodOverrideDeprecated1()
3725 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testMethodOverrideDeprecated1()
3734 buf= new StringBuffer(); in testMethodOverrideDeprecated1()
3735 buf.append("package pack;\n"); in testMethodOverrideDeprecated1()
3736 buf.append("public class E {\n"); in testMethodOverrideDeprecated1()
3737 buf.append(" @Deprecated\n"); in testMethodOverrideDeprecated1()
3738 buf.append(" public void foo() {\n"); in testMethodOverrideDeprecated1()
3739 buf.append(" }\n"); in testMethodOverrideDeprecated1()
3740 buf.append("} \n"); in testMethodOverrideDeprecated1()
3741 buf.append("\n"); in testMethodOverrideDeprecated1()
3742 buf.append("class F extends E {\n"); in testMethodOverrideDeprecated1()
3743 buf.append(" @Deprecated\n"); in testMethodOverrideDeprecated1()
3744 buf.append(" public void foo() {\n"); in testMethodOverrideDeprecated1()
3745 buf.append(" }\n"); in testMethodOverrideDeprecated1()
3746 buf.append("}\n"); in testMethodOverrideDeprecated1()
3747 buf.append("\n"); in testMethodOverrideDeprecated1()
3748 expected[0]= buf.toString(); in testMethodOverrideDeprecated1()
3750 buf= new StringBuffer(); in testMethodOverrideDeprecated1()
3751 buf.append("package pack;\n"); in testMethodOverrideDeprecated1()
3752 buf.append("public class E {\n"); in testMethodOverrideDeprecated1()
3753 buf.append(" @Deprecated\n"); in testMethodOverrideDeprecated1()
3754 buf.append(" public void foo() {\n"); in testMethodOverrideDeprecated1()
3755 buf.append(" }\n"); in testMethodOverrideDeprecated1()
3756 buf.append("} \n"); in testMethodOverrideDeprecated1()
3757 buf.append("\n"); in testMethodOverrideDeprecated1()
3758 buf.append("class F extends E {\n"); in testMethodOverrideDeprecated1()
3759 buf.append(" @SuppressWarnings(\"deprecation\")\n"); in testMethodOverrideDeprecated1()
3760 buf.append(" public void foo() {\n"); in testMethodOverrideDeprecated1()
3761 buf.append(" }\n"); in testMethodOverrideDeprecated1()
3762 buf.append("}\n"); in testMethodOverrideDeprecated1()
3763 buf.append("\n"); in testMethodOverrideDeprecated1()
3764 expected[1]= buf.toString(); in testMethodOverrideDeprecated1()
3776 StringBuffer buf= new StringBuffer(); in testMethodOverrideDeprecated2() local
3777 buf.append("package pack;\n"); in testMethodOverrideDeprecated2()
3778 buf.append("public class E {\n"); in testMethodOverrideDeprecated2()
3779 buf.append(" @Deprecated\n"); in testMethodOverrideDeprecated2()
3780 buf.append(" public void foo() {\n"); in testMethodOverrideDeprecated2()
3781 buf.append(" }\n"); in testMethodOverrideDeprecated2()
3782 buf.append("} \n"); in testMethodOverrideDeprecated2()
3783 buf.append("\n"); in testMethodOverrideDeprecated2()
3784 buf.append("class F extends E {\n"); in testMethodOverrideDeprecated2()
3785 buf.append(" /**\n"); in testMethodOverrideDeprecated2()
3786 buf.append(" */\n"); in testMethodOverrideDeprecated2()
3787 buf.append(" public void foo() {\n"); in testMethodOverrideDeprecated2()
3788 buf.append(" }\n"); in testMethodOverrideDeprecated2()
3789 buf.append("}\n"); in testMethodOverrideDeprecated2()
3790 buf.append("\n"); in testMethodOverrideDeprecated2()
3791 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testMethodOverrideDeprecated2()
3800 buf= new StringBuffer(); in testMethodOverrideDeprecated2()
3801 buf.append("package pack;\n"); in testMethodOverrideDeprecated2()
3802 buf.append("public class E {\n"); in testMethodOverrideDeprecated2()
3803 buf.append(" @Deprecated\n"); in testMethodOverrideDeprecated2()
3804 buf.append(" public void foo() {\n"); in testMethodOverrideDeprecated2()
3805 buf.append(" }\n"); in testMethodOverrideDeprecated2()
3806 buf.append("} \n"); in testMethodOverrideDeprecated2()
3807 buf.append("\n"); in testMethodOverrideDeprecated2()
3808 buf.append("class F extends E {\n"); in testMethodOverrideDeprecated2()
3809 buf.append(" /**\n"); in testMethodOverrideDeprecated2()
3810 buf.append(" * @deprecated\n"); in testMethodOverrideDeprecated2()
3811 buf.append(" */\n"); in testMethodOverrideDeprecated2()
3812 buf.append(" @Deprecated\n"); in testMethodOverrideDeprecated2()
3813 buf.append(" public void foo() {\n"); in testMethodOverrideDeprecated2()
3814 buf.append(" }\n"); in testMethodOverrideDeprecated2()
3815 buf.append("}\n"); in testMethodOverrideDeprecated2()
3816 buf.append("\n"); in testMethodOverrideDeprecated2()
3817 expected[0]= buf.toString(); in testMethodOverrideDeprecated2()
3819 buf= new StringBuffer(); in testMethodOverrideDeprecated2()
3820 buf.append("package pack;\n"); in testMethodOverrideDeprecated2()
3821 buf.append("public class E {\n"); in testMethodOverrideDeprecated2()
3822 buf.append(" @Deprecated\n"); in testMethodOverrideDeprecated2()
3823 buf.append(" public void foo() {\n"); in testMethodOverrideDeprecated2()
3824 buf.append(" }\n"); in testMethodOverrideDeprecated2()
3825 buf.append("} \n"); in testMethodOverrideDeprecated2()
3826 buf.append("\n"); in testMethodOverrideDeprecated2()
3827 buf.append("class F extends E {\n"); in testMethodOverrideDeprecated2()
3828 buf.append(" /**\n"); in testMethodOverrideDeprecated2()
3829 buf.append(" */\n"); in testMethodOverrideDeprecated2()
3830 buf.append(" @SuppressWarnings(\"deprecation\")\n"); in testMethodOverrideDeprecated2()
3831 buf.append(" public void foo() {\n"); in testMethodOverrideDeprecated2()
3832 buf.append(" }\n"); in testMethodOverrideDeprecated2()
3833 buf.append("}\n"); in testMethodOverrideDeprecated2()
3834 buf.append("\n"); in testMethodOverrideDeprecated2()
3835 expected[1]= buf.toString(); in testMethodOverrideDeprecated2()
3843 StringBuffer buf= new StringBuffer(); in testAbstractMethodInEnumWithoutEnumConstants() local
3844 buf.append("package r;\n"); in testAbstractMethodInEnumWithoutEnumConstants()
3845 buf.append("\n"); in testAbstractMethodInEnumWithoutEnumConstants()
3846 buf.append("enum E {\n"); in testAbstractMethodInEnumWithoutEnumConstants()
3847 buf.append(" ;\n"); in testAbstractMethodInEnumWithoutEnumConstants()
3848 buf.append(" public abstract boolean foo();\n"); in testAbstractMethodInEnumWithoutEnumConstants()
3849 buf.append("}\n"); in testAbstractMethodInEnumWithoutEnumConstants()
3850 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testAbstractMethodInEnumWithoutEnumConstants()
3859 buf= new StringBuffer(); in testAbstractMethodInEnumWithoutEnumConstants()
3860 buf.append("package r;\n"); in testAbstractMethodInEnumWithoutEnumConstants()
3861 buf.append("\n"); in testAbstractMethodInEnumWithoutEnumConstants()
3862 buf.append("enum E {\n"); in testAbstractMethodInEnumWithoutEnumConstants()
3863 buf.append(" ;\n"); in testAbstractMethodInEnumWithoutEnumConstants()
3864 buf.append(" public boolean foo() {\n"); in testAbstractMethodInEnumWithoutEnumConstants()
3865 buf.append(" return false;\n"); in testAbstractMethodInEnumWithoutEnumConstants()
3866 buf.append(" }\n"); in testAbstractMethodInEnumWithoutEnumConstants()
3867 buf.append("}\n"); in testAbstractMethodInEnumWithoutEnumConstants()
3868 expected[0]= buf.toString(); in testAbstractMethodInEnumWithoutEnumConstants()
3876 StringBuffer buf= new StringBuffer(); in testInvalidEnumModifier() local
3877 buf.append("package r;\n"); in testInvalidEnumModifier()
3878 buf.append("\n"); in testInvalidEnumModifier()
3879 buf.append("private final strictfp enum E {\n"); in testInvalidEnumModifier()
3880 buf.append("}\n"); in testInvalidEnumModifier()
3881 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvalidEnumModifier()
3890 buf= new StringBuffer(); in testInvalidEnumModifier()
3891 buf.append("package r;\n"); in testInvalidEnumModifier()
3892 buf.append("\n"); in testInvalidEnumModifier()
3893 buf.append("strictfp enum E {\n"); in testInvalidEnumModifier()
3894 buf.append("}\n"); in testInvalidEnumModifier()
3895 expected[0]= buf.toString(); in testInvalidEnumModifier()
3903 StringBuffer buf= new StringBuffer(); in testInvalidEnumModifier2() local
3904 buf.append("package r;\n"); in testInvalidEnumModifier2()
3905 buf.append("\n"); in testInvalidEnumModifier2()
3906 buf.append("public abstract enum E {\n"); in testInvalidEnumModifier2()
3907 buf.append("}\n"); in testInvalidEnumModifier2()
3908 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvalidEnumModifier2()
3917 buf= new StringBuffer(); in testInvalidEnumModifier2()
3918 buf.append("package r;\n"); in testInvalidEnumModifier2()
3919 buf.append("\n"); in testInvalidEnumModifier2()
3920 buf.append("public enum E {\n"); in testInvalidEnumModifier2()
3921 buf.append("}\n"); in testInvalidEnumModifier2()
3922 expected[0]= buf.toString(); in testInvalidEnumModifier2()
3930 StringBuffer buf= new StringBuffer(); in testInvalidEnumConstantModifier() local
3931 buf.append("package r;\n"); in testInvalidEnumConstantModifier()
3932 buf.append("\n"); in testInvalidEnumConstantModifier()
3933 buf.append("enum E {\n"); in testInvalidEnumConstantModifier()
3934 buf.append(" private final WHITE;\n"); in testInvalidEnumConstantModifier()
3935 buf.append("}\n"); in testInvalidEnumConstantModifier()
3936 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvalidEnumConstantModifier()
3945 buf= new StringBuffer(); in testInvalidEnumConstantModifier()
3946 buf.append("package r;\n"); in testInvalidEnumConstantModifier()
3947 buf.append("\n"); in testInvalidEnumConstantModifier()
3948 buf.append("enum E {\n"); in testInvalidEnumConstantModifier()
3949 buf.append(" WHITE;\n"); in testInvalidEnumConstantModifier()
3950 buf.append("}\n"); in testInvalidEnumConstantModifier()
3951 expected[0]= buf.toString(); in testInvalidEnumConstantModifier()
3959 StringBuffer buf= new StringBuffer(); in testInvalidEnumConstructorModifier() local
3960 buf.append("package r;\n"); in testInvalidEnumConstructorModifier()
3961 buf.append("\n"); in testInvalidEnumConstructorModifier()
3962 buf.append("enum E {\n"); in testInvalidEnumConstructorModifier()
3963 buf.append(" WHITE(1);\n"); in testInvalidEnumConstructorModifier()
3964 buf.append("\n"); in testInvalidEnumConstructorModifier()
3965 buf.append(" public final E(int foo) {\n"); in testInvalidEnumConstructorModifier()
3966 buf.append(" }\n"); in testInvalidEnumConstructorModifier()
3967 buf.append("}\n"); in testInvalidEnumConstructorModifier()
3968 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvalidEnumConstructorModifier()
3977 buf= new StringBuffer(); in testInvalidEnumConstructorModifier()
3978 buf.append("package r;\n"); in testInvalidEnumConstructorModifier()
3979 buf.append("\n"); in testInvalidEnumConstructorModifier()
3980 buf.append("enum E {\n"); in testInvalidEnumConstructorModifier()
3981 buf.append(" WHITE(1);\n"); in testInvalidEnumConstructorModifier()
3982 buf.append("\n"); in testInvalidEnumConstructorModifier()
3983 buf.append(" E(int foo) {\n"); in testInvalidEnumConstructorModifier()
3984 buf.append(" }\n"); in testInvalidEnumConstructorModifier()
3985 buf.append("}\n"); in testInvalidEnumConstructorModifier()
3986 expected[0]= buf.toString(); in testInvalidEnumConstructorModifier()
3994 StringBuffer buf= new StringBuffer(); in testInvalidMemberEnumModifier() local
3995 buf.append("package r;\n"); in testInvalidMemberEnumModifier()
3996 buf.append("\n"); in testInvalidMemberEnumModifier()
3997 buf.append("class E {\n"); in testInvalidMemberEnumModifier()
3998 buf.append(" final enum A {\n"); in testInvalidMemberEnumModifier()
3999 buf.append(" }\n"); in testInvalidMemberEnumModifier()
4000 buf.append("}\n"); in testInvalidMemberEnumModifier()
4001 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testInvalidMemberEnumModifier()
4010 buf= new StringBuffer(); in testInvalidMemberEnumModifier()
4011 buf.append("package r;\n"); in testInvalidMemberEnumModifier()
4012 buf.append("\n"); in testInvalidMemberEnumModifier()
4013 buf.append("class E {\n"); in testInvalidMemberEnumModifier()
4014 buf.append(" enum A {\n"); in testInvalidMemberEnumModifier()
4015 buf.append(" }\n"); in testInvalidMemberEnumModifier()
4016 buf.append("}\n"); in testInvalidMemberEnumModifier()
4017 expected[0]= buf.toString(); in testInvalidMemberEnumModifier()
4025 StringBuffer buf= new StringBuffer(); in testMissingSynchronizedOnInheritedMethod() local
4026 buf.append("package r;\n"); in testMissingSynchronizedOnInheritedMethod()
4027 buf.append("\n"); in testMissingSynchronizedOnInheritedMethod()
4028 buf.append("public class A {\n"); in testMissingSynchronizedOnInheritedMethod()
4029 buf.append(" protected synchronized void foo() {\n"); in testMissingSynchronizedOnInheritedMethod()
4030 buf.append(" }\n"); in testMissingSynchronizedOnInheritedMethod()
4031 buf.append("}\n"); in testMissingSynchronizedOnInheritedMethod()
4032 pack1.createCompilationUnit("A.java", buf.toString(), false, null); in testMissingSynchronizedOnInheritedMethod()
4034 buf= new StringBuffer(); in testMissingSynchronizedOnInheritedMethod()
4035 buf.append("package r;\n"); in testMissingSynchronizedOnInheritedMethod()
4036 buf.append("\n"); in testMissingSynchronizedOnInheritedMethod()
4037 buf.append("class B extends A {\n"); in testMissingSynchronizedOnInheritedMethod()
4038 buf.append(" protected void foo() {\n"); in testMissingSynchronizedOnInheritedMethod()
4039 buf.append(" }\n"); in testMissingSynchronizedOnInheritedMethod()
4040 buf.append("}\n"); in testMissingSynchronizedOnInheritedMethod()
4041 ICompilationUnit cu= pack1.createCompilationUnit("B.java", buf.toString(), false, null); in testMissingSynchronizedOnInheritedMethod()
4050 buf= new StringBuffer(); in testMissingSynchronizedOnInheritedMethod()
4051 buf.append("package r;\n"); in testMissingSynchronizedOnInheritedMethod()
4052 buf.append("\n"); in testMissingSynchronizedOnInheritedMethod()
4053 buf.append("class B extends A {\n"); in testMissingSynchronizedOnInheritedMethod()
4054 buf.append(" protected synchronized void foo() {\n"); in testMissingSynchronizedOnInheritedMethod()
4055 buf.append(" }\n"); in testMissingSynchronizedOnInheritedMethod()
4056 buf.append("}\n"); in testMissingSynchronizedOnInheritedMethod()
4057 expected[0]= buf.toString(); in testMissingSynchronizedOnInheritedMethod()
4070 StringBuffer buf= new StringBuffer(); in testMethodCanBeStatic() local
4071 buf.append("package test1;\n"); in testMethodCanBeStatic()
4072 buf.append("public class E {\n"); in testMethodCanBeStatic()
4073 buf.append(" private void foo() {\n"); in testMethodCanBeStatic()
4074 buf.append(" System.out.println(\"doesn't need class\");\n"); in testMethodCanBeStatic()
4075 buf.append(" }\n"); in testMethodCanBeStatic()
4076 buf.append("}\n"); in testMethodCanBeStatic()
4077 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testMethodCanBeStatic()
4087 buf= new StringBuffer(); in testMethodCanBeStatic()
4088 buf.append("package test1;\n"); in testMethodCanBeStatic()
4089 buf.append("public class E {\n"); in testMethodCanBeStatic()
4090 buf.append(" private static void foo() {\n"); in testMethodCanBeStatic()
4091 buf.append(" System.out.println(\"doesn't need class\");\n"); in testMethodCanBeStatic()
4092 buf.append(" }\n"); in testMethodCanBeStatic()
4093 buf.append("}\n"); in testMethodCanBeStatic()
4094 assertEqualString(preview, buf.toString()); in testMethodCanBeStatic()
4105 StringBuffer buf= new StringBuffer(); in testMethodCanPotentiallyBeStatic() local
4106 buf.append("package test1;\n"); in testMethodCanPotentiallyBeStatic()
4107 buf.append("public class E {\n"); in testMethodCanPotentiallyBeStatic()
4108 buf.append(" void foo() {\n"); in testMethodCanPotentiallyBeStatic()
4109 buf.append(" System.out.println(\"doesn't need class\");\n"); in testMethodCanPotentiallyBeStatic()
4110 buf.append(" }\n"); in testMethodCanPotentiallyBeStatic()
4111 buf.append("}\n"); in testMethodCanPotentiallyBeStatic()
4112 ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null); in testMethodCanPotentiallyBeStatic()
4120 buf= new StringBuffer(); in testMethodCanPotentiallyBeStatic()
4121 buf.append("package test1;\n"); in testMethodCanPotentiallyBeStatic()
4122 buf.append("public class E {\n"); in testMethodCanPotentiallyBeStatic()
4123 buf.append(" static void foo() {\n"); in testMethodCanPotentiallyBeStatic()
4124 buf.append(" System.out.println(\"doesn't need class\");\n"); in testMethodCanPotentiallyBeStatic()
4125 buf.append(" }\n"); in testMethodCanPotentiallyBeStatic()
4126 buf.append("}\n"); in testMethodCanPotentiallyBeStatic()
4127 expected[0]= buf.toString(); in testMethodCanPotentiallyBeStatic()
4129 buf= new StringBuffer(); in testMethodCanPotentiallyBeStatic()
4130 buf.append("package test1;\n"); in testMethodCanPotentiallyBeStatic()
4131 buf.append("public class E {\n"); in testMethodCanPotentiallyBeStatic()
4132 buf.append(" @SuppressWarnings(\"static-method\")\n"); in testMethodCanPotentiallyBeStatic()
4133 buf.append(" void foo() {\n"); in testMethodCanPotentiallyBeStatic()
4134 buf.append(" System.out.println(\"doesn't need class\");\n"); in testMethodCanPotentiallyBeStatic()
4135 buf.append(" }\n"); in testMethodCanPotentiallyBeStatic()
4136 buf.append("}\n"); in testMethodCanPotentiallyBeStatic()
4137 expected[1]= buf.toString(); in testMethodCanPotentiallyBeStatic()
4154 StringBuffer buf= new StringBuffer(); in testOverridingMethodIsPrivate() local
4156 buf.append("package test1;\n"); in testOverridingMethodIsPrivate()
4157 buf.append("public abstract class A1 {\n"); in testOverridingMethodIsPrivate()
4158 buf.append(" protected abstract void m1();\n"); in testOverridingMethodIsPrivate()
4159 buf.append("}\n"); in testOverridingMethodIsPrivate()
4160 pack1.createCompilationUnit("A1.java", buf.toString(), false, null); in testOverridingMethodIsPrivate()
4162 buf= new StringBuffer(); in testOverridingMethodIsPrivate()
4164 buf.append("package test1;\n"); in testOverridingMethodIsPrivate()
4165 buf.append("public class B1 extends A1 {\n"); in testOverridingMethodIsPrivate()
4166 buf.append(" private void m1() {\n"); in testOverridingMethodIsPrivate()
4167 buf.append(" }\n"); in testOverridingMethodIsPrivate()
4168 buf.append("}\n"); in testOverridingMethodIsPrivate()
4169 ICompilationUnit cu= pack1.createCompilationUnit("B1.java", buf.toString(), false, null); in testOverridingMethodIsPrivate()
4178 buf= new StringBuffer(); in testOverridingMethodIsPrivate()
4179 buf.append("package test1;\n"); in testOverridingMethodIsPrivate()
4180 buf.append("public class B1 extends A1 {\n"); in testOverridingMethodIsPrivate()
4181 buf.append(" protected void m1() {\n"); in testOverridingMethodIsPrivate()
4182 buf.append(" }\n"); in testOverridingMethodIsPrivate()
4183 buf.append("}\n"); in testOverridingMethodIsPrivate()
4184 expected[0]= buf.toString(); in testOverridingMethodIsPrivate()
4203 StringBuffer buf= new StringBuffer(); in testInvalidVisabilityOverrideMethod() local
4205 buf.append("package test1;\n"); in testInvalidVisabilityOverrideMethod()
4206 buf.append("public abstract class Abs {\n"); in testInvalidVisabilityOverrideMethod()
4207 buf.append(" abstract String getName();\n"); in testInvalidVisabilityOverrideMethod()
4208 buf.append("}\n"); in testInvalidVisabilityOverrideMethod()
4209 pack1.createCompilationUnit("Abs.java", buf.toString(), false, null); in testInvalidVisabilityOverrideMethod()
4211 buf= new StringBuffer(); in testInvalidVisabilityOverrideMethod()
4213 buf.append("package test2;\n"); in testInvalidVisabilityOverrideMethod()
4214 buf.append("public class AbsImpl extends test1.Abs {\n"); in testInvalidVisabilityOverrideMethod()
4215 buf.append(" String getName() {\n"); in testInvalidVisabilityOverrideMethod()
4216 buf.append(" return \"name\";\n"); in testInvalidVisabilityOverrideMethod()
4217 buf.append(" }\n"); in testInvalidVisabilityOverrideMethod()
4218 buf.append("}\n"); in testInvalidVisabilityOverrideMethod()
4219 ICompilationUnit cu= pack2.createCompilationUnit("AbsImpl.java", buf.toString(), false, null); in testInvalidVisabilityOverrideMethod()
4413 StringBuffer buf= new StringBuffer(); in test216898Comment1Variation() local
4415 buf.append("package test1;\n"); in test216898Comment1Variation()
4416 buf.append("public abstract class Abs {\n"); in test216898Comment1Variation()
4417 buf.append(" protected abstract String getName();\n"); in test216898Comment1Variation()
4418 buf.append("}\n"); in test216898Comment1Variation()
4419 pack1.createCompilationUnit("Abs.java", buf.toString(), false, null); in test216898Comment1Variation()
4421 buf= new StringBuffer(); in test216898Comment1Variation()
4423 buf.append("package test2;\n"); in test216898Comment1Variation()
4424 buf.append("public class AbsImpl extends test1.Abs {\n"); in test216898Comment1Variation()
4425 buf.append(" String getName() {\n"); in test216898Comment1Variation()
4426 buf.append(" return \"name\";\n"); in test216898Comment1Variation()
4427 buf.append(" }\n"); in test216898Comment1Variation()
4428 buf.append("}\n"); in test216898Comment1Variation()
4429 ICompilationUnit cu= pack2.createCompilationUnit("AbsImpl.java", buf.toString(), false, null); in test216898Comment1Variation()
4438 buf= new StringBuffer(); in test216898Comment1Variation()
4439 buf.append("package test2;\n"); in test216898Comment1Variation()
4440 buf.append("public class AbsImpl extends test1.Abs {\n"); in test216898Comment1Variation()
4441 buf.append(" protected String getName() {\n"); in test216898Comment1Variation()
4442 buf.append(" return \"name\";\n"); in test216898Comment1Variation()
4443 buf.append(" }\n"); in test216898Comment1Variation()
4444 buf.append("}\n"); in test216898Comment1Variation()
4445 expected[0]= buf.toString(); in test216898Comment1Variation()
4461 StringBuffer buf= new StringBuffer(); in testImplementExtendSameMethod() local
4462 buf.append("package test1;\n"); in testImplementExtendSameMethod()
4463 buf.append("interface I {\n"); in testImplementExtendSameMethod()
4464 buf.append(" void xxx();\n"); in testImplementExtendSameMethod()
4465 buf.append("}\n"); in testImplementExtendSameMethod()
4466 buf.append("class A {\n"); in testImplementExtendSameMethod()
4467 buf.append(" void xxx() {}\n"); in testImplementExtendSameMethod()
4468 buf.append("}\n"); in testImplementExtendSameMethod()
4469 buf.append("class B extends A implements I {\n"); in testImplementExtendSameMethod()
4470 buf.append(" void xxx() {}//error\n"); in testImplementExtendSameMethod()
4471 buf.append("}\n"); in testImplementExtendSameMethod()
4472 ICompilationUnit cu= pack1.createCompilationUnit("I.java", buf.toString(), false, null); in testImplementExtendSameMethod()
4481 buf= new StringBuffer(); in testImplementExtendSameMethod()
4482 buf.append("package test1;\n"); in testImplementExtendSameMethod()
4483 buf.append("interface I {\n"); in testImplementExtendSameMethod()
4484 buf.append(" void xxx();\n"); in testImplementExtendSameMethod()
4485 buf.append("}\n"); in testImplementExtendSameMethod()
4486 buf.append("class A {\n"); in testImplementExtendSameMethod()
4487 buf.append(" void xxx() {}\n"); in testImplementExtendSameMethod()
4488 buf.append("}\n"); in testImplementExtendSameMethod()
4489 buf.append("class B extends A implements I {\n"); in testImplementExtendSameMethod()
4490 buf.append(" public void xxx() {}//error\n"); in testImplementExtendSameMethod()
4491 buf.append("}\n"); in testImplementExtendSameMethod()
4492 expected[0]= buf.toString(); in testImplementExtendSameMethod()