1 /*******************************************************************************
2  * Copyright (c) 2000, 2020 IBM Corporation and others.
3  *
4  * This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License 2.0
6  * which accompanies this distribution, and is available at
7  * https://www.eclipse.org/legal/epl-2.0/
8  *
9  * SPDX-License-Identifier: EPL-2.0
10  *
11  * Contributors:
12  *     IBM Corporation - initial API and implementation
13  *     Stephan Herrmann - Contribution for
14  *								bug 383690 - [compiler] location of error re uninitialized final field should be aligned
15  *								bug 388800 - [1.8] adjust tests to 1.8 JRE
16  *								bug 388795 - [compiler] detection of name clash depends on order of super interfaces
17  *								bug 388739 - [1.8][compiler] consider default methods when detecting whether a class needs to be declared abstract
18  *								bug 395681 - [compiler] Improve simulation of javac6 behavior from bug 317719 after fixing bug 388795
19  *								bug 406928 - computation of inherited methods seems damaged (affecting @Overrides)
20  *								Bug 400874 - [1.8][compiler] Inference infrastructure should evolve to meet JLS8 18.x (Part G of JSR335 spec)
21  *								Bug 424286 - [1.8] Update type inference to spec version 0.9.1
22  *								Bug 426676 - [1.8][compiler] Wrong generic method type inferred from lambda expression
23  *								Bug 423505 - [1.8] Implement "18.5.4 More Specific Method Inference"
24  *								Bug 434483 - [1.8][compiler][inference] Type inference not picked up with method reference
25  *     Harry Terkelsen - Bug 460491 - NPE in ParameterizedTypeBinding.collectSubstitutes
26  *******************************************************************************/
27 package org.eclipse.jdt.core.tests.compiler.regression;
28 
29 import static java.lang.Math.abs;
30 import static java.util.stream.Collectors.toList;
31 
32 import java.io.File;
33 import java.util.List;
34 import java.util.Map;
35 import java.util.concurrent.atomic.AtomicInteger;
36 import java.util.function.Consumer;
37 import java.util.function.IntFunction;
38 import java.util.stream.IntStream;
39 
40 import junit.framework.Test;
41 
42 import org.eclipse.jdt.core.JavaCore;
43 import org.eclipse.jdt.core.ToolFactory;
44 import org.eclipse.jdt.core.tests.util.Util;
45 import org.eclipse.jdt.core.util.ClassFileBytesDisassembler;
46 import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants;
47 import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
48 
49 @SuppressWarnings({ "unchecked", "rawtypes" })
50 public class GenericTypeTest extends AbstractComparableTest {
51 
GenericTypeTest(String name)52 	public GenericTypeTest(String name) {
53 		super(name);
54 	}
55 
56 	// Static initializer to specify tests subset using TESTS_* static variables
57 	// All specified tests which does not belong to the class are skipped...
58 	static {
59 //		TESTS_NAMES = new String[] { "test1277" };
60 //		TESTS_NUMBERS = new int[] { 470, 627 };
61 //		TESTS_RANGE = new int[] { 1097, -1 };
62 	}
suite()63 	public static Test suite() {
64 		return buildComparableTestSuite(testClass());
65 	}
66 
testClass()67 	public static Class testClass() {
68 		return GenericTypeTest.class;
69 	}
70 
71 	@Override
getCompilerOptions()72 	protected Map getCompilerOptions() {
73 		Map options = super.getCompilerOptions();
74 		options.put(CompilerOptions.OPTION_ReportMissingOverrideAnnotationForInterfaceMethodImplementation, CompilerOptions.DISABLED);
75 		options.put(CompilerOptions.OPTION_ReportUnusedLocal, CompilerOptions.IGNORE);
76 		options.put(CompilerOptions.OPTION_ReportUnusedParameter, CompilerOptions.IGNORE);
77 		options.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.IGNORE);
78 		options.put(CompilerOptions.OPTION_ReportUnusedTypeParameter, CompilerOptions.IGNORE);
79 		return options;
80 	}
81 
test0001()82 	public void test0001() {
83 		this.runConformTest(
84 			new String[] {
85 				"X.java",
86 				"public class X<Tx1 extends String, Tx2 extends Comparable>  extends XS<Tx2> {\n" +
87 				"\n" +
88 				"    public static void main(String[] args) {\n" +
89 				"        Integer w = new X<String,Integer>().get(new Integer(12));\n" +
90 				"        System.out.println(\"SUCCESS\");\n" +
91 				"    }\n" +
92 				"}\n" +
93 				"class XS <Txs> {\n" +
94 				"    Txs get(Txs t) {\n" +
95 				"        return t;\n" +
96 				"    }\n" +
97 				"}\n"
98 			},
99 			"SUCCESS");
100 	}
101 
test0002()102 	public void test0002() {
103 		this.runConformTest(
104 			new String[] {
105 				"X.java",
106 				"public class X<Xp1 extends String, Xp2 extends Comparable>  extends XS<Xp2> {\n" +
107 				"\n" +
108 				"    public static void main(String[] args) {\n" +
109 				"        Integer w = new X<String,Integer>().get(new Integer(12));\n" +
110 				"        System.out.println(\"SUCCESS\");\n" +
111 				"    }\n" +
112 				"    Xp2 get(Xp2 t){\n" +
113 				"        System.out.print(\"{X::get}\");\n" +
114 				"        return super.get(t);\n" +
115 				"    }\n" +
116 				"}\n" +
117 				"\n" +
118 				"class XS <XSp1> {\n" +
119 				"    XSp1 get(XSp1 t) {\n" +
120 				"        System.out.print(\"{XS::get}\");\n" +
121 				"        return t;\n" +
122 				"    }\n" +
123 				"}\n"
124 			},
125 			"{X::get}{XS::get}SUCCESS");
126 	}
127 
128 	// check cannot bind superclass to type variable
test0003()129 	public void test0003() {
130 		this.runNegativeTest(
131 			new String[] {
132 				"X.java",
133 				"public class X <X> extends X {\n" +
134 				"}\n",
135 			},
136 			"----------\n" +
137 			"1. WARNING in X.java (at line 1)\n" +
138 			"	public class X <X> extends X {\n" +
139 			"	                ^\n" +
140 			"The type parameter X is hiding the type X<X>\n" +
141 			"----------\n" +
142 			"2. ERROR in X.java (at line 1)\n" +
143 			"	public class X <X> extends X {\n" +
144 			"	                           ^\n" +
145 			"Cannot refer to the type parameter X as a supertype\n" +
146 			"----------\n");
147 	}
148 
149 	// check cannot bind superinterface to type variable
test0004()150 	public void test0004() {
151 		this.runNegativeTest(
152 			new String[] {
153 				"X.java",
154 				"public class X <X> implements X {\n" +
155 				"}\n",
156 			},
157 			"----------\n" +
158 			"1. WARNING in X.java (at line 1)\n" +
159 			"	public class X <X> implements X {\n" +
160 			"	                ^\n" +
161 			"The type parameter X is hiding the type X<X>\n" +
162 			"----------\n" +
163 			"2. ERROR in X.java (at line 1)\n" +
164 			"	public class X <X> implements X {\n" +
165 			"	                              ^\n" +
166 			"Cannot refer to the type parameter X as a supertype\n" +
167 			"----------\n");
168 	}
169 
170 	// check cannot bind type variable in static context
test0005()171 	public void test0005() {
172 		this.runNegativeTest(
173 			new String[] {
174 				"X.java",
175 				"public class X <T> {\n" +
176 				"    \n" +
177 				"    T t;\n" +
178 				"    static {\n" +
179 				"        T s;\n" +
180 				"    }\n" +
181 				"}\n",
182 			},
183 			"----------\n" +
184 			"1. ERROR in X.java (at line 5)\n" +
185 			"	T s;\n" +
186 			"	^\n" +
187 			"Cannot make a static reference to the non-static type T\n" +
188 			"----------\n");
189 	}
190 
191 	// check static references to type variables
test0006()192 	public void test0006() {
193 		this.runNegativeTest(
194 			new String[] {
195 				"X.java",
196 				"public class X <T> {\n" +
197 				"    \n" +
198 				"    T ok1;\n" +
199 				"    static {\n" +
200 				"        T wrong1;\n" +
201 				"    }\n" +
202 				"    static void foo(T wrong2) {\n" +
203 				"		T wrong3;\n" +
204 				"    }\n" +
205 				"    class MX extends T {\n" +
206 				"        T ok2;\n" +
207 				"    }\n" +
208 				"    static class SMX extends T {\n" +
209 				"        T wrong4;\n" +
210 				"    }\n" +
211 				"}\n",
212 			},
213 			"----------\n" +
214 			"1. ERROR in X.java (at line 5)\n" +
215 			"	T wrong1;\n" +
216 			"	^\n" +
217 			"Cannot make a static reference to the non-static type T\n" +
218 			"----------\n" +
219 			"2. ERROR in X.java (at line 7)\n" +
220 			"	static void foo(T wrong2) {\n" +
221 			"	                ^\n" +
222 			"Cannot make a static reference to the non-static type T\n" +
223 			"----------\n" +
224 			"3. ERROR in X.java (at line 8)\n" +
225 			"	T wrong3;\n" +
226 			"	^\n" +
227 			"Cannot make a static reference to the non-static type T\n" +
228 			"----------\n" +
229 			"4. ERROR in X.java (at line 10)\n" +
230 			"	class MX extends T {\n" +
231 			"	                 ^\n" +
232 			"Cannot refer to the type parameter T as a supertype\n" +
233 			"----------\n" +
234 			"5. ERROR in X.java (at line 13)\n" +
235 			"	static class SMX extends T {\n" +
236 			"	                         ^\n" +
237 			"Cannot make a static reference to the non-static type T\n" +
238 			"----------\n" +
239 			"6. ERROR in X.java (at line 14)\n" +
240 			"	T wrong4;\n" +
241 			"	^\n" +
242 			"Cannot make a static reference to the non-static type T\n" +
243 			"----------\n");
244 	}
245 
246 	// check static references to type variables
test0007()247 	public void test0007() {
248 		this.runNegativeTest(
249 			new String[] {
250 				"X.java",
251 				"public class X <T> {\n" +
252 				"    \n" +
253 				"    T ok1;\n" +
254 				"    static class SMX {\n" +
255 				"        T wrong4;\n" +
256 				"    }\n" +
257 				"}\n",
258 			},
259 			"----------\n" +
260 			"1. ERROR in X.java (at line 5)\n" +
261 			"	T wrong4;\n" +
262 			"	^\n" +
263 			"Cannot make a static reference to the non-static type T\n" +
264 			"----------\n");
265 	}
266 
267 	// check static references to type variables
test0008()268 	public void test0008() {
269 		this.runNegativeTest(
270 			new String[] {
271 				"X.java",
272 				"public class X <T> {\n" +
273 				"    \n" +
274 				"     T ok;\n" +
275 				"    static T wrong;\n" +
276 				"}\n",
277 			},
278 			"----------\n" +
279 			"1. ERROR in X.java (at line 4)\n" +
280 			"	static T wrong;\n" +
281 			"	       ^\n" +
282 			"Cannot make a static reference to the non-static type T\n" +
283 			"----------\n");
284 	}
285 
286 	// Object cannot be generic
test0009()287 	public void test0009() {
288 		this.runNegativeTest(
289 			new String[] {
290 				"Object.java",
291 				"package java.lang;\n" +
292 				"public class Object <T> {\n" +
293 				"}\n",
294 			},
295 			"----------\n" +
296 			"1. ERROR in Object.java (at line 2)\n" +
297 			"	public class Object <T> {\n" +
298 			"	                     ^\n" +
299 			"The type java.lang.Object cannot be declared as a generic\n" +
300 			"----------\n");
301 	}
302 
test0010()303 	public void test0010() {
304 		this.runNegativeTest(
305 			new String[] {
306 				"X.java",
307 				"class Foo {} \n" +
308 				"public class X<T extends Object & Comparable<? super T>> {\n" +
309 				"    public static void main(String[] args) {\n" +
310 				"        new X<Foo>();\n" +
311 				"    }\n" +
312 				"}\n",
313 			},
314 			"----------\n" +
315 			"1. ERROR in X.java (at line 4)\n" +
316 			"	new X<Foo>();\n" +
317 			"	      ^^^\n" +
318 			"Bound mismatch: The type Foo is not a valid substitute for the bounded parameter <T extends Object & Comparable<? super T>> of the type X<T>\n" +
319 			"----------\n");
320 	}
321 
test0011()322 	public void test0011() {
323 		this.runNegativeTest(
324 			new String[] {
325 				"X.java",
326 				"public class X<T extends Object & Comparable<? super T>> {\n" +
327 				"    public static void main(String[] args) {\n" +
328 				"        new X<Foo>();\n" +
329 				"    }\n" +
330 				"}\n",
331 			},
332 			"----------\n" +
333 			"1. ERROR in X.java (at line 3)\n" +
334 			"	new X<Foo>();\n" +
335 			"	      ^^^\n" +
336 			"Foo cannot be resolved to a type\n" +
337 			"----------\n");
338 	}
339 
test0012()340 	public void test0012() {
341 		this.runConformTest(
342 			new String[] {
343 				"X.java",
344 				"public class X <T extends String> {\n" +
345 				"    T foo(T t) {\n" +
346 				"        return t;\n" +
347 				"    }\n" +
348 				"    \n" +
349 				"    public static void main(String[] args) {\n" +
350 				"        String s = new X<String>().foo(\"SUCCESS\");\n" +
351 				"        System.out.println(s);\n" +
352 				"    }\n" +
353 				"}\n",
354 			},
355 			"SUCCESS");
356 	}
357 
test0013()358 	public void test0013() {
359 		this.runConformTest(
360 			new String[] {
361 				"X.java",
362 				"public class X <T extends String> {\n" +
363 				"    T foo(T t) {\n" +
364 				"        return t;\n" +
365 				"    }\n" +
366 				"    public static void main(String[] args) {\n" +
367 				"        new X<String>().baz(\"SUCCESS\");\n" +
368 				"    }\n" +
369 				"    void baz(final T t) {\n" +
370 				"        new Object() {\n" +
371 				"            void print() {\n" +
372 				"                System.out.println(foo(t));\n" +
373 				"            }\n" +
374 				"        }.print();\n" +
375 				"    }\n" +
376 				"}\n",
377 			},
378 			"SUCCESS");
379 	}
380 
test0014()381 	public void test0014() {
382 		this.runNegativeTest(
383 			new String[] {
384 				"X.java",
385 				"public class X <T extends Exception> {\n" +
386 				"    T foo(T t) throws T {\n" +
387 				"        return t;\n" +
388 				"    }\n" +
389 				"    public static void main(String[] args) {\n" +
390 				"        new X<EX>().baz(new EX());\n" +
391 				"    }\n" +
392 				"    void baz(final T t) {\n" +
393 				"        new Object() {\n" +
394 				"            void print() {\n" +
395 				"                System.out.println(foo(t));\n" +
396 				"            }\n" +
397 				"        }.print();\n" +
398 				"    }\n" +
399 				"}\n" +
400 				"class EX extends Exception {\n" +
401 				"}\n",
402 			},
403 			"----------\n" +
404 			"1. ERROR in X.java (at line 11)\n" +
405 			"	System.out.println(foo(t));\n" +
406 			"	                   ^^^^^^\n" +
407 			"Unhandled exception type T\n" +
408 			"----------\n" +
409 			"2. WARNING in X.java (at line 16)\n" +
410 			"	class EX extends Exception {\n" +
411 			"	      ^^\n" +
412 			"The serializable class EX does not declare a static final serialVersionUID field of type long\n" +
413 			"----------\n");
414 	}
test0015()415 	public void test0015() {
416 		this.runConformTest(
417 			new String[] {
418 				"X.java",
419 				"public class X <T extends Exception> {\n" +
420 				"    String foo() throws T {\n" +
421 				"        return \"SUCCESS\";\n" +
422 				"    }\n" +
423 				"    public static void main(String[] args) {\n" +
424 				"        new X<EX>().baz(new EX());\n" +
425 				"    }\n" +
426 				"    void baz(final T t) {\n" +
427 				"        new Object() {\n" +
428 				"            void print() {\n" +
429 				"                try {\n" +
430 				"	                System.out.println(foo());\n" +
431 				"                } catch (Exception t) {\n" +
432 				"                }\n" +
433 				"            }\n" +
434 				"        }.print();\n" +
435 				"    }\n" +
436 				"}\n" +
437 				"class EX extends Exception {\n" +
438 				"}\n",
439 			},
440 			"SUCCESS");
441 	}
442 
test0016()443 	public void test0016() {
444 		this.runConformTest(
445 			new String[] {
446 				"X.java",
447 				"public class X <E extends Exception> {\n" +
448 				"    void foo(E e) throws E {\n" +
449 				"        throw e;\n" +
450 				"    }\n" +
451 				"    void bar(E e) {\n" +
452 				"        try {\n" +
453 				"            foo(e);\n" +
454 				"        } catch(Exception ex) {\n" +
455 				"	        System.out.println(\"SUCCESS\");\n" +
456 				"        }\n" +
457 				"    }\n" +
458 				"    public static void main(String[] args) {\n" +
459 				"        new X<Exception>().bar(new Exception());\n" +
460 				"    }\n" +
461 				"}\n",
462 			},
463 			"SUCCESS");
464 	}
test0017()465 	public void test0017() {
466 		this.runNegativeTest(
467 			new String[] {
468 				"X.java",
469 				"import java.io.IOException;\n" +
470 				"public class X <E extends Exception> {\n" +
471 				"    void foo(E e) throws E {\n" +
472 				"        throw e;\n" +
473 				"    }\n" +
474 				"    void bar(E e) {\n" +
475 				"        try {\n" +
476 				"            foo(e);\n" +
477 				"        } catch(Exception ex) {\n" +
478 				"	        System.out.println(\"SUCCESS\");\n" +
479 				"        }\n" +
480 				"    }\n" +
481 				"    public static void main(String[] args) {\n" +
482 				"        new X<IOException>().bar(new Exception());\n" +
483 				"    }\n" +
484 				"}\n" ,
485 			},
486 			"----------\n" +
487 			"1. ERROR in X.java (at line 14)\n" +
488 			"	new X<IOException>().bar(new Exception());\n" +
489 			"	                     ^^^\n" +
490 			"The method bar(IOException) in the type X<IOException> is not applicable for the arguments (Exception)\n" +
491 			"----------\n");
492 	}
test0018()493 	public void test0018() {
494 		this.runConformTest(
495 			new String[] {
496 				"X.java",
497 				"public class X <T> {\n" +
498 				"    T foo(T t) {\n" +
499 				"        System.out.println(t);\n" +
500 				"        return t;\n" +
501 				"    }\n" +
502 				"    public static void main(String[] args) {\n" +
503 				"        new X<XY>() {\n" +
504 				"            void run() {\n" +
505 				"                foo(new XY());\n" +
506 				"            }\n" +
507 				"        }.run();\n" +
508 				"    }\n" +
509 				"}\n" +
510 				"class XY {\n" +
511 				"    public String toString() {\n" +
512 				"        return \"SUCCESS\";\n" +
513 				"    }\n" +
514 				"}\n",
515 			},
516 			"SUCCESS");
517 	}
test0019()518 	public void test0019() {
519 		this.runNegativeTest(
520 			new String[] {
521 				"X.java",
522 				"public class X <T> {\n" +
523 				"     private T foo(T t) {\n" +
524 				"        System.out.println(t);\n" +
525 				"        return t;\n" +
526 				"    }\n" +
527 				"    public static void main(String[] args) {\n" +
528 				"        new X<XY>() {\n" +
529 				"            void run() {\n" +
530 				"                foo(new XY());\n" +
531 				"            }\n" +
532 				"        }.run();\n" +
533 				"    }\n" +
534 				"}\n" +
535 				"class XY {\n" +
536 				"    public String toString() {\n" +
537 				"        return \"SUCCESS\";\n" +
538 				"    }\n" +
539 				"}",
540 			},
541 			"----------\n" +
542 			"1. ERROR in X.java (at line 9)\n" +
543 			"	foo(new XY());\n" +
544 			"	^^^\n" +
545 			"The method foo(T) in the type X<T> is not applicable for the arguments (XY)\n" +
546 			"----------\n" +
547 			"2. WARNING in X.java (at line 15)\n" +
548 			"	public String toString() {\n" +
549 			"	              ^^^^^^^^^^\n" +
550 			"The method toString() of type XY should be tagged with @Override since it actually overrides a superclass method\n" +
551 			"----------\n");
552 	}
test0020()553 	public void test0020() {
554 		this.runNegativeTest(
555 			new String[] {
556 				"X.java",
557 				"public class X <T> {\n" +
558 				"     void foo(Y<T> y) {\n" +
559 				"		System.out.print(\"SUCC\");\n" +
560 				"    }\n" +
561 				"    public static void main(String[] args) {\n" +
562 				"        new X<String>().bar();\n" +
563 				"    }\n" +
564 				"    void bar() {\n" +
565 				"        new Y<T>() {\n" +
566 				"            @Override\n" +
567 				"            public void pre() {\n" +
568 				"                foo(this);\n" +
569 				"            }\n" +
570 				"        }.print(\"ESS\");\n" +
571 				"    }\n" +
572 				"}\n" +
573 				"class Y <P> {\n" +
574 				"	public void print(P p) {\n" +
575 				"		pre();\n" +
576 				"		System.out.println(p);\n" +
577 				"	}\n" +
578 				"	public void pre() {\n" +
579 				"	}\n" +
580 				"}",
581 			},
582 			"----------\n" +
583 			"1. ERROR in X.java (at line 14)\n" +
584 			"	}.print(\"ESS\");\n" +
585 			"	  ^^^^^\n" +
586 			"The method print(T) in the type Y<T> is not applicable for the arguments (String)\n" +
587 			"----------\n");
588 	}
test0021()589 	public void test0021() {
590 		this.runNegativeTest(
591 			new String[] {
592 				"X.java",
593 				"public class X <T extends String> {\n" +
594 				"    void foo(T t) {\n" +
595 				"    }\n" +
596 				"    void bar(String x) {\n" +
597 				"        foo(x);\n" +
598 				"    }\n" +
599 				"    public static void main(String[] args) {\n" +
600 				"        new X<String>().foo(new Object());\n" +
601 				"    }\n" +
602 				"}\n",
603 			},
604 			"----------\n" +
605 			"1. WARNING in X.java (at line 1)\n" +
606 			"	public class X <T extends String> {\n" +
607 			"	                          ^^^^^^\n" +
608 			"The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
609 			"----------\n" +
610 			"2. ERROR in X.java (at line 5)\n" +
611 			"	foo(x);\n" +
612 			"	^^^\n" +
613 			"The method foo(T) in the type X<T> is not applicable for the arguments (String)\n" +
614 			"----------\n" +
615 			"3. ERROR in X.java (at line 8)\n" +
616 			"	new X<String>().foo(new Object());\n" +
617 			"	                ^^^\n" +
618 			"The method foo(String) in the type X<String> is not applicable for the arguments (Object)\n" +
619 			"----------\n");
620 	}
621 
test0022()622 	public void test0022() {
623 		this.runConformTest(
624 			new String[] {
625 				"X.java",
626 				"public class X <T extends String> {\n" +
627 				"    X(T t) {\n" +
628 				"        System.out.println(t);\n" +
629 				"    }\n" +
630 				"    \n" +
631 				"    public static void main(String[] args) {\n" +
632 				"       new X<String>(\"SUCCESS\");\n" +
633 				"    }\n" +
634 				"}\n",
635 			},
636 			"SUCCESS");
637 	}
638 
test0023()639 	public void test0023() {
640 		this.runConformTest(
641 			new String[] {
642 				"X.java",
643 				"public class X <T extends String> {\n" +
644 				"    X(final T t) {\n" +
645 				"        new Object() {\n" +
646 				"            void print() {\n" +
647 				"                System.out.println(t);\n" +
648 				"            }\n" +
649 				"        }.print();\n" +
650 				"    }\n" +
651 				"    public static void main(String[] args) {\n" +
652 				"        new X<String>(\"SUCCESS\");\n" +
653 				"    }\n" +
654 				"}\n",
655 			},
656 			"SUCCESS");
657 	}
658 
test0024()659 	public void test0024() {
660 		this.runNegativeTest(
661 			new String[] {
662 				"X.java",
663 				"public class X <T extends Exception> {\n" +
664 				"    X(final T t) throws T {\n" +
665 				"        new Object() {\n" +
666 				"            void print() {\n" +
667 				"                System.out.println(t);\n" +
668 				"            }\n" +
669 				"        }.print();\n" +
670 				"    }\n" +
671 				"    public static void main(String[] args) {\n" +
672 				"        new X<EX>(new EX());\n" +
673 				"    }\n" +
674 				"}\n" +
675 				"class EX extends Exception {\n" +
676 				"}\n",
677 			},
678 			"----------\n" +
679 			"1. ERROR in X.java (at line 10)\n" +
680 			"	new X<EX>(new EX());\n" +
681 			"	^^^^^^^^^^^^^^^^^^^\n" +
682 			"Unhandled exception type EX\n" +
683 			"----------\n" +
684 			"2. WARNING in X.java (at line 13)\n" +
685 			"	class EX extends Exception {\n" +
686 			"	      ^^\n" +
687 			"The serializable class EX does not declare a static final serialVersionUID field of type long\n" +
688 			"----------\n");
689 	}
690 
test0025()691 	public void test0025() {
692 		this.runConformTest(
693 			new String[] {
694 				"X.java",
695 				"public class X <T extends Exception> {\n" +
696 				"    String foo() throws T {\n" +
697 				"        return \"SUCCESS\";\n" +
698 				"    }\n" +
699 				"    public static void main(String[] args) {\n" +
700 				"        new X<EX>(new EX());\n" +
701 				"    }\n" +
702 				"    X(final T t) {\n" +
703 				"        new Object() {\n" +
704 				"            void print() {\n" +
705 				"                try {\n" +
706 				"	                System.out.println(foo());\n" +
707 				"                } catch (Exception t) {\n" +
708 				"                }\n" +
709 				"            }\n" +
710 				"        }.print();\n" +
711 				"    }\n" +
712 				"}\n" +
713 				"class EX extends Exception {\n" +
714 				"}\n",
715 			},
716 			"SUCCESS");
717 	}
718 
test0026()719 	public void test0026() {
720 		this.runConformTest(
721 			new String[] {
722 				"X.java",
723 				"public class X <E extends Exception> {\n" +
724 				"    void foo(E e) throws E {\n" +
725 				"        throw e;\n" +
726 				"    }\n" +
727 				"    X(E e) {\n" +
728 				"        try {\n" +
729 				"            foo(e);\n" +
730 				"        } catch(Exception ex) {\n" +
731 				"	        System.out.println(\"SUCCESS\");\n" +
732 				"        }\n" +
733 				"    }\n" +
734 				"    public static void main(String[] args) {\n" +
735 				"        new X<Exception>(new Exception());\n" +
736 				"    }\n" +
737 				"}\n",
738 			},
739 			"SUCCESS");
740 	}
test0027()741 	public void test0027() {
742 		this.runNegativeTest(
743 			new String[] {
744 				"X.java",
745 				"import java.io.IOException;\n" +
746 				"public class X <E extends Exception> {\n" +
747 				"    void foo(E e) throws E {\n" +
748 				"        throw e;\n" +
749 				"    }\n" +
750 				"    X(E e) {\n" +
751 				"        try {\n" +
752 				"            foo(e);\n" +
753 				"        } catch(Exception ex) {\n" +
754 				"	        System.out.println(\"SUCCESS\");\n" +
755 				"        }\n" +
756 				"    }\n" +
757 				"    public static void main(String[] args) {\n" +
758 				"        new X<IOException>(new Exception());\n" +
759 				"    }\n" +
760 				"}\n" ,
761 			},
762 			"----------\n" +
763 			"1. ERROR in X.java (at line 14)\n" +
764 			"	new X<IOException>(new Exception());\n" +
765 			"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
766 			"The constructor X<IOException>(Exception) is undefined\n" +
767 			"----------\n");
768 	}
769 
test0028()770 	public void test0028() {
771 		this.runConformTest(
772 			new String[] {
773 				"X.java",
774 				"public class X <T> {\n" +
775 				"    T t;\n" +
776 				"    X(T t) {\n" +
777 				"        this.t = t;\n" +
778 				"    }\n" +
779 				"    public static void main(String[] args) {\n" +
780 				"        String s = new X<String>(\"SU\").t;\n" +
781 				"        System.out.print(s);\n" +
782 				"        s = new X<String>(\"failed\").t = \"CC\";\n" +
783 				"        System.out.print(s);\n" +
784 				"        s = new X<String>(\"\").t += \"ESS\";\n" +
785 				"        System.out.println(s);\n" +
786 				"    }\n" +
787 				"}\n",
788 			},
789 			"SUCCESS");
790 	}
791 
test0029()792 	public void test0029() {
793 		this.runNegativeTest(
794 			new String[] {
795 				"X.java",
796 				"public class X <T> {\n" +
797 				"    T t;\n" +
798 				"    X() {\n" +
799 				"    }\n" +
800 				"    T foo(T a, T b) {\n" +
801 				"        T s;\n" +
802 				"        s = t = a;\n" +
803 				"		s = t += b;\n" +
804 				"		return t;\n" +
805 				"    }\n" +
806 				"    public static void main(String[] args) {\n" +
807 				"        System.out.println(new X<String>().foo(\"SUC\", \"CESS\"));\n" +
808 				"    }\n" +
809 				"}\n",
810 			},
811 			"----------\n" +
812 			"1. ERROR in X.java (at line 8)\n" +
813 			"	s = t += b;\n" +
814 			"	    ^^^^^^\n" +
815 			"The operator += is undefined for the argument type(s) T, T\n" +
816 			"----------\n");
817 	}
818 
test0030()819 	public void test0030() {
820 		this.runConformTest(
821 			new String[] {
822 				"X.java",
823 				"public class X <T> {\n" +
824 				"    T t;\n" +
825 				"    X() {\n" +
826 				"    }\n" +
827 				"    T foo(T a) {\n" +
828 				"        T s;\n" +
829 				"        s = t = a;\n" +
830 				"		return t;\n" +
831 				"    }\n" +
832 				"    public static void main(String[] args) {\n" +
833 				"        System.out.println(new X<String>().foo(\"SUCCESS\"));\n" +
834 				"    }\n" +
835 				"}\n" ,
836 			},
837 			"SUCCESS");
838 	}
839 
test0031()840 	public void test0031() {
841 		this.runConformTest(
842 			new String[] {
843 				"X.java",
844 				"public class X <T> {\n" +
845 				"    T t;\n" +
846 				"    X(T t) {\n" +
847 				"        this.t = t;\n" +
848 				"    }\n" +
849 				"    public static void main(String[] args) {\n" +
850 				"        new X<String>(\"OUTER\").bar();\n" +
851 				"    }\n" +
852 				"    void bar() {\n" +
853 				"        new X<String>(\"INNER\") {\n" +
854 				"            void run() {\n" +
855 				"                \n" +
856 				"                new Object() {\n" +
857 				"                    void run() {\n" +
858 				"		                String s = t = \"SUC\";\n" +
859 				"		                s = t+= \"CESS\";\n" +
860 				"				        System.out.println(t);\n" +
861 				"                    }\n" +
862 				"                }.run();\n" +
863 				"            }\n" +
864 				"        }.run();\n" +
865 				"    }\n" +
866 				"}\n" ,
867 			},
868 			"SUCCESS");
869 	}
870 
test0032()871 	public void test0032() {
872 		this.runConformTest(
873 			new String[] {
874 				"X.java",
875 				"public class X <T> {\n" +
876 				"    T t;\n" +
877 				"    X(T t) {\n" +
878 				"        this.t = t;\n" +
879 				"    }\n" +
880 				"    public static void main(String[] args) {\n" +
881 				"        new X<String>(\"OUTER\").bar();\n" +
882 				"    }\n" +
883 				"    void bar() {\n" +
884 				"        new X<String>(\"INNER\") {\n" +
885 				"            void run() {\n" +
886 				"                String s = t = \"SUC\";\n" +
887 				"                s = t+= \"CESS\";\n" +
888 				"		        System.out.println(t);\n" +
889 				"            }\n" +
890 				"        }.run();\n" +
891 				"    }\n" +
892 				"}\n" ,
893 			},
894 			"SUCCESS");
895 	}
896 
test0033()897 	public void test0033() {
898 		this.runNegativeTest(
899 			new String[] {
900 				"X.java",
901 				"public class X <E, T> {\n" +
902 				"	void foo(E e){}\n" +
903 				"	void foo(T t){}\n" +
904 				"}\n" ,
905 			},
906 			"----------\n" +
907 			"1. ERROR in X.java (at line 2)\n" +
908 			"	void foo(E e){}\n" +
909 			"	     ^^^^^^^^\n" +
910 			"Erasure of method foo(E) is the same as another method in type X<E,T>\n" +
911 			"----------\n" +
912 			"2. ERROR in X.java (at line 3)\n" +
913 			"	void foo(T t){}\n" +
914 			"	     ^^^^^^^^\n" +
915 			"Erasure of method foo(T) is the same as another method in type X<E,T>\n" +
916 			"----------\n");
917 	}
918 
test0034()919 	public void test0034() {
920 		this.runNegativeTest(
921 			new String[] {
922 				"X.java",
923 				"public class X <E extends Exception, T extends Exception> {\n" +
924 				"	void foo(E e){}\n" +
925 				"	void foo(T t){}\n" +
926 				"}\n" ,
927 			},
928 			"----------\n" +
929 			"1. ERROR in X.java (at line 2)\n" +
930 			"	void foo(E e){}\n" +
931 			"	     ^^^^^^^^\n" +
932 			"Erasure of method foo(E) is the same as another method in type X<E,T>\n" +
933 			"----------\n" +
934 			"2. ERROR in X.java (at line 3)\n" +
935 			"	void foo(T t){}\n" +
936 			"	     ^^^^^^^^\n" +
937 			"Erasure of method foo(T) is the same as another method in type X<E,T>\n" +
938 			"----------\n");
939 	}
940 
test0035()941 	public void test0035() {
942 		this.runNegativeTest(
943 			new String[] {
944 				"X.java",
945 				"public class X <E extends Exception, T extends Thread> {\n" +
946 				"	void foo(E e, Thread t){}\n" +
947 				"	void foo(Exception e, T t){}\n" +
948 				"}\n" ,
949 			},
950 			"----------\n" +
951 			"1. ERROR in X.java (at line 2)\n" +
952 			"	void foo(E e, Thread t){}\n" +
953 			"	     ^^^^^^^^^^^^^^^^^^\n" +
954 			"Erasure of method foo(E, Thread) is the same as another method in type X<E,T>\n" +
955 			"----------\n" +
956 			"2. ERROR in X.java (at line 3)\n" +
957 			"	void foo(Exception e, T t){}\n" +
958 			"	     ^^^^^^^^^^^^^^^^^^^^^\n" +
959 			"Erasure of method foo(Exception, T) is the same as another method in type X<E,T>\n" +
960 			"----------\n");
961 	}
962 
test0036()963 	public void test0036() {
964 		this.runConformTest(
965 			new String[] {
966 				"X.java",
967 				"public class X <E extends Exception, T extends Thread> {\n" +
968 				"	void foo(E e){}\n" +
969 				"	void foo(T t){}\n" +
970 				"    public static void main(String[] args) {\n" +
971 				"		 System.out.println(\"SUCCESS\");\n" +
972 				"    }\n" +
973 				"}\n" ,
974 			},
975 			"SUCCESS");
976 	}
977 
test0037()978 	public void test0037() {
979 		this.runConformTest(
980 			new String[] {
981 				"X.java",
982 				"public class X <E extends Cloneable, T extends Thread & Cloneable> {\n" +
983 				"	void foo(E e){}\n" +
984 				"	void foo(T t){}\n" +
985 				"    public static void main(String[] args) {\n" +
986 				"		 System.out.println(\"SUCCESS\");\n" +
987 				"    }\n" +
988 				"}\n" ,
989 			},
990 			"SUCCESS");
991 	}
992 
test0038()993 	public void test0038() {
994 		this.runNegativeTest(
995 			new String[] {
996 				"X.java",
997 				"public class X <E extends Cloneable, T extends Thread & Cloneable> {\n" +
998 				"	void foo(E e){}\n" +
999 				"	void foo(T t){}\n" +
1000 				"	public static void main(String[] args) {\n" +
1001 				"		X<XY,XY> x = new X<XY, XY>();\n" +
1002 				"		x.foo(new XY());\n" +
1003 				"	}\n" +
1004 				"}\n" +
1005 				"class XY extends Thread implements Cloneable {\n" +
1006 				"}\n" ,
1007 			},		"----------\n" +
1008 			"1. ERROR in X.java (at line 6)\n" +
1009 			"	x.foo(new XY());\n" +
1010 			"	  ^^^\n" +
1011 			"The method foo(XY) is ambiguous for the type X<XY,XY>\n" +
1012 			"----------\n");
1013 	}
1014 
test0039()1015 	public void test0039() {
1016 		this.runNegativeTest(
1017 			new String[] {
1018 				"X.java",
1019 				"public class X <E extends Cloneable, T extends Thread> {\n" +
1020 				"	void foo(L<E> l1){}\n" +
1021 				"	void foo(L<T> l2){}\n" +
1022 				"	void foo(L l){}\n" +
1023 				"}\n" +
1024 				"\n" +
1025 				"class L<E> {\n" +
1026 				"}\n",
1027 			},
1028 			"----------\n" +
1029 			"1. ERROR in X.java (at line 2)\n" +
1030 			"	void foo(L<E> l1){}\n" +
1031 			"	     ^^^^^^^^^^^^\n" +
1032 			"Erasure of method foo(L<E>) is the same as another method in type X<E,T>\n" +
1033 			"----------\n" +
1034 			"2. ERROR in X.java (at line 3)\n" +
1035 			"	void foo(L<T> l2){}\n" +
1036 			"	     ^^^^^^^^^^^^\n" +
1037 			"Erasure of method foo(L<T>) is the same as another method in type X<E,T>\n" +
1038 			"----------\n" +
1039 			"3. ERROR in X.java (at line 4)\n" +
1040 			"	void foo(L l){}\n" +
1041 			"	     ^^^^^^^^\n" +
1042 			"Erasure of method foo(L) is the same as another method in type X<E,T>\n" +
1043 			"----------\n" +
1044 			"4. WARNING in X.java (at line 4)\n" +
1045 			"	void foo(L l){}\n" +
1046 			"	         ^\n" +
1047 			"L is a raw type. References to generic type L<E> should be parameterized\n" +
1048 			"----------\n");
1049 	}
1050 
test0040()1051 	public void test0040() {
1052 		this.runConformTest(
1053 			new String[] {
1054 				"X.java",
1055 				"public class X <T extends X> {\n" +
1056 				"    public static void main(String[] args) {\n" +
1057 				"        System.out.println(\"SUCCESS\");\n" +
1058 				"    }    \n" +
1059 				"}\n",
1060 			},
1061 			"SUCCESS");
1062 	}
1063 
test0041()1064 	public void test0041() {
1065 		this.runConformTest(
1066 			new String[] {
1067 				"X.java",
1068 				"public class X <T, U extends T> {\n" +
1069 				"    public static void main(String[] args) {\n" +
1070 				"        System.out.println(\"SUCCESS\");\n" +
1071 				"    }    \n" +
1072 				"}\n",
1073 			},
1074 			"SUCCESS");
1075 	}
1076 
1077 	// **
test0042()1078 	public void test0042() {
1079 		String[] test = new String[] {
1080 			"X.java",
1081 			"public class X <T extends U, U> {}"
1082 		};
1083 		if (this.complianceLevel < ClassFileConstants.JDK1_7) {
1084 			this.runNegativeTest(
1085 				test,
1086 				"----------\n" +
1087 				"1. ERROR in X.java (at line 1)\n" +
1088 				"	public class X <T extends U, U> {}\n" +
1089 				"	                ^\n" +
1090 				"Illegal forward reference to type parameter U\n" +
1091 				"----------\n");
1092 		} else {
1093 			this.runConformTest(test, "");
1094 		}
1095 	}
1096 
test0043()1097 	public void test0043() {
1098 		this.runConformTest(
1099 			new String[] {
1100 				"X.java",
1101 				"public class X <T extends L<T> , U extends T> {\n" +
1102 				"    public static void main(String[] args) {\n" +
1103 				"        System.out.println(\"SUCCESS\");\n" +
1104 				"    }\n" +
1105 				"}\n" +
1106 				"class L<E>{}\n",
1107 			},
1108 			"SUCCESS");
1109 	}
1110 
test0044()1111 	public void test0044() {
1112 		this.runConformTest(
1113 			new String[] {
1114 				"X.java",
1115 				"public class X extends L<X> {\n" +
1116 				"    public static void main(String[] args) {\n" +
1117 				"        System.out.println(\"SUCCESS\");\n" +
1118 				"    }    \n" +
1119 				"}\n" +
1120 				"class L<E> {}\n",
1121 			},
1122 			"SUCCESS");
1123 	}
1124 
test0045()1125 	public void test0045() {
1126 		this.runNegativeTest(
1127 			new String[] {
1128 				"X.java",
1129 				"public class X {\n" +
1130 				"    public Z<T> var;\n" +
1131 				"}\n",
1132 			},
1133 			"----------\n" +
1134 			"1. ERROR in X.java (at line 2)\n" +
1135 			"	public Z<T> var;\n" +
1136 			"	       ^\n" +
1137 			"Z cannot be resolved to a type\n" +
1138 			"----------\n" +
1139 			"2. ERROR in X.java (at line 2)\n" +
1140 			"	public Z<T> var;\n" +
1141 			"	         ^\n" +
1142 			"T cannot be resolved to a type\n" +
1143 			"----------\n");
1144 	}
test0046()1145 	public void test0046() {
1146 		this.runNegativeTest(
1147 			new String[] {
1148 				"X.java",
1149 				"public class X {\n" +
1150 				"    public Object<T> var;\n" +
1151 				"}\n",
1152 			},
1153 			"----------\n" +
1154 			"1. ERROR in X.java (at line 2)\n" +
1155 			"	public Object<T> var;\n" +
1156 			"	       ^^^^^^\n" +
1157 			"The type Object is not generic; it cannot be parameterized with arguments <T>\n" +
1158 			"----------\n" +
1159 			"2. ERROR in X.java (at line 2)\n" +
1160 			"	public Object<T> var;\n" +
1161 			"	              ^\n" +
1162 			"T cannot be resolved to a type\n" +
1163 			"----------\n");
1164 	}
test0047()1165 	public void test0047() {
1166 		this.runNegativeTest(
1167 			new String[] {
1168 				"X.java",
1169 				"public class X <T> {\n" +
1170 				"    private T t;\n" +
1171 				"    X(T t) {\n" +
1172 				"        this.t = t;\n" +
1173 				"    }\n" +
1174 				"    public static void main(String[] args) {\n" +
1175 				"        new X<String>(\"OUTER\").bar();\n" +
1176 				"    }\n" +
1177 				"    void bar() {\n" +
1178 				"        new MX<String>(\"INNER\") {\n" +
1179 				"            void run() {\n" +
1180 				"                \n" +
1181 				"                new Object() {\n" +
1182 				"                    void run() {\n" +
1183 				"		                String s = t = \"SUC\";\n" +
1184 				"		                s = t+= \"CESS\";\n" +
1185 				"				        System.out.println(t);\n" +
1186 				"                    }\n" +
1187 				"                }.run();\n" +
1188 				"            }\n" +
1189 				"        }.run();\n" +
1190 				"    }\n" +
1191 				"}\n" +
1192 				"class MX<U> {\n" +
1193 				"    MX(U u){}\n" +
1194 				"}\n",
1195 			},
1196 			"----------\n" +
1197 			"1. ERROR in X.java (at line 15)\n" +
1198 			"	String s = t = \"SUC\";\n" +
1199 			"	           ^^^^^^^^^\n" +
1200 			"Type mismatch: cannot convert from T to String\n" +
1201 			"----------\n" +
1202 			"2. ERROR in X.java (at line 15)\n" +
1203 			"	String s = t = \"SUC\";\n" +
1204 			"	               ^^^^^\n" +
1205 			"Type mismatch: cannot convert from String to T\n" +
1206 			"----------\n" +
1207 			"3. ERROR in X.java (at line 16)\n" +
1208 			"	s = t+= \"CESS\";\n" +
1209 			"	    ^^^^^^^^^^\n" +
1210 			"The operator += is undefined for the argument type(s) T, String\n" +
1211 			"----------\n");
1212 	}
1213 	// Access to enclosing 't' of type 'T' (not substituted from X<X> as private thus non inherited)
test0048()1214 	public void test0048() {
1215 		this.runNegativeTest(
1216 			// test directory preparation
1217 			new String[] { /* test files */
1218 				"X.java",
1219 				"public class X <T> {\n" +
1220 				"    private T t;\n" +
1221 				"    X(T t) {\n" +
1222 				"        this.t = t;\n" +
1223 				"    }\n" +
1224 				"    public static void main(String[] args) {\n" +
1225 				"        new X<String>(\"OUTER\").bar();\n" +
1226 				"    }\n" +
1227 				"    void bar() {\n" +
1228 				"        new X<X>(this) {\n" +
1229 				"            void run() {\n" +
1230 				"                new Object() {\n" +
1231 				"                    void run() {\n" +
1232 				"                        X x = t;\n" +
1233 				"				        System.out.println(x);\n" +
1234 				"                    }\n" +
1235 				"                }.run();\n" +
1236 				"            }\n" +
1237 				"        }.run();\n" +
1238 				"    }\n" +
1239 				"}\n",
1240 			},
1241 			// compiler results
1242 			"----------\n" + /* expected compiler log */
1243 			"1. WARNING in X.java (at line 10)\n" +
1244 			"	new X<X>(this) {\n" +
1245 			"	      ^\n" +
1246 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
1247 			"----------\n" +
1248 			"2. WARNING in X.java (at line 14)\n" +
1249 			"	X x = t;\n" +
1250 			"	^\n" +
1251 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
1252 			"----------\n" +
1253 			"3. ERROR in X.java (at line 14)\n" +
1254 			"	X x = t;\n" +
1255 			"	      ^\n" +
1256 			"Type mismatch: cannot convert from T to X\n" +
1257 			"----------\n",
1258 			// javac options
1259 			JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
1260 	}
test0049()1261 	public void test0049() {
1262 		this.runConformTest(
1263 			new String[] {
1264 				"X.java",
1265 				"public class X <T> {\n" +
1266 				"    public T t;\n" +
1267 				"    X(T t) {\n" +
1268 				"        this.t = t;\n" +
1269 				"    }\n" +
1270 				"    public static void main(String[] args) {\n" +
1271 				"        new X<String>(\"OUTER\").bar();\n" +
1272 				"    }\n" +
1273 				"    void bar() {\n" +
1274 				"        new X<X>(this) {\n" +
1275 				"            void run() {\n" +
1276 				"                new Object() {\n" +
1277 				"                    void run() {\n" +
1278 				"                        X x = t;\n" +
1279 				"				        System.out.println(\"SUCCESS\");\n" +
1280 				"                    }\n" +
1281 				"                }.run();\n" +
1282 				"            }\n" +
1283 				"        }.run();\n" +
1284 				"    }\n" +
1285 				"}\n",
1286 			},
1287 			"SUCCESS");
1288 	}
test0050()1289 	public void test0050() {
1290 		this.runNegativeTest(
1291 			new String[] {
1292 				"X.java",
1293 				"public class X <T extends N> {\n" +
1294 				"	static class N {}" +
1295 				"}\n" +
1296 				"class Y <T extends Y.N> {\n" +
1297 				"	static class N {}" +
1298 				"}\n"
1299 			},
1300 			"----------\n" +
1301 			"1. ERROR in X.java (at line 1)\n" +
1302 			"	public class X <T extends N> {\n" +
1303 			"	                          ^\n" +
1304 			"N cannot be resolved to a type\n" +
1305 			"----------\n");
1306 	}
test0050a()1307 	public void test0050a() {
1308 		this.runNegativeTest(
1309 			new String[] {
1310 				"X.java",
1311 				"class Super {class M {}}\n" +
1312 				"public class X <T extends M> extends Super {}\n" +
1313 				"class Y <T extends Y.M> extends Super {}\n",
1314 			},
1315 			"----------\n" +
1316 			"1. ERROR in X.java (at line 2)\n" +
1317 			"	public class X <T extends M> extends Super {}\n" +
1318 			"	                          ^\n" +
1319 			"M cannot be resolved to a type\n" +
1320 			"----------\n");
1321 	}
1322 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=98504
test0050b()1323 	public void test0050b() {
1324 		this.runConformTest(
1325 			new String[] {
1326 				"X.java",
1327 				"public class X {\n" +
1328 				"	class M extends Y implements I {}\n" +
1329 				"}\n" +
1330 				"class Y {\n" +
1331 				"	static interface I { void foo(); }\n" +
1332 				"}\n" +
1333 				"interface I {}\n"
1334 			},
1335 			"");
1336 	}
1337 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=98504 - variation
test0050c()1338 	public void test0050c() {
1339 		this.runConformTest(
1340 			new String[] {
1341 				"Test.java",
1342 				"public class Test<T extends Test.InnerTest> implements Base<T> {\n" +
1343 				"	static class InnerTest implements Inner {}\n" +
1344 				"}\n"+
1345 				"interface Base<T> {\n" +
1346 				"	interface Inner {}\n" +
1347 				"}\n"
1348 			},
1349 			"");
1350 	}
1351 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=101387
test0050d()1352 	public void test0050d() {
1353 		this.runConformTest(
1354 			new String[] {
1355 				"X.java",
1356 				"public class X<I, C extends I> {}\n" +
1357 				"class Y extends X<Y.M, Y.N> {\n" +
1358 				"	static class M {}\n" +
1359 				"	static class N extends M {}\n" +
1360 				"}\n"
1361 			},
1362 			"");
1363 	}
test0051()1364 	public void test0051() {
1365 		this.runConformTest(
1366 			new String[] {
1367 				"X.java",
1368 				"class Super {class M {}}\n" +
1369 				"public class X extends Super {\n" +
1370 				"	class N <T extends M> {}\n" +
1371 				"	public static void main(String[] args) {\n" +
1372 				"		System.out.println(\"SUCCESS\");\n" +
1373 				"	}\n" +
1374 				"}\n",
1375 			},
1376 			"SUCCESS");
1377 	}
test0052()1378 	public void test0052() {
1379 		this.runConformTest(
1380 			new String[] {
1381 				"X.java",
1382 				"public class X <T> extends p.A<T> {\n" +
1383 				"	public static void main(String[] args) {\n" +
1384 				"		System.out.println(\"SUCCESS\");\n" +
1385 				"	}\n" +
1386 				"}\n",
1387 				"p/A.java",
1388 				"package p; \n" +
1389 				"public class A<P> {\n" +
1390 				"}\n",
1391 			},
1392 			"SUCCESS");
1393 	}
test0053()1394 	public void test0053() {
1395 		this.runConformTest(
1396 			new String[] {
1397 				"X.java",
1398 				"public class X <T> extends p.A<T> {\n" +
1399 				"    protected T t;\n" +
1400 				"    X(T t) {\n" +
1401 				"        this.t = t;\n" +
1402 				"    }\n" +
1403 				"    public static void main(String[] args) {\n" +
1404 				"        new X<String>(\"OUTER\").bar();\n" +
1405 				"    }\n" +
1406 				"    void bar() {\n" +
1407 				"        new X<X>(this) {\n" +
1408 				"            void run() {\n" +
1409 				"                new Object() {\n" +
1410 				"                    void run() {\n" +
1411 				"                        print(t);\n" +
1412 				"                    }\n" +
1413 				"                }.run();\n" +
1414 				"            }\n" +
1415 				"        }.run();\n" +
1416 				"    }\n" +
1417 				"}\n",
1418 				"p/A.java",
1419 				"package p; \n" +
1420 				"public class A<P> {\n" +
1421 				"    protected void print(P p) {\n" +
1422 				"        System.out.println(\"SUCCESS\");\n" +
1423 				"    }\n" +
1424 				"}\n",
1425 			},
1426 			"SUCCESS");
1427 	}
test0054()1428 	public void test0054() {
1429 		this.runNegativeTest(
1430 			new String[] {
1431 				"X.java",
1432 				"public class X <T> extends p.A<T> {\n" +
1433 				"    protected T t;\n" +
1434 				"    X(T t) {\n" +
1435 				"        this.t = t;\n" +
1436 				"    }\n" +
1437 				"    public static void main(String[] args) {\n" +
1438 				"        new X<String>(\"OUTER\").bar();\n" +
1439 				"    }\n" +
1440 				"    void bar() {\n" +
1441 				"        new X<X>(this) {\n" +
1442 				"            void run() {\n" +
1443 				"                new Object() {\n" +
1444 				"                    void run() {\n" +
1445 				"                        print(X.this.t);\n" +
1446 				"                    }\n" +
1447 				"                }.run();\n" +
1448 				"            }\n" +
1449 				"        }.run();\n" +
1450 				"    }\n" +
1451 				"}\n",
1452 				"p/A.java",
1453 				"package p; \n" +
1454 				"public class A<P> {\n" +
1455 				"    protected void print(P p) {\n" +
1456 				"        System.out.println(\"SUCCESS\");\n" +
1457 				"    }\n" +
1458 				"}\n",
1459 			},
1460 			"----------\n" +
1461 			"1. WARNING in X.java (at line 10)\n" +
1462 			"	new X<X>(this) {\n" +
1463 			"	      ^\n" +
1464 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
1465 			"----------\n" +
1466 			"2. ERROR in X.java (at line 14)\n" +
1467 			"	print(X.this.t);\n" +
1468 			"	^^^^^\n" +
1469 			"The method print(X) in the type A<X> is not applicable for the arguments (T)\n" +
1470 			"----------\n");
1471 	}
1472 
test0055()1473 	public void test0055() {
1474 		this.runConformTest(
1475 			new String[] {
1476 				"X.java",
1477 				"public class X <T> extends p.A<T> {\n" +
1478 				"    protected T t;\n" +
1479 				"    X(T t) {\n" +
1480 				"        super(t);\n" +
1481 				"        this.t = t;\n" +
1482 				"    }\n" +
1483 				"    public static void main(String[] args) {\n" +
1484 				"	  X<String> xs = new X<String>(\"SUCCESS\");\n" +
1485 				"	  System.out.println(xs.t);\n" +
1486 				"    }\n" +
1487 				"}\n",
1488 				"p/A.java",
1489 				"package p; \n" +
1490 				"public class A<P> {\n" +
1491 				"	 protected P p;\n" +
1492 				"    protected A(P p) {\n" +
1493 				"       this.p = p; \n" +
1494 				"    } \n" +
1495 				"    protected void print(P p) {\n" +
1496 				"        System.out.println(\"SUCCESS\");\n" +
1497 				"    }\n" +
1498 				"}\n",
1499 			},
1500 			"SUCCESS");
1501 	}
1502 
test0056()1503 	public void test0056() {
1504 		this.runNegativeTest(
1505 			new String[] {
1506 				"X.java",
1507 				"public class X <T> extends p.A<T> {\n" +
1508 				"    protected T t;\n" +
1509 				"    X(T t) {\n" +
1510 				"        super(t);\n" +
1511 				"        this.t = t;\n" +
1512 				"    }\n" +
1513 				"    public static void main(String[] args) {\n" +
1514 				"	  X<String> xs = new X<String>(\"SUCCESS\");\n" +
1515 				"	  System.out.println((X)xs.t);\n" +
1516 				"    }\n" +
1517 				"}\n",
1518 				"p/A.java",
1519 				"package p; \n" +
1520 				"public class A<P> {\n" +
1521 				"	 protected P p;\n" +
1522 				"    protected A(P p) {\n" +
1523 				"       this.p = p; \n" +
1524 				"    } \n" +
1525 				"    protected void print(P p) {\n" +
1526 				"        System.out.println(\"SUCCESS\");\n" +
1527 				"    }\n" +
1528 				"}\n",
1529 			},
1530 			"----------\n" +
1531 			"1. ERROR in X.java (at line 9)\n" +
1532 			"	System.out.println((X)xs.t);\n" +
1533 			"	                   ^^^^^^^\n" +
1534 			"Cannot cast from String to X\n" +
1535 			"----------\n" +
1536 			"----------\n" +
1537 			"1. WARNING in p\\A.java (at line 7)\n" +
1538 			"	protected void print(P p) {\n" +
1539 			"	                       ^\n" +
1540 			"The parameter p is hiding a field from type A<P>\n" +
1541 			"----------\n");
1542 	}
1543 
test0057()1544 	public void test0057() {
1545 		this.runConformTest(
1546 			new String[] {
1547 				"X.java",
1548 				"public class X <T> extends p.A<T> {\n" +
1549 				"    protected T t;\n" +
1550 				"    X(T t) {\n" +
1551 				"        super(t);\n" +
1552 				"        this.t = t;\n" +
1553 				"    }\n" +
1554 				"    public static void main(String[] args) {\n" +
1555 				"	  X<X<String>> xs = new X<X<String>>(new X<String>(\"SUCCESS\"));\n" +
1556 				"	  System.out.println(xs.t.t);\n" +
1557 				"    }\n" +
1558 				"}\n",
1559 				"p/A.java",
1560 				"package p; \n" +
1561 				"public class A<P> {\n" +
1562 				"	 protected P p;\n" +
1563 				"    protected A(P p) {\n" +
1564 				"       this.p = p; \n" +
1565 				"    } \n" +
1566 				"    protected void print(P p) {\n" +
1567 				"        System.out.println(\"SUCCESS\");\n" +
1568 				"    }\n" +
1569 				"}\n",
1570 			},
1571 			"SUCCESS");
1572 	}
1573 
1574 	// JSR14-v10[2.1,2.2]: Valid multiple parameter types
test0058()1575 	public void test0058() {
1576 		this.runConformTest(
1577 			new String[] {
1578 				"test/X.java",
1579 				"package test;\n" +
1580 					"// Valid Parameterized Type Declaration\n" +
1581 					"public class X<A1, A2, A3> {\n" +
1582 					"}\n" +
1583 					"// Valid Type Syntax\n" +
1584 					"class Y {\n" +
1585 					"	X<String, Number, Integer> x;\n" +
1586 					"}\n"
1587 			}
1588 		);
1589 	}
1590 	// JSR14-v10[2.1,2.2]: Invalid multiple parameter types: more declared than referenced
test0059()1591 	public void test0059() {
1592 		this.runNegativeTest(
1593 			new String[] {
1594 				"test/X.java",
1595 				"package test;\n" +
1596 					"// Valid Parameterized Type Declaration\n" +
1597 					"public class X<A1, A2, A3, A4> {\n" +
1598 					"}\n" +
1599 					"// Invalid Valid Type Syntax (not enough parameters)\n" +
1600 					"class Y {\n" +
1601 					"	X<String, Number, Integer> x;\n" +
1602 					"}\n"
1603 			},
1604 			"----------\n" +
1605 			"1. ERROR in test\\X.java (at line 7)\n" +
1606 			"	X<String, Number, Integer> x;\n" +
1607 			"	^\n" +
1608 			"Incorrect number of arguments for type X<A1,A2,A3,A4>; it cannot be parameterized with arguments <String, Number, Integer>\n" +
1609 			"----------\n"
1610 		);
1611 	}
1612 	// JSR14-v10[2.1,2.2]: Invalid multiple parameter types: more referenced than declared
test0060()1613 	public void test0060() {
1614 		this.runNegativeTest(
1615 			new String[] {
1616 				"test/X.java",
1617 				"package test;\n" +
1618 					"// Valid Parameterized Type Declaration\n" +
1619 					"public class X<A1, A2> {\n" +
1620 					"}\n" +
1621 					"// Invalid Valid Type Syntax (too many parameters)\n" +
1622 					"class Y {\n" +
1623 					"	X<String, Number, Integer> x;\n" +
1624 					"}\n"
1625 			},
1626 			"----------\n" +
1627 				"1. ERROR in test\\X.java (at line 7)\n" +
1628 				"	X<String, Number, Integer> x;\n" +
1629 				"	^\n" +
1630 				"Incorrect number of arguments for type X<A1,A2>; it cannot be parameterized with arguments <String, Number, Integer>\n" +
1631 				"----------\n"
1632 		);
1633 	}
1634 	// JSR14-v10[2.1,2.2]: Invalid multiple parameter types: primitive types
test0061()1635 	public void test0061() {
1636 		this.runNegativeTest(
1637 			new String[] {
1638 				"test/X.java",
1639 				"package test;\n" +
1640 					"// Valid Parameterized Type Declaration\n" +
1641 					"public class X<A1, A2, A3, A4, A5, A6, A7> {\n" +
1642 					"}\n" +
1643 					"// Invalid Valid Type Syntax (primitive cannot be parameters)\n" +
1644 					"class Y {\n" +
1645 					"	X<int, short, long, float, double, boolean, char> x;\n" +
1646 					"}\n"
1647 			},
1648 			"----------\n" +
1649 			"1. ERROR in test\\X.java (at line 7)\n" +
1650 			"	X<int, short, long, float, double, boolean, char> x;\n" +
1651 			"	  ^^^\n" +
1652 			"Syntax error, insert \"Dimensions\" to complete TypeArgument\n" +
1653 			"----------\n" +
1654 			"2. ERROR in test\\X.java (at line 7)\n" +
1655 			"	X<int, short, long, float, double, boolean, char> x;\n" +
1656 			"	       ^^^^^\n" +
1657 			"Syntax error, insert \"Dimensions\" to complete TypeArgument\n" +
1658 			"----------\n" +
1659 			"3. ERROR in test\\X.java (at line 7)\n" +
1660 			"	X<int, short, long, float, double, boolean, char> x;\n" +
1661 			"	              ^^^^\n" +
1662 			"Syntax error, insert \"Dimensions\" to complete TypeArgument\n" +
1663 			"----------\n" +
1664 			"4. ERROR in test\\X.java (at line 7)\n" +
1665 			"	X<int, short, long, float, double, boolean, char> x;\n" +
1666 			"	                    ^^^^^\n" +
1667 			"Syntax error, insert \"Dimensions\" to complete TypeArgument\n" +
1668 			"----------\n" +
1669 			"5. ERROR in test\\X.java (at line 7)\n" +
1670 			"	X<int, short, long, float, double, boolean, char> x;\n" +
1671 			"	                           ^^^^^^\n" +
1672 			"Syntax error, insert \"Dimensions\" to complete TypeArgument\n" +
1673 			"----------\n" +
1674 			"6. ERROR in test\\X.java (at line 7)\n" +
1675 			"	X<int, short, long, float, double, boolean, char> x;\n" +
1676 			"	                                   ^^^^^^^\n" +
1677 			"Syntax error, insert \"Dimensions\" to complete TypeArgument\n" +
1678 			"----------\n" +
1679 			"7. ERROR in test\\X.java (at line 7)\n" +
1680 			"	X<int, short, long, float, double, boolean, char> x;\n" +
1681 			"	                                            ^^^^\n" +
1682 			"Syntax error, insert \"Dimensions\" to complete ReferenceType\n" +
1683 			"----------\n");
1684 	}
1685 	// JSR14-v10[2.1,2.2]: Valid multiple parameter types: primitive type arrays
test0062()1686 	public void test0062() {
1687 		this.runConformTest(
1688 			new String[] {
1689 				"test/X.java",
1690 				"package test;\n" +
1691 					"// Valid Parameterized Type Declaration\n" +
1692 					"public class X<A1, A2, A3, A4, A5, A6, A7, A8> {\n" +
1693 					"}\n" +
1694 					"// Valid Type Syntax\n" +
1695 					"class Y {\n" +
1696 					"	X<int[], short[][], long[][][], float[][][][], double[][][][][], boolean[][][][][][], char[][][][][][][], Object[][][][][][][][][]> x;\n" +
1697 					"}\n"
1698 			},
1699 			""
1700 		);
1701 	}
test0063()1702 	public void test0063() {
1703 		this.runNegativeTest(
1704 			new String[] {
1705 				"X.java",
1706 				"public class X<T> extends p.A<T> {\n" +
1707 				"    \n" +
1708 				"    X(T t) {\n" +
1709 				"        super(t);\n" +
1710 				"    }\n" +
1711 				"    public static void main(String[] args) {\n" +
1712 				"        X x = new X(args);\n" +
1713 				"        X<String> xs = new X<String>(args);\n" +
1714 				"	}\n" +
1715 				"}\n",
1716 				"p/A.java",
1717 				"package p; \n" +
1718 				"public class A<P> {\n" +
1719 				"	 protected P p;\n" +
1720 				"    protected A(P p) {\n" +
1721 				"       this.p = p; \n" +
1722 				"    } \n" +
1723 				"    protected void print(P p) {\n" +
1724 				"        System.out.println(\"SUCCESS\"+p);\n" +
1725 				"    }\n" +
1726 				"}\n",
1727 			},
1728 			"----------\n" +
1729 			"1. WARNING in X.java (at line 7)\n" +
1730 			"	X x = new X(args);\n" +
1731 			"	^\n" +
1732 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
1733 			"----------\n" +
1734 			"2. WARNING in X.java (at line 7)\n" +
1735 			"	X x = new X(args);\n" +
1736 			"	      ^^^^^^^^^^^\n" +
1737 			"Type safety: The constructor X(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
1738 			"----------\n" +
1739 			"3. WARNING in X.java (at line 7)\n" +
1740 			"	X x = new X(args);\n" +
1741 			"	          ^\n" +
1742 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
1743 			"----------\n" +
1744 			"4. ERROR in X.java (at line 8)\n" +
1745 			"	X<String> xs = new X<String>(args);\n" +
1746 			"	               ^^^^^^^^^^^^^^^^^^^\n" +
1747 			"The constructor X<String>(String[]) is undefined\n" +
1748 			"----------\n" +
1749 			"----------\n" +
1750 			"1. WARNING in p\\A.java (at line 7)\n" +
1751 			"	protected void print(P p) {\n" +
1752 			"	                       ^\n" +
1753 			"The parameter p is hiding a field from type A<P>\n" +
1754 			"----------\n");
1755 	}
1756 	// raw type: variable map to its strict erasure
test0064()1757 	public void test0064() {
1758 		this.runNegativeTest(
1759 			new String[] {
1760 				"X.java",
1761 				"public class X<T extends Exception & IX> {\n" +
1762 				"    T t;\n" +
1763 				"    void bar(T t) {\n" +
1764 				"        t.getMessage();\n" +
1765 				"        t.foo();\n" +
1766 				"    }\n" +
1767 				"    public static void main(String[] args) {\n" +
1768 				"		X x = new X();\n" + // raw type
1769 				"		x.t.getMessage();\n" + // T is strictly exception !
1770 				"		x.t.foo();\n" +
1771 				"	}\n" +
1772 				"}\n" +
1773 				"\n" +
1774 				"interface IX {\n" +
1775 				"    void foo();\n" +
1776 				"}\n",
1777 			},
1778 			"----------\n" +
1779 			"1. WARNING in X.java (at line 3)\n" +
1780 			"	void bar(T t) {\n" +
1781 			"	           ^\n" +
1782 			"The parameter t is hiding a field from type X<T>\n" +
1783 			"----------\n" +
1784 			"2. WARNING in X.java (at line 8)\n" +
1785 			"	X x = new X();\n" +
1786 			"	^\n" +
1787 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
1788 			"----------\n" +
1789 			"3. WARNING in X.java (at line 8)\n" +
1790 			"	X x = new X();\n" +
1791 			"	          ^\n" +
1792 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
1793 			"----------\n" +
1794 			"4. ERROR in X.java (at line 10)\n" +
1795 			"	x.t.foo();\n" +
1796 			"	    ^^^\n" +
1797 			"The method foo() is undefined for the type Exception\n" +
1798 			"----------\n");
1799 	}
1800 	// raw type: assignments
test0065()1801 	public void test0065() {
1802 		Map customOptions = getCompilerOptions();
1803 		this.runNegativeTest(
1804 			new String[] {
1805 				"X.java",
1806 				"import java.io.IOException;\n" +
1807 				"\n" +
1808 				"public class X<T extends Exception> {\n" +
1809 				"\n" +
1810 				"    public static void main(String[] args) {\n" +
1811 				"		X x = new X();\n" +
1812 				"		X<IOException> xioe = new X<IOException>(); // ok\n" +
1813 				"		\n" +
1814 				"		X x2 = xioe;\n" +
1815 				"		X<IOException> xioe2 = x; // unsafe\n" +
1816 				"	}\n" +
1817 				"}\n",
1818 			},
1819 			"----------\n" +
1820 			"1. WARNING in X.java (at line 6)\n" +
1821 			"	X x = new X();\n" +
1822 			"	^\n" +
1823 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
1824 			"----------\n" +
1825 			"2. WARNING in X.java (at line 6)\n" +
1826 			"	X x = new X();\n" +
1827 			"	          ^\n" +
1828 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
1829 			"----------\n" +
1830 			"3. WARNING in X.java (at line 9)\n" +
1831 			"	X x2 = xioe;\n" +
1832 			"	^\n" +
1833 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
1834 			"----------\n" +
1835 			"4. WARNING in X.java (at line 10)\n" +
1836 			"	X<IOException> xioe2 = x; // unsafe\n" +
1837 			"	                       ^\n" +
1838 			"Type safety: The expression of type X needs unchecked conversion to conform to X<IOException>\n" +
1839 			"----------\n",
1840 			null,
1841 			true,
1842 			customOptions);
1843 	}
1844 
1845 	// JSR14-v10[2.1,2.2]: Invalid PT declaration (mix with reference)
test0066()1846 	public void test0066() {
1847 		this.runNegativeTest(
1848 			new String[] {
1849 				"test/X1.java",
1850 				"package test;\n" +
1851 				"// Valid Consecutive Parameterized Type Declaration\n" +
1852 				"public class X1<A1 extends X2<A2>> {\n" +
1853 				"	A1 a1;\n" +
1854 				"}\n" +
1855 				"// Valid Parameterized Type Declaration\n" +
1856 				"class X2<A2>{\n" +
1857 				"	A2 a2;\n" +
1858 				"}\n"
1859 			},
1860 			"----------\n" +
1861 			"1. ERROR in test\\X1.java (at line 3)\n" +
1862 			"	public class X1<A1 extends X2<A2>> {\n" +
1863 			"	                              ^^\n" +
1864 			"A2 cannot be resolved to a type\n" +
1865 			"----------\n"
1866 		);
1867 	}
1868 
1869 	// JSR14-v10[2.1,2.2]: Invalid PT declaration (mix with reference)
test0067()1870 	public void test0067() {
1871 		this.runNegativeTest(
1872 			new String[] {
1873 				"test/X1.java",
1874 				"package test;\n" +
1875 				"// Valid Consecutive Parameterized Type Declaration\n" +
1876 				"public class X1< A1 extends X2	<	A2	>     			> {\n" +
1877 				"	A1 a1;\n" +
1878 				"}\n" +
1879 				"// Valid Parameterized Type Declaration\n" +
1880 				"class X2<A2>{\n" +
1881 				"	A2 a2;\n" +
1882 				"}\n"
1883 			},
1884 			"----------\n" +
1885 			"1. ERROR in test\\X1.java (at line 3)\n" +
1886 			"	public class X1< A1 extends X2	<	A2	>     			> {\n" +
1887 			"	                              	 	^^\n" +
1888 			"A2 cannot be resolved to a type\n" +
1889 			"----------\n"
1890 		);
1891 	}
1892 
1893 	// JSR14-V10[2.4]: Not terminated consecutive declaration
1894 	// TODO (david) diagnosis message on error 3 sounds strange, doesn't it?
_test0068()1895 	public void _test0068() {
1896 		this.runNegativeTest(
1897 			new String[] {
1898 				"test/X1.java",
1899 				"package test;\n" +
1900 				"// Invalid Consecutive Parameterized Type Declaration\n" +
1901 				"public class X1<A1 extends X2<A2> {\n" +
1902 				"	A1 a1;\n" +
1903 				"}\n" +
1904 				"// Invalid Parameterized Type Declaration\n" +
1905 				"class X2<A2 {\n" +
1906 				"	A2 a2;\n" +
1907 				"}\n"
1908 			},
1909 			"----------\n" +
1910 			"1. ERROR in test\\X1.java (at line 3)\n" +
1911 			"	public class X1<A1 extends X2<A2> {\n" +
1912 			"	                              ^^\n" +
1913 			"A2 cannot be resolved to a type\n" +
1914 			"----------\n" +
1915 			"2. ERROR in test\\X1.java (at line 3)\n" +
1916 			"	public class X1<A1 extends X2<A2> {\n" +
1917 			"	                                ^\n" +
1918 			"Syntax error, insert \">\" to complete ReferenceType1\n" +
1919 			"----------\n" +
1920 			"3. ERROR in test\\X1.java (at line 7)\n" +
1921 			"	class X2<A2 {\n" +
1922 			"	         ^^\n" +
1923 			"Syntax error on token \"A2\", > expected after this token\n" +
1924 			"----------\n"
1925 		);
1926 	}
1927 
1928 	// JSR14-V10[2.4]: Not terminated consecutive declaration
test0069()1929 	public void test0069() {
1930 		this.runNegativeTest(
1931 			new String[] {
1932 				"test/X1.java",
1933 				"package test;\n" +
1934 				"// Invalid Consecutive Parameterized Type Declaration\n" +
1935 				"public class X1<A1 extends X2<A2 {\n" +
1936 				"	A1 a1;\n" +
1937 				"}\n" +
1938 				"// Invalid Parameterized Type Declaration\n" +
1939 				"class X2<A2> {\n" +
1940 				"	A2 a2;\n" +
1941 				"}\n"
1942 			},
1943 			"----------\n" +
1944 			"1. ERROR in test\\X1.java (at line 3)\n" +
1945 			"	public class X1<A1 extends X2<A2 {\n" +
1946 			"	                              ^^\n" +
1947 			"Syntax error, insert \">>\" to complete ReferenceType2\n" +
1948 			"----------\n"
1949 		);
1950 	}
1951 
1952 	// JSR14-v10[2.4]: Unexpected consecutive PT declaration (right-shift symbol)
1953 	// TODO (david) surround expected token with (double-)quotes
test0070()1954 	public void test0070() {
1955 		this.runNegativeTest(
1956 			new String[] {
1957 				"test/X1.java",
1958 				"package test;\n" +
1959 				"// Invalid Consecutive Parameterized Type Declaration\n" +
1960 				"public class X1<A1>> {\n" +
1961 				"	A1 a1;\n" +
1962 				"}\n"
1963 			},
1964 			"----------\n" +
1965 			"1. ERROR in test\\X1.java (at line 3)\n" +
1966 			"	public class X1<A1>> {\n" +
1967 			"	                  ^^\n" +
1968 			"Syntax error on token \">>\", > expected\n" +
1969 			"----------\n"
1970 		);
1971 	}
1972 
1973 	// JSR14-v10[2.1,2.2]: Unexpected consecutive PT declaration (with spaces)
test0071()1974 	public void test0071() {
1975 		this.runNegativeTest(
1976 			new String[] {
1977 				"test/X1.java",
1978 				"package test;\n" +
1979 				"// Invalid Consecutive Parameterized Type Declaration\n" +
1980 				"public class X1 < A1 > > {\n" +
1981 				"	A1 a1;\n" +
1982 				"}\n"
1983 			},
1984 			"----------\n" +
1985 			"1. ERROR in test\\X1.java (at line 3)\n" +
1986 			"	public class X1 < A1 > > {\n" +
1987 			"	                       ^\n" +
1988 			"Syntax error on token \">\", delete this token\n" +
1989 			"----------\n"
1990 		);
1991 	}
1992 
1993 	// JSR14-v10[2.4]: Unexpected consecutive PT declaration (unary right-shift symbol)
1994 	// TODO (david) surround expected token with (double-)quotes
test0072()1995 	public void test0072() {
1996 		this.runNegativeTest(
1997 			new String[] {
1998 				"test/X1.java",
1999 				"package test;\n" +
2000 				"// Invalid Consecutive Parameterized Type Declaration\n" +
2001 				"public class X1<A1>>> {\n" +
2002 				"	A1 a1;\n" +
2003 				"}\n"
2004 			},
2005 			"----------\n" +
2006 			"1. ERROR in test\\X1.java (at line 3)\n" +
2007 			"	public class X1<A1>>> {\n" +
2008 			"	                  ^^^\n" +
2009 			"Syntax error on token \">>>\", > expected\n" +
2010 			"----------\n"
2011 		);
2012 	}
2013 
2014 	// JSR14-v10[2.4]: Unexpected consecutive PT declaration (right-shift symbol)
2015 	// TODO (david) surround expected token with (double-)quotes
test0073()2016 	public void test0073() {
2017 		this.runNegativeTest(
2018 			new String[] {
2019 				"test/X1.java",
2020 				"package test;\n" +
2021 				"// Invalid Consecutive Parameterized Type Declaration\n" +
2022 				"public class X1<A1 extends X2<A1>>> {\n" +
2023 				"	A1 a1;\n" +
2024 				"}\n" +
2025 				"// Valid Parameterized Type Declaration\n" +
2026 				"class X2<A2> {\n" +
2027 				"	A2 a2;\n" +
2028 				"}\n"
2029 			},
2030 			"----------\n" +
2031 			"1. ERROR in test\\X1.java (at line 3)\n" +
2032 			"	public class X1<A1 extends X2<A1>>> {\n" +
2033 			"	                                ^^^\n" +
2034 			"Syntax error on token \">>>\", >> expected\n" +
2035 			"----------\n"
2036 		);
2037 	}
2038 
2039 	// JSR14-v10[2.1,2.2]: Unexpected consecutive PT declaration (with spaces)
test0074()2040 	public void test0074() {
2041 		this.runNegativeTest(
2042 			new String[] {
2043 				"test/X1.java",
2044 				"package test;\n" +
2045 				"// Invalid Consecutive Parameterized Type Declaration\n" +
2046 				"public class X1 < A1 > > > {\n" +
2047 				"	A1 a1;\n" +
2048 				"}\n"
2049 			},
2050 			"----------\n" +
2051 			"1. ERROR in test\\X1.java (at line 3)\n" +
2052 			"	public class X1 < A1 > > > {\n" +
2053 			"	                       ^^^\n" +
2054 			"Syntax error on tokens, delete these tokens\n" +
2055 			"----------\n"
2056 		);
2057 	}
2058 
2059 	// A is not an interface
test0075()2060 	public void test0075() {
2061 		this.runNegativeTest(
2062 			new String[] {
2063 				"X.java",
2064 				"public class X <T extends Object & p.A<? super T>> extends p.A<T> {\n" +
2065 				"    protected T t;\n" +
2066 				"    X(T t) {\n" +
2067 				"        super(t);\n" +
2068 				"        this.t = t;\n" +
2069 				"    }\n" +
2070 				"}",
2071 				"p/A.java",
2072 				"package p;\n" +
2073 				"public class A<P> {\n" +
2074 				"    protected P p;\n" +
2075 				"    protected A(P p) {\n" +
2076 				"        this.p = p;\n" +
2077 				"    }\n" +
2078 				"}"
2079 			},
2080 		"----------\n" +
2081 		"1. ERROR in X.java (at line 1)\n" +
2082 		"	public class X <T extends Object & p.A<? super T>> extends p.A<T> {\n" +
2083 		"	                                   ^^^\n" +
2084 		"The type A<? super T> is not an interface; it cannot be specified as a bounded parameter\n" +
2085 		"----------\n"
2086 		);
2087 	}
2088 
2089 	// A is not an interface
test0076()2090 	public void test0076() {
2091 		this.runNegativeTest(
2092 			new String[] {
2093 				"X.java",
2094 				"public class X <T extends Object & p.A> extends p.A<T> {\n" +
2095 				"    protected T t;\n" +
2096 				"    X(T t) {\n" +
2097 				"        super(t);\n" +
2098 				"        this.t = t;\n" +
2099 				"    }\n" +
2100 				"}",
2101 				"p/A.java",
2102 				"package p;\n" +
2103 				"public class A<P> {\n" +
2104 				"    protected P p;\n" +
2105 				"    protected A(P p) {\n" +
2106 				"        this.p = p;\n" +
2107 				"    }\n" +
2108 				"}"
2109 			},
2110 			"----------\n" +
2111 			"1. WARNING in X.java (at line 1)\n" +
2112 			"	public class X <T extends Object & p.A> extends p.A<T> {\n" +
2113 			"	                                   ^^^\n" +
2114 			"A is a raw type. References to generic type A<P> should be parameterized\n" +
2115 			"----------\n" +
2116 			"2. ERROR in X.java (at line 1)\n" +
2117 			"	public class X <T extends Object & p.A> extends p.A<T> {\n" +
2118 			"	                                   ^^^\n" +
2119 			"The type A is not an interface; it cannot be specified as a bounded parameter\n" +
2120 			"----------\n"
2121 		);
2122 	}
2123 	// unsafe type operation: only for constructors with signature change
test0077()2124 	public void test0077() {
2125 		this.runNegativeTest(
2126 			new String[] {
2127 				"X.java",
2128 				"public class X<T> extends p.A<T> {\n" +
2129 				"	 X() {\n" +
2130 				"		super(null);\n" +
2131 				"	}\n"+
2132 				"    X(T t) {\n" +
2133 				"        super(t);\n" +
2134 				"    }\n" +
2135 				"    X(X<T> xt) {\n" +
2136 				"        super(xt.t);\n" +
2137 				"    }\n" +
2138 				"    public static void main(String[] args) {\n" +
2139 				"        X x = new X();\n" +
2140 				"        X x1 = new X(args);\n" +
2141 				"        X x2 = new X(x);\n" +
2142 				"        X<String> xs = new X<String>(args);\n" +
2143 				"	}\n" +
2144 				"}\n",
2145 				"p/A.java",
2146 				"package p;\n" +
2147 				"public class A<P> {\n" +
2148 				"    protected P p;\n" +
2149 				"    protected A(P p) {\n" +
2150 				"        this.p = p;\n" +
2151 				"    }\n" +
2152 				"}"
2153 			},
2154 			"----------\n" +
2155 			"1. ERROR in X.java (at line 9)\n" +
2156 			"	super(xt.t);\n" +
2157 			"	         ^\n" +
2158 			"t cannot be resolved or is not a field\n" +
2159 			"----------\n" +
2160 			"2. WARNING in X.java (at line 12)\n" +
2161 			"	X x = new X();\n" +
2162 			"	^\n" +
2163 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
2164 			"----------\n" +
2165 			"3. WARNING in X.java (at line 12)\n" +
2166 			"	X x = new X();\n" +
2167 			"	          ^\n" +
2168 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
2169 			"----------\n" +
2170 			"4. WARNING in X.java (at line 13)\n" +
2171 			"	X x1 = new X(args);\n" +
2172 			"	^\n" +
2173 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
2174 			"----------\n" +
2175 			"5. WARNING in X.java (at line 13)\n" +
2176 			"	X x1 = new X(args);\n" +
2177 			"	       ^^^^^^^^^^^\n" +
2178 			"Type safety: The constructor X(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
2179 			"----------\n" +
2180 			"6. WARNING in X.java (at line 13)\n" +
2181 			"	X x1 = new X(args);\n" +
2182 			"	           ^\n" +
2183 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
2184 			"----------\n" +
2185 			"7. WARNING in X.java (at line 14)\n" +
2186 			"	X x2 = new X(x);\n" +
2187 			"	^\n" +
2188 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
2189 			"----------\n" +
2190 			"8. WARNING in X.java (at line 14)\n" +
2191 			"	X x2 = new X(x);\n" +
2192 			"	       ^^^^^^^^\n" +
2193 			"Type safety: The constructor X(X) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
2194 			"----------\n" +
2195 			"9. WARNING in X.java (at line 14)\n" +
2196 			"	X x2 = new X(x);\n" +
2197 			"	           ^\n" +
2198 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
2199 			"----------\n" +
2200 			"10. ERROR in X.java (at line 15)\n" +
2201 			"	X<String> xs = new X<String>(args);\n" +
2202 			"	               ^^^^^^^^^^^^^^^^^^^\n" +
2203 			"The constructor X<String>(String[]) is undefined\n" +
2204 			"----------\n");
2205 	}
test0078()2206 	public void test0078() {
2207 		this.runNegativeTest(
2208 			new String[] {
2209 				"X.java",
2210 				"import p.A;\n" +
2211 				"public class X {\n" +
2212 				"    X(A<String> a, A<String> b) {\n" +
2213 				"    }\n" +
2214 				"    void foo(A<String> a) {\n" +
2215 				"    }\n" +
2216 				"    public static void main(String[] args) {\n" +
2217 				"        X x = new X((A)null, (A)null);\n" +
2218 				"        A a = new A((A)null);\n" +
2219 				"		x.foo(a);\n" +
2220 				"		a.print(x);\n" +
2221 				"		A<String> as = new A<String>(null);\n" +
2222 				"		as.print(\"hello\");\n" +
2223 				"	}\n" +
2224 				"}\n",
2225 				"p/A.java",
2226 				"package p;\n" +
2227 				"public class A<P> {\n" +
2228 				"    protected P p;\n" +
2229 				"    protected A(P p) {\n" +
2230 				"        this.p = p;\n" +
2231 				"    }\n" +
2232 				"    protected void print(P p) {\n" +
2233 				"        System.out.println(\"SUCCESS\"+p);\n" +
2234 				"    }\n" +
2235 				"    protected void print(A<P> a) {\n" +
2236 				"        print(a.p);\n" +
2237 				"    }\n" +
2238 				"}\n",
2239 			},
2240 			"----------\n" +
2241 			"1. WARNING in X.java (at line 8)\n" +
2242 			"	X x = new X((A)null, (A)null);\n" +
2243 			"	            ^^^^^^^\n" +
2244 			"Type safety: The expression of type A needs unchecked conversion to conform to A<String>\n" +
2245 			"----------\n" +
2246 			"2. WARNING in X.java (at line 8)\n" +
2247 			"	X x = new X((A)null, (A)null);\n" +
2248 			"	             ^\n" +
2249 			"A is a raw type. References to generic type A<P> should be parameterized\n" +
2250 			"----------\n" +
2251 			"3. WARNING in X.java (at line 8)\n" +
2252 			"	X x = new X((A)null, (A)null);\n" +
2253 			"	                     ^^^^^^^\n" +
2254 			"Type safety: The expression of type A needs unchecked conversion to conform to A<String>\n" +
2255 			"----------\n" +
2256 			"4. WARNING in X.java (at line 8)\n" +
2257 			"	X x = new X((A)null, (A)null);\n" +
2258 			"	                      ^\n" +
2259 			"A is a raw type. References to generic type A<P> should be parameterized\n" +
2260 			"----------\n" +
2261 			"5. WARNING in X.java (at line 9)\n" +
2262 			"	A a = new A((A)null);\n" +
2263 			"	^\n" +
2264 			"A is a raw type. References to generic type A<P> should be parameterized\n" +
2265 			"----------\n" +
2266 			"6. ERROR in X.java (at line 9)\n" +
2267 			"	A a = new A((A)null);\n" +
2268 			"	      ^^^^^^^^^^^^^^\n" +
2269 			"The constructor A(P) is not visible\n" +
2270 			"----------\n" +
2271 			"7. WARNING in X.java (at line 9)\n" +
2272 			"	A a = new A((A)null);\n" +
2273 			"	          ^\n" +
2274 			"A is a raw type. References to generic type A<P> should be parameterized\n" +
2275 			"----------\n" +
2276 			"8. WARNING in X.java (at line 9)\n" +
2277 			"	A a = new A((A)null);\n" +
2278 			"	             ^\n" +
2279 			"A is a raw type. References to generic type A<P> should be parameterized\n" +
2280 			"----------\n" +
2281 			"9. WARNING in X.java (at line 10)\n" +
2282 			"	x.foo(a);\n" +
2283 			"	      ^\n" +
2284 			"Type safety: The expression of type A needs unchecked conversion to conform to A<String>\n" +
2285 			"----------\n" +
2286 			"10. ERROR in X.java (at line 11)\n" +
2287 			"	a.print(x);\n" +
2288 			"	  ^^^^^\n" +
2289 			"The method print(P) from the type A is not visible\n" +
2290 			"----------\n" +
2291 			"11. ERROR in X.java (at line 12)\n" +
2292 			"	A<String> as = new A<String>(null);\n" +
2293 			"	               ^^^^^^^^^^^^^^^^^^^\n" +
2294 			"The constructor A<String>(P) is not visible\n" +
2295 			"----------\n" +
2296 			"12. ERROR in X.java (at line 13)\n" +
2297 			"	as.print(\"hello\");\n" +
2298 			"	   ^^^^^\n" +
2299 			"The method print(P) from the type A<String> is not visible\n" +
2300 			"----------\n" +
2301 			"----------\n" +
2302 			"1. WARNING in p\\A.java (at line 7)\n" +
2303 			"	protected void print(P p) {\n" +
2304 			"	                       ^\n" +
2305 			"The parameter p is hiding a field from type A<P>\n" +
2306 			"----------\n");
2307 	}
2308 
2309 	// JSR14-v10[2.4]: Valid consecutive Type Parameters Brackets
test0079()2310 	public void test0079() {
2311 		this.runConformTest(
2312 			new String[] {
2313 				"test/X.java",
2314 				"package test;\n" +
2315 					"public class X<A extends X1<X2<X3<String>>>> {\n" +
2316 					"	A a;\n" +
2317 					"	public static void main(String[] args) {\n" +
2318 					"		X<X1<X2<X3<String>>>> x = new X<X1<X2<X3<String>>>>();\n" +
2319 					"		x.a = new X1<X2<X3<String>>>();\n" +
2320 					"		x.a.a1 = new X2<X3<String>>();\n" +
2321 					"		x.a.a1.a2 = new X3<String>();\n" +
2322 					"		x.a.a1.a2.a3 = \"SUCCESS\";\n" +
2323 					"		System.out.println(x.a.a1.a2.a3);\n" +
2324 					"	}\n" +
2325 					"}\n" +
2326 					"class X1<A extends X2<X3<String>>> {\n" +
2327 					"	A a1;\n" +
2328 					"}\n" +
2329 					"class X2<A extends X3<String>> {\n" +
2330 					"	A a2;\n" +
2331 					"}\n" +
2332 					"class X3<A> {\n" +
2333 					"	A a3;\n" +
2334 					"}\n"
2335 			},
2336 			"SUCCESS"
2337 		);
2338 	}
2339 	// TODO (david) remove errors: insert dimension to complete array type
_test0080()2340 	public void _test0080() {
2341 		this.runNegativeTest(
2342 			new String[] {
2343 				"test/X.java",
2344 				"package test;\n" +
2345 					"public class X<A extends X1<X2<X3<String>>> {}\n" +
2346 					"class X1<A extends X2<X3<String>> {}\n" +
2347 					"class X2<A extends X3<String> {}\n" +
2348 					"class X3<A {}\n"
2349 			},
2350 			"----------\n" +
2351 			"1. ERROR in test\\X.java (at line 2)\n" +
2352 			"	public class X<A extends X1<X2<X3<String>>> {}\n" +
2353 			"	                                        ^^^\n" +
2354 			"Syntax error, insert \">\" to complete ReferenceType1\n" +
2355 			"----------\n" +
2356 			"2. ERROR in test\\X.java (at line 3)\n" +
2357 			"	class X1<A extends X2<X3<String>> {}\n" +
2358 			"	                               ^^\n" +
2359 			"Syntax error, insert \">\" to complete ReferenceType1\n" +
2360 			"----------\n" +
2361 			"3. ERROR in test\\X.java (at line 4)\n" +
2362 			"	class X2<A extends X3<String> {}\n" +
2363 			"	                            ^\n" +
2364 			"Syntax error, insert \">\" to complete ReferenceType1\n" +
2365 			"----------\n" +
2366 			"4. ERROR in test\\X.java (at line 5)\n" +
2367 			"	class X3<A {}\n" +
2368 			"	         ^\n" +
2369 			"Syntax error on token \"A\", > expected after this token\n" +
2370 			"----------\n"
2371 		);
2372 	}
2373 	// TODO (david) remove errors: insert dimension to complete array type
test0081()2374 	public void test0081() {
2375 		this.runNegativeTest(
2376 			new String[] {
2377 				"test/X.java",
2378 				"package test;\n" +
2379 					"public class X<A extends X1<X2<X3<String>> {}\n" +
2380 					"class X1<A extends X2<X3<String> {}\n" +
2381 					"class X2<A extends X3<String {}\n" +
2382 					"class X3<A> {}\n"
2383 			},
2384 			"----------\n" +
2385 			"1. ERROR in test\\X.java (at line 2)\n" +
2386 			"	public class X<A extends X1<X2<X3<String>> {}\n" +
2387 			"	                                        ^^\n" +
2388 			"Syntax error, insert \">>\" to complete ReferenceType2\n" +
2389 			"----------\n" +
2390 			"2. ERROR in test\\X.java (at line 3)\n" +
2391 			"	class X1<A extends X2<X3<String> {}\n" +
2392 			"	                               ^\n" +
2393 			"Syntax error, insert \">>\" to complete ReferenceType2\n" +
2394 			"----------\n" +
2395 			"3. ERROR in test\\X.java (at line 4)\n" +
2396 			"	class X2<A extends X3<String {}\n" +
2397 			"	                      ^^^^^^\n" +
2398 			"Syntax error, insert \">>\" to complete ReferenceType2\n" +
2399 			"----------\n"
2400 		);
2401 	}
2402 	// TODO (david) remove error: insert dimension to complete array type
test0082()2403 	public void test0082() {
2404 		this.runNegativeTest(
2405 			new String[] {
2406 				"test/X.java",
2407 				"package test;\n" +
2408 					"public class X<A extends X1<X2<X3<String> {}\n" +
2409 					"class X1<A extends X2<X3<String {}\n" +
2410 					"class X2<A extends X3<String>> {}\n" +
2411 					"class X3<A> {}\n"
2412 			},
2413 			"----------\n" +
2414 			"1. ERROR in test\\X.java (at line 2)\n" +
2415 			"	public class X<A extends X1<X2<X3<String> {}\n" +
2416 			"	                                        ^\n" +
2417 			"Syntax error, insert \">>>\" to complete ReferenceType3\n" +
2418 			"----------\n" +
2419 			"2. ERROR in test\\X.java (at line 3)\n" +
2420 			"	class X1<A extends X2<X3<String {}\n" +
2421 			"	                         ^^^^^^\n" +
2422 			"Syntax error, insert \">>>\" to complete ReferenceType3\n" +
2423 			"----------\n"
2424 		);
2425 	}
2426 	// TODO (david) remove error: insert dimension to complete array type
_test0083()2427 	public void _test0083() {
2428 		this.runNegativeTest(
2429 			new String[] {
2430 				"test/X.java",
2431 				"package test;\n" +
2432 					"public class X<A extends X1<X2<X3<String {}\n" +
2433 					"class X1<A extends X2<X3<String>>> {}\n" +
2434 					"class X2<A extends X3<String>> {}\n" +
2435 					"class X3<A> {}\n"
2436 			},
2437 			"----------\n" +
2438 			"1. ERROR in test\\X.java (at line 2)\n" +
2439 			"	public class X<A extends X1<X2<X3<String {}\n" +
2440 			"	                                  ^^^^^^\n" +
2441 			"Syntax error, insert \">>>\" to complete ReferenceType3\n" +
2442 			"----------\n" +
2443 			"2. ERROR in test\\X.java (at line 2)\n" +
2444 			"	public class X<A extends X1<X2<X3<String {}\n" +
2445 			"	                                  ^^^^^^\n" +
2446 			"Syntax error, insert \">\" to complete ReferenceType1\n" +
2447 			"----------\n");
2448 	}
test0084()2449 	public void test0084() {
2450 		this.runNegativeTest(
2451 			new String[] {
2452 				"X.java",
2453 				"public class X {\n" +
2454 				"    X(AX<String> a, AX<String> b) {\n" +
2455 				"    }\n" +
2456 				"    void foo(AX<String> a) {\n" +
2457 				"    }\n" +
2458 				"    public static void main(String[] args) {\n" +
2459 				"        X x = new X((AX)null, (AX)null);\n" +
2460 				"        AX a = new AX((AX)null);\n" +
2461 				"        AX a2 = new AX(null);\n" +
2462 				"		x.foo(a);\n" +
2463 				"		a.foo(a);\n" +
2464 				"		a.bar(a);\n" +
2465 				"		AX<String> as = new AX<String>(null);\n" +
2466 				"		as.print(a);\n" +
2467 				"		as.bar(a);\n" +
2468 				"	}\n" +
2469 				"}\n" +
2470 				"class AX <P> {\n" +
2471 				"    AX(AX<P> ax){}\n" +
2472 				"    AX(P p){}\n" +
2473 				"    void print(P p){}\n" +
2474 				"    void foo(AX rawAx){}\n" +
2475 				"    void bar(AX<P> ax){}\n" +
2476 				"}\n",
2477 			},
2478 			"----------\n" +
2479 			"1. WARNING in X.java (at line 7)\n" +
2480 			"	X x = new X((AX)null, (AX)null);\n" +
2481 			"	            ^^^^^^^^\n" +
2482 			"Type safety: The expression of type AX needs unchecked conversion to conform to AX<String>\n" +
2483 			"----------\n" +
2484 			"2. WARNING in X.java (at line 7)\n" +
2485 			"	X x = new X((AX)null, (AX)null);\n" +
2486 			"	             ^^\n" +
2487 			"AX is a raw type. References to generic type AX<P> should be parameterized\n" +
2488 			"----------\n" +
2489 			"3. WARNING in X.java (at line 7)\n" +
2490 			"	X x = new X((AX)null, (AX)null);\n" +
2491 			"	                      ^^^^^^^^\n" +
2492 			"Type safety: The expression of type AX needs unchecked conversion to conform to AX<String>\n" +
2493 			"----------\n" +
2494 			"4. WARNING in X.java (at line 7)\n" +
2495 			"	X x = new X((AX)null, (AX)null);\n" +
2496 			"	                       ^^\n" +
2497 			"AX is a raw type. References to generic type AX<P> should be parameterized\n" +
2498 			"----------\n" +
2499 			"5. WARNING in X.java (at line 8)\n" +
2500 			"	AX a = new AX((AX)null);\n" +
2501 			"	^^\n" +
2502 			"AX is a raw type. References to generic type AX<P> should be parameterized\n" +
2503 			"----------\n" +
2504 			"6. WARNING in X.java (at line 8)\n" +
2505 			"	AX a = new AX((AX)null);\n" +
2506 			"	       ^^^^^^^^^^^^^^^^\n" +
2507 			"Type safety: The constructor AX(AX) belongs to the raw type AX. References to generic type AX<P> should be parameterized\n" +
2508 			"----------\n" +
2509 			"7. WARNING in X.java (at line 8)\n" +
2510 			"	AX a = new AX((AX)null);\n" +
2511 			"	           ^^\n" +
2512 			"AX is a raw type. References to generic type AX<P> should be parameterized\n" +
2513 			"----------\n" +
2514 			"8. WARNING in X.java (at line 8)\n" +
2515 			"	AX a = new AX((AX)null);\n" +
2516 			"	               ^^\n" +
2517 			"AX is a raw type. References to generic type AX<P> should be parameterized\n" +
2518 			"----------\n" +
2519 			"9. WARNING in X.java (at line 9)\n" +
2520 			"	AX a2 = new AX(null);\n" +
2521 			"	^^\n" +
2522 			"AX is a raw type. References to generic type AX<P> should be parameterized\n" +
2523 			"----------\n" +
2524 			"10. WARNING in X.java (at line 9)\n" +
2525 			"	AX a2 = new AX(null);\n" +
2526 			"	        ^^^^^^^^^^^^\n" +
2527 			"Type safety: The constructor AX(AX) belongs to the raw type AX. References to generic type AX<P> should be parameterized\n" +
2528 			"----------\n" +
2529 			"11. WARNING in X.java (at line 9)\n" +
2530 			"	AX a2 = new AX(null);\n" +
2531 			"	            ^^\n" +
2532 			"AX is a raw type. References to generic type AX<P> should be parameterized\n" +
2533 			"----------\n" +
2534 			"12. WARNING in X.java (at line 10)\n" +
2535 			"	x.foo(a);\n" +
2536 			"	      ^\n" +
2537 			"Type safety: The expression of type AX needs unchecked conversion to conform to AX<String>\n" +
2538 			"----------\n" +
2539 			"13. WARNING in X.java (at line 12)\n" +
2540 			"	a.bar(a);\n" +
2541 			"	^^^^^^^^\n" +
2542 			"Type safety: The method bar(AX) belongs to the raw type AX. References to generic type AX<P> should be parameterized\n" +
2543 			"----------\n" +
2544 			"14. ERROR in X.java (at line 13)\n" +
2545 			"	AX<String> as = new AX<String>(null);\n" +
2546 			"	                ^^^^^^^^^^^^^^^^^^^^\n" +
2547 			"The constructor AX<String>(AX<String>) is ambiguous\n" +
2548 			"----------\n" +
2549 			"15. ERROR in X.java (at line 14)\n" +
2550 			"	as.print(a);\n" +
2551 			"	   ^^^^^\n" +
2552 			"The method print(String) in the type AX<String> is not applicable for the arguments (AX)\n" +
2553 			"----------\n" +
2554 			"16. WARNING in X.java (at line 15)\n" +
2555 			"	as.bar(a);\n" +
2556 			"	       ^\n" +
2557 			"Type safety: The expression of type AX needs unchecked conversion to conform to AX<String>\n" +
2558 			"----------\n" +
2559 			"17. WARNING in X.java (at line 22)\n" +
2560 			"	void foo(AX rawAx){}\n" +
2561 			"	         ^^\n" +
2562 			"AX is a raw type. References to generic type AX<P> should be parameterized\n" +
2563 			"----------\n");
2564 	}
2565 
test0085()2566 	public void test0085() {
2567 		this.runConformTest(
2568 			new String[] {
2569 				"X.java",
2570 				"public class X<T> {\n" +
2571 				"    \n" +
2572 				"    public static void main(String[] args) {\n" +
2573 				"        AX ax = new AX();\n" +
2574 				"        X x = (X)ax.p;\n" +
2575 				"        System.out.println(x);\n" +
2576 				"    }\n" +
2577 				"}\n" +
2578 				"\n" +
2579 				"class AX <P> {\n" +
2580 				"    \n" +
2581 				"    P p;\n" +
2582 				"}\n",
2583 			},
2584 		"null");
2585 	}
2586 
test0086()2587 	public void test0086() {
2588 		Map customOptions = getCompilerOptions();
2589 		this.runNegativeTest(
2590 			new String[] {
2591 				"X.java",
2592 				"public class X<T> {\n" +
2593 				"    \n" +
2594 				"    public static void main(String[] args) {\n" +
2595 				"        AX ax = new AX();\n" +
2596 				"        AX ax2 = ax.p;\n" +
2597 				"        ax.p = new AX<String>();\n" +
2598 				"        System.out.println(ax2);\n" +
2599 				"    }\n" +
2600 				"}\n" +
2601 				"\n" +
2602 				"class AX <P> {\n" +
2603 				"    AX<P> p;\n" +
2604 				"}\n",
2605 			},
2606 			"----------\n" +
2607 			"1. WARNING in X.java (at line 4)\n" +
2608 			"	AX ax = new AX();\n" +
2609 			"	^^\n" +
2610 			"AX is a raw type. References to generic type AX<P> should be parameterized\n" +
2611 			"----------\n" +
2612 			"2. WARNING in X.java (at line 4)\n" +
2613 			"	AX ax = new AX();\n" +
2614 			"	            ^^\n" +
2615 			"AX is a raw type. References to generic type AX<P> should be parameterized\n" +
2616 			"----------\n" +
2617 			"3. WARNING in X.java (at line 5)\n" +
2618 			"	AX ax2 = ax.p;\n" +
2619 			"	^^\n" +
2620 			"AX is a raw type. References to generic type AX<P> should be parameterized\n" +
2621 			"----------\n" +
2622 			"4. WARNING in X.java (at line 6)\n" +
2623 			"	ax.p = new AX<String>();\n" +
2624 			"	   ^\n" +
2625 			"Type safety: The field p from the raw type AX is assigned a value of type AX<String>. References to generic type AX<P> should be parameterized\n" +
2626 			"----------\n",
2627 		null,
2628 		true,
2629 		customOptions);
2630 	}
2631 
test0087()2632 	public void test0087() {
2633 		Map customOptions = getCompilerOptions();
2634 		// check no unsafe type operation problem is issued
2635 		customOptions.put(CompilerOptions.OPTION_ReportUncheckedTypeOperation, CompilerOptions.ERROR);
2636 		customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
2637 		this.runConformTest(
2638 			new String[] {
2639 				"X.java",
2640 				"public class X<T> {\n" +
2641 				"    \n" +
2642 				"    public static void main(String[] args) {\n" +
2643 				"        AX ax = new AX();\n" +
2644 				"        AX ax2 = ax.p;\n" +
2645 				"        AX ax3 = new AX<String>();\n" +
2646 				"        System.out.println(\"SUCCESS\");\n" +
2647 				"    }\n" +
2648 				"}\n" +
2649 				"\n" +
2650 				"class AX <P> {\n" +
2651 				"    AX<P> p;\n" +
2652 				"}\n",
2653 			},
2654 		"SUCCESS",
2655 		null,
2656 		true,
2657 		null,
2658 		customOptions,
2659 		null/*no custom requestor*/);
2660 	}
2661 
test0088()2662 	public void test0088() {
2663 		Map customOptions = getCompilerOptions();
2664 		// check no unsafe type operation problem is issued
2665 		customOptions.put(CompilerOptions.OPTION_ReportUncheckedTypeOperation, CompilerOptions.ERROR);
2666 		customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
2667 		this.runConformTest(
2668 			new String[] {
2669 				"X.java",
2670 				"public class X<T> {\n" +
2671 				"     AX ax = new AX();\n" +
2672 				"     AX ax2 = ax.p;\n" +
2673 				"     AX ax3 = new AX<String>();\n" +
2674 				"}\n" +
2675 				"\n" +
2676 				"class AX <P> {\n" +
2677 				"    AX<P> p;\n" +
2678 				"}\n",
2679 			},
2680 		"",
2681 		null,
2682 		true,
2683 		null,
2684 		customOptions,
2685 		null/*no custom requestor*/);
2686 	}
2687 
test0089()2688 	public void test0089() {
2689 		this.runConformTest(
2690 			new String[] {
2691 				"X.java",
2692 				"public class X<T> {\n" +
2693 				"    T q;\n" +
2694 				"     public static void main(String[] args) {\n" +
2695 				"         X<String[]> xss = new X<String[]>();\n" +
2696 				"         X<X<String[]>> xxs = new X<X<String[]>>();\n" +
2697 				"         xxs.q = xss;\n" +
2698 				"         System.out.println(\"SUCCESS\");\n" +
2699 				"     }\n" +
2700 				"}\n",
2701 			},
2702 		"SUCCESS");
2703 	}
2704 
test0090()2705 	public void test0090() {
2706 		Map customOptions = getCompilerOptions();
2707 		// check no unsafe type operation problem is issued
2708 		customOptions.put(CompilerOptions.OPTION_ReportUncheckedTypeOperation, CompilerOptions.ERROR);
2709 		this.runConformTest(
2710 			new String[] {
2711 				"X.java",
2712 				"public class X<T> {\n" +
2713 				"    T q;\n" +
2714 				"    \n" +
2715 				"     public static void main(String[] args) {\n" +
2716 				"         X<String[]> xss = new X<String[]>();\n" +
2717 				"         X<X<String[]>> xxs = new X<X<String[]>>();\n" +
2718 				"         xxs.q = xss;\n" +
2719 				"         System.out.println(\"SUCCESS\");\n" +
2720 				"     }\n" +
2721 				"      void foo(X[] xs) {\n" +
2722 				"          xs[0] = new X<String>();\n" +
2723 				"     }\n" +
2724 				"}\n",
2725 			},
2726 		"SUCCESS",
2727 		null,
2728 		true,
2729 		null,
2730 		customOptions,
2731 		null/*no custom requestor*/);
2732 	}
2733 
test0091()2734 	public void test0091() {
2735 		this.runConformTest(
2736 			new String[] {
2737 				"X.java",
2738 				"public class X<T> {\n" +
2739 				"      void foo(X<String>[] xs) {\n" +
2740 				"     }\n" +
2741 				"}\n",
2742 			},
2743 			"");
2744 	}
2745 
test0092()2746 	public void test0092() {
2747 		this.runNegativeTest(
2748 			new String[] {
2749 				"X.java",
2750 				"public class X<T> {\n" +
2751 				"    T t;\n" +
2752 				"    X(T t) {\n" +
2753 				"        this.t = t;\n" +
2754 				"    }\n" +
2755 				"     void foo() {\n" +
2756 				"         X<String> xs = new X<String>(\"\");\n" +
2757 				"         X<String> xs2 = (X<String>) xs;\n" +
2758 				"         \n" +
2759 				"         ((X)xs).t = this;\n" +
2760 				"         \n" +
2761 				"         System.out.prinln((T) this.t);\n" +
2762 				"     }\n" +
2763 				"     public static void main(String[] args) {\n" +
2764 				"		new X<String>(\"SUCCESS\").foo();\n" +
2765 				"	}\n" +
2766 				"}\n",
2767 			},
2768 			"----------\n" +
2769 			"1. WARNING in X.java (at line 8)\n" +
2770 			"	X<String> xs2 = (X<String>) xs;\n" +
2771 			"	                ^^^^^^^^^^^^^^\n" +
2772 			"Unnecessary cast from X<String> to X<String>\n" +
2773 			"----------\n" +
2774 			"2. WARNING in X.java (at line 10)\n" +
2775 			"	((X)xs).t = this;\n" +
2776 			"	  ^\n" +
2777 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
2778 			"----------\n" +
2779 			"3. WARNING in X.java (at line 10)\n" +
2780 			"	((X)xs).t = this;\n" +
2781 			"	        ^\n" +
2782 			"Type safety: The field t from the raw type X is assigned a value of type X<T>. References to generic type X<T> should be parameterized\n" +
2783 			"----------\n" +
2784 			"4. ERROR in X.java (at line 12)\n" +
2785 			"	System.out.prinln((T) this.t);\n" +
2786 			"	           ^^^^^^\n" +
2787 			"The method prinln(T) is undefined for the type PrintStream\n" +
2788 			"----------\n");
2789 	}
2790 
2791 	// **
test0093()2792 	public void test0093() {
2793 		this.runConformTest(
2794 			new String[] {
2795 				"X.java",
2796 				"public class X<T> {\n" +
2797 				"    public static void main(String[] args) {\n" +
2798 				"        AX ax = new AX();\n" +
2799 				"        AX ax2 = new AX();\n" +
2800 				"        ax.p = ax2.p;\n" +
2801 				"        System.out.println(\"SUCCESS\");\n" +
2802 				"    }\n" +
2803 				"}\n" +
2804 				"class AX <P> {\n" +
2805 				"    AX<P> p;\n" +
2806 				"}\n",
2807 			},
2808 		"SUCCESS");
2809 	}
2810 
2811 	// same as test001, but every type is now a SourceTypeBinding
test0094()2812 	public void test0094() {
2813 		this.runConformTest(
2814 			new String[] {
2815 				"X.java",
2816 				"public class X<Tx1 extends S, Tx2 extends C>  extends XS<Tx2> {\n" +
2817 				"\n" +
2818 				"    public static void main(String[] args) {\n" +
2819 				"        I w = new X<S,I>().get(new I());\n" +
2820 				"        System.out.println(\"SUCCESS\");\n" +
2821 				"    }\n" +
2822 				"}\n" +
2823 				"class S {}\n" +
2824 				"class I implements C<I> {}\n" +
2825 				"interface C<Tc> {}\n" +
2826 				"class XS <Txs> {\n" +
2827 				"    Txs get(Txs t) {\n" +
2828 				"        return t;\n" +
2829 				"    }\n" +
2830 				"}\n"
2831 			},
2832 			"SUCCESS");
2833 	}
test0095()2834 	public void test0095() {
2835 		this.runConformTest(
2836 			new String[] {
2837 				"X.java",
2838 				"public class X<Tx1 extends S, Tx2 extends C>  extends XS<Tx2> {\n" +
2839 				"\n" +
2840 				"    public static void main(String[] args) {\n" +
2841 				"        I w = new X<S,I>().get(new I());\n" +
2842 				"        System.out.println(\"SUCCESS\");\n" +
2843 				"    }\n" +
2844 				"}\n" +
2845 				"class S {}\n" +
2846 				"class I implements C {}\n" +
2847 				"interface C<Tc> {}\n" +
2848 				"class XS <Txs> {\n" +
2849 				"    Txs get(Txs t) {\n" +
2850 				"        return t;\n" +
2851 				"    }\n" +
2852 				"}\n"
2853 			},
2854 			"SUCCESS");
2855 	}
test0096()2856 	public void test0096() {
2857 		this.runNegativeTest(
2858 			new String[] {
2859 				"X.java",
2860 				"public class X<T> extends X {}\n"
2861 			},
2862 			"----------\n" +
2863 			"1. ERROR in X.java (at line 1)\n" +
2864 			"	public class X<T> extends X {}\n" +
2865 			"	                          ^\n" +
2866 			"Cycle detected: the type X<T> cannot extend/implement itself or one of its own member types\n" +
2867 			"----------\n");
2868 	}
test0097()2869 	public void test0097() {
2870 		this.runNegativeTest(
2871 			new String[] {
2872 				"X.java",
2873 				"public class X<T> extends X<String> {}\n"
2874 			},
2875 			"----------\n" +
2876 			"1. ERROR in X.java (at line 1)\n" +
2877 			"	public class X<T> extends X<String> {}\n" +
2878 			"	                          ^\n" +
2879 			"Cycle detected: the type X<T> cannot extend/implement itself or one of its own member types\n" +
2880 			"----------\n");
2881 	}
test0098()2882 	public void test0098() {
2883 		Map customOptions = getCompilerOptions();
2884 		customOptions.put(CompilerOptions.OPTION_ReportUncheckedTypeOperation, CompilerOptions.ERROR);
2885 		this.runNegativeTest(
2886 			new String[] {
2887 				"X.java",
2888 				"public class X<T> {\n" +
2889 				"    \n" +
2890 				"    public static void main(String[] args) {\n" +
2891 				"        AX ax = new AX();\n" +
2892 				"        AX ax2 = ax.p;\n" +
2893 				"        ax.p = new AX<String>();\n" +
2894 				"        ax.q = new AX<String>();\n" +
2895 				"        ax.r = new AX<Object>();\n" +
2896 				"        ax.s = new AX<String>();\n" +
2897 				"        System.out.println(ax2);\n" +
2898 				"    }\n" +
2899 				"}\n" +
2900 				"\n" +
2901 				"class AX <P> {\n" +
2902 				"    AX<P> p;\n" +
2903 				"    AX<Object> q;\n" +
2904 				"    AX<String> r;\n" +
2905 				"    BX<String> s;\n" +
2906 				"}\n" +
2907 				"\n" +
2908 				"class BX<Q> {\n" +
2909 				"}\n",
2910 			},
2911 			"----------\n" +
2912 			"1. WARNING in X.java (at line 4)\n" +
2913 			"	AX ax = new AX();\n" +
2914 			"	^^\n" +
2915 			"AX is a raw type. References to generic type AX<P> should be parameterized\n" +
2916 			"----------\n" +
2917 			"2. WARNING in X.java (at line 4)\n" +
2918 			"	AX ax = new AX();\n" +
2919 			"	            ^^\n" +
2920 			"AX is a raw type. References to generic type AX<P> should be parameterized\n" +
2921 			"----------\n" +
2922 			"3. WARNING in X.java (at line 5)\n" +
2923 			"	AX ax2 = ax.p;\n" +
2924 			"	^^\n" +
2925 			"AX is a raw type. References to generic type AX<P> should be parameterized\n" +
2926 			"----------\n" +
2927 			"4. ERROR in X.java (at line 6)\n" +
2928 			"	ax.p = new AX<String>();\n" +
2929 			"	   ^\n" +
2930 			"Type safety: The field p from the raw type AX is assigned a value of type AX<String>. References to generic type AX<P> should be parameterized\n" +
2931 			"----------\n" +
2932 			"5. ERROR in X.java (at line 7)\n" +
2933 			"	ax.q = new AX<String>();\n" +
2934 			"	   ^\n" +
2935 			"Type safety: The field q from the raw type AX is assigned a value of type AX<String>. References to generic type AX<P> should be parameterized\n" +
2936 			"----------\n" +
2937 			"6. ERROR in X.java (at line 8)\n" +
2938 			"	ax.r = new AX<Object>();\n" +
2939 			"	   ^\n" +
2940 			"Type safety: The field r from the raw type AX is assigned a value of type AX<Object>. References to generic type AX<P> should be parameterized\n" +
2941 			"----------\n" +
2942 			"7. ERROR in X.java (at line 9)\n" +
2943 			"	ax.s = new AX<String>();\n" +
2944 			"	       ^^^^^^^^^^^^^^^^\n" +
2945 			"Type mismatch: cannot convert from AX<String> to BX\n" +
2946 			"----------\n",
2947 		null,
2948 		true,
2949 		customOptions);
2950 	}
2951 	// wildcard bound cannot be base type
2952 	// TODO (david) only syntax error should be related to wilcard bound being a base type. Ripple effect is severe here.
test0099()2953 	public void test0099() {
2954 		this.runNegativeTest(
2955 			new String[] {
2956 				"X.java",
2957 				"public class X  <T extends AX<? super int>> {\n" +
2958 				"    public static void main(String[] args) {\n" +
2959 				"		AX<String> ax;\n" +
2960 				"		System.out.println(\"SUCCESS\");\n" +
2961 				"	}\n" +
2962 				"	void foo(X<?> x) {\n" +
2963 				"	}\n" +
2964 				"}\n" +
2965 				"\n" +
2966 				"class AX<P> {\n" +
2967 				"}\n",
2968 			},
2969 			"----------\n" +
2970 			"1. ERROR in X.java (at line 1)\n" +
2971 			"	public class X  <T extends AX<? super int>> {\n" +
2972 			"	                                      ^^^\n" +
2973 			"Syntax error, insert \"Dimensions\" to complete ArrayType\n" +
2974 			"----------\n"
2975 );
2976 	}
2977 
2978 	// type parameterized with wildcard cannot appear in allocation
test0100()2979 	public void test0100() {
2980 		this.runNegativeTest(
2981 			new String[] {
2982 				"X.java",
2983 				"public class X <T> {\n" +
2984 				"    T t;\n" +
2985 				"    X(T t){\n" +
2986 				"        this.t = t;\n" +
2987 				"    }\n" +
2988 				"    public static void main(String[] args) {\n" +
2989 				"		X<? extends AX> x = new X<? extends AX>(new AX<String>());\n" +
2990 				"		System.out.println(\"SUCCESS\");\n" +
2991 				"	}\n" +
2992 				"}\n" +
2993 				"\n" +
2994 				"class AX<P> {\n" +
2995 				"    P foo() { return null; }\n" +
2996 				"}\n",
2997 			},
2998 			"----------\n" +
2999 			"1. WARNING in X.java (at line 7)\n" +
3000 			"	X<? extends AX> x = new X<? extends AX>(new AX<String>());\n" +
3001 			"	            ^^\n" +
3002 			"AX is a raw type. References to generic type AX<P> should be parameterized\n" +
3003 			"----------\n" +
3004 			"2. ERROR in X.java (at line 7)\n" +
3005 			"	X<? extends AX> x = new X<? extends AX>(new AX<String>());\n" +
3006 			"	                        ^\n" +
3007 			"Cannot instantiate the type X<? extends AX>\n" +
3008 			"----------\n" +
3009 			"3. WARNING in X.java (at line 7)\n" +
3010 			"	X<? extends AX> x = new X<? extends AX>(new AX<String>());\n" +
3011 			"	                                    ^^\n" +
3012 			"AX is a raw type. References to generic type AX<P> should be parameterized\n" +
3013 			"----------\n");
3014 	}
3015 
3016 	// wilcard may not pass parameter bound check
test0101()3017 	public void test0101() {
3018 		this.runNegativeTest(
3019 			new String[] {
3020 				"X.java",
3021 				"public class X <T extends String> {\n" +
3022 				"    T t;\n" +
3023 				"    X(T t){\n" +
3024 				"        this.t = t;\n" +
3025 				"    }\n" +
3026 				"    public static void main(String[] args) {\n" +
3027 				"		X<? extends AX> x = new X<AX<String>>(new AX<String>());\n" +
3028 				"		x.t.foo(\"SUCCESS\");\n" +
3029 				"	}\n" +
3030 				"}\n" +
3031 				"\n" +
3032 				"class AX<P> {\n" +
3033 				"   void foo(P p) { \n" +
3034 				"		System.out.println(p);\n" +
3035 				"   }\n" +
3036 				"}\n" +
3037 				"\n",
3038 			},
3039 			"----------\n" +
3040 			"1. WARNING in X.java (at line 1)\n" +
3041 			"	public class X <T extends String> {\n" +
3042 			"	                          ^^^^^^\n" +
3043 			"The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
3044 			"----------\n" +
3045 			"2. ERROR in X.java (at line 7)\n" +
3046 			"	X<? extends AX> x = new X<AX<String>>(new AX<String>());\n" +
3047 			"	  ^^^^^^^^^^^^\n" +
3048 			"Bound mismatch: The type ? extends AX is not a valid substitute for the bounded parameter <T extends String> of the type X<T>\n" +
3049 			"----------\n" +
3050 			"3. WARNING in X.java (at line 7)\n" +
3051 			"	X<? extends AX> x = new X<AX<String>>(new AX<String>());\n" +
3052 			"	            ^^\n" +
3053 			"AX is a raw type. References to generic type AX<P> should be parameterized\n" +
3054 			"----------\n" +
3055 			"4. ERROR in X.java (at line 7)\n" +
3056 			"	X<? extends AX> x = new X<AX<String>>(new AX<String>());\n" +
3057 			"	                          ^^\n" +
3058 			"Bound mismatch: The type AX<String> is not a valid substitute for the bounded parameter <T extends String> of the type X<T>\n" +
3059 			"----------\n" +
3060 			"5. WARNING in X.java (at line 8)\n" +
3061 			"	x.t.foo(\"SUCCESS\");\n" +
3062 			"	^^^^^^^^^^^^^^^^^^\n" +
3063 			"Type safety: The method foo(Object) belongs to the raw type AX. References to generic type AX<P> should be parameterized\n" +
3064 			"----------\n");
3065 	}
3066 	// unbound wildcard implicitly bound by matching parameter bounds
test0102()3067 	public void test0102() {
3068 		this.runNegativeTest(
3069 			new String[] {
3070 				"X.java",
3071 				"public class X <T extends AX> {\n" +
3072 				"    T t;\n" +
3073 				"    X(T t){\n" +
3074 				"        this.t = t;\n" +
3075 				"    }\n" +
3076 				"    public static void main(String[] args) {\n" +
3077 				"		X<?> x = new X<BX<String>>(new BX<String>());\n" +
3078 				"		x.t.foo(\"SUCC\");\n" +
3079 				"		x.t.bar(\"ESS\");\n" +
3080 				"	}\n" +
3081 				"}\n" +
3082 				"\n" +
3083 				"class AX<P> {\n" +
3084 				"   void foo(P p) { \n" +
3085 				"		System.out.print(p);\n" +
3086 				"   }\n" +
3087 				"}\n" +
3088 				"\n" +
3089 				"class BX<Q> extends AX<Q> {\n" +
3090 				"   void bar(Q q) { \n" +
3091 				"		System.out.println(q);\n" +
3092 				"   }\n" +
3093 				"}\n",
3094 			},
3095 			"----------\n" +
3096 			"1. WARNING in X.java (at line 1)\n" +
3097 			"	public class X <T extends AX> {\n" +
3098 			"	                          ^^\n" +
3099 			"AX is a raw type. References to generic type AX<P> should be parameterized\n" +
3100 			"----------\n" +
3101 			"2. WARNING in X.java (at line 8)\n" +
3102 			"	x.t.foo(\"SUCC\");\n" +
3103 			"	^^^^^^^^^^^^^^^\n" +
3104 			"Type safety: The method foo(Object) belongs to the raw type AX. References to generic type AX<P> should be parameterized\n" +
3105 			"----------\n" +
3106 			"3. ERROR in X.java (at line 9)\n" +
3107 			"	x.t.bar(\"ESS\");\n" +
3108 			"	    ^^^\n" +
3109 			"The method bar(String) is undefined for the type capture#2-of ?\n" +
3110 			"----------\n");
3111 	}
3112 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=85303
test0103()3113 	public void test0103() throws Exception {
3114 		this.runConformTest(
3115 			new String[] {
3116 				"X.java",
3117 				"public class X <T extends AX> {\n" +
3118 				"    T t;\n" +
3119 				"    X(T t){\n" +
3120 				"        this.t = t;\n" +
3121 				"    }\n" +
3122 				"    public static void main(String[] args) {\n" +
3123 				"		X<? extends BX> x = new X<BX<String>>(new BX<String>());\n" +
3124 				"		x.t.foo(\"SUCC\");\n" +
3125 				"		x.t.bar(\"ESS\");\n" +
3126 				"	}\n" +
3127 				"}\n" +
3128 				"\n" +
3129 				"class AX<P> {\n" +
3130 				"   void foo(P p) { \n" +
3131 				"		System.out.print(p);\n" +
3132 				"   }\n" +
3133 				"}\n" +
3134 				"\n" +
3135 				"class BX<Q> extends AX<Q> {\n" +
3136 				"   void bar(Q q) { \n" +
3137 				"		System.out.println(q);\n" +
3138 				"   }\n" +
3139 				"}\n",
3140 			},
3141 			"SUCCESS");
3142 		String expectedOutput =
3143 			"  // Method descriptor #25 ([Ljava/lang/String;)V\n" +
3144 			"  // Stack: 4, Locals: 2\n" +
3145 			"  public static void main(java.lang.String[] args);\n" +
3146 			"     0  new X [1]\n" +
3147 			"     3  dup\n" +
3148 			"     4  new BX [26]\n" +
3149 			"     7  dup\n" +
3150 			"     8  invokespecial BX() [28]\n" +
3151 			"    11  invokespecial X(AX) [29]\n" +
3152 			"    14  astore_1 [x]\n" +
3153 			"    15  aload_1 [x]\n" +
3154 			"    16  getfield X.t : AX [16]\n" +
3155 			"    19  checkcast BX [26]\n" +
3156 			"    22  ldc <String \"SUCC\"> [31]\n" +
3157 			"    24  invokevirtual BX.foo(java.lang.Object) : void [33]\n" +
3158 			"    27  aload_1 [x]\n" +
3159 			"    28  getfield X.t : AX [16]\n" +
3160 			"    31  checkcast BX [26]\n" +
3161 			"    34  ldc <String \"ESS\"> [37]\n" +
3162 			"    36  invokevirtual BX.bar(java.lang.Object) : void [39]\n" +
3163 			"    39  return\n" +
3164 			"      Line numbers:\n" +
3165 			"        [pc: 0, line: 7]\n" +
3166 			"        [pc: 15, line: 8]\n" +
3167 			"        [pc: 27, line: 9]\n" +
3168 			"        [pc: 39, line: 10]\n" +
3169 			"      Local variable table:\n" +
3170 			"        [pc: 0, pc: 40] local: args index: 0 type: java.lang.String[]\n" +
3171 			"        [pc: 15, pc: 40] local: x index: 1 type: X\n" +
3172 			"      Local variable type table:\n" +
3173 			"        [pc: 15, pc: 40] local: x index: 1 type: X<? extends BX>\n";
3174 
3175 		File f = new File(OUTPUT_DIR + File.separator + "X.class");
3176 		byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
3177 		ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
3178 		String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
3179 		int index = result.indexOf(expectedOutput);
3180 		if (index == -1 || expectedOutput.length() == 0) {
3181 			System.out.println(Util.displayString(result, 3));
3182 		}
3183 		if (index == -1) {
3184 			assertEquals("Wrong contents", expectedOutput, result);
3185 		}
3186 	}
3187 
3188 	// wildcard bound check
test0104()3189 	public void test0104() {
3190 		this.runNegativeTest(
3191 			new String[] {
3192 				"X.java",
3193 				"public class X <T extends AX> {\n" +
3194 				"    T t;\n" +
3195 				"    X(T t){\n" +
3196 				"        this.t = t;\n" +
3197 				"    }\n" +
3198 				"    public static void main(String[] args) {\n" +
3199 				"		X<? extends BX> x = new X<AX<String>>(new AX<String>());\n" +
3200 				"		x.t.foo(\"SUCC\");\n" +
3201 				"		x.t.bar(\"ESS\");\n" +
3202 				"	}\n" +
3203 				"}\n" +
3204 				"\n" +
3205 				"class AX<P> {\n" +
3206 				"   void foo(P p) { \n" +
3207 				"		System.out.print(p);\n" +
3208 				"   }\n" +
3209 				"}\n" +
3210 				"\n" +
3211 				"class BX<Q> extends AX<Q> {\n" +
3212 				"   void bar(Q q) { \n" +
3213 				"		System.out.println(q);\n" +
3214 				"   }\n" +
3215 				"}\n",
3216 			},
3217 			"----------\n" +
3218 			"1. WARNING in X.java (at line 1)\n" +
3219 			"	public class X <T extends AX> {\n" +
3220 			"	                          ^^\n" +
3221 			"AX is a raw type. References to generic type AX<P> should be parameterized\n" +
3222 			"----------\n" +
3223 			"2. WARNING in X.java (at line 7)\n" +
3224 			"	X<? extends BX> x = new X<AX<String>>(new AX<String>());\n" +
3225 			"	            ^^\n" +
3226 			"BX is a raw type. References to generic type BX<Q> should be parameterized\n" +
3227 			"----------\n" +
3228 			"3. ERROR in X.java (at line 7)\n" +
3229 			"	X<? extends BX> x = new X<AX<String>>(new AX<String>());\n" +
3230 			"	                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
3231 			"Type mismatch: cannot convert from X<AX<String>> to X<? extends BX>\n" +
3232 			"----------\n" +
3233 			"4. WARNING in X.java (at line 8)\n" +
3234 			"	x.t.foo(\"SUCC\");\n" +
3235 			"	^^^^^^^^^^^^^^^\n" +
3236 			"Type safety: The method foo(Object) belongs to the raw type AX. References to generic type AX<P> should be parameterized\n" +
3237 			"----------\n" +
3238 			"5. WARNING in X.java (at line 9)\n" +
3239 			"	x.t.bar(\"ESS\");\n" +
3240 			"	^^^^^^^^^^^^^^\n" +
3241 			"Type safety: The method bar(Object) belongs to the raw type BX. References to generic type BX<Q> should be parameterized\n" +
3242 			"----------\n");
3243 	}
test0105()3244 	public void test0105() {
3245 		this.runConformTest(
3246 			new String[] {
3247 				"X.java",
3248 				"public class X <T extends AX> {\n" +
3249 				"    T t;\n" +
3250 				"    X(T t){\n" +
3251 				"        this.t = t;\n" +
3252 				"    }\n" +
3253 				"    public static void main(String[] args) {\n" +
3254 				"		X<? extends AX> x = new X<AX<String>>(new AX<String>());\n" +
3255 				"		x.t.foo(\"SUCCESS\");\n" +
3256 				"	}\n" +
3257 				"}\n" +
3258 				"\n" +
3259 				"class AX<P> {\n" +
3260 				"   void foo(P p) { \n" +
3261 				"		System.out.println(p);\n" +
3262 				"   }\n" +
3263 				"}\n",
3264 			},
3265 			"SUCCESS");
3266 	}
test0106()3267 	public void test0106() {
3268 		this.runConformTest(
3269 			new String[] {
3270 				"X.java",
3271 				"public class X <T extends AX> {\n" +
3272 				"    T t;\n" +
3273 				"    X(T t){\n" +
3274 				"        this.t = t;\n" +
3275 				"    }\n" +
3276 				"    public static void main(String[] args) {\n" +
3277 				"        X<BX<String>> x = new X<BX<String>>(new BX<String>());\n" +
3278 				"		x.t.foo(\"SUCC\");\n" +
3279 				"		x.t.bar(\"ESS\");\n" +
3280 				"	}\n" +
3281 				"}\n" +
3282 				"\n" +
3283 				"class AX<P> {\n" +
3284 				"   void foo(P p) { \n" +
3285 				"		System.out.print(p);\n" +
3286 				"   }\n" +
3287 				"}\n" +
3288 				"\n" +
3289 				"class BX<Q> extends AX<Q> {\n" +
3290 				"   void bar(Q q) { \n" +
3291 				"		System.out.println(q);\n" +
3292 				"   }\n" +
3293 				"}\n",
3294 			},
3295 			"SUCCESS");
3296 	}
3297 	// unsafe assignment thru binaries
test0107()3298 	public void test0107() {
3299 		Map customOptions = getCompilerOptions();
3300 		this.runNegativeTest(
3301 			new String[] {
3302 				"X.java",
3303 				"import java.util.ArrayList;\n" +
3304 				"\n" +
3305 				"public class X  {\n" +
3306 				"    \n" +
3307 				"    public static void main(String[] args) {\n" +
3308 				"        \n" +
3309 				"        Iterable<String> is = new ArrayList();\n" +
3310 				"		is.iterator();\n" +
3311 				"    }\n" +
3312 				"}\n" +
3313 				"\n",
3314 			},
3315 			"----------\n" +
3316 			"1. WARNING in X.java (at line 7)\n" +
3317 			"	Iterable<String> is = new ArrayList();\n" +
3318 			"	                      ^^^^^^^^^^^^^^^\n" +
3319 			"Type safety: The expression of type ArrayList needs unchecked conversion to conform to Iterable<String>\n" +
3320 			"----------\n" +
3321 			"2. WARNING in X.java (at line 7)\n" +
3322 			"	Iterable<String> is = new ArrayList();\n" +
3323 			"	                          ^^^^^^^^^\n" +
3324 			"ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
3325 			"----------\n",
3326 			null,
3327 			true,
3328 			customOptions);
3329 	}
3330 	// class literal: Integer.class of type Class<Integer>
test0108()3331 	public void test0108() {
3332 	    // also ensure no unsafe type operation problem is issued (assignment to variable of type raw)
3333 		Map customOptions = getCompilerOptions();
3334 		customOptions.put(CompilerOptions.OPTION_ReportUncheckedTypeOperation, CompilerOptions.ERROR);
3335 		customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
3336 		this.runConformTest(
3337 			new String[] {
3338 				"X.java",
3339 			"public class X {\n" +
3340 			"    Class k;\n" +
3341 			"    public static void main(String args[]) {\n" +
3342 			"        new X().foo();\n" +
3343 			"    }\n" +
3344 			"    void foo() {\n" +
3345 			"        Class c = this.getClass();\n" +
3346 			"        this.k = this.getClass();\n" +
3347 			"        this.k = Integer.class;\n" +
3348 			"        try {\n" +
3349 			"            Integer i = Integer.class.newInstance();\n" +
3350 			"        } catch (Exception e) {\n" +
3351 			"        }\n" +
3352 			"        System.out.println(\"SUCCESS\");\n" +
3353 			"    }\n" +
3354 			"}\n",
3355 			},
3356 		"SUCCESS",
3357 		null,
3358 		true,
3359 		null,
3360 		customOptions,
3361 		null/*no custom requestor*/);
3362 	}
3363 	// parameterized interface cannot be implemented simultaneously with distinct arguments
test0109()3364 	public void test0109() {
3365 		this.runNegativeTest(
3366 			new String[] {
3367 				"X.java",
3368 				"public class X implements AX<String> {}\n" +
3369 				"class Y extends X implements AX<Thread> {}\n" +
3370 				"interface AX<P> {}\n" +
3371 				"\n",
3372 			},
3373 			"----------\n" +
3374 			"1. ERROR in X.java (at line 2)\n" +
3375 			"	class Y extends X implements AX<Thread> {}\n" +
3376 			"	      ^\n" +
3377 			"The interface AX cannot be implemented more than once with different arguments: AX<String> and AX<Thread>\n" +
3378 			"----------\n");
3379 	}
test0110()3380 	public void test0110() {
3381 		this.runNegativeTest(
3382 			new String[] {
3383 				"X.java",
3384 				"public class X implements AX {}\n" +
3385 				"class Y extends X implements AX<Thread> {}\n" +
3386 				"interface AX<P> {}\n" +
3387 				"\n",
3388 			},
3389 			"----------\n" +
3390 			"1. WARNING in X.java (at line 1)\n" +
3391 			"	public class X implements AX {}\n" +
3392 			"	                          ^^\n" +
3393 			"AX is a raw type. References to generic type AX<P> should be parameterized\n" +
3394 			"----------\n" +
3395 			"2. ERROR in X.java (at line 2)\n" +
3396 			"	class Y extends X implements AX<Thread> {}\n" +
3397 			"	      ^\n" +
3398 			"The interface AX cannot be implemented more than once with different arguments: AX and AX<Thread>\n" +
3399 			"----------\n");
3400 	}
test0111()3401 	public void test0111() {
3402 		this.runNegativeTest(
3403 			new String[] {
3404 				"X.java",
3405 				"public class X implements AX<Object> {}\n" +
3406 				"class Y extends X implements AX {}\n" +
3407 				"interface AX<P> {}\n" +
3408 				"\n",
3409 			},
3410 			"----------\n" +
3411 			"1. ERROR in X.java (at line 2)\n" +
3412 			"	class Y extends X implements AX {}\n" +
3413 			"	      ^\n" +
3414 			"The interface AX cannot be implemented more than once with different arguments: AX<Object> and AX\n" +
3415 			"----------\n" +
3416 			"2. WARNING in X.java (at line 2)\n" +
3417 			"	class Y extends X implements AX {}\n" +
3418 			"	                             ^^\n" +
3419 			"AX is a raw type. References to generic type AX<P> should be parameterized\n" +
3420 			"----------\n");
3421 	}
3422 	// test member types
test0112()3423 	public void test0112() {
3424 		this.runNegativeTest(
3425 			new String[] {
3426 				"X.java",
3427 				"public class X <T extends X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>>{\n" +
3428 				"    void foo(X<Thread>.MX<String>.MMX<X> mx) {}\n" +
3429 				"    class MX <MT> {\n" +
3430 				"        class MMX <MMT> {}\n" +
3431 				"    }\n" +
3432 				"}\n",
3433 			},
3434 			"----------\n" +
3435 			"1. WARNING in X.java (at line 1)\n" +
3436 			"	public class X <T extends X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>>{\n" +
3437 			"	                            ^^^^^^^^\n" +
3438 			"X.MX.MMX is a raw type. References to generic type X<T>.MX<MT>.MMX<MMT> should be parameterized\n" +
3439 			"----------\n" +
3440 			"2. ERROR in X.java (at line 1)\n" +
3441 			"	public class X <T extends X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>>{\n" +
3442 			"	                            ^^^^^^^^\n" +
3443 			"Bound mismatch: The type X.MX.MMX is not a valid substitute for the bounded parameter <T extends X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>> of the type X<T>\n" +
3444 			"----------\n" +
3445 			"3. ERROR in X.java (at line 2)\n" +
3446 			"	void foo(X<Thread>.MX<String>.MMX<X> mx) {}\n" +
3447 			"	           ^^^^^^\n" +
3448 			"Bound mismatch: The type Thread is not a valid substitute for the bounded parameter <T extends X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>> of the type X<T>\n" +
3449 			"----------\n" +
3450 			"4. WARNING in X.java (at line 2)\n" +
3451 			"	void foo(X<Thread>.MX<String>.MMX<X> mx) {}\n" +
3452 			"	                                  ^\n" +
3453 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
3454 			"----------\n");
3455 		this.runNegativeTest(
3456 			new String[] {
3457 				"X.java",
3458 				"public class X <T extends X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>>{\n" +
3459 				"    class MX <MT extends Comparable> {\n" +
3460 				"        class MMX <MMT> {}\n" +
3461 				"    }\n" +
3462 				"}\n",
3463 			},
3464 			"----------\n" +
3465 			"1. WARNING in X.java (at line 1)\n" +
3466 			"	public class X <T extends X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>>{\n" +
3467 			"	                            ^^^^^^^^\n" +
3468 			"X.MX.MMX is a raw type. References to generic type X<T>.MX<MT>.MMX<MMT> should be parameterized\n" +
3469 			"----------\n" +
3470 			"2. ERROR in X.java (at line 1)\n" +
3471 			"	public class X <T extends X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>>{\n" +
3472 			"	                            ^^^^^^^^\n" +
3473 			"Bound mismatch: The type X.MX.MMX is not a valid substitute for the bounded parameter <T extends X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>> of the type X<T>\n" +
3474 			"----------\n" +
3475 			"3. ERROR in X.java (at line 1)\n" +
3476 			"	public class X <T extends X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>>{\n" +
3477 			"	                                         ^^^^^^^^\n" +
3478 			"Bound mismatch: The type Runnable is not a valid substitute for the bounded parameter <MT extends Comparable> of the type X<T>.MX<MT>\n" +
3479 			"----------\n" +
3480 			"4. WARNING in X.java (at line 2)\n" +
3481 			"	class MX <MT extends Comparable> {\n" +
3482 			"	                     ^^^^^^^^^^\n" +
3483 			"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
3484 			"----------\n");
3485 		this.runNegativeTest(
3486 			new String[] {
3487 				"X.java",
3488 				"public class X <T extends X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>>{\n" +
3489 				"    class MX <MT> {\n" +
3490 				"        class MMX <MMT extends Comparable> {}\n" +
3491 				"    }\n" +
3492 				"}\n",
3493 			},
3494 			"----------\n" +
3495 			"1. WARNING in X.java (at line 1)\n" +
3496 			"	public class X <T extends X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>>{\n" +
3497 			"	                            ^^^^^^^^\n" +
3498 			"X.MX.MMX is a raw type. References to generic type X<T>.MX<MT>.MMX<MMT> should be parameterized\n" +
3499 			"----------\n" +
3500 			"2. ERROR in X.java (at line 1)\n" +
3501 			"	public class X <T extends X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>>{\n" +
3502 			"	                            ^^^^^^^^\n" +
3503 			"Bound mismatch: The type X.MX.MMX is not a valid substitute for the bounded parameter <T extends X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>> of the type X<T>\n" +
3504 			"----------\n" +
3505 			"3. ERROR in X.java (at line 1)\n" +
3506 			"	public class X <T extends X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>>{\n" +
3507 			"	                                                       ^^^^^^^^\n" +
3508 			"Bound mismatch: The type Iterable<String> is not a valid substitute for the bounded parameter <MMT extends Comparable> of the type X<T>.MX<MT>.MMX<MMT>\n" +
3509 			"----------\n" +
3510 			"4. WARNING in X.java (at line 3)\n" +
3511 			"	class MMX <MMT extends Comparable> {}\n" +
3512 			"	                       ^^^^^^^^^^\n" +
3513 			"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
3514 			"----------\n");
3515 	}
test0113()3516 	public void test0113() {
3517 		this.runConformTest(
3518 			new String[] {
3519 				"X.java",
3520 				"public class X<T> {\n" +
3521 				"  class MX<U> {\n" +
3522 				"  }\n" +
3523 				"\n" +
3524 				"  public static void main(String[] args) {\n" +
3525 				"    new X<Thread>().foo();\n" +
3526 				"	System.out.println(\"SUCCESS\");\n" +
3527 				"  }\n" +
3528 				"  void foo() {\n" +
3529 				"		new X<String>().new MX<T>();\n" +
3530 				"  }\n" +
3531 				"}\n",
3532 			},
3533 			"SUCCESS");
3534 	}
test0114()3535 	public void test0114() {
3536 		this.runConformTest(
3537 			new String[] {
3538 				"X.java",
3539 				"public class X<T> {\n" +
3540 				"  class MX<U> {\n" +
3541 				"  }\n" +
3542 				"\n" +
3543 				"  public static void main(String[] args) {\n" +
3544 				"    new X<Thread>().foo(new X<String>().new MX<Thread>());\n" +
3545 				"  }\n" +
3546 				"  void foo(X<String>.MX<Thread> mx) {\n" +
3547 				"	System.out.println(\"SUCCESS\");\n" +
3548 				"  }\n" +
3549 				"}\n",
3550 			},
3551 			"SUCCESS");
3552 	}
test0115()3553 	public void test0115() {
3554 		this.runConformTest(
3555 			new String[] {
3556 				"X.java",
3557 				"public class X<T> {\n" +
3558 				"  class MX<U> {\n" +
3559 				"  }\n" +
3560 				"\n" +
3561 				"  public static void main(String[] args) {\n" +
3562 				"    new X<Thread>().foo(new X<String>().new MX<Thread>());\n" +
3563 				"  }\n" +
3564 				"  void foo(X.MX mx) {\n" +
3565 				"	System.out.println(\"SUCCESS\");\n" +
3566 				"  }\n" +
3567 				"}\n",
3568 			},
3569 			"SUCCESS");
3570 	}
test0116()3571 	public void test0116() {
3572 		this.runConformTest(
3573 			new String[] {
3574 				"X.java",
3575 				"public class X<T> {\n" +
3576 				"  class MX<U> {\n" +
3577 				"  }\n" +
3578 				"\n" +
3579 				"  public static void main(String[] args) {\n" +
3580 				"    new X<Thread>().foo(new X<String>().new MX<Thread>());\n" +
3581 				"  }\n" +
3582 				"  void foo(X<?>.MX<?> mx) {\n" +
3583 				"	System.out.println(\"SUCCESS\");\n" +
3584 				"  }\n" +
3585 				"}\n",
3586 			},
3587 			"SUCCESS");
3588 	}
3589 	// test member types
test0117()3590 	public void test0117() {
3591 		this.runNegativeTest(
3592 			new String[] {
3593 				"X.java",
3594 				"public class X <T extends X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>>{\n" +
3595 				"    public static void main(String [] args) {\n" +
3596 				"        \n" +
3597 				"        new X<X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>>().new MX<Exception>();\n" +
3598 				"        System.out.println(\"SUCCESS\");\n" +
3599 				"    }\n" +
3600 				"    void foo(X<X.MX.MMX>.MX<X>.MMX<X> mx) {\n" +
3601 				"    }\n" +
3602 				"    \n" +
3603 				"    class MX <MT> {\n" +
3604 				"        class MMX <MMT> {\n" +
3605 				"        }\n" +
3606 				"    }\n" +
3607 				"}\n",
3608 			},
3609 			"----------\n" +
3610 			"1. WARNING in X.java (at line 1)\n" +
3611 			"	public class X <T extends X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>>{\n" +
3612 			"	                            ^^^^^^^^\n" +
3613 			"X.MX.MMX is a raw type. References to generic type X<T>.MX<MT>.MMX<MMT> should be parameterized\n" +
3614 			"----------\n" +
3615 			"2. ERROR in X.java (at line 1)\n" +
3616 			"	public class X <T extends X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>>{\n" +
3617 			"	                            ^^^^^^^^\n" +
3618 			"Bound mismatch: The type X.MX.MMX is not a valid substitute for the bounded parameter <T extends X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>> of the type X<T>\n" +
3619 			"----------\n" +
3620 			"3. WARNING in X.java (at line 4)\n" +
3621 			"	new X<X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>>().new MX<Exception>();\n" +
3622 			"	        ^^^^^^^^\n" +
3623 			"X.MX.MMX is a raw type. References to generic type X<T>.MX<MT>.MMX<MMT> should be parameterized\n" +
3624 			"----------\n" +
3625 			"4. ERROR in X.java (at line 4)\n" +
3626 			"	new X<X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>>().new MX<Exception>();\n" +
3627 			"	        ^^^^^^^^\n" +
3628 			"Bound mismatch: The type X.MX.MMX is not a valid substitute for the bounded parameter <T extends X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>> of the type X<T>\n" +
3629 			"----------\n" +
3630 			"5. WARNING in X.java (at line 7)\n" +
3631 			"	void foo(X<X.MX.MMX>.MX<X>.MMX<X> mx) {\n" +
3632 			"	           ^^^^^^^^\n" +
3633 			"X.MX.MMX is a raw type. References to generic type X<T>.MX<MT>.MMX<MMT> should be parameterized\n" +
3634 			"----------\n" +
3635 			"6. ERROR in X.java (at line 7)\n" +
3636 			"	void foo(X<X.MX.MMX>.MX<X>.MMX<X> mx) {\n" +
3637 			"	           ^^^^^^^^\n" +
3638 			"Bound mismatch: The type X.MX.MMX is not a valid substitute for the bounded parameter <T extends X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>> of the type X<T>\n" +
3639 			"----------\n" +
3640 			"7. WARNING in X.java (at line 7)\n" +
3641 			"	void foo(X<X.MX.MMX>.MX<X>.MMX<X> mx) {\n" +
3642 			"	                        ^\n" +
3643 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
3644 			"----------\n" +
3645 			"8. WARNING in X.java (at line 7)\n" +
3646 			"	void foo(X<X.MX.MMX>.MX<X>.MMX<X> mx) {\n" +
3647 			"	                               ^\n" +
3648 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
3649 			"----------\n");
3650 	}
3651 	// test generic method with recursive parameter bound <T extends Comparable<? super T>>
test0118()3652 	public void test0118() {
3653 		this.runConformTest(
3654 			new String[] {
3655 				"X.java",
3656 				"public class X {\n" +
3657 				"    public static void main(String[] args) {\n" +
3658 				"        java.util.Collections.sort(new java.util.LinkedList<String>());\n" +
3659 				"        System.out.println(\"SUCCESS\");\n" +
3660 				"    }\n" +
3661 				"}\n"
3662 			},
3663 			"SUCCESS");
3664 	}
3665 	// test generic method
test0118a()3666 	public void test0118a() {
3667 		this.runConformTest(
3668 			// test directory preparation
3669 			true /* flush output directory */,
3670 			new String[] { /* test files */
3671 				"X.java",
3672 				"class A<T> {}\n" +
3673 				"\n" +
3674 				"public class X {\n" +
3675 				"	static <T extends A<U>, U> void foo() {}\n" +
3676 				"	void bar(A<?> a) {\n" +
3677 				"		foo();\n" +
3678 				"	}\n" +
3679 				"}"
3680 			},
3681 			// compiler results
3682 			null /* do not check compiler log */,
3683 			// runtime results
3684 			"" /* expected output string */,
3685 			null /* do not check error string */,
3686 			// javac options
3687 			JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
3688 	}
3689 	// test binary member types **
_test0119()3690 	public void _test0119() {
3691 		this.runConformTest(
3692 			new String[] {
3693 				"X.java",
3694 				"public class X <T extends X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>>{\n" +
3695 				"    public static void main(String [] args) {\n" +
3696 				"        \n" +
3697 				"        new X<X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>>().new MX<Exception>();\n" +
3698 				"        System.out.println(\"SUCCESS\");\n" +
3699 				"    }\n" +
3700 				"    void foo(X<X.MX.MMX>.MX<Object>.MMX<X> mx) {\n" +
3701 				"    }\n" +
3702 				"    void foo2(X<X.MX.MMX>.MX<Iterable>.MMX<X> mx) {\n" +
3703 				"    }\n" +
3704 				"    void foo3(X<X<X.MX.MMX>.MX<Runnable>.MMX<Iterable<String>>> mx) {\n" +
3705 				"    }\n" +
3706 				"    \n" +
3707 				"    class MX <MT> {\n" +
3708 				"        class MMX <MMT> {\n" +
3709 				"        }\n" +
3710 				"    }\n" +
3711 				"}\n",
3712 			},
3713 			"SUCCESS"
3714 		);
3715 
3716 		// TODO (philippe) bounds checks are done before binaryType X is finished creating its type variables
3717 		this.runConformTest(
3718 			new String[] {
3719 				"Y.java",
3720 				"public class Y extends X {\n" +
3721 				"    public static void main(String [] args) {\n" +
3722 				"        System.out.println(\"SUCCESS\");\n" +
3723 				"    }\n" +
3724 				"}\n",
3725 			},
3726 			"SUCCESS",
3727 			null,
3728 			false, // do not flush output
3729 			null);
3730 	}
3731 	// test generic method
test0120()3732 	public void test0120() {
3733 		this.runConformTest(
3734 			new String[] {
3735 				"X.java",
3736 				"public class X <T>{\n" +
3737 				"    public static void main(String[] args) {\n" +
3738 				"        \n" +
3739 				"        String s = new X<String>().foo(\"SUCCESS\");\n" +
3740 				"	}\n" +
3741 				"    <U extends String> T foo (U u) {\n" +
3742 				"        System.out.println(u);\n" +
3743 				"        return null;\n" +
3744 				"    }\n" +
3745 				"}\n",
3746 			},
3747 			"SUCCESS");
3748 	}
3749 	// test generic method
test0120a()3750 	public void test0120a() {
3751 		this.runConformTest(
3752 			// test directory preparation
3753 			new String[] { /* test files */
3754 				"X.java",
3755 				"public class X<E> {\n" +
3756 				"    <U extends X<?>> U foo() {\n" +
3757 				"    	return null;\n" +
3758 				"    }\n" +
3759 				"    <V extends X<?>> V bar() {\n" +
3760 				"        return foo();\n" +
3761 				"    }\n" +
3762 				"}"
3763 			},
3764 			// javac options
3765 			JavacTestOptions.JavacHasABug.JavacBug6302954 /* javac test options */);
3766 	}
3767 	// substitute array types
test0121()3768 	public void test0121() {
3769 		this.runConformTest(
3770 			new String[] {
3771 				"X.java",
3772 				"public class X <T> {\n" +
3773 				"    public static void main(String[] args) {\n" +
3774 				"		new X<String>().foo(args);\n" +
3775 				"	}\n" +
3776 				"    \n" +
3777 				"    void foo(T[] ts) {\n" +
3778 				"        System.out.println(\"SUCCESS\");\n" +
3779 				"    }\n" +
3780 				"}\n",
3781 			},
3782 			"SUCCESS");
3783 	}
3784 	// generic method with most specific common supertype: U --> String
test0122()3785 	public void test0122() {
3786 		this.runConformTest(
3787 			new String[] {
3788 				"X.java",
3789 				"public class X <T> {\n" +
3790 				"    public static void main(String[] args) {\n" +
3791 				"		new X<String>().foo(args, new X<X<String>>());\n" +
3792 				"	}\n" +
3793 				"    <U> void foo(U[] us, X<X<U>> xxu) {\n" +
3794 				"        System.out.println(\"SUCCESS\");\n" +
3795 				"    }\n" +
3796 				"}\n",
3797 			},
3798 			"SUCCESS");
3799 	}
3800 	// invalid parameterized type
test0123()3801 	public void test0123() {
3802 		this.runNegativeTest(
3803 			new String[] {
3804 				"X.java",
3805 				"public class X <T> {\n" +
3806 				"    T<String> ts;\n" +
3807 				"}\n",
3808 			},
3809 			"----------\n" +
3810 			"1. ERROR in X.java (at line 2)\n" +
3811 			"	T<String> ts;\n" +
3812 			"	^\n" +
3813 			"The type T is not generic; it cannot be parameterized with arguments <String>\n" +
3814 			"----------\n");
3815 	}
3816 	// generic method with indirect type inference: BX<String, Thread> --> AX<W>
test0124()3817 	public void test0124() {
3818 		this.runConformTest(
3819 			new String[] {
3820 				"X.java",
3821 				"public class X {\n" +
3822 				"    \n" +
3823 				"    <W> void foo(AX<W> aw) {\n" +
3824 				"        System.out.println(\"SUCCESS\");\n" +
3825 				"     }\n" +
3826 				"    \n" +
3827 				"    public static void main(String[] args) {\n" +
3828 				"		new X().foo(new BX<String,Thread>());\n" +
3829 				"	}\n" +
3830 				"}\n" +
3831 				"\n" +
3832 				"class AX<T> {\n" +
3833 				"}\n" +
3834 				"class BX<U, V> extends AX<V> {\n" +
3835 				"}\n",
3836 			},
3837 			"SUCCESS");
3838 	}
3839 	// generic method with indirect type inference: CX  --> AX<W>
test0125()3840 	public void test0125() {
3841 		this.runConformTest(
3842 			new String[] {
3843 				"X.java",
3844 				"public class X {\n" +
3845 				"    \n" +
3846 				"    <W> void foo(AX<W> aw) {\n" +
3847 				"        System.out.println(\"SUCCESS\");\n" +
3848 				"     }\n" +
3849 				"    \n" +
3850 				"    public static void main(String[] args) {\n" +
3851 				"		new X().foo(new CX());\n" +
3852 				"	}\n" +
3853 				"}\n" +
3854 				"\n" +
3855 				"class AX<T> {\n" +
3856 				"}\n" +
3857 				"class BX<U, V> extends AX<V> {\n" +
3858 				"}\n" +
3859 				"class CX extends BX<String, Thread> {\n" +
3860 				"}\n",
3861 			},
3862 			"SUCCESS");
3863 	}
3864 	// variation on test0125 with typo: CX extends B instead of BX.
test0126()3865 	public void test0126() {
3866 		this.runNegativeTest(
3867 			new String[] {
3868 				"X.java",
3869 				"public class X {\n" +
3870 				"    \n" +
3871 				"    <W> void foo(AX<W> aw) {\n" +
3872 				"        System.out.println(\"SUCCESS\");\n" +
3873 				"     }\n" +
3874 				"    \n" +
3875 				"    public static void main(String[] args) {\n" +
3876 				"		new X().foo(new CX());\n" +
3877 				"	}\n" +
3878 				"}\n" +
3879 				"\n" +
3880 				"class AX<T> {\n" +
3881 				"}\n" +
3882 				"class BX<U, V> extends AX<V> {\n" +
3883 				"}\n" +
3884 				"class CX extends B<String, Thread> {\n" +
3885 				"}\n",
3886 			},
3887 			"----------\n" +
3888 			"1. ERROR in X.java (at line 8)\n" +
3889 			"	new X().foo(new CX());\n" +
3890 			"	        ^^^\n" +
3891 			"The method foo(AX<W>) in the type X is not applicable for the arguments (CX)\n" +
3892 			"----------\n" +
3893 			"2. ERROR in X.java (at line 16)\n" +
3894 			"	class CX extends B<String, Thread> {\n" +
3895 			"	                 ^\n" +
3896 			"B cannot be resolved to a type\n" +
3897 			"----------\n");
3898 	}
3899 	// 57784: test generic method
test0127()3900 	public void test0127() {
3901 		this.runConformTest(
3902 			new String[] {
3903 				"X.java",
3904 				"public class X {\n" +
3905 				"    public static void main(String[] args) {\n" +
3906 				"        java.util.Arrays.asList(new Object[] {\"1\"});\n" +
3907 				"        System.out.println(\"SUCCESS\");\n" +
3908 				"    }\n" +
3909 				"}\n"
3910 			},
3911 			"SUCCESS");
3912 	}
3913 	// 58666: special treatment for Object#getClass declared of type: Class<? extends Object>
3914 	// but implicitly converted to Class<? extends X> for free.
test0128()3915 	public void test0128() {
3916 		this.runNegativeTest(
3917 			new String[] {
3918 				"X.java",
3919 				"public class X { \n" +
3920 				"    public static void main(String[] args) {\n" +
3921 				"		X x = new X();\n" +
3922 				"		Class c1 = x.getClass();\n" +
3923 				"		Class<? extends X> c2 = x.getClass();\n" +
3924 				"		String s = \"hello\";\n" +
3925 				"		Class<? extends X> c3 = s.getClass();\n" +
3926 				"		System.out.println(\"SUCCESS\");\n" +
3927 				"    }\n" +
3928 				"}\n"
3929 			},
3930 			"----------\n" +
3931 			"1. WARNING in X.java (at line 4)\n" +
3932 			"	Class c1 = x.getClass();\n" +
3933 			"	^^^^^\n" +
3934 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
3935 			"----------\n" +
3936 			"2. ERROR in X.java (at line 7)\n" +
3937 			"	Class<? extends X> c3 = s.getClass();\n" +
3938 			"	                        ^^^^^^^^^^^^\n" +
3939 			"Type mismatch: cannot convert from Class<capture#3-of ? extends String> to Class<? extends X>\n" +
3940 			"----------\n");
3941 	}
3942 	// variation on test0128
test0129()3943 	public void test0129() {
3944 		this.runNegativeTest(
3945 			new String[] {
3946 				"X.java",
3947 				"public class X { \n" +
3948 				"\n" +
3949 				"    public static void main(String[] args) {\n" +
3950 				"		XY xy = new XY();\n" +
3951 				"		Class c1 = xy.getClass();\n" +
3952 				"		Class<? extends XY> c2 = xy.getClass();\n" +
3953 				"		String s = \"hello\";\n" +
3954 				"		Class<? extends XY> c3 = s.getClass();\n" +
3955 				"		System.out.println(\"SUCCESS\");\n" +
3956 				"    }\n" +
3957 				"}\n" +
3958 				"\n" +
3959 				"class XY extends X {\n" +
3960 				"    public Class <? extends Object> getClass() {\n" +
3961 				"        return super.getClass();\n" +
3962 				"    }\n" +
3963 				"}\n"
3964 			},
3965 			"----------\n" +
3966 			"1. WARNING in X.java (at line 5)\n" +
3967 			"	Class c1 = xy.getClass();\n" +
3968 			"	^^^^^\n" +
3969 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
3970 			"----------\n" +
3971 			"2. ERROR in X.java (at line 8)\n" +
3972 			"	Class<? extends XY> c3 = s.getClass();\n" +
3973 			"	                         ^^^^^^^^^^^^\n" +
3974 			"Type mismatch: cannot convert from Class<capture#3-of ? extends String> to Class<? extends XY>\n" +
3975 			"----------\n" +
3976 			"3. ERROR in X.java (at line 14)\n" +
3977 			"	public Class <? extends Object> getClass() {\n" +
3978 			"	                                ^^^^^^^^^^\n" +
3979 			"Cannot override the final method from Object\n" +
3980 			"----------\n" +
3981 			"4. WARNING in X.java (at line 14)\n" +
3982 			"	public Class <? extends Object> getClass() {\n" +
3983 			"	                                ^^^^^^^^^^\n" +
3984 			"The method getClass() of type XY should be tagged with @Override since it actually overrides a superclass method\n" +
3985 			"----------\n");
3986 	}
3987 	// getClass on array type
test0130()3988 	public void test0130() {
3989 		this.runConformTest(
3990 			new String[] {
3991 				"X.java",
3992 				"public class X { \n" +
3993 				"\n" +
3994 				"    public static void main(String[] args) {\n" +
3995 				"		X[] x = new X[0];\n" +
3996 				"		Class<? extends X[]> c = x.getClass();\n" +
3997 				"		System.out.println(\"SUCCESS\");\n" +
3998 				"    }\n" +
3999 				"}\n"
4000 			},
4001 			"SUCCESS");
4002 	}
4003 	// 58979
test0131()4004 	public void test0131() {
4005 		this.runNegativeTest(
4006 			new String[] {
4007 				"ArrayList.java",
4008 				" interface List<T> {\n" +
4009 				"	 List<T> foo();\n" +
4010 				"}\n" +
4011 				"\n" +
4012 				" class ArrayList<T> implements List<T> {\n" +
4013 				"	public List<T> foo() {\n" +
4014 				"		List<T> lt = this;\n" +
4015 				"		lt.bar();\n" +
4016 				"		return this;\n" +
4017 				"	}\n" +
4018 				"}\n",
4019 			},
4020 			"----------\n" +
4021 			"1. ERROR in ArrayList.java (at line 8)\n" +
4022 			"	lt.bar();\n" +
4023 			"	   ^^^\n" +
4024 			"The method bar() is undefined for the type List<T>\n" +
4025 			"----------\n");
4026 	}
test0132()4027 	public void test0132() {
4028 		this.runNegativeTest(
4029 			new String[] {
4030 				"X.java",
4031 				"public class X {\n" +
4032 				"  <T extends X<W>.Z> foo() {}\n" +
4033 				"}"
4034 			},
4035 			"----------\n" +
4036 			"1. ERROR in X.java (at line 2)\n" +
4037 			"	<T extends X<W>.Z> foo() {}\n" +
4038 			"	           ^\n" +
4039 			"The type X is not generic; it cannot be parameterized with arguments <W>\n" +
4040 			"----------\n" +
4041 			"2. ERROR in X.java (at line 2)\n" +
4042 			"	<T extends X<W>.Z> foo() {}\n" +
4043 			"	             ^\n" +
4044 			"W cannot be resolved to a type\n" +
4045 			"----------\n" +
4046 			"3. ERROR in X.java (at line 2)\n" +
4047 			"	<T extends X<W>.Z> foo() {}\n" +
4048 			"	                   ^^^^^\n" +
4049 			"Return type for the method is missing\n" +
4050 			"----------\n");
4051 	}
4052 	// bridge method
test0133()4053 	public void test0133() {
4054 		this.runConformTest(
4055 			new String[] {
4056 				"X.java",
4057 				"public class X<T> {\n" +
4058 				"    public static void main(String[] args) {\n" +
4059 				"        X x = new Y();\n" +
4060 				"        System.out.println(x.foo());\n" +
4061 				"    }\n" +
4062 				"   T foo() {return null;}\n" +
4063 				"   void foo(T t) {}\n" +
4064 				"}\n" +
4065 				"class Y extends X<Object> {\n" +
4066 				"    String foo() {return \"SUCCESS\";}\n" +
4067 				"    void foo(String s) {}\n" +
4068 				"}\n"
4069 			},
4070 			"SUCCESS");
4071 	}
test0134()4072 	public void test0134() {
4073 		this.runConformTest(
4074 			new String[] {
4075 				"Z.java",
4076 				"import java.util.ArrayList;\n" +
4077 				"import java.util.List;\n" +
4078 				"\n" +
4079 				"public class Z <T extends List> { \n" +
4080 				"    T t;\n" +
4081 				"    public static void main(String[] args) {\n" +
4082 				"        foo(new Z<ArrayList>().set(new ArrayList<String>()));\n" +
4083 				"        System.out.println(\"SUCCESS\");\n" +
4084 				"    }\n" +
4085 				"    Z<T> set(T t) {\n" +
4086 				"        this.t = t;\n" +
4087 				"        return this;\n" +
4088 				"    }\n" +
4089 				"    T get() { \n" +
4090 				"        return this.t; \n" +
4091 				"    }\n" +
4092 				"    \n" +
4093 				"    static void foo(Z<? super ArrayList> za) {\n" +
4094 				"        za.get().isEmpty();\n" +
4095 				"    }\n" +
4096 				"}\n"
4097 			},
4098 			"SUCCESS");
4099 	}
test0135()4100 	public void test0135() {
4101 		this.runNegativeTest(
4102 			new String[] {
4103 				"Z.java",
4104 				"public class Z <T extends ZA> { \n" +
4105 				"    public static void main(String[] args) {\n" +
4106 				"        foo(new Z<ZA>());\n" +
4107 				"        System.out.println(\"SUCCESS\");\n" +
4108 				"    }\n" +
4109 				"    static void foo(Z<? super String> zs) {\n" +
4110 				"    }\n" +
4111 				"}\n" +
4112 				"\n" +
4113 				"class ZA {\n" +
4114 				"    void foo() {}\n" +
4115 				"}\n" +
4116 				"\n" +
4117 				"class ZB extends ZA {\n" +
4118 				"}"
4119 			},
4120 			"----------\n" +
4121 			"1. ERROR in Z.java (at line 3)\n" +
4122 			"	foo(new Z<ZA>());\n" +
4123 			"	^^^\n" +
4124 			"The method foo(Z<? super String>) in the type Z<T> is not applicable for the arguments (Z<ZA>)\n" +
4125 			"----------\n" +
4126 			"2. ERROR in Z.java (at line 6)\n" +
4127 			"	static void foo(Z<? super String> zs) {\n" +
4128 			"	                  ^^^^^^^^^^^^^^\n" +
4129 			"Bound mismatch: The type ? super String is not a valid substitute for the bounded parameter <T extends ZA> of the type Z<T>\n" +
4130 			"----------\n");
4131 	}
test0136()4132 	public void test0136() {
4133 		this.runNegativeTest(
4134 			new String[] {
4135 				"Z.java",
4136 				"public class Z <T extends ZB> { \n" +
4137 				"    public static void main(String[] args) {\n" +
4138 				"        foo(new Z<ZB>());\n" +
4139 				"    }\n" +
4140 				"    static void foo(Z<? super ZA> zs) {\n" +
4141 				"        zs.foo();\n" +
4142 				"    }\n" +
4143 				"}\n" +
4144 				"class ZA {\n" +
4145 				"}\n" +
4146 				"class ZB extends ZA {\n" +
4147 				"    void foo() {}\n" +
4148 				"}"
4149 			},
4150 			"----------\n" +
4151 			"1. ERROR in Z.java (at line 3)\n" +
4152 			"	foo(new Z<ZB>());\n" +
4153 			"	^^^\n" +
4154 			"The method foo(Z<? super ZA>) in the type Z<T> is not applicable for the arguments (Z<ZB>)\n" +
4155 			"----------\n" +
4156 			"2. ERROR in Z.java (at line 5)\n" +
4157 			"	static void foo(Z<? super ZA> zs) {\n" +
4158 			"	                  ^^^^^^^^^^\n" +
4159 			"Bound mismatch: The type ? super ZA is not a valid substitute for the bounded parameter <T extends ZB> of the type Z<T>\n" +
4160 			"----------\n" +
4161 			"3. ERROR in Z.java (at line 6)\n" +
4162 			"	zs.foo();\n" +
4163 			"	   ^^^\n" +
4164 			"The method foo(Z<? super ZA>) in the type Z<capture#1-of ? super ZA> is not applicable for the arguments ()\n" +
4165 			"----------\n");
4166 	}
test0137()4167 	public void test0137() {
4168 		this.runConformTest(
4169 			new String[] {
4170 				"Z.java",
4171 				"import java.util.ArrayList;\n" +
4172 				"import java.util.List;\n" +
4173 				"\n" +
4174 				"public class Z <T extends List> { \n" +
4175 				"    T t;\n" +
4176 				"    public static void main(String[] args) {\n" +
4177 				"        foo(new Z<ArrayList>().set(new ArrayList<String>()));\n" +
4178 				"        System.out.println(\"SUCCESS\");\n" +
4179 				"    }\n" +
4180 				"    Z<T> set(T t) {\n" +
4181 				"        this.t = t;\n" +
4182 				"        return this;\n" +
4183 				"    }\n" +
4184 				"    T get() { \n" +
4185 				"        return this.t; \n" +
4186 				"    }\n" +
4187 				"    \n" +
4188 				"    static void foo(Z<? extends ArrayList> za) {\n" +
4189 				"        za.get().isEmpty();\n" +
4190 				"    }\n" +
4191 				"}\n"
4192 			},
4193 			"SUCCESS");
4194 	}
4195 	// unbound wildcard still remembers its variable bound: Z<?> behaves like Z<AX>
test0138()4196 	public void test0138() {
4197 		this.runConformTest(
4198 			new String[] {
4199 				"Z.java",
4200 				"public class Z <T extends AX> {\n" +
4201 				"    T t;\n" +
4202 				"    Z(T t){\n" +
4203 				"        this.t = t;\n" +
4204 				"    }\n" +
4205 				"    public static void main(String[] args) {\n" +
4206 				"		 Z<AX<String>> zax = new Z<AX<String>>(new AX<String>());\n" +
4207 				"        System.out.println(\"SUCCESS\");\n" +
4208 				"	}\n" +
4209 				"    void baz(Z<?> zu){\n" +
4210 				"        zu.t.foo(null);\n" +
4211 				"    }\n" +
4212 				"}\n" +
4213 				"\n" +
4214 				"class AX<P> {\n" +
4215 				"   void foo(P p) { \n" +
4216 				"		System.out.print(p);\n" +
4217 				"   }\n" +
4218 				"}\n"
4219 			},
4220 			"SUCCESS");
4221 	}
4222 	// extending wildcard considers its bound prior to its corresponding variable
test0139()4223 	public void test0139() {
4224 		this.runNegativeTest(
4225 			new String[] {
4226 				"X.java",
4227 				"public class X<T extends AX> {\n" +
4228 				"    T t;\n" +
4229 				"    X(T t) {\n" +
4230 				"        this.t = t;\n" +
4231 				"    }\n" +
4232 				"    T get() {\n" +
4233 				"        return this.t;\n" +
4234 				"    }\n" +
4235 				"    void bar(X<? extends BX> x) {\n" +
4236 				"        x.get().afoo();\n" +
4237 				"        x.get().bfoo();\n" +
4238 				"    }\n" +
4239 				"}\n" +
4240 				"class AX {\n" +
4241 				"    void afoo() {}\n" +
4242 				"}\n" +
4243 				"class BX {\n" +
4244 				"    void bfoo() {}\n" +
4245 				"}\n",
4246 			},
4247 			"----------\n" +
4248 			"1. ERROR in X.java (at line 9)\n" +
4249 			"	void bar(X<? extends BX> x) {\n" +
4250 			"	           ^^^^^^^^^^^^\n" +
4251 			"Bound mismatch: The type ? extends BX is not a valid substitute for the bounded parameter <T extends AX> of the type X<T>\n" +
4252 			"----------\n" +
4253 			"2. ERROR in X.java (at line 10)\n" +
4254 			"	x.get().afoo();\n" +
4255 			"	        ^^^^\n" +
4256 			"The method afoo() is undefined for the type capture#1-of ? extends BX\n" +
4257 			"----------\n");
4258 	}
4259 	// extending wildcard considers its bound prior to its corresponding variable
test0140()4260 	public void test0140() {
4261 		this.runConformTest(
4262 			new String[] {
4263 				"X.java",
4264 				"public class X<T extends AX> {\n" +
4265 				"    T t;\n" +
4266 				"    X(T t) {\n" +
4267 				"        this.t = t;\n" +
4268 				"    }\n" +
4269 				"    T get() {\n" +
4270 				"        return this.t;\n" +
4271 				"    }\n" +
4272 				"    void bar(X<? extends BX> x) {\n" +
4273 				"        x.get().afoo();\n" +
4274 				"        x.get().bfoo();\n" +
4275 				"    }\n" +
4276 				"    public static void main(String[] args) {\n" +
4277 				"        System.out.println(\"SUCCESS\");\n" +
4278 				"	}\n" +
4279 				"}\n" +
4280 				"class AX {\n" +
4281 				"    void afoo() {}\n" +
4282 				"}\n" +
4283 				"class BX extends AX {\n" +
4284 				"    void bfoo() {}\n" +
4285 				"}\n",
4286 			},
4287 			"SUCCESS");
4288 	}
4289 	// super wildcard considers its variable for lookups
test0141()4290 	public void test0141() {
4291 		this.runNegativeTest(
4292 			new String[] {
4293 				"X.java",
4294 				"public class X<T extends AX> {\n" +
4295 				"    T t;\n" +
4296 				"    X(T t) {\n" +
4297 				"        this.t = t;\n" +
4298 				"    }\n" +
4299 				"    T get() {\n" +
4300 				"        return this.t;\n" +
4301 				"    }\n" +
4302 				"    void bar(X<? super BX> x) {\n" +
4303 				"        x.get().afoo();\n" +
4304 				"        x.get().bfoo();\n" +
4305 				"    }\n" +
4306 				"}\n" +
4307 				"class AX {\n" +
4308 				"    void afoo() {}\n" +
4309 				"}\n" +
4310 				"class BX extends AX {\n" +
4311 				"    void bfoo() {}\n" +
4312 				"}\n",
4313 			},
4314 			"----------\n" +
4315 			"1. ERROR in X.java (at line 11)\n" +
4316 			"	x.get().bfoo();\n" +
4317 			"	        ^^^^\n" +
4318 			"The method bfoo() is undefined for the type capture#2-of ? super BX\n" +
4319 			"----------\n");
4320 	}
test0142()4321 	public void test0142() {
4322 		this.runNegativeTest(
4323 			new String[] {
4324 				"X.java",
4325 				"public class X<T extends AX> {\n" +
4326 				"    T t;\n" +
4327 				"    X(T t) {\n" +
4328 				"        this.t = t;\n" +
4329 				"    }\n" +
4330 				"    T get() {\n" +
4331 				"        return this.t;\n" +
4332 				"    }\n" +
4333 				"    void bar(X<? extends X> x) {\n" +
4334 				"        x = identity(x);\n" +
4335 				"    }\n" +
4336 				"    <P extends AX> X<P> identity(X<P> x) {\n" +
4337 				"        return x;\n" +
4338 				"    }\n" +
4339 				"    public static void main(String[] args) {\n" +
4340 				"    }\n" +
4341 				"}\n" +
4342 				"class AX {\n" +
4343 				"    void afoo() {}\n" +
4344 				"}\n" +
4345 				"class BX extends AX {\n" +
4346 				"    void bfoo() {}\n" +
4347 				"}\n",
4348 			},
4349 			this.complianceLevel < ClassFileConstants.JDK1_8 ?
4350 			"----------\n" +
4351 			"1. ERROR in X.java (at line 9)\n" +
4352 			"	void bar(X<? extends X> x) {\n" +
4353 			"	           ^^^^^^^^^^^\n" +
4354 			"Bound mismatch: The type ? extends X is not a valid substitute for the bounded parameter <T extends AX> of the type X<T>\n" +
4355 			"----------\n" +
4356 			"2. WARNING in X.java (at line 9)\n" +
4357 			"	void bar(X<? extends X> x) {\n" +
4358 			"	                     ^\n" +
4359 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
4360 			"----------\n" +
4361 			"3. ERROR in X.java (at line 10)\n" +
4362 			"	x = identity(x);\n" +
4363 			"	    ^^^^^^^^\n" +
4364 			"Bound mismatch: The generic method identity(X<P>) of type X<T> is not applicable for the arguments (X<capture#2-of ? extends X>). The inferred type capture#2-of ? extends X is not a valid substitute for the bounded parameter <P extends AX>\n" +
4365 			"----------\n" :
4366 				"----------\n" +
4367 				"1. ERROR in X.java (at line 9)\n" +
4368 				"	void bar(X<? extends X> x) {\n" +
4369 				"	           ^^^^^^^^^^^\n" +
4370 				"Bound mismatch: The type ? extends X is not a valid substitute for the bounded parameter <T extends AX> of the type X<T>\n" +
4371 				"----------\n" +
4372 				"2. WARNING in X.java (at line 9)\n" +
4373 				"	void bar(X<? extends X> x) {\n" +
4374 				"	                     ^\n" +
4375 				"X is a raw type. References to generic type X<T> should be parameterized\n" +
4376 				"----------\n" +
4377 				"3. ERROR in X.java (at line 10)\n" +
4378 				"	x = identity(x);\n" +
4379 				"	    ^^^^^^^^\n" +
4380 				"The method identity(X<P>) in the type X<T> is not applicable for the arguments (X<capture#2-of ? extends X>)\n" +
4381 				"----------\n");
4382 	}
test0143()4383 	public void test0143() {
4384 		this.runNegativeTest(
4385 			new String[] {
4386 				"X.java",
4387 				"public class X {\n" +
4388 				"    public static void main(String[] args) {\n" +
4389 				"        Class<? extends X> xx = null;\n" +
4390 				"        Class<? extends Object> xo = xx;\n" +
4391 				"        Class<Object> xo2 = xx;\n" +
4392 				"    }\n" +
4393 				"}\n",
4394 			},
4395 			"----------\n" +
4396 			"1. ERROR in X.java (at line 5)\n" +
4397 			"	Class<Object> xo2 = xx;\n" +
4398 			"	                    ^^\n" +
4399 			"Type mismatch: cannot convert from Class<capture#2-of ? extends X> to Class<Object>\n" +
4400 			"----------\n");
4401 	}
test0144()4402 	public void test0144() {
4403 		this.runConformTest(
4404 			new String[] {
4405 				"X.java",
4406 				"public class X {\n" +
4407 				"    public static void main(String[] args) {\n" +
4408 				"        Class<? extends X> xx = null;\n" +
4409 				"        Class<? extends Object> xo = xx;\n" +
4410 				"        X x = get(xx);\n" +
4411 				"        System.out.println(\"SUCCESS\");\n" +
4412 				"    }\n" +
4413 				"    static <P> P get(Class<P> cp) {\n" +
4414 				"        return null;\n" +
4415 				"    }\n" +
4416 				"}\n",
4417 			},
4418 			"SUCCESS");
4419 	}
4420 	// 59641: check assign/invoke with wildcards
test0145()4421 	public void test0145() {
4422 		this.runNegativeTest(
4423 			new String[] {
4424 				"X.java",
4425 				"public class X {\n" +
4426 				"	public static void main(String[] args) {\n" +
4427 				"		XList<?> lx = new XList<X>();\n" +
4428 				"		X x = lx.get();\n" +
4429 				"		lx.add(null);\n" +
4430 				"		lx.add(x);\n" +
4431 				"		lx.slot = x;\n" +
4432 				"		lx.addAll(lx);\n" +
4433 				"    }    	\n" +
4434 				"}\n" +
4435 				"class XList<E extends X> {\n" +
4436 				"    E slot;\n" +
4437 				"    void add(E e) {}\n" +
4438 				"    E get() { return null; \n" +
4439 				"    }\n" +
4440 				"    void addAll(XList<E> le) {}\n" +
4441 				"}\n",
4442 			},
4443 			"----------\n" +
4444 			"1. ERROR in X.java (at line 6)\n" +
4445 			"	lx.add(x);\n" +
4446 			"	   ^^^\n" +
4447 			"The method add(capture#3-of ?) in the type XList<capture#3-of ?> is not applicable for the arguments (X)\n" +
4448 			"----------\n" +
4449 			"2. ERROR in X.java (at line 7)\n" +
4450 			"	lx.slot = x;\n" +
4451 			"	          ^\n" +
4452 			"Type mismatch: cannot convert from X to capture#4-of ?\n" +
4453 			"----------\n" +
4454 			"3. ERROR in X.java (at line 8)\n" +
4455 			"	lx.addAll(lx);\n" +
4456 			"	   ^^^^^^\n" +
4457 			"The method addAll(XList<capture#5-of ?>) in the type XList<capture#5-of ?> is not applicable for the arguments (XList<capture#6-of ?>)\n" +
4458 			"----------\n");
4459 	}
4460 	// 59628
test0146()4461 	public void test0146() {
4462 		this.runConformTest(
4463 			new String[] {
4464 				"X.java",
4465 				"import java.util.AbstractList;\n" +
4466 				"public class X extends AbstractList {\n" +
4467 				"    public static void main(String[] args) {\n" +
4468 				"        System.out.println(\"SUCCESS\");\n" +
4469 				"    }\n" +
4470 				"    public int size() { return 0; }\n" +
4471 				"    public Object get(int index) { return null; }\n" +
4472 				"}\n"
4473 			},
4474 			"SUCCESS");
4475 	}
4476 	// 59723
test0147()4477 	public void test0147() {
4478 		this.runConformTest(
4479 			new String[] {
4480 				"X.java",
4481 				"import java.util.ArrayList;\n" +
4482 				"\n" +
4483 				"public class X {\n" +
4484 				"	public static void main(String[] args) {\n" +
4485 				"	    char[][] tokens = new char[0][];\n" +
4486 				"	    ArrayList list = new ArrayList();\n" +
4487 				"		list.toArray(tokens);\n" +
4488 				"      System.out.println(\"SUCCESS\");\n" +
4489 				"    }    	\n" +
4490 				"}\n"
4491 			},
4492 			"SUCCESS");
4493 	}
4494 	// bridge method
test0148()4495 	public void test0148() {
4496 		this.runConformTest(
4497 			new String[] {
4498 				"X.java",
4499 				"public class X extends AX<String>{\n" +
4500 				"    \n" +
4501 				"    String foo(String s) {\n" +
4502 				"        System.out.println(s);\n" +
4503 				"        return s;\n" +
4504 				"    }\n" +
4505 				"	public static void main(String[] args) {\n" +
4506 				"	   new X().bar(\"SUCCESS\");\n" +
4507 				"    }    	\n" +
4508 				"}\n" +
4509 				"class AX<T> {\n" +
4510 				"    T foo(T t) {\n" +
4511 				"        return null;\n" +
4512 				"    }\n" +
4513 				"    void bar(T t) {\n" +
4514 				"        foo(t);\n" +
4515 				"    }\n" +
4516 				"}\n"
4517 			},
4518 			"SUCCESS");
4519 	}
4520 	// method compatibility
test0149()4521 	public void test0149() {
4522 		this.runConformTest(
4523 			new String[] {
4524 				"X.java",
4525 				"public abstract class X implements java.util.Collection {\n" +
4526 				"	public Object[] toArray(Object[] a) {\n" +
4527 				"		return a;\n" +
4528 				"	}\n" +
4529 				"	public static void main(String[] args) {\n" +
4530 				"	   System.out.println(\"SUCCESS\");\n" +
4531 				"    }\n" +
4532 				"}\n"
4533 			},
4534 			"SUCCESS");
4535 		this.runNegativeTest(
4536 			new String[] {
4537 				"X.java",
4538 				"public abstract class X implements java.util.Collection<Object> {\n" +
4539 				"	public Object[] toArray(Object[] a) {\n" +
4540 				"		return a;\n" +
4541 				"	}\n" +
4542 				"}\n"
4543 			},
4544 			"----------\n" +
4545 			"1. WARNING in X.java (at line 2)\n" +
4546 			"	public Object[] toArray(Object[] a) {\n" +
4547 			"	       ^^^^^^^^\n" +
4548 			"Type safety: The return type Object[] for toArray(Object[]) from the type X needs unchecked conversion to conform to T[] from the type Collection<E>\n" +
4549 			"----------\n");
4550 	}
test0150()4551 	public void test0150() {
4552 		this.runNegativeTest(
4553 			new String[] {
4554 				"X.java",
4555 				"import java.util.*;\n" +
4556 				"public class X {\n" +
4557 				"    \n" +
4558 				"    <T extends X> void foo(T[] ta, List<T> lt) {\n" +
4559 				"    }\n" +
4560 				"    \n" +
4561 				"    public static void main(String[] args) {\n" +
4562 				"		new X().foo(args, new ArrayList<String>());\n" +
4563 				"	}\n" +
4564 				"}\n"
4565 			},
4566 			this.complianceLevel < ClassFileConstants.JDK1_8 ?
4567 			"----------\n" +
4568 			"1. ERROR in X.java (at line 8)\n" +
4569 			"	new X().foo(args, new ArrayList<String>());\n" +
4570 			"	        ^^^\n" +
4571 			"Bound mismatch: The generic method foo(T[], List<T>) of type X is not applicable for the arguments (String[], ArrayList<String>). The inferred type String is not a valid substitute for the bounded parameter <T extends X>\n" +
4572 			"----------\n" :
4573 				"----------\n" +
4574 				"1. ERROR in X.java (at line 8)\n" +
4575 				"	new X().foo(args, new ArrayList<String>());\n" +
4576 				"	        ^^^\n" +
4577 				"The method foo(T[], List<T>) in the type X is not applicable for the arguments (String[], ArrayList<String>)\n" +
4578 				"----------\n");
4579 	}
test0151()4580 	public void test0151() {
4581 		this.runNegativeTest(
4582 			new String[] {
4583 				"X.java",
4584 				"import java.util.*;\n" +
4585 				"public class X <E>{\n" +
4586 				"    \n" +
4587 				"    <T extends X> X(T[] ta, List<T> lt) {\n" +
4588 				"    }\n" +
4589 				"    \n" +
4590 				"    public static void main(String[] args) {\n" +
4591 				"		new X<Object>(args, new ArrayList<String>());\n" +
4592 				"	}\n" +
4593 				"}\n"
4594 			},
4595 			this.complianceLevel < ClassFileConstants.JDK1_8 ?
4596 			"----------\n" +
4597 			"1. WARNING in X.java (at line 4)\n" +
4598 			"	<T extends X> X(T[] ta, List<T> lt) {\n" +
4599 			"	           ^\n" +
4600 			"X is a raw type. References to generic type X<E> should be parameterized\n" +
4601 			"----------\n" +
4602 			"2. ERROR in X.java (at line 8)\n" +
4603 			"	new X<Object>(args, new ArrayList<String>());\n" +
4604 			"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
4605 			"Bound mismatch: The generic constructor X(T[], List<T>) of type X<E> is not applicable for the arguments (String[], ArrayList<String>). The inferred type String is not a valid substitute for the bounded parameter <T extends X>\n" +
4606 			"----------\n" :
4607 				"----------\n" +
4608 				"1. WARNING in X.java (at line 4)\n" +
4609 				"	<T extends X> X(T[] ta, List<T> lt) {\n" +
4610 				"	           ^\n" +
4611 				"X is a raw type. References to generic type X<E> should be parameterized\n" +
4612 				"----------\n" +
4613 				"2. ERROR in X.java (at line 8)\n" +
4614 				"	new X<Object>(args, new ArrayList<String>());\n" +
4615 				"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
4616 				"The constructor X<Object>(String[], ArrayList<String>) is undefined\n" +
4617 				"----------\n");
4618 	}
4619 	// 60556
test0152()4620 	public void test0152() {
4621 		this.runConformTest(
4622 			new String[] {
4623 				"X.java",
4624 				"import java.util.*;\n" +
4625 				"public class X {\n" +
4626 				"    \n" +
4627 				"    public static void main(String[] args) {\n" +
4628 				"        System.out.println(\"SUCCESS\");\n" +
4629 				"	}\n" +
4630 				"    List<X> x(List<X> list) {\n" +
4631 				"        return Collections.unmodifiableList(list);\n" +
4632 				"    }\n" +
4633 				"}\n"
4634 			},
4635 			"SUCCESS");
4636 	}
test0153()4637 	public void test0153() {
4638 		this.runConformTest(
4639 			new String[] {
4640 				"X.java",
4641 				"public class X {\n" +
4642 				"    \n" +
4643 				"    public static void main(String[] args) {\n" +
4644 				"        AX<X> ax = new AX<X>();\n" +
4645 				"        AX<X> a = bar(ax);\n" +
4646 				"        System.out.println(\"SUCCESS\");\n" +
4647 				"	}\n" +
4648 				"    public static <T> AX<T> bar(AX<? extends T> a) {\n" +
4649 				"		return null;\n" +
4650 				"    }    \n" +
4651 				"}\n" +
4652 				"class AX<E> {\n" +
4653 				"}\n"
4654 			},
4655 			"SUCCESS");
4656 	}
test0154()4657 	public void test0154() {
4658 		this.runConformTest(
4659 			new String[] {
4660 				"X.java",
4661 				"public class X {\n" +
4662 				"    \n" +
4663 				"    public static void main(String[] args) {\n" +
4664 				"        AX<X> ax = new AX<X>();\n" +
4665 				"        AX<X> a = bar(ax);\n" +
4666 				"        System.out.println(\"SUCCESS\");\n" +
4667 				"	}\n" +
4668 				"    public static <T> AX<T> bar(AX<? super T> a) {\n" +
4669 				"		return null;\n" +
4670 				"    }    \n" +
4671 				"}\n" +
4672 				"class AX<E> {\n" +
4673 				"}\n"
4674 			},
4675 			"SUCCESS");
4676 	}
test0155()4677 	public void test0155() {
4678 		this.runConformTest(
4679 			new String[] {
4680 				"X.java",
4681 				"public class X {\n" +
4682 				"    \n" +
4683 				"    public static void main(String[] args) {\n" +
4684 				"        AX<X> ax = new AX<X>();\n" +
4685 				"        AX<X> a = bar(ax);\n" +
4686 				"        System.out.println(\"SUCCESS\");\n" +
4687 				"	}\n" +
4688 				"    public static <T> AX<T> bar(AX<?> a) {\n" +
4689 				"		return null;\n" +
4690 				"    }    \n" +
4691 				"}\n" +
4692 				"class AX<E> {\n" +
4693 				"}\n"
4694 			},
4695 			"SUCCESS");
4696 	}
test0156()4697 	public void test0156() {
4698 		this.runNegativeTest(
4699 			new String[] {
4700 				"X.java",
4701 				"public class X {\n" +
4702 				"    \n" +
4703 				"    public static void main(String[] args) {\n" +
4704 				"        AX<X> ax = new AX<X>();\n" +
4705 				"        AX<X> a = bar(ax);\n" +
4706 				"	}\n" +
4707 				"    public static <T> AX<T> bar(AX<?> a) {\n" +
4708 				"		return null;\n" +
4709 				"    }    \n" +
4710 				"}\n" +
4711 				"class AX<E extends X> {\n" +
4712 				"}\n"
4713 			},
4714 			"----------\n" +
4715 			"1. ERROR in X.java (at line 7)\n" +
4716 			"	public static <T> AX<T> bar(AX<?> a) {\n" +
4717 			"	                     ^\n" +
4718 			"Bound mismatch: The type T is not a valid substitute for the bounded parameter <E extends X> of the type AX<E>\n" +
4719 			"----------\n");
4720 	}
test0157()4721 	public void test0157() {
4722 		this.runNegativeTest(
4723 			new String[] {
4724 				"X.java",
4725 				"public class X {\n" +
4726 				"    \n" +
4727 				"    public static void main(String[] args) {\n" +
4728 				"        AX<X> ax = new AX<X>();\n" +
4729 				"        AX<String> as = new AX<String>();\n" +
4730 				"        AX<X> a = bar(ax, as);\n" +
4731 				"        System.out.println(\"SUCCESS\");\n" +
4732 				"	}\n" +
4733 				"    public static <T,U> AX<T> bar(AX<? extends U> a, AX<? super U> b) {\n" +
4734 				"		return null;\n" +
4735 				"    }    \n" +
4736 				"}\n" +
4737 				"class AX<E> {\n" +
4738 				"}\n"
4739 			},
4740 			"----------\n" +
4741 			"1. ERROR in X.java (at line 6)\n" +
4742 			"	AX<X> a = bar(ax, as);\n" +
4743 			"	          ^^^\n" +
4744 			"The method bar(AX<? extends U>, AX<? super U>) in the type X is not applicable for the arguments (AX<X>, AX<String>)\n" +
4745 			"----------\n");
4746 	}
test0158()4747 	public void test0158() {
4748 		this.runConformTest(
4749 			new String[] {
4750 				"X.java",
4751 				"public class X {\n" +
4752 				"    \n" +
4753 				"    public static void main(String[] args) {\n" +
4754 				"        AX<X> ax = new AX<X>();\n" +
4755 				"        AX<String> as = new AX<String>();\n" +
4756 				"        AX<X> a = bar(ax, as);\n" +
4757 				"        System.out.println(\"SUCCESS\");\n" +
4758 				"	}\n" +
4759 				"    public static <T,U> AX<T> bar(AX<?> a, AX<? super U> b) {\n" +
4760 				"		return null;\n" +
4761 				"    }    \n" +
4762 				"}\n" +
4763 				"class AX<E> {\n" +
4764 				"}\n"
4765 			},
4766 			"SUCCESS");
4767 	}
test0159()4768 	public void test0159() {
4769 		this.runNegativeTest(
4770 			new String[] {
4771 				"X.java",
4772 				"public class X {\n" +
4773 				"    \n" +
4774 				"    public static void main(String[] args) {\n" +
4775 				"        AX<X> ax = new AX<X>(new X());\n" +
4776 				"        AX<String> as = new AX<String>(\"SUCCESS\");\n" +
4777 				"        AX<X> a = bar(ax, as);\n" +
4778 				"	}\n" +
4779 				"    public static <T,U> T bar(AX<?> a, AX<? super U> b) {\n" +
4780 				"		return a.get();\n" +
4781 				"    }    \n" +
4782 				"}\n" +
4783 				"class AX<E> {\n" +
4784 				"	 E e;\n" +
4785 				"    AX(E e) { this.e = e; }\n" +
4786 				"    E get() { return this.e; }\n" +
4787 				"}\n"
4788 			},
4789 			"----------\n" +
4790 			"1. ERROR in X.java (at line 9)\n" +
4791 			"	return a.get();\n" +
4792 			"	       ^^^^^^^\n" +
4793 			"Type mismatch: cannot convert from capture#1-of ? to T\n" +
4794 			"----------\n");
4795 	}
test0160()4796 	public void test0160() {
4797 		this.runNegativeTest(
4798 			new String[] {
4799 				"X.java",
4800 				"public class X {\n" +
4801 				"    \n" +
4802 				"    public static void main(String[] args) {\n" +
4803 				"        String s = foo(new AX<String>(\"aaa\"));\n" +
4804 				"	}\n" +
4805 				"    static <V> V foo(AX<String> a) {\n" +
4806 				"        return a.get();\n" +
4807 				"    }\n" +
4808 				"}\n" +
4809 				"class AX<E> {\n" +
4810 				"    E e;\n" +
4811 				"    AX(E e) { this.e = e; }\n" +
4812 				"    E get() { return this.e; }\n" +
4813 				"}\n"
4814 			},
4815 			"----------\n" +
4816 			"1. ERROR in X.java (at line 7)\n" +
4817 			"	return a.get();\n" +
4818 			"	       ^^^^^^^\n" +
4819 			"Type mismatch: cannot convert from String to V\n" +
4820 			"----------\n");
4821 	}
test0161()4822 	public void test0161() {
4823 		this.runNegativeTest(
4824 			new String[] {
4825 				"X.java",
4826 				"public class X {\n" +
4827 				"    \n" +
4828 				"    public static void main(String[] args) {\n" +
4829 				"        boolean b = foo(new AX<String>(\"aaa\")).equals(args);\n" +
4830 				"	}\n" +
4831 				"    static <V> V foo(AX<String> a) {\n" +
4832 				"        return a.get();\n" +
4833 				"    }\n" +
4834 				"    String bar() {\n" +
4835 				"        return \"bbb\";\n" +
4836 				"    }\n" +
4837 				"}\n" +
4838 				"class AX<E> {\n" +
4839 				"    E e;\n" +
4840 				"    AX(E e) { this.e = e; }\n" +
4841 				"    E get() { return this.e; }\n" +
4842 				"}\n"
4843 			},
4844 			"----------\n" +
4845 			"1. ERROR in X.java (at line 7)\n" +
4846 			"	return a.get();\n" +
4847 			"	       ^^^^^^^\n" +
4848 			"Type mismatch: cannot convert from String to V\n" +
4849 			"----------\n");
4850 	}
test0162()4851 	public void test0162() {
4852 		this.runNegativeTest(
4853 			new String[] {
4854 				"X.java",
4855 				"public class X {\n" +
4856 				"    \n" +
4857 				"    public static void main(String[] args) {\n" +
4858 				"        String s = foo(new AX<String>(\"aaa\")).bar();\n" +
4859 				"	}\n" +
4860 				"    static <V> V foo(AX<String> a) {\n" +
4861 				"        return a.get();\n" +
4862 				"    }\n" +
4863 				"    String bar() {\n" +
4864 				"        return \"bbb\";\n" +
4865 				"    }\n" +
4866 				"}\n" +
4867 				"class AX<E> {\n" +
4868 				"    E e;\n" +
4869 				"    AX(E e) { this.e = e; }\n" +
4870 				"    E get() { return this.e; }\n" +
4871 				"}\n"
4872 			},
4873 			"----------\n" +
4874 			"1. ERROR in X.java (at line 4)\n" +
4875 			"	String s = foo(new AX<String>(\"aaa\")).bar();\n" +
4876 			"	                                      ^^^\n" +
4877 			"The method bar() is undefined for the type Object\n" +
4878 			"----------\n" +
4879 			"2. ERROR in X.java (at line 7)\n" +
4880 			"	return a.get();\n" +
4881 			"	       ^^^^^^^\n" +
4882 			"Type mismatch: cannot convert from String to V\n" +
4883 			"----------\n");
4884 	}
test0163()4885 	public void test0163() {
4886 		this.runNegativeTest(
4887 			new String[] {
4888 				"X.java",
4889 				"public class X {\n" +
4890 				"    \n" +
4891 				"    public static void main(String[] args) {\n" +
4892 				"        String s = foo(new AX<String>(\"aaa\")).bar();\n" +
4893 				"	}\n" +
4894 				"    static <V> V foo(AX<String> a) {\n" +
4895 				"        return a.get();\n" +
4896 				"    }\n" +
4897 				"    String bar() {\n" +
4898 				"        return \"bbb\";\n" +
4899 				"    }\n" +
4900 				"}\n" +
4901 				"class AX<E> {\n" +
4902 				"    E e;\n" +
4903 				"    AX(E e) { this.e = e; }\n" +
4904 				"    E get() { return this.e; }\n" +
4905 				"}\n"
4906 			},
4907 			"----------\n" +
4908 			"1. ERROR in X.java (at line 4)\n" +
4909 			"	String s = foo(new AX<String>(\"aaa\")).bar();\n" +
4910 			"	                                      ^^^\n" +
4911 			"The method bar() is undefined for the type Object\n" +
4912 			"----------\n" +
4913 			"2. ERROR in X.java (at line 7)\n" +
4914 			"	return a.get();\n" +
4915 			"	       ^^^^^^^\n" +
4916 			"Type mismatch: cannot convert from String to V\n" +
4917 			"----------\n");
4918 	}
test0164()4919 	public void test0164() {
4920 		this.runConformTest(
4921 			new String[] {
4922 				"X.java",
4923 				"import java.util.List;\n" +
4924 				"public class X {\n" +
4925 				"    public static void main(String[] args) {\n" +
4926 				"        foo(new AX<String>(\"SUCCESS\"));\n" +
4927 				"	}\n" +
4928 				"    static <V> List<V> foo(AX<String> a) {\n" +
4929 				"        System.out.println(a.get());\n" +
4930 				"        List<V> v = null;\n" +
4931 				"        if (a == null) v = foo(a); \n" +
4932 				"        return v;\n" +
4933 				"    }\n" +
4934 				"}\n" +
4935 				"class AX<E> {\n" +
4936 				"    E e;\n" +
4937 				"    AX(E e) { this.e = e; }\n" +
4938 				"    E get() { return this.e; }\n" +
4939 				"}\n"
4940 			},
4941 			"SUCCESS");
4942 	}
test0165()4943 	public void test0165() {
4944 		this.runConformTest(
4945 			new String[] {
4946 				"X.java",
4947 				"public class X {\n" +
4948 				"    \n" +
4949 				"    public static void main(String[] args) {\n" +
4950 				"        AX<X> ax = new AX<X>();\n" +
4951 				"        AX<String> a = bar(ax);\n" +
4952 				"        System.out.println(\"SUCCESS\");\n" +
4953 				"	}\n" +
4954 				"    public static <T> AX<T> bar(AX<?> a) {\n" +
4955 				"		 if (a == null) {\n" +
4956 				"        	AX<String> as = bar(a);\n" +
4957 				"        	String s = as.get();\n" +
4958 				"		}\n" +
4959 				"		return null;\n" +
4960 				"    }    \n" +
4961 				"}\n" +
4962 				"class AX<E> {\n" +
4963 				"    E get() { return null; }\n" +
4964 				"}\n"
4965 			},
4966 			"SUCCESS");
4967 	}
test0166()4968 	public void test0166() {
4969 		this.runConformTest(
4970 			new String[] {
4971 				"X.java",
4972 				"public class X {\n" +
4973 				"    \n" +
4974 				"    public static void main(String[] args) {\n" +
4975 				"        AX<X> ax = new AX<X>(new X());\n" +
4976 				"        AX<String> a = bar(ax, true);\n" +
4977 				"        String s = a.get();\n" +
4978 				"        System.out.println(s);\n" +
4979 				"	}\n" +
4980 				"    public static <T> AX<T> bar(AX<?> a, boolean recurse) {\n" +
4981 				"        if (recurse) {\n" +
4982 				"	        AX<String> as = bar(a, false);\n" +
4983 				"			String s = as.get();\n" +
4984 				"        }\n" +
4985 				"		return new AX(\"SUCCESS\");\n" +
4986 				"    }    \n" +
4987 				"}\n" +
4988 				"class AX<E> {\n" +
4989 				"    E e;\n" +
4990 				"    AX(E e) { this.e = e; }\n" +
4991 				"    E get() { return this.e; }\n" +
4992 				"}\n"
4993 			},
4994 			"SUCCESS");
4995 	}
test0167()4996 	public void test0167() {
4997 		this.runConformTest(
4998 			new String[] {
4999 				"X.java",
5000 				"public class X {\n" +
5001 				"    \n" +
5002 				"    public static void main(String[] args) {\n" +
5003 				"        AX<String, Thread> a = bar();\n" +
5004 				"        String s = a.get();\n" +
5005 				"        System.out.println(s);\n" +
5006 				"	}\n" +
5007 				"    public static <T, U> AX<T, U> bar() {\n" +
5008 				"		return new AX(\"SUCCESS\");\n" +
5009 				"    }    \n" +
5010 				"}\n" +
5011 				"class AX<E, F> {\n" +
5012 				"    E e;\n" +
5013 				"    AX(E e) { this.e = e; }\n" +
5014 				"    E get() { return this.e; }\n" +
5015 				"}\n"
5016 			},
5017 			"SUCCESS");
5018 	}
5019 	// FAIL ERRMSG (type display)
test0168()5020 	public void test0168() {
5021 		if (this.complianceLevel >= ClassFileConstants.JDK1_8)
5022 			return;
5023 		this.runNegativeTest(
5024 			new String[] {
5025 				"X.java",
5026 				"public class X {\n" +
5027 				"    \n" +
5028 				"    public static void main(String[] args) {\n" +
5029 				"        AX<String, Thread> a = bar();\n" +
5030 				"        String s = a.get();\n" +
5031 				"        System.out.println(s);\n" +
5032 				"	}\n" +
5033 				"    public static <T, U> AX<AX<T, T>, U> bar() {\n" +
5034 				"		return new AX(\"SUCCESS\");\n" +
5035 				"    }    \n" +
5036 				"}\n" +
5037 				"class AX<E, F> {\n" +
5038 				"    E e;\n" +
5039 				"    AX(E e) { this.e = e; }\n" +
5040 				"    E get() { return this.e; }\n" +
5041 				"}\n"
5042 			},
5043 			"----------\n" +
5044 			"1. ERROR in X.java (at line 4)\n" +
5045 			"	AX<String, Thread> a = bar();\n" +
5046 			"	                       ^^^^^\n" +
5047 			"Type mismatch: cannot convert from AX<AX<Object,Object>,Thread> to AX<String,Thread>\n" +
5048 			"----------\n" +
5049 			"2. WARNING in X.java (at line 9)\n" +
5050 			"	return new AX(\"SUCCESS\");\n" +
5051 			"	       ^^^^^^^^^^^^^^^^^\n" +
5052 			"Type safety: The constructor AX(Object) belongs to the raw type AX. References to generic type AX<E,F> should be parameterized\n" +
5053 			"----------\n" +
5054 			"3. WARNING in X.java (at line 9)\n" +
5055 			"	return new AX(\"SUCCESS\");\n" +
5056 			"	       ^^^^^^^^^^^^^^^^^\n" +
5057 			"Type safety: The expression of type AX needs unchecked conversion to conform to AX<AX<T,T>,U>\n" +
5058 			"----------\n" +
5059 			"4. WARNING in X.java (at line 9)\n" +
5060 			"	return new AX(\"SUCCESS\");\n" +
5061 			"	           ^^\n" +
5062 			"AX is a raw type. References to generic type AX<E,F> should be parameterized\n" +
5063 			"----------\n");
5064 	}
test0169()5065 	public void test0169() {
5066 		this.runNegativeTest(
5067 			new String[] {
5068 				"X.java",
5069 				"public class X {\n" +
5070 				"    \n" +
5071 				"    public static void main(String[] args) {\n" +
5072 				"        AX<String> a = bar(new X());\n" +
5073 				"        String s = a.get();\n" +
5074 				"        System.out.println(s);\n" +
5075 				"	}\n" +
5076 				"    public static <T> AX<T> bar(T t) {\n" +
5077 				"		return new AX(\"SUCCESS\");\n" +
5078 				"    }    \n" +
5079 				"}\n" +
5080 				"class AX<E> {\n" +
5081 				"    E e;\n" +
5082 				"    AX(E e) { this.e = e; }\n" +
5083 				"    E get() { return this.e; }\n" +
5084 				"}\n"
5085 			},
5086 			"----------\n" +
5087 			"1. ERROR in X.java (at line 4)\n" +
5088 			"	AX<String> a = bar(new X());\n" +
5089 			"	               ^^^^^^^^^^^^\n" +
5090 			"Type mismatch: cannot convert from AX<X> to AX<String>\n" +
5091 			"----------\n" +
5092 			"2. WARNING in X.java (at line 9)\n" +
5093 			"	return new AX(\"SUCCESS\");\n" +
5094 			"	       ^^^^^^^^^^^^^^^^^\n" +
5095 			"Type safety: The constructor AX(Object) belongs to the raw type AX. References to generic type AX<E> should be parameterized\n" +
5096 			"----------\n" +
5097 			"3. WARNING in X.java (at line 9)\n" +
5098 			"	return new AX(\"SUCCESS\");\n" +
5099 			"	       ^^^^^^^^^^^^^^^^^\n" +
5100 			"Type safety: The expression of type AX needs unchecked conversion to conform to AX<T>\n" +
5101 			"----------\n" +
5102 			"4. WARNING in X.java (at line 9)\n" +
5103 			"	return new AX(\"SUCCESS\");\n" +
5104 			"	           ^^\n" +
5105 			"AX is a raw type. References to generic type AX<E> should be parameterized\n" +
5106 			"----------\n");
5107 	}
5108 	// Expected type inference for cast operation
test0170()5109 	public void test0170() {
5110 		this.runNegativeTest(
5111 			new String[] {
5112 				"X.java",
5113 				"public class X {\n" +
5114 				"    \n" +
5115 				"    public static void main(String[] args) {\n" +
5116 				"        AX<X> ax = new AX<X>(new X());\n" +
5117 				"        AX<String> as = new AX<String>(\"\");\n" +
5118 				"        ax = (AX)bar(ax);\n" + // shouldn't complain about unnecessary cast
5119 				"	}\n" +
5120 				"    public static <T> T bar(AX<?> a) {\n" +
5121 				"		return a.get();\n" +
5122 				"    }    \n" +
5123 				"}\n" +
5124 				"class AX<E> {\n" +
5125 				"	 E e;\n" +
5126 				"    AX(E e) { this.e = e; }\n" +
5127 				"    E get() { return this.e; }\n" +
5128 				"}\n"
5129 			},
5130 			"----------\n" +
5131 			"1. WARNING in X.java (at line 6)\n" +
5132 			"	ax = (AX)bar(ax);\n" +
5133 			"	     ^^^^^^^^^^^\n" +
5134 			"Type safety: The expression of type AX needs unchecked conversion to conform to AX<X>\n" +
5135 			"----------\n" +
5136 			"2. WARNING in X.java (at line 6)\n" +
5137 			"	ax = (AX)bar(ax);\n" +
5138 			"	      ^^\n" +
5139 			"AX is a raw type. References to generic type AX<E> should be parameterized\n" +
5140 			"----------\n" +
5141 			"3. ERROR in X.java (at line 9)\n" +
5142 			"	return a.get();\n" +
5143 			"	       ^^^^^^^\n" +
5144 			"Type mismatch: cannot convert from capture#1-of ? to T\n" +
5145 			"----------\n");
5146 	}
5147 	// Expected type inference for cast operation
test0171()5148 	public void test0171() {
5149 		this.runNegativeTest(
5150 			new String[] {
5151 				"X.java",
5152 				"public class X {\n" +
5153 				"    \n" +
5154 				"    public static void main(String[] args) {\n" +
5155 				"        AX<X> ax = new AX<X>(new X());\n" +
5156 				"        AX<String> as = new AX<String>(\"\");\n" +
5157 				"        ax = (AX<X>)bar(ax);\n" + // shouldn't complain about unnecessary cast as return type inference do not
5158 				"	}\n" +                                         // work on cast conversion
5159 				"    public static <T> T bar(AX<?> a) {\n" +
5160 				"		return a.get();\n" +
5161 				"    }    \n" +
5162 				"}\n" +
5163 				"class AX<E> {\n" +
5164 				"	 E e;\n" +
5165 				"    AX(E e) { this.e = e; }\n" +
5166 				"    E get() { return this.e; }\n" +
5167 				"}\n"
5168 			},
5169 			"----------\n" +
5170 			"1. WARNING in X.java (at line 6)\n" +
5171 			"	ax = (AX<X>)bar(ax);\n" +
5172 			"	     ^^^^^^^^^^^^^^\n" +
5173 			"Type safety: Unchecked cast from Object to AX<X>\n" +
5174 			"----------\n" +
5175 			"2. ERROR in X.java (at line 9)\n" +
5176 			"	return a.get();\n" +
5177 			"	       ^^^^^^^\n" +
5178 			"Type mismatch: cannot convert from capture#1-of ? to T\n" +
5179 			"----------\n");
5180 	}
5181 	// Expected type inference for cast operation
test0172()5182 	public void test0172() {
5183 		this.runNegativeTest(
5184 			new String[] {
5185 				"X.java",
5186 				"public class X {\n" +
5187 				"    \n" +
5188 				"    public static void main(String[] args) {\n" +
5189 				"        AX<X> ax = new AX<X>(new X());\n" +
5190 				"        AX<String> as = new AX<String>(\"SUCCESS\");\n" +
5191 				"        ax = (AX<X>)bar(ax);\n" + // no warn for unsafe cast, since forbidden cast
5192 				"	}\n" +
5193 				"    public static <T> String bar(AX<?> a) {\n" +
5194 				"		return null;\n" +
5195 				"    }    \n" +
5196 				"}\n" +
5197 				"class AX<E> {\n" +
5198 				"	 E e;\n" +
5199 				"    AX(E e) { this.e = e; }\n" +
5200 				"    E get() { return this.e; }\n" +
5201 				"}\n"
5202 			},
5203 			"----------\n" +
5204 			"1. ERROR in X.java (at line 6)\n" +
5205 			"	ax = (AX<X>)bar(ax);\n" +
5206 			"	     ^^^^^^^^^^^^^^\n" +
5207 			"Cannot cast from String to AX<X>\n" +
5208 			"----------\n");
5209 	}
5210 	// Expected type inference for return statement
test0173()5211 	public void test0173() {
5212 		this.runConformTest(
5213 			new String[] {
5214 				"X.java",
5215 				"public class X {\n" +
5216 				"    \n" +
5217 				"    public static void main(String[] args) {\n" +
5218 				"    	foo();\n" +
5219 				"    	System.out.println(\"SUCCESS\");\n" +
5220 				"	}\n" +
5221 				"    public static <T> T bar(AX<?> a) {\n" +
5222 				"		return null;\n" +
5223 				"    }    \n" +
5224 				"    public static AX<X> foo() {\n" +
5225 				"        AX<X> ax = new AX<X>(new X());\n" +
5226 				"       return bar(ax);\n" + // use return type of enclosing method for type inference
5227 				"    }\n" +
5228 				"}\n" +
5229 				"class AX<E> {\n" +
5230 				"	 E e;\n" +
5231 				"    AX(E e) { this.e = e; }\n" +
5232 				"    E get() { return this.e; }\n" +
5233 				"}\n" +
5234 				"\n"
5235 			},
5236 			"SUCCESS");
5237 	}
5238 	// Expected type inference for field declaration
test0174()5239 	public void test0174() {
5240 		this.runConformTest(
5241 			new String[] {
5242 				"X.java",
5243 				"public class X {\n" +
5244 				"    \n" +
5245 				"    public static void main(String[] args) {\n" +
5246 				"    	Object o = foo;\n" +
5247 				"    	System.out.println(\"SUCCESS\");\n" +
5248 				"	}\n" +
5249 				"    public static <T> T bar(AX<?> a) {\n" +
5250 				"		return null;\n" +
5251 				"    }    \n" +
5252 				"    static AX<X> foo = bar(new AX<X>(new X()));\n" + // use field type for type inference
5253 				"}\n" +
5254 				"class AX<E> {\n" +
5255 				"	 E e;\n" +
5256 				"    AX(E e) { this.e = e; }\n" +
5257 				"    E get() { return this.e; }\n" +
5258 				"}\n" +
5259 				"\n"
5260 			},
5261 			"SUCCESS");
5262 	}
5263 	// 60563
test0175()5264 	public void test0175() {
5265 		this.runConformTest(
5266 			new String[] {
5267 				"X.java",
5268 				"    interface A<T> {\n" +
5269 				"        T[] m1(T x);                          \n" +
5270 				"    }\n" +
5271 				"    public class X { \n" +
5272 				"    	public static void main(String[] args) {\n" +
5273 				"			new X().m2(new A<X>(){ \n" +
5274 				"				public X[] m1(X x) { \n" +
5275 				"					System.out.println(\"SUCCESS\");\n" +
5276 				"					return null;\n" +
5277 				"				}\n" +
5278 				"			});\n" +
5279 				"		}\n" +
5280 				"        void m2(A<X> x) { \n" +
5281 				"            m3(x.m1(new X())); \n" +
5282 				"        }\n" +
5283 				"        void m3(X[] x) {\n" +
5284 				"        }                    \n" +
5285 				"    }\n"
5286 			},
5287 			"SUCCESS");
5288 	}
5289 	// unsafe raw return value
test0176()5290 	public void test0176() {
5291 		Map customOptions = getCompilerOptions();
5292 		this.runNegativeTest(
5293 			new String[] {
5294 				"X.java",
5295 				"import java.util.*;\n" +
5296 				"\n" +
5297 				"public class X {\n" +
5298 				"    <T> Vector<T> valuesOf(Hashtable<?, T> h) {\n" +
5299 				"        return new Vector();\n" +
5300 				"    }\n" +
5301 				"    Vector<Object> data;\n" +
5302 				"    \n" +
5303 				"    public void t() {\n" +
5304 				"        Vector<Object> v = (Vector<Object>) data.elementAt(0);\n" +
5305 				"    }\n" +
5306 				"}\n",
5307 			},
5308 			"----------\n" +
5309 			"1. WARNING in X.java (at line 5)\n" +
5310 			"	return new Vector();\n" +
5311 			"	       ^^^^^^^^^^^^\n" +
5312 			"Type safety: The expression of type Vector needs unchecked conversion to conform to Vector<T>\n" +
5313 			"----------\n" +
5314 			"2. WARNING in X.java (at line 5)\n" +
5315 			"	return new Vector();\n" +
5316 			"	           ^^^^^^\n" +
5317 			"Vector is a raw type. References to generic type Vector<E> should be parameterized\n" +
5318 			"----------\n" +
5319 			"3. WARNING in X.java (at line 10)\n" +
5320 			"	Vector<Object> v = (Vector<Object>) data.elementAt(0);\n" +
5321 			"	                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
5322 			"Type safety: Unchecked cast from Object to Vector<Object>\n" +
5323 			"----------\n",
5324 			null,
5325 			true,
5326 			customOptions);
5327 	}
5328 	// cast to type variable allowed, can be diagnosed as unnecessary
test0177()5329 	public void test0177() {
5330 		Map options = getCompilerOptions();
5331 		runConformTest(
5332 	 		// test directory preparation
5333 			true /* flush output directory */,
5334 			new String[] { /* test files */
5335 				"X.java",
5336 				"public class X <T> {\n" +
5337 				"	\n" +
5338 				"	T foo(T t) {\n" +
5339 				"		return (T) t;\n" +
5340 				"	}\n" +
5341 				"}\n",
5342 			},
5343 			// compiler options
5344 			null /* no class libraries */,
5345 			options /* custom options - happen to be the default not changed by the test suite */,
5346 			// compiler results
5347 			"----------\n" + /* expected compiler log */
5348 			"1. WARNING in X.java (at line 4)\n" +
5349 			"	return (T) t;\n" +
5350 			"	       ^^^^^\n" +
5351 			"Unnecessary cast from T to T\n" +
5352 			"----------\n",
5353 			// runtime results
5354 			null /* do not check output string */,
5355 			null /* do not check error string */,
5356 			// javac options
5357 			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings /* javac test options */);
5358 	}
5359 	// reject instanceof type variable or parameterized type
test0178()5360 	public void test0178() {
5361 		Map customOptions = getCompilerOptions();
5362 		this.runNegativeTest(
5363 			new String[] {
5364 				"X.java",
5365 				"public class X <T> {\n" +
5366 				"	\n" +
5367 				"	T foo(T t) {\n" +
5368 				"		if (t instanceof X<T>) {\n" +
5369 				"			return t;\n" +
5370 				"		} else if (t instanceof X<String>) {\n" +
5371 				"			return t;\n" +
5372 				"		} else if (t instanceof X<?>) {\n" +  // ok
5373 				"			return t;\n" +
5374 				"		} else 	if (t instanceof T) {\n" +
5375 				"			return t;\n" +
5376 				"		} else if (t instanceof X) {\n" +
5377 				"			return t;\n" +
5378 				"		}\n" +
5379 				"		return null;\n" +
5380 				"	}\n" +
5381 				"}\n",
5382 			},
5383 			"----------\n" +
5384 			"1. ERROR in X.java (at line 4)\n" +
5385 			"	if (t instanceof X<T>) {\n" +
5386 			"	    ^^^^^^^^^^^^^^\n" +
5387 			"Cannot perform instanceof check against parameterized type X<T>. Use the form X<?> instead since further generic type information will be erased at runtime\n" +
5388 			"----------\n" +
5389 			"2. ERROR in X.java (at line 6)\n" +
5390 			"	} else if (t instanceof X<String>) {\n" +
5391 			"	           ^^^^^^^^^^^^^^\n" +
5392 			"Cannot perform instanceof check against parameterized type X<String>. Use the form X<?> instead since further generic type information will be erased at runtime\n" +
5393 			"----------\n" +
5394 			"3. ERROR in X.java (at line 10)\n" +
5395 			"	} else 	if (t instanceof T) {\n" +
5396 			"	       	    ^^^^^^^^^^^^^^\n" +
5397 			"Cannot perform instanceof check against type parameter T. Use its erasure Object instead since further generic type information will be erased at runtime\n" +
5398 			"----------\n",
5399 			null,
5400 			true,
5401 			customOptions);
5402 	}
test0178a()5403 	public void test0178a() {
5404 		if (this.complianceLevel < ClassFileConstants.JDK14)
5405 			return;
5406 		Map customOptions = getCompilerOptions();
5407 		customOptions.put(CompilerOptions.OPTION_EnablePreviews, CompilerOptions.ENABLED);
5408 		customOptions.put(CompilerOptions.OPTION_ReportPreviewFeatures, CompilerOptions.WARNING);
5409 		this.runNegativeTest(
5410 			new String[] {
5411 				"X.java",
5412 				"public class X <T> {\n" +
5413 				"	\n" +
5414 				"	T foo(T t) {\n" +
5415 				"		boolean b = false;\n" +
5416 				"		if (t instanceof X<T>) {\n" +
5417 				"			return t;\n" +
5418 				"		} else if (t instanceof X<String>) {\n" +
5419 				"			return t;\n" +
5420 				"		} else if (t instanceof X<?>) {\n" +  // ok
5421 				"			return t;\n" +
5422 				"		} else 	if (t instanceof T) {\n" +
5423 				"			return t;\n" +
5424 				"		} else if (t instanceof X) { // this is allowed since Java 14 as preview feature\n" +
5425 				"			return t;\n" +
5426 				"		}\n" +
5427 				"		return null;\n" +
5428 				"	}\n" +
5429 				"}\n",
5430 			},
5431 			"----------\n" +
5432 			"1. ERROR in X.java (at line 5)\n" +
5433 			"	if (t instanceof X<T>) {\n" +
5434 			"	    ^\n" +
5435 			"Type T cannot be safely cast to X<T>\n" +
5436 			"----------\n" +
5437 			"2. WARNING in X.java (at line 5)\n" +
5438 			"	if (t instanceof X<T>) {\n" +
5439 			"	                 ^\n" +
5440 			"You are using a preview language feature that may or may not be supported in a future release\n" +
5441 			"----------\n" +
5442 			"3. ERROR in X.java (at line 7)\n" +
5443 			"	} else if (t instanceof X<String>) {\n" +
5444 			"	           ^\n" +
5445 			"Type T cannot be safely cast to X<String>\n" +
5446 			"----------\n" +
5447 			"4. WARNING in X.java (at line 7)\n" +
5448 			"	} else if (t instanceof X<String>) {\n" +
5449 			"	                        ^\n" +
5450 			"You are using a preview language feature that may or may not be supported in a future release\n" +
5451 			"----------\n" +
5452 			"5. WARNING in X.java (at line 11)\n" +
5453 			"	} else 	if (t instanceof T) {\n" +
5454 			"	       	    ^^^^^^^^^^^^^^\n" +
5455 			"The expression of type T is already an instance of type T\n" +
5456 			"----------\n" +
5457 			"6. WARNING in X.java (at line 11)\n" +
5458 			"	} else 	if (t instanceof T) {\n" +
5459 			"	       	                 ^\n" +
5460 			"You are using a preview language feature that may or may not be supported in a future release\n" +
5461 			"----------\n",
5462 			null,
5463 			true,
5464 			customOptions);
5465 	}
5466 	// 61507
test0179()5467 	public void test0179() {
5468 		this.runConformTest(
5469 			new String[] {
5470 				"X.java",
5471 				"class U {\n" +
5472 				" static <T> T notNull(T t) { return t; }\n" +
5473 				"}\n" +
5474 				"public class X {\n" +
5475 				" void t() {\n" +
5476 				"  String s = U.notNull(null);\n" +
5477 				" }\n" +
5478 				" public static void main(String[] args) {\n" +
5479 				"	new X().t();\n" +
5480 				"	System.out.println(\"SUCCESS\");\n" +
5481 				"}\n" +
5482 				"}\n",
5483 			},
5484 			"SUCCESS");
5485 	}
test0180()5486 	public void test0180() {
5487 		this.runConformTest(
5488 			new String[] {
5489 				"X.java",
5490 				"class U {\n" +
5491 				" static <T> T notNull(T t) { return t; }\n" +
5492 				"}\n" +
5493 				"public class X {\n" +
5494 				" void t() {\n" +
5495 				"  String s = U.notNull(\"\");\n" +
5496 				" }\n" +
5497 				" public static void main(String[] args) {\n" +
5498 				"	new X().t();\n" +
5499 				"	System.out.println(\"SUCCESS\");\n" +
5500 				"}\n" +
5501 				"}\n",
5502 			},
5503 			"SUCCESS");
5504 	}
5505 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=61507 - variation computing most specific type with 'null'
test0181()5506 	public void test0181() {
5507 		this.runConformTest(
5508 			new String[] {
5509 				"X.java",
5510 				"class U {\n" +
5511 				" static <T> T notNull(T t, V<T> vt) { return t; }\n" +
5512 				"}\n" +
5513 				"class V<T> {}\n" +
5514 				"\n" +
5515 				"public class X {\n" +
5516 				" void t() {\n" +
5517 				"  String s = U.notNull(null, new V<String>());\n" +
5518 				" }\n" +
5519 				" public static void main(String[] args) {\n" +
5520 				"	new X().t();\n" +
5521 				"	System.out.println(\"SUCCESS\");\n" +
5522 				"}\n" +
5523 				"}\n",
5524 			},
5525 			"SUCCESS");
5526 	}
test0182()5527 	public void test0182() {
5528 		this.runNegativeTest(
5529 			new String[] {
5530 				"X.java",
5531 				"public class X<E> {\n" +
5532 				"    X<E> foo() {\n" +
5533 				"    	return (X<E>) this;\n" +
5534 				"    }\n" +
5535 				"    X<String> bar() {\n" +
5536 				"    	return (AX<String>) new X<String>();\n" +
5537 				"    }\n" +
5538 				"    X<String> bar(Object o) {\n" +
5539 				"    	return (AX<String>) o;\n" +
5540 				"    }\n" +
5541 				"    X<E> foo(Object o) {\n" +
5542 				"    	return (AX<E>) o;\n" +
5543 				"    }    \n" +
5544 				"    X<E> baz(Object o) {\n" +
5545 				"    	return (AX<E>) null;\n" +
5546 				"    }\n" +
5547 				"    X<String> baz2(BX bx) {\n" +
5548 				"    	return (X<String>) bx;\n" +
5549 				"    }    \n" +
5550 				"}\n" +
5551 				"class AX<F> extends X<F> {}\n" +
5552 				"class BX extends AX<String> {}\n",
5553 			},
5554 			"----------\n" +
5555 			"1. WARNING in X.java (at line 3)\n" +
5556 			"	return (X<E>) this;\n" +
5557 			"	       ^^^^^^^^^^^\n" +
5558 			"Unnecessary cast from X<E> to X<E>\n" +
5559 			"----------\n" +
5560 			"2. WARNING in X.java (at line 6)\n" +
5561 			"	return (AX<String>) new X<String>();\n" +
5562 			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
5563 			"Unnecessary cast from X<String> to AX<String>\n" +
5564 			"----------\n" +
5565 			"3. WARNING in X.java (at line 9)\n" +
5566 			"	return (AX<String>) o;\n" +
5567 			"	       ^^^^^^^^^^^^^^\n" +
5568 			"Type safety: Unchecked cast from Object to AX<String>\n" +
5569 			"----------\n" +
5570 			"4. WARNING in X.java (at line 12)\n" +
5571 			"	return (AX<E>) o;\n" +
5572 			"	       ^^^^^^^^^\n" +
5573 			"Type safety: Unchecked cast from Object to AX<E>\n" +
5574 			"----------\n" +
5575 			"5. WARNING in X.java (at line 15)\n" +
5576 			"	return (AX<E>) null;\n" +
5577 			"	       ^^^^^^^^^^^^\n" +
5578 			"Unnecessary cast from null to AX<E>\n" +
5579 			"----------\n" +
5580 			"6. WARNING in X.java (at line 18)\n" +
5581 			"	return (X<String>) bx;\n" +
5582 			"	       ^^^^^^^^^^^^^^\n" +
5583 			"Unnecessary cast from BX to X<String>\n" +
5584 			"----------\n");
5585 	}
test0183()5586 	public void test0183() {
5587 		this.runNegativeTest(
5588 			new String[] {
5589 				"X.java",
5590 				"import java.util.*;\n" +
5591 				"\n" +
5592 				"public class X {\n" +
5593 				"	\n" +
5594 				"	{\n" +
5595 				"		Dictionary<String, Integer> d;\n" +
5596 				"		Object o;\n" +
5597 				"		\n" +
5598 				"		Object a1 = (Hashtable<String,Integer>) d;\n" +
5599 				"		Object a2 = (Hashtable) o;\n" +
5600 				"\n" +
5601 				"		Object a3 = (Hashtable<Float, Double>) d;\n" +
5602 				"		Object a4 = (Hashtable<String,Integer>) o;\n" +
5603 				"		\n" +
5604 				"		abstract class Z1 extends Hashtable<String,Integer> {\n" +
5605 				"			private static final long serialVersionUID = 1L;\n" +
5606 				"		}\n" +
5607 				"		Z1 z1;\n" +
5608 				"		Object a5 = (Hashtable<String,Integer>) z1;\n" +
5609 				"\n" +
5610 				"		abstract class Z2 extends Z1 {\n" +
5611 				"			private static final long serialVersionUID = 1L;\n" +
5612 				"		}\n" +
5613 				"		Object a6 = (Z2) z1;\n" +
5614 				"\n" +
5615 				"		abstract class Z3 extends Hashtable {\n" +
5616 				"			private static final long serialVersionUID = 1L;\n" +
5617 				"		}\n" +
5618 				"		Z3 z3;\n" +
5619 				"		Object a7 = (Hashtable<String,Integer>) z3;\n" +
5620 				"	}\n" +
5621 				"}\n",
5622 			},
5623 			"----------\n" +
5624 			"1. WARNING in X.java (at line 9)\n" +
5625 			"	Object a1 = (Hashtable<String,Integer>) d;\n" +
5626 			"	            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
5627 			"Unnecessary cast from Dictionary<String,Integer> to Hashtable<String,Integer>\n" +
5628 			"----------\n" +
5629 			"2. WARNING in X.java (at line 10)\n" +
5630 			"	Object a2 = (Hashtable) o;\n" +
5631 			"	            ^^^^^^^^^^^^^\n" +
5632 			"Unnecessary cast from Object to Hashtable\n" +
5633 			"----------\n" +
5634 			"3. WARNING in X.java (at line 10)\n" +
5635 			"	Object a2 = (Hashtable) o;\n" +
5636 			"	             ^^^^^^^^^\n" +
5637 			"Hashtable is a raw type. References to generic type Hashtable<K,V> should be parameterized\n" +
5638 			"----------\n" +
5639 			"4. ERROR in X.java (at line 12)\n" +
5640 			"	Object a3 = (Hashtable<Float, Double>) d;\n" +
5641 			"	            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
5642 			"Cannot cast from Dictionary<String,Integer> to Hashtable<Float,Double>\n" +
5643 			"----------\n" +
5644 			"5. WARNING in X.java (at line 12)\n" +
5645 			"	Object a3 = (Hashtable<Float, Double>) d;\n" +
5646 			"	            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
5647 			"Unnecessary cast from Dictionary<String,Integer> to Hashtable<Float,Double>\n" +
5648 			"----------\n" +
5649 			"6. WARNING in X.java (at line 13)\n" +
5650 			"	Object a4 = (Hashtable<String,Integer>) o;\n" +
5651 			"	            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
5652 			"Type safety: Unchecked cast from Object to Hashtable<String,Integer>\n" +
5653 			"----------\n" +
5654 			"7. WARNING in X.java (at line 13)\n" +
5655 			"	Object a4 = (Hashtable<String,Integer>) o;\n" +
5656 			"	            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
5657 			"Unnecessary cast from Object to Hashtable<String,Integer>\n" +
5658 			"----------\n" +
5659 			"8. WARNING in X.java (at line 19)\n" +
5660 			"	Object a5 = (Hashtable<String,Integer>) z1;\n" +
5661 			"	            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
5662 			"Unnecessary cast from Z1 to Hashtable<String,Integer>\n" +
5663 			"----------\n" +
5664 			"9. WARNING in X.java (at line 24)\n" +
5665 			"	Object a6 = (Z2) z1;\n" +
5666 			"	            ^^^^^^^\n" +
5667 			"Unnecessary cast from Z1 to Z2\n" +
5668 			"----------\n" +
5669 			"10. WARNING in X.java (at line 26)\n" +
5670 			"	abstract class Z3 extends Hashtable {\n" +
5671 			"	                          ^^^^^^^^^\n" +
5672 			"Hashtable is a raw type. References to generic type Hashtable<K,V> should be parameterized\n" +
5673 			"----------\n" +
5674 			"11. WARNING in X.java (at line 30)\n" +
5675 			"	Object a7 = (Hashtable<String,Integer>) z3;\n" +
5676 			"	            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
5677 			"Type safety: Unchecked cast from Z3 to Hashtable<String,Integer>\n" +
5678 			"----------\n" +
5679 			"12. WARNING in X.java (at line 30)\n" +
5680 			"	Object a7 = (Hashtable<String,Integer>) z3;\n" +
5681 			"	            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
5682 			"Unnecessary cast from Z3 to Hashtable<String,Integer>\n" +
5683 			"----------\n");
5684 	}
5685 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=62292 - parameterized message send
test0184()5686 	public void test0184() {
5687 		this.runConformTest(
5688 			new String[] {
5689 				"X.java",
5690 				"public class X {\n" +
5691 				"\n" +
5692 				"	static <T, U> T foo(T t, U u) {\n" +
5693 				"		return t;\n" +
5694 				"	}\n" +
5695 				"	public static void main(String[] args) {\n" +
5696 				"		System.out.println(X.<String,X>foo(\"SUCCESS\", null));\n" +
5697 				"	}\n" +
5698 				"}\n",
5699 			},
5700 			"SUCCESS");
5701 	}
5702 	// parameterized message send - variation on 184 with non-static generic method
test0185()5703 	public void test0185() {
5704 		this.runConformTest(
5705 			new String[] {
5706 				"X.java",
5707 				"public class X {\n" +
5708 				"\n" +
5709 				"	<T, U> T foo(T t, U u) {\n" +
5710 				"		return t;\n" +
5711 				"	}\n" +
5712 				"	public static void main(String[] args) {\n" +
5713 				"		System.out.println(new X().<String,X>foo(\"SUCCESS\", null));\n" +
5714 				"	}\n" +
5715 				"}\n",
5716 			},
5717 			"SUCCESS");
5718 	}
5719 	// message send parameterized with type not matching parameter bounds
test0186()5720 	public void test0186() {
5721 		this.runNegativeTest(
5722 			new String[] {
5723 				"X.java",
5724 				"public class X {\n" +
5725 				"\n" +
5726 				"	<T, U extends String> T foo(T t, U u) {\n" +
5727 				"		return t;\n" +
5728 				"	}\n" +
5729 				"	public static void main(String[] args) {\n" +
5730 				"		System.out.println(new X().<String, X>foo(\"SUCCESS\", null));\n" +
5731 				"	}\n" +
5732 				"}\n",
5733 			},
5734 			"----------\n" +
5735 			"1. WARNING in X.java (at line 3)\n" +
5736 			"	<T, U extends String> T foo(T t, U u) {\n" +
5737 			"	              ^^^^^^\n" +
5738 			"The type parameter U should not be bounded by the final type String. Final types cannot be further extended\n" +
5739 			"----------\n" +
5740 			"2. ERROR in X.java (at line 7)\n" +
5741 			"	System.out.println(new X().<String, X>foo(\"SUCCESS\", null));\n" +
5742 			"	                                      ^^^\n" +
5743 			"Bound mismatch: The generic method foo(T, U) of type X is not applicable for the arguments (String, null). The inferred type X is not a valid substitute for the bounded parameter <U extends String>\n" +
5744 			"----------\n");
5745 	}
5746 	// invalid type argument arity for parameterized message send
test0187()5747 	public void test0187() {
5748 		this.runNegativeTest(
5749 			new String[] {
5750 				"X.java",
5751 				"public class X {\n" +
5752 				"\n" +
5753 				"	<T, U extends String> T foo(T t, U u) {\n" +
5754 				"		return t;\n" +
5755 				"	}\n" +
5756 				"	public static void main(String[] args) {\n" +
5757 				"		System.out.println(new X().<String>foo(\"SUCCESS\", null));\n" +
5758 				"	}\n" +
5759 				"}\n",
5760 			},
5761 			"----------\n" +
5762 			"1. WARNING in X.java (at line 3)\n" +
5763 			"	<T, U extends String> T foo(T t, U u) {\n" +
5764 			"	              ^^^^^^\n" +
5765 			"The type parameter U should not be bounded by the final type String. Final types cannot be further extended\n" +
5766 			"----------\n" +
5767 			"2. ERROR in X.java (at line 7)\n" +
5768 			"	System.out.println(new X().<String>foo(\"SUCCESS\", null));\n" +
5769 			"	                                   ^^^\n" +
5770 			"Incorrect number of type arguments for generic method <T, U>foo(T, U) of type X; it cannot be parameterized with arguments <String>\n" +
5771 			"----------\n");
5772 	}
5773 	// parameterized invocation of non generic method with incorrect argument count
test0188()5774 	public void test0188() {
5775 		this.runNegativeTest(
5776 			new String[] {
5777 				"X.java",
5778 				"public class X {\n" +
5779 				"\n" +
5780 				"	void foo() {\n" +
5781 				"		return;\n" +
5782 				"	}\n" +
5783 				"	public static void main(String[] args) {\n" +
5784 				"		System.out.println(new X().<String>foo(\"SUCCESS\", null));\n" +
5785 				"	}\n" +
5786 				"}\n",
5787 			},
5788 			"----------\n" +
5789 			"1. ERROR in X.java (at line 7)\n" +
5790 			"	System.out.println(new X().<String>foo(\"SUCCESS\", null));\n" +
5791 			"	                                   ^^^\n" +
5792 			"The method foo() in the type X is not applicable for the arguments (String, null)\n" +
5793 			"----------\n");
5794 	}
5795 	// parameterized invocation of non generic method
test0189()5796 	public void test0189() {
5797 		String expectedOutput = this.complianceLevel < ClassFileConstants.JDK1_7
5798 			? 	"----------\n" +
5799 				"1. ERROR in X.java (at line 7)\n" +
5800 				"	System.out.println(new X().<String>foo());\n" +
5801 				"	                                   ^^^\n" +
5802 				"The method foo() of type X is not generic; it cannot be parameterized with arguments <String>\n" +
5803 				"----------\n"
5804 			: 	"----------\n" +
5805 				"1. ERROR in X.java (at line 7)\n" +
5806 				"	System.out.println(new X().<String>foo());\n" +
5807 				"	           ^^^^^^^\n" +
5808 				"The method println(boolean) in the type PrintStream is not applicable for the arguments (void)\n" +
5809 				"----------\n" +
5810 				"2. WARNING in X.java (at line 7)\n" +
5811 				"	System.out.println(new X().<String>foo());\n" +
5812 				"	                            ^^^^^^\n" +
5813 				"Unused type arguments for the non generic method foo() of type X; it should not be parameterized with arguments <String>\n" +
5814 				"----------\n";
5815 
5816 		this.runNegativeTest(
5817 			new String[] {
5818 				"X.java",
5819 				"public class X {\n" +
5820 				"\n" +
5821 				"	void foo() {\n" +
5822 				"		return;\n" +
5823 				"	}\n" +
5824 				"	public static void main(String[] args) {\n" +
5825 				"		System.out.println(new X().<String>foo());\n" +
5826 				"	}\n" +
5827 				"}\n",
5828 			},
5829 			expectedOutput);
5830 	}
5831 	// parameterized allocation
5832 	public void test0190() {
5833 		this.runConformTest(
5834 			new String[] {
5835 				"X.java",
5836 				"public class X {\n" +
5837 				"	public <T> X(T t){\n" +
5838 				"		System.out.println(t);\n" +
5839 				"	}\n" +
5840 				"	public static void main(String[] args) {\n" +
5841 				"		new <String>X(\"SUCCESS\");\n" +
5842 				"	}\n" +
5843 				"}\n",
5844 			},
5845 			"SUCCESS");
5846 	}
5847 	// parameterized allocation - wrong arity
5848 	public void test0191() {
5849 		this.runNegativeTest(
5850 			new String[] {
5851 				"X.java",
5852 				"public class X {\n" +
5853 				"	public <T> X(T t){\n" +
5854 				"		System.out.println(t);\n" +
5855 				"	}\n" +
5856 				"	public static void main(String[] args) {\n" +
5857 				"		new <String, String>X(\"FAILED\");\n" +
5858 				"	}\n" +
5859 				"}\n",
5860 			},
5861 			"----------\n" +
5862 			"1. ERROR in X.java (at line 6)\n" +
5863 			"	new <String, String>X(\"FAILED\");\n" +
5864 			"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
5865 			"Incorrect number of type arguments for generic constructor <T>X(T) of type X; it cannot be parameterized with arguments <String, String>\n" +
5866 			"----------\n");
5867 	}
5868 	// parameterized allocation - non generic target constructor
5869 	// **
5870 	public void test0192() {
5871 		if (this.complianceLevel < ClassFileConstants.JDK1_7) {
5872 			this.runNegativeTest(
5873 				new String[] {
5874 					"X.java",
5875 					"public class X {\n" +
5876 					"	public X(String t){\n" +
5877 					"		System.out.println(t);\n" +
5878 					"	}\n" +
5879 					"	public static void main(String[] args) {\n" +
5880 					"		new <String>X(\"FAILED\");\n" +
5881 					"	}\n" +
5882 					"}\n",
5883 				},
5884 				"----------\n" +
5885 				"1. ERROR in X.java (at line 6)\n" +
5886 				"	new <String>X(\"FAILED\");\n" +
5887 				"	^^^^^^^^^^^^^^^^^^^^^^^\n" +
5888 				"The constructor X(String) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
5889 				"----------\n");
5890 			return;
5891 		}
5892 		this.runNegativeTest(
5893 				new String[] {
5894 					"X.java",
5895 					"public class X {\n" +
5896 					"	public X(String t){\n" +
5897 					"		System.out.println(t);\n" +
5898 					"	}\n" +
5899 					"	public static void main(String[] args) {\n" +
5900 					"		new <String>X(\"FAILED\");\n" +
5901 					"		Zork z;\n" +
5902 					"	}\n" +
5903 					"}\n",
5904 				},
5905 				"----------\n" +
5906 				"1. WARNING in X.java (at line 6)\n" +
5907 				"	new <String>X(\"FAILED\");\n" +
5908 				"	     ^^^^^^\n" +
5909 				"Unused type arguments for the non generic constructor X(String) of type X; it should not be parameterized with arguments <String>\n" +
5910 				"----------\n" +
5911 				"2. ERROR in X.java (at line 7)\n" +
5912 				"	Zork z;\n" +
5913 				"	^^^^\n" +
5914 				"Zork cannot be resolved to a type\n" +
5915 				"----------\n");
5916 	}
5917 	// parameterized allocation - argument type mismatch
5918 	public void test0193() {
5919 		this.runNegativeTest(
5920 			new String[] {
5921 				"X.java",
5922 				"public class X {\n" +
5923 				"	public <T> X(T t){\n" +
5924 				"		System.out.println(t);\n" +
5925 				"	}\n" +
5926 				"	public static void main(String[] args) {\n" +
5927 				"		new <String>X(new X(null));\n" +
5928 				"	}\n" +
5929 				"}\n",
5930 			},
5931 			"----------\n" +
5932 			"1. ERROR in X.java (at line 6)\n" +
5933 			"	new <String>X(new X(null));\n" +
5934 			"	^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
5935 			"The parameterized constructor <String>X(String) of type X is not applicable for the arguments (X)\n" +
5936 			"----------\n");
5937 	}
5938 	// parameterized invocation - argument type mismatch
5939 	public void test0194() {
5940 		this.runNegativeTest(
5941 			new String[] {
5942 				"X.java",
5943 				"public class X {\n" +
5944 				"\n" +
5945 				"	<T> void foo(T t) {\n" +
5946 				"		return;\n" +
5947 				"	}\n" +
5948 				"	public static void main(String[] args) {\n" +
5949 				"		System.out.println(new X().<String>foo(new X()));\n" +
5950 				"	}\n" +
5951 				"}\n",
5952 			},
5953 			"----------\n" +
5954 			"1. ERROR in X.java (at line 7)\n" +
5955 			"	System.out.println(new X().<String>foo(new X()));\n" +
5956 			"	                                   ^^^\n" +
5957 			"The parameterized method <String>foo(String) of type X is not applicable for the arguments (X)\n" +
5958 			"----------\n");
5959 	}
5960 	// parameterized qualified allocation
5961 	public void test0195() {
5962 		this.runConformTest(
5963 			new String[] {
5964 				"X.java",
5965 				"public class X {\n" +
5966 				"	public class MX {\n" +
5967 				"		public <T> MX(T t){\n" +
5968 				"			System.out.println(t);\n" +
5969 				"		}\n" +
5970 				"	}\n" +
5971 				"	public static void main(String[] args) {\n" +
5972 				"		new X().new <String>MX(\"SUCCESS\");\n" +
5973 				"	}\n" +
5974 				"}\n",
5975 			},
5976 			"SUCCESS");
5977 	}
5978 	// parameterized qualified allocation - wrong arity
5979 	public void test0196() {
5980 		this.runNegativeTest(
5981 			new String[] {
5982 				"X.java",
5983 				"public class X {\n" +
5984 				"	public class MX {\n" +
5985 				"		public <T> MX(T t){\n" +
5986 				"			System.out.println(t);\n" +
5987 				"		}\n" +
5988 				"	}\n" +
5989 				"	public static void main(String[] args) {\n" +
5990 				"		new X().new <String,String>MX(\"FAILED\");\n" +
5991 				"	}\n" +
5992 				"}\n",
5993 			},
5994 			"----------\n" +
5995 			"1. ERROR in X.java (at line 8)\n" +
5996 			"	new X().new <String,String>MX(\"FAILED\");\n" +
5997 			"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
5998 			"Incorrect number of type arguments for generic constructor <T>MX(T) of type X.MX; it cannot be parameterized with arguments <String, String>\n" +
5999 			"----------\n");
6000 	}
6001 	// parameterized qualified allocation - non generic target constructor
6002 	// **
6003 	public void test0197() {
6004 		if (this.complianceLevel < ClassFileConstants.JDK1_7) {
6005 			this.runNegativeTest(
6006 				new String[] {
6007 					"X.java",
6008 					"public class X {\n" +
6009 					"	public class MX {\n" +
6010 					"		public MX(String t){\n" +
6011 					"			System.out.println(t);\n" +
6012 					"		}\n" +
6013 					"	}\n" +
6014 					"	public static void main(String[] args) {\n" +
6015 					"		new X().new <String>MX(\"FAILED\");\n" +
6016 					"	}\n" +
6017 					"}\n",
6018 				},
6019 				"----------\n" +
6020 				"1. ERROR in X.java (at line 8)\n" +
6021 				"	new X().new <String>MX(\"FAILED\");\n" +
6022 				"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
6023 				"The constructor MX(String) of type X.MX is not generic; it cannot be parameterized with arguments <String>\n" +
6024 				"----------\n");
6025 			return;
6026 		}
6027 		this.runNegativeTest(
6028 				new String[] {
6029 					"X.java",
6030 					"public class X {\n" +
6031 					"	public class MX {\n" +
6032 					"		public MX(String t){\n" +
6033 					"			System.out.println(t);\n" +
6034 					"		}\n" +
6035 					"	}\n" +
6036 					"	public static void main(String[] args) {\n" +
6037 					"		new X().new <String>MX(\"FAILED\");\n" +
6038 					"		Zork z;\n" +
6039 					"	}\n" +
6040 					"}\n",
6041 				},
6042 				"----------\n" +
6043 				"1. WARNING in X.java (at line 8)\n" +
6044 				"	new X().new <String>MX(\"FAILED\");\n" +
6045 				"	             ^^^^^^\n" +
6046 				"Unused type arguments for the non generic constructor X.MX(String) of type X.MX; it should not be parameterized with arguments <String>\n" +
6047 				"----------\n" +
6048 				"2. ERROR in X.java (at line 9)\n" +
6049 				"	Zork z;\n" +
6050 				"	^^^^\n" +
6051 				"Zork cannot be resolved to a type\n" +
6052 				"----------\n");
6053 	}
6054 	// parameterized qualified allocation - argument type mismatch
6055 	public void test0198() {
6056 		this.runNegativeTest(
6057 			new String[] {
6058 				"X.java",
6059 				"public class X {\n" +
6060 				"	public class MX {\n" +
6061 				"		public <T>MX(T t){\n" +
6062 				"			System.out.println(t);\n" +
6063 				"		}\n" +
6064 				"	}\n" +
6065 				"	public static void main(String[] args) {\n" +
6066 				"		new X().new <String>MX(new X());\n" +
6067 				"	}\n" +
6068 				"}\n",
6069 			},
6070 			"----------\n" +
6071 			"1. ERROR in X.java (at line 8)\n" +
6072 			"	new X().new <String>MX(new X());\n" +
6073 			"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
6074 			"The parameterized constructor <String>MX(String) of type X.MX is not applicable for the arguments (X)\n" +
6075 			"----------\n");
6076 	}
6077 	// parameterized explicit constructor call
6078 	public void test0199() {
6079 		this.runConformTest(
6080 			new String[] {
6081 				"X.java",
6082 				"public class X {\n" +
6083 				"	public <T> X(T t){\n" +
6084 				"		System.out.println(t);\n" +
6085 				"	}\n" +
6086 				"	public static void main(String[] args) {\n" +
6087 				"		class Local extends X {\n" +
6088 				"			Local() {\n" +
6089 				"				<String>super(\"SUCCESS\");\n" +
6090 				"			}\n" +
6091 				"		};\n" +
6092 				"		new Local();\n" +
6093 				"	}\n" +
6094 				"}\n",
6095 			},
6096 			"SUCCESS");
6097 	}
6098 	// parameterized explicit constructor call - wrong arity
6099 	public void test0200() {
6100 		this.runNegativeTest(
6101 			new String[] {
6102 				"X.java",
6103 				"public class X {\n" +
6104 				"	public <T> X(T t){\n" +
6105 				"		System.out.println(t);\n" +
6106 				"	}\n" +
6107 				"	public static void main(String[] args) {\n" +
6108 				"		class Local extends X {\n" +
6109 				"			Local() {\n" +
6110 				"				<String,String>super(\"FAILED\");\n" +
6111 				"			}\n" +
6112 				"		};\n" +
6113 				"		new Local();\n" +
6114 				"	}\n" +
6115 				"}\n",
6116 			},
6117 			"----------\n" +
6118 			"1. ERROR in X.java (at line 8)\n" +
6119 			"	<String,String>super(\"FAILED\");\n" +
6120 			"	               ^^^^^^^^^^^^^^^^\n" +
6121 			"Incorrect number of type arguments for generic constructor <T>X(T) of type X; it cannot be parameterized with arguments <String, String>\n" +
6122 			"----------\n");
6123 	}
6124 	// parameterized explicit constructor call - non generic target constructor
6125 	// **
6126 	public void test0201() {
6127 		if (this.complianceLevel < ClassFileConstants.JDK1_7) {
6128 			this.runNegativeTest(
6129 				new String[] {
6130 					"X.java",
6131 					"public class X {\n" +
6132 					"	public X(String t){\n" +
6133 					"		System.out.println(t);\n" +
6134 					"	}\n" +
6135 					"	public static void main(String[] args) {\n" +
6136 					"		class Local extends X {\n" +
6137 					"			Local() {\n" +
6138 					"				<String>super(\"FAILED\");\n" +
6139 					"			}\n" +
6140 					"		};\n" +
6141 					"		new Local();\n" +
6142 					"	}\n" +
6143 					"}\n",
6144 				},
6145 				"----------\n" +
6146 				"1. ERROR in X.java (at line 8)\n" +
6147 				"	<String>super(\"FAILED\");\n" +
6148 				"	        ^^^^^^^^^^^^^^^^\n" +
6149 				"The constructor X(String) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
6150 				"----------\n");
6151 			return;
6152 		}
6153 		this.runNegativeTest(
6154 				new String[] {
6155 					"X.java",
6156 					"public class X {\n" +
6157 					"	public X(String t){\n" +
6158 					"		System.out.println(t);\n" +
6159 					"		Zork z;\n" +
6160 					"	}\n" +
6161 					"	public static void main(String[] args) {\n" +
6162 					"		class Local extends X {\n" +
6163 					"			Local() {\n" +
6164 					"				<String>super(\"FAILED\");\n" +
6165 					"			}\n" +
6166 					"		};\n" +
6167 					"		new Local();\n" +
6168 					"	}\n" +
6169 					"}\n",
6170 				},
6171 				"----------\n" +
6172 				"1. ERROR in X.java (at line 4)\n" +
6173 				"	Zork z;\n" +
6174 				"	^^^^\n" +
6175 				"Zork cannot be resolved to a type\n" +
6176 				"----------\n" +
6177 				"2. WARNING in X.java (at line 9)\n" +
6178 				"	<String>super(\"FAILED\");\n" +
6179 				"	 ^^^^^^\n" +
6180 				"Unused type arguments for the non generic constructor X(String) of type X; it should not be parameterized with arguments <String>\n" +
6181 				"----------\n");
6182 	}
6183 	// parameterized explicit constructor call - argument type mismatch
6184 	public void test0202() {
6185 		this.runNegativeTest(
6186 			new String[] {
6187 				"X.java",
6188 				"public class X {\n" +
6189 				"	public <T> X(T t){\n" +
6190 				"		System.out.println(t);\n" +
6191 				"	}\n" +
6192 				"	public static void main(String[] args) {\n" +
6193 				"		class Local extends X {\n" +
6194 				"			Local() {\n" +
6195 				"				<String>super(new X(null));\n" +
6196 				"			}\n" +
6197 				"		};\n" +
6198 				"		new Local();\n" +
6199 				"	}\n" +
6200 				"}\n", 			},
6201 			"----------\n" +
6202 			"1. ERROR in X.java (at line 8)\n" +
6203 			"	<String>super(new X(null));\n" +
6204 			"	        ^^^^^^^^^^^^^^^^^^^\n" +
6205 			"The parameterized constructor <String>X(String) of type X is not applicable for the arguments (X)\n" +
6206 			"----------\n");
6207 	}
6208 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=62822 - supertypes partially resolved during bound check
6209 	public void test0203() {
6210 		this.runConformTest(
6211 			new String[] {
6212 				"X.java",
6213 				"public class X {\n" +
6214 				"	public static void main(String[] args) {\n" +
6215 				"		demo.AD ad;\n" +
6216 				"		System.out.println(\"SUCCESS\");\n" +
6217 				"	}\n" +
6218 				"}\n",
6219 				"demo/AD.java",
6220 				"package demo;\n" +
6221 				"public interface AD extends LIST<ADXP> {}\n",
6222 				"demo/ADXP.java",
6223 				"package demo;\n" +
6224 				"public interface ADXP extends BIN {}\n",
6225 				"demo/ANY.java",
6226 				"package demo;\n" +
6227 				"public interface ANY {}\n",
6228 				"demo/BL.java",
6229 				"package demo;\n" +
6230 				"public interface BL extends ANY {}\n",
6231 				"demo/LIST.java",
6232 				"package demo;\n" +
6233 				"public interface LIST<T extends ANY> extends ANY {}\n",
6234 				"demo/BIN.java",
6235 				"package demo;\n" +
6236 				"public interface BIN extends LIST<BL> {}\n",
6237 			},
6238 			"SUCCESS");
6239 	}
6240 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=62806
6241 	public void test0204() {
6242 		this.runConformTest(
6243 			new String[] {
6244 				"Function.java",
6245 				"public abstract class Function<Y,X> {\n" +
6246 				"    public abstract Y eval(X x);\n" +
6247 				"\n" +
6248 				"}\n",
6249 				"FunctionMappedComparator.java",
6250 				"import java.util.*;\n" +
6251 				"public class FunctionMappedComparator<Y,X> implements Comparator<X> {\n" +
6252 				"	/*\n" +
6253 				"	 * \'Function\' is highlighted as an error here - the message is:\n" +
6254 				"	 * The type Function is not generic; it cannot be parameterized with arguments <Y, X>\n" +
6255 				"	 */\n" +
6256 				"    protected Function<Y,X> function;\n" +
6257 				"    protected Comparator<Y> comparator;\n" +
6258 				"    public FunctionMappedComparator(Function<Y,X> function,Comparator<Y> comparator ) {\n" +
6259 				"        this.function=function;\n" +
6260 				"        this.comparator=comparator;\n" +
6261 				"    }\n" +
6262 				"\n" +
6263 				"    public int compare(X x1, X x2) {\n" +
6264 				"        return comparator.compare(function.eval(x1),function.eval(x2));\n" +
6265 				"    }\n" +
6266 				"}\n",
6267 			},
6268 			"");
6269 	}
6270 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=63555 - reference to static type parameter allowed inside type itself
6271 	public void test0205() {
6272 		this.runConformTest(
6273 			new String[] {
6274 				"Alpha.java",
6275 				"public class Alpha {\n" +
6276 				"	static class Beta<T> {\n" +
6277 				"		T obj;\n" +
6278 				"	}\n" +
6279 				"}\n",
6280 			},
6281 			"");
6282 	}
6283 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=63555 - variation on static method type parameter
6284 	public void test0206() {
6285 		this.runConformTest(
6286 			new String[] {
6287 				"Alpha.java",
6288 				"public class Alpha {\n" +
6289 				"	static <T> void Beta(T t) {\n" +
6290 				"	}\n" +
6291 				"}\n",
6292 			},
6293 			"");
6294 	}
6295 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=63590 - disallow parameterized type in catch/throws clause
6296 	public void test0207() {
6297 		this.runNegativeTest(
6298 			new String[] {
6299 				"Alpha.java",
6300 				"public class Alpha<T> extends RuntimeException {\n" +
6301 				"	public static void main(String[] args) {\n" +
6302 				"		new Object() {\n" +
6303 				"			public void m() throws Alpha<String> {\n" +
6304 				"				System.out.println(\"SUCCESS\");\n" +
6305 				"			}\n" +
6306 				"		}.m();\n" +
6307 				"	}\n" +
6308 				"}\n",
6309 			},
6310 			"----------\n" +
6311 			"1. WARNING in Alpha.java (at line 1)\n" +
6312 			"	public class Alpha<T> extends RuntimeException {\n" +
6313 			"	             ^^^^^\n" +
6314 			"The serializable class Alpha does not declare a static final serialVersionUID field of type long\n" +
6315 			"----------\n" +
6316 			"2. ERROR in Alpha.java (at line 1)\n" +
6317 			"	public class Alpha<T> extends RuntimeException {\n" +
6318 			"	                              ^^^^^^^^^^^^^^^^\n" +
6319 			"The generic class Alpha<T> may not subclass java.lang.Throwable\n" +
6320 			"----------\n" +
6321 			"3. ERROR in Alpha.java (at line 4)\n" +
6322 			"	public void m() throws Alpha<String> {\n" +
6323 			"	                       ^^^^^\n" +
6324 			"Cannot use the parameterized type Alpha<String> either in catch block or throws clause\n" +
6325 			"----------\n");
6326 	}
6327 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=63590 - disallow parameterized type in catch/throws clause
6328 	public void test0208() {
6329 		this.runNegativeTest(
6330 			new String[] {
6331 				"X.java",
6332 				"public class X<T> extends RuntimeException {\n" +
6333 				"	public static void main(String[] args) {\n" +
6334 				"		try {\n" +
6335 				"			throw new X<String>();\n" +
6336 				"		} catch(X<String> e) {\n" +
6337 				"			System.out.println(\"X<String>\");\n" +
6338 				"		} catch(X<X<String>> e) {\n" +
6339 				"			System.out.println(\"X<X<String>>\");\n" +
6340 				"		} catch(RuntimeException e) {\n" +
6341 				"			System.out.println(\"RuntimeException\");\n" +
6342 				"		}\n" +
6343 				"	}\n" +
6344 				"}\n",
6345 			},
6346 			"----------\n" +
6347 			"1. WARNING in X.java (at line 1)\n" +
6348 			"	public class X<T> extends RuntimeException {\n" +
6349 			"	             ^\n" +
6350 			"The serializable class X does not declare a static final serialVersionUID field of type long\n" +
6351 			"----------\n" +
6352 			"2. ERROR in X.java (at line 1)\n" +
6353 			"	public class X<T> extends RuntimeException {\n" +
6354 			"	                          ^^^^^^^^^^^^^^^^\n" +
6355 			"The generic class X<T> may not subclass java.lang.Throwable\n" +
6356 			"----------\n" +
6357 			"3. ERROR in X.java (at line 5)\n" +
6358 			"	} catch(X<String> e) {\n" +
6359 			"	                  ^\n" +
6360 			"Cannot use the parameterized type X<String> either in catch block or throws clause\n" +
6361 			"----------\n" +
6362 			"4. ERROR in X.java (at line 7)\n" +
6363 			"	} catch(X<X<String>> e) {\n" +
6364 			"	                     ^\n" +
6365 			"Cannot use the parameterized type X<X<String>> either in catch block or throws clause\n" +
6366 			"----------\n");
6367 	}
6368 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=63556 - should resolve all occurrences of A to type variable
6369 	public void test0209() {
6370 		this.runConformTest(
6371 			new String[] {
6372 				"X.java",
6373 				"public class X<A,B,C extends java.util.List<A>> {}\n" +
6374 				"class X2<A,C extends java.util.List<A>, B> {}\n" +
6375 				"class X3<B, A,C extends java.util.List<A>> {}\n",
6376 			},
6377 			"");
6378 	}
6379 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=68006 - Invalid modifier after parse
6380 	public void test0210() {
6381 		this.runNegativeTest(
6382 			new String[] {
6383 				"X.java",
6384 				"public class X {\n" +
6385 				"	void foo(Map<? super Object, ? extends String> m){\n" +
6386 				"	}\n" +
6387 				"}\n",
6388 			},
6389 			"----------\n" +
6390 			"1. ERROR in X.java (at line 2)\n" +
6391 			"	void foo(Map<? super Object, ? extends String> m){\n" +
6392 			"	         ^^^\n" +
6393 			"Map cannot be resolved to a type\n" +
6394 			"----------\n");
6395 	}
6396 	// test compilation against binaries
6397 	public void test0211() {
6398 		this.runConformTest(
6399 			new String[] {
6400 				"p/Top.java",
6401 				"package p;\n" +
6402 				"public interface Top<T> {}\n",
6403 			},
6404 			"");
6405 
6406 		this.runConformTest(
6407 			new String[] {
6408 				"p/Super.java",
6409 				"package p;\n" +
6410 				"public class Super<T> implements Top<T>{\n" +
6411 				"    public static void main(String [] args) {\n" +
6412 				"        System.out.println(\"SUCCESS\");\n" +
6413 				"    }\n" +
6414 				"}\n",
6415 			},
6416 			"SUCCESS",
6417 			null,
6418 			false, // do not flush output
6419 			null);
6420 	}
6421 	// check type variable equivalence
6422 	public void test0212() {
6423 		this.runConformTest(
6424 			new String[] {
6425 				"X.java",
6426 				"import java.util.*;\n" +
6427 				"\n" +
6428 				"public class X<T>{\n" +
6429 				"    public static void main(String [] args) {\n" +
6430 				"        System.out.println(\"SUCCESS\");\n" +
6431 				"    }\n" +
6432 				"	X<T> _recurse; \n" +
6433 				"	public List<T> toList(){\n" +
6434 				"		List<T> result = new ArrayList<T>();\n" +
6435 				"		result.addAll(_recurse.toList()); // should be applicable\n" +
6436 				"		return result;\n" +
6437 				"	}\n" +
6438 				"}\n"
6439 			},
6440 			"SUCCESS");
6441 	}
6442 	public void test0213() {
6443 		this.runConformTest(
6444 			new String[] {
6445 				"X.java",
6446 				"public class X<R,T extends Comparable<T>>{\n" +
6447 				"	T test;\n" +
6448 				"	public Comparable<? extends T> getThis(){\n" +
6449 				"		return test;\n" +
6450 				"	}\n" +
6451 				"    public static void main(String [] args) {\n" +
6452 				"        System.out.println(\"SUCCESS\");\n" +
6453 				"    }\n" +
6454 				"}\n"
6455 			},
6456 			"SUCCESS");
6457 	}
6458 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=68133 - verify error
6459 	public void test0214() {
6460 		this.runConformTest(
6461 			new String[] {
6462 				"X.java",
6463 				"import java.util.ArrayList;\n" +
6464 				"public class X {\n" +
6465 				"    public static void main(String[] args) {\n" +
6466 				"        ArrayList<Object> l;\n" +
6467 				"        switch (args.length) {\n" +
6468 				"        case 1:\n" +
6469 				"            l = new ArrayList<Object>();\n" +
6470 				"            System.out.println(l);\n" +
6471 				"            break;\n" +
6472 				"        default:\n" +
6473 				"            System.out.println(\"SUCCESS\");\n" +
6474 				"            return;\n" +
6475 				"        }\n" +
6476 				"    }\n" +
6477 				"}\n"
6478 			},
6479 			"SUCCESS");
6480 	}
6481 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=68133 variation
6482 	public void test0215() throws Exception {
6483 		this.runConformTest(
6484 			new String[] {
6485 				"X.java",
6486 				"public class X {\n" +
6487 				"	public static void main(String[] args) {\n" +
6488 				"		java.util.ArrayList<Object> i;	\n" +
6489 				"		outer: {\n" +
6490 				"			if (args == null) {\n" +
6491 				"				i = null;\n" +
6492 				"				break outer;\n" +
6493 				"			}\n" +
6494 				"			return;\n" +
6495 				"		}\n" +
6496 				"		System.out.println(i);	\n" +
6497 				"		System.out.println(\"SUCCESS\");	\n" +
6498 				"	}\n" +
6499 				"}\n",
6500 			},
6501 			"");
6502 
6503 		String expectedOutput =
6504 			"  // Method descriptor #15 ([Ljava/lang/String;)V\n" +
6505 			"  // Stack: 2, Locals: 2\n" +
6506 			"  public static void main(java.lang.String[] args);\n" +
6507 			"     0  aload_0 [args]\n" +
6508 			"     1  ifnonnull 9\n" +
6509 			"     4  aconst_null\n" +
6510 			"     5  astore_1 [i]\n" +
6511 			"     6  goto 10\n" +
6512 			"     9  return\n" +
6513 			"    10  getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
6514 			"    13  aload_1 [i]\n" +
6515 			"    14  invokevirtual java.io.PrintStream.println(java.lang.Object) : void [22]\n" +
6516 			"    17  getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
6517 			"    20  ldc <String \"SUCCESS\"> [28]\n" +
6518 			"    22  invokevirtual java.io.PrintStream.println(java.lang.String) : void [30]\n" +
6519 			"    25  return\n" +
6520 			"      Line numbers:\n" +
6521 			"        [pc: 0, line: 5]\n" +
6522 			"        [pc: 4, line: 6]\n" +
6523 			"        [pc: 6, line: 7]\n" +
6524 			"        [pc: 9, line: 9]\n" +
6525 			"        [pc: 10, line: 11]\n" +
6526 			"        [pc: 17, line: 12]\n" +
6527 			"        [pc: 25, line: 13]\n" +
6528 			"      Local variable table:\n" +
6529 			"        [pc: 0, pc: 26] local: args index: 0 type: java.lang.String[]\n" +
6530 			"        [pc: 6, pc: 9] local: i index: 1 type: java.util.ArrayList\n" +
6531 			"        [pc: 10, pc: 26] local: i index: 1 type: java.util.ArrayList\n" +
6532 			"      Local variable type table:\n" +
6533 			"        [pc: 6, pc: 9] local: i index: 1 type: java.util.ArrayList<java.lang.Object>\n" +
6534 			"        [pc: 10, pc: 26] local: i index: 1 type: java.util.ArrayList<java.lang.Object>\n";
6535 
6536 		File f = new File(OUTPUT_DIR + File.separator + "X.class");
6537 		byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
6538 		ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
6539 		String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
6540 		int index = result.indexOf(expectedOutput);
6541 		if (index == -1 || expectedOutput.length() == 0) {
6542 			System.out.println(Util.displayString(result, 3));
6543 		}
6544 		if (index == -1) {
6545 			assertEquals("Wrong contents", expectedOutput, result);
6546 		}
6547 	}
6548 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=68998 parameterized field constants
6549 	public void test0216() {
6550 		this.runConformTest(
6551 			new String[] {
6552 				"test/cheetah/NG.java",
6553 				"package test.cheetah;\n" +
6554 				"public class NG extends G {\n" +
6555 				"		public static void main(String[] args) {\n" +
6556 				"			System.out.println(\"SUCCESS\");	\n" +
6557 				"		}\n" +
6558 				"    public boolean test() {\n" +
6559 				"        return o == null;\n" +
6560 				"    }\n" +
6561 				"}\n",
6562 				"test/cheetah/G.java",
6563 				"package test.cheetah;\n" +
6564 				"public class G<E> {\n" +
6565 				"    protected Object o;\n" +
6566 				"}\n",
6567 			},
6568 			"SUCCESS");
6569 	}
6570 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69135 - unnecessary cast operation
6571 	public void test0217() {
6572 		Map customOptions = getCompilerOptions();
6573 		runConformTest(
6574 			// test directory preparation
6575 			true /* flush output directory */,
6576 			new String[] { /* test files */
6577 				"X.java",
6578 				"import java.util.ArrayList;\n" +
6579 				"public class X {\n" +
6580 				"    public static void main(String [] args) {\n" +
6581 				"		ArrayList<String> l= new ArrayList<String>();\n" +
6582 				"		String string = (String) l.get(0);\n" +
6583 				"    }\n" +
6584 				"}\n",
6585 			},
6586 			// compiler options
6587 			null /* no class libraries */,
6588 			customOptions /* custom options */,
6589 			// compiler results
6590 			"----------\n" + /* expected compiler log */
6591 			"1. WARNING in X.java (at line 5)\n" +
6592 			"	String string = (String) l.get(0);\n" +
6593 			"	                ^^^^^^^^^^^^^^^^^\n" +
6594 			"Unnecessary cast from String to String\n" +
6595 			"----------\n",
6596 			// runtime results
6597 			null /* do not check output string */,
6598 			"java.lang.IndexOutOfBoundsException" /* do not check error string */,
6599 			// javac options
6600 			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings /* javac test options */);
6601 	}
6602 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=64154 visibility issue due to invalid use of parameterized binding
6603 	public void test0218() {
6604 		this.runConformTest(
6605 			new String[] {
6606 				"X.java",
6607 				"public class X<T>{\n" +
6608 				"	private final T _data;\n" +
6609 				"	private X(T data){\n" +
6610 				"		_data = data;\n" +
6611 				"	}\n" +
6612 				"	public T getData(){\n" +
6613 				"		return _data;\n" +
6614 				"	}\n" +
6615 				"	public static <E> X<E> create(E data) {\n" +
6616 				"		return new X<E>(data);\n" +
6617 				"	}\n" +
6618 				"	public static void main(String[] args) {\n" +
6619 				"		create(new Object());\n" +
6620 				"		System.out.println(\"SUCCESS\");\n" +
6621 				"	}\n" +
6622 				"}\n",
6623 			},
6624 			"SUCCESS");
6625 	}
6626 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=64154 variation
6627 	public void test0219() {
6628 		this.runConformTest(
6629 			new String[] {
6630 				"X.java",
6631 				"public class X<T>{\n" +
6632 				"	private final T _data;\n" +
6633 				"	private X(T data){\n" +
6634 				"		_data = data;\n" +
6635 				"	}\n" +
6636 				"	public T getData(){\n" +
6637 				"		return _data;\n" +
6638 				"	}\n" +
6639 				"	public static <E> E create(E data) {\n" +
6640 				"		return new X<E>(data)._data;\n" +
6641 				"	}\n" +
6642 				"	public static void main(String[] args) {\n" +
6643 				"		create(new Object());\n" +
6644 				"		System.out.println(\"SUCCESS\");\n" +
6645 				"	}\n" +
6646 				"}\n",
6647 			},
6648 			"SUCCESS");
6649 	}
6650 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69141 unsafe wildcard operation tolerates wildcard with lower bounds
6651 	public void test0220() {
6652 		this.runNegativeTest(
6653 			new String[] {
6654 				"X.java",
6655 				"import java.util.ArrayList;\n" +
6656 				"\n" +
6657 				"public class X {\n" +
6658 				"	void foo() {\n" +
6659 				"		ArrayList<? super Integer> al = new ArrayList<Object>();\n" +
6660 				"		al.add(Integer.valueOf(1)); // (1)\n" +
6661 				"		Integer i = al.get(0);  // (2)\n" +
6662 				"	}\n" +
6663 				"}\n",
6664 			},
6665 			"----------\n" +
6666 			"1. ERROR in X.java (at line 7)\n" +
6667 			"	Integer i = al.get(0);  // (2)\n" +
6668 			"	            ^^^^^^^^^\n" +
6669 			"Type mismatch: cannot convert from capture#2-of ? super Integer to Integer\n" +
6670 			"----------\n");
6671 	}
6672 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69141 variation
6673 	public void test0221() {
6674 		this.runNegativeTest(
6675 			new String[] {
6676 				"X.java",
6677 				"import java.util.ArrayList;\n" +
6678 				"\n" +
6679 				"public class X {\n" +
6680 				"	void foo() {\n" +
6681 				"		ArrayList<? extends Integer> al = new ArrayList<Integer>();\n" +
6682 				"		al.add(Integer.valueOf(1)); // (1)\n" +
6683 				"	}\n" +
6684 				"}\n",
6685 			},
6686 			"----------\n" +
6687 			"1. ERROR in X.java (at line 6)\n" +
6688 			"	al.add(Integer.valueOf(1)); // (1)\n" +
6689 			"	   ^^^\n" +
6690 			"The method add(capture#1-of ? extends Integer) in the type ArrayList<capture#1-of ? extends Integer> is not applicable for the arguments (Integer)\n" +
6691 			"----------\n");
6692 	}
6693 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69141: variation
6694 	public void test0222() {
6695 		this.runNegativeTest(
6696 			new String[] {
6697 				"X.java",
6698 				"public class X {\n" +
6699 				"	public static void main(String[] args) {\n" +
6700 				"		XList<? super Integer> lx = new XList<Integer>();\n" +
6701 				"		lx.slot = Integer.valueOf(1);\n" +
6702 				"		Integer i = lx.slot;\n" +
6703 				"    }    	\n" +
6704 				"}\n" +
6705 				"class XList<E> {\n" +
6706 				"    E slot;\n" +
6707 				"}\n",
6708 			},
6709 			"----------\n" +
6710 			"1. ERROR in X.java (at line 5)\n" +
6711 			"	Integer i = lx.slot;\n" +
6712 			"	            ^^^^^^^\n" +
6713 			"Type mismatch: cannot convert from capture#2-of ? super Integer to Integer\n" +
6714 			"----------\n");
6715 	}
6716 
6717 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69251- instantiating wildcards
6718 	public void test0223() {
6719 		Map customOptions = getCompilerOptions();
6720 		this.runNegativeTest(
6721 			new String[] {
6722 				"X.java",
6723 				"import java.util.HashMap;\n" +
6724 				"import java.util.Map;\n" +
6725 				"public class X {\n" +
6726 				"    static final Map<String, Class<? extends Object>> classes \n" +
6727 				"            = new HashMap<String, Class<? extends Object>>();\n" +
6728 				"    \n" +
6729 				"    static final Map<String, Class<? extends Object>> classes2 \n" +
6730 				"            = new HashMap<String, Class>();\n" +
6731 				"    \n" +
6732 				"    class MX<E> {\n" +
6733 				"    	E get() { return null; }\n" +
6734 				"    	void foo(E e) {}\n" +
6735 				"    }\n" +
6736 				"    \n" +
6737 				"    void foo() {\n" +
6738 				"    	MX<Class<? extends Object>> mx1 = new MX<Class<? extends Object>>();\n" +
6739 				"    	MX<Class> mx2 = new MX<Class>();\n" +
6740 				"    	mx1.foo(mx2.get());\n" +
6741 				"    }\n" +
6742 				"}\n"	,
6743 			},
6744 			"----------\n" +
6745 			"1. ERROR in X.java (at line 8)\n" +
6746 			"	= new HashMap<String, Class>();\n" +
6747 			"	  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
6748 			"Type mismatch: cannot convert from HashMap<String,Class> to Map<String,Class<? extends Object>>\n" +
6749 			"----------\n" +
6750 			"2. WARNING in X.java (at line 8)\n" +
6751 			"	= new HashMap<String, Class>();\n" +
6752 			"	                      ^^^^^\n" +
6753 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
6754 			"----------\n" +
6755 			"3. WARNING in X.java (at line 17)\n" +
6756 			"	MX<Class> mx2 = new MX<Class>();\n" +
6757 			"	   ^^^^^\n" +
6758 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
6759 			"----------\n" +
6760 			"4. WARNING in X.java (at line 17)\n" +
6761 			"	MX<Class> mx2 = new MX<Class>();\n" +
6762 			"	                       ^^^^^\n" +
6763 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
6764 			"----------\n" +
6765 			"5. WARNING in X.java (at line 18)\n" +
6766 			"	mx1.foo(mx2.get());\n" +
6767 			"	        ^^^^^^^^^\n" +
6768 			"Type safety: The expression of type Class needs unchecked conversion to conform to Class<? extends Object>\n" +
6769 			"----------\n",
6770 			null,
6771 			true,
6772 			customOptions);
6773 	}
6774 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=68998 variation
6775 	public void test0224() {
6776 		this.runNegativeTest(
6777 			new String[] {
6778 				"test/cheetah/NG.java",
6779 				"package test.cheetah;\n" +
6780 				"public class NG extends G {\n" +
6781 				"		public static void main(String[] args) {\n" +
6782 				"			System.out.println(\"SUCCESS\");	\n" +
6783 				"		}\n" +
6784 				"    public boolean test() {\n" +
6785 				"        return o == null;\n" +
6786 				"    }\n" +
6787 				"}\n",
6788 				"test/cheetah/G.java",
6789 				"package test.cheetah;\n" +
6790 				"public class G<E> {\n" +
6791 				"    protected final Object o;\n" +
6792 				"}\n",
6793 			},
6794 			"----------\n" +
6795 			"1. WARNING in test\\cheetah\\NG.java (at line 2)\n" +
6796 			"	public class NG extends G {\n" +
6797 			"	                        ^\n" +
6798 			"G is a raw type. References to generic type G<E> should be parameterized\n" +
6799 			"----------\n" +
6800 			"----------\n" +
6801 			"1. ERROR in test\\cheetah\\G.java (at line 3)\n" +
6802 			"	protected final Object o;\n" +
6803 			"	                       ^\n" +
6804 			"The blank final field o may not have been initialized\n" +
6805 			"----------\n");
6806 	}
6807 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69353 - prevent using type parameter in catch block
6808 	public void test0225() {
6809 		this.runNegativeTest(
6810 			new String[] {
6811 				"X.java",
6812 				"public class X <T extends Exception> {\n" +
6813 				"    String foo() throws T {\n" +
6814 				"        return \"SUCCESS\";\n" +
6815 				"    }\n" +
6816 				"    public static void main(String[] args) {\n" +
6817 				"        new X<EX>().baz(new EX());\n" +
6818 				"    }\n" +
6819 				"    void baz(final T t) {\n" +
6820 				"        new Object() {\n" +
6821 				"            void print() {\n" +
6822 				"                try {\n" +
6823 				"	                System.out.println(foo());\n" +
6824 				"                } catch (T t) {\n" +
6825 				"                }\n" +
6826 				"            }\n" +
6827 				"        }.print();\n" +
6828 				"    }\n" +
6829 				"}\n" +
6830 				"class EX extends Exception {\n" +
6831 				"}\n",
6832 			},
6833 			"----------\n" +
6834 			"1. ERROR in X.java (at line 13)\n" +
6835 			"	} catch (T t) {\n" +
6836 			"	           ^\n" +
6837 			"Cannot use the type parameter T in a catch block\n" +
6838 			"----------\n" +
6839 			"2. WARNING in X.java (at line 13)\n" +
6840 			"	} catch (T t) {\n" +
6841 			"	           ^\n" +
6842 			"The parameter t is hiding another local variable defined in an enclosing scope\n" +
6843 			"----------\n" +
6844 			"3. WARNING in X.java (at line 19)\n" +
6845 			"	class EX extends Exception {\n" +
6846 			"	      ^^\n" +
6847 			"The serializable class EX does not declare a static final serialVersionUID field of type long\n" +
6848 			"----------\n");
6849 	}
6850 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69170 - invalid generic array creation
6851 	public void test0226() {
6852 		this.runNegativeTest(
6853 			new String[] {
6854 				"X.java",
6855 				"public class X<T>{\n" +
6856 				"	 Object x1= new T[0];\n" +
6857 				"	 Object x2= new X<String>[0];	 \n" +
6858 				"	 Object x3= new X<T>[0];	 \n" +
6859 				"	 Object x4= new X[0];	 \n" +
6860 				"}\n",
6861 			},
6862 			"----------\n" +
6863 			"1. ERROR in X.java (at line 2)\n" +
6864 			"	Object x1= new T[0];\n" +
6865 			"	           ^^^^^^^^\n" +
6866 			"Cannot create a generic array of T\n" +
6867 			"----------\n" +
6868 			"2. ERROR in X.java (at line 3)\n" +
6869 			"	Object x2= new X<String>[0];	 \n" +
6870 			"	           ^^^^^^^^^^^^^^^^\n" +
6871 			"Cannot create a generic array of X<String>\n" +
6872 			"----------\n" +
6873 			"3. ERROR in X.java (at line 4)\n" +
6874 			"	Object x3= new X<T>[0];	 \n" +
6875 			"	           ^^^^^^^^^^^\n" +
6876 			"Cannot create a generic array of X<T>\n" +
6877 			"----------\n");
6878 	}
6879 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69359 - unsafe cast diagnosis
6880 	public void test0227() {
6881 		this.runNegativeTest(
6882 			new String[] {
6883 				"X.java",
6884 				" import java.util.*;\n" +
6885 				" public class X {\n" +
6886 				"  List list() { return null; }\n" +
6887 				"  void m() { List<X> l = (List<X>)list(); } // unsafe cast\n" +
6888 				"  void m0() { List<X> l = list(); } // unsafe conversion\n" +
6889 				"  void m1() { for (X a : list()); } // type mismatch\n" +
6890 				"  void m2() { for (Iterator<X> i = list().iterator(); i.hasNext();); }  // unsafe conversion\n" +
6891 				"  void m3() { Collection c = null; List l = (List<X>)c; } // unsafe cast\n" +
6892 				"  void m4() { Collection c = null; List l = (List<?>)c; } // ok\n" +
6893 				"  void m5() { List c = null; List l = (Collection<X>)c; } // type mismatch\n" +
6894 				"  void m6() { List c = null; List l = (Collection<?>)c; } // type mismatch\n" +
6895 				"}\n"	,
6896 			},
6897 			"----------\n" +
6898 			"1. WARNING in X.java (at line 3)\n" +
6899 			"	List list() { return null; }\n" +
6900 			"	^^^^\n" +
6901 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
6902 			"----------\n" +
6903 			"2. WARNING in X.java (at line 4)\n" +
6904 			"	void m() { List<X> l = (List<X>)list(); } // unsafe cast\n" +
6905 			"	                       ^^^^^^^^^^^^^^^\n" +
6906 			"Type safety: Unchecked cast from List to List<X>\n" +
6907 			"----------\n" +
6908 			"3. WARNING in X.java (at line 4)\n" +
6909 			"	void m() { List<X> l = (List<X>)list(); } // unsafe cast\n" +
6910 			"	                       ^^^^^^^^^^^^^^^\n" +
6911 			"Unnecessary cast from List to List<X>\n" +
6912 			"----------\n" +
6913 			"4. WARNING in X.java (at line 5)\n" +
6914 			"	void m0() { List<X> l = list(); } // unsafe conversion\n" +
6915 			"	                        ^^^^^^\n" +
6916 			"Type safety: The expression of type List needs unchecked conversion to conform to List<X>\n" +
6917 			"----------\n" +
6918 			"5. ERROR in X.java (at line 6)\n" +
6919 			"	void m1() { for (X a : list()); } // type mismatch\n" +
6920 			"	                       ^^^^^^\n" +
6921 			"Type mismatch: cannot convert from element type Object to X\n" +
6922 			"----------\n" +
6923 			"6. WARNING in X.java (at line 7)\n" +
6924 			"	void m2() { for (Iterator<X> i = list().iterator(); i.hasNext();); }  // unsafe conversion\n" +
6925 			"	                                 ^^^^^^^^^^^^^^^^^\n" +
6926 			"Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<X>\n" +
6927 			"----------\n" +
6928 			"7. WARNING in X.java (at line 8)\n" +
6929 			"	void m3() { Collection c = null; List l = (List<X>)c; } // unsafe cast\n" +
6930 			"	            ^^^^^^^^^^\n" +
6931 			"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
6932 			"----------\n" +
6933 			"8. WARNING in X.java (at line 8)\n" +
6934 			"	void m3() { Collection c = null; List l = (List<X>)c; } // unsafe cast\n" +
6935 			"	                                 ^^^^\n" +
6936 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
6937 			"----------\n" +
6938 			"9. WARNING in X.java (at line 8)\n" +
6939 			"	void m3() { Collection c = null; List l = (List<X>)c; } // unsafe cast\n" +
6940 			"	                                          ^^^^^^^^^^\n" +
6941 			"Type safety: Unchecked cast from Collection to List<X>\n" +
6942 			"----------\n" +
6943 			"10. WARNING in X.java (at line 9)\n" +
6944 			"	void m4() { Collection c = null; List l = (List<?>)c; } // ok\n" +
6945 			"	            ^^^^^^^^^^\n" +
6946 			"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
6947 			"----------\n" +
6948 			"11. WARNING in X.java (at line 9)\n" +
6949 			"	void m4() { Collection c = null; List l = (List<?>)c; } // ok\n" +
6950 			"	                                 ^^^^\n" +
6951 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
6952 			"----------\n" +
6953 			"12. WARNING in X.java (at line 10)\n" +
6954 			"	void m5() { List c = null; List l = (Collection<X>)c; } // type mismatch\n" +
6955 			"	            ^^^^\n" +
6956 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
6957 			"----------\n" +
6958 			"13. WARNING in X.java (at line 10)\n" +
6959 			"	void m5() { List c = null; List l = (Collection<X>)c; } // type mismatch\n" +
6960 			"	                           ^^^^\n" +
6961 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
6962 			"----------\n" +
6963 			"14. WARNING in X.java (at line 10)\n" +
6964 			"	void m5() { List c = null; List l = (Collection<X>)c; } // type mismatch\n" +
6965 			"	                                    ^^^^^^^^^^^^^^^^\n" +
6966 			"Type safety: Unchecked cast from List to Collection<X>\n" +
6967 			"----------\n" +
6968 			"15. ERROR in X.java (at line 10)\n" +
6969 			"	void m5() { List c = null; List l = (Collection<X>)c; } // type mismatch\n" +
6970 			"	                                    ^^^^^^^^^^^^^^^^\n" +
6971 			"Type mismatch: cannot convert from Collection<X> to List\n" +
6972 			"----------\n" +
6973 			"16. WARNING in X.java (at line 11)\n" +
6974 			"	void m6() { List c = null; List l = (Collection<?>)c; } // type mismatch\n" +
6975 			"	            ^^^^\n" +
6976 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
6977 			"----------\n" +
6978 			"17. WARNING in X.java (at line 11)\n" +
6979 			"	void m6() { List c = null; List l = (Collection<?>)c; } // type mismatch\n" +
6980 			"	                           ^^^^\n" +
6981 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
6982 			"----------\n" +
6983 			"18. ERROR in X.java (at line 11)\n" +
6984 			"	void m6() { List c = null; List l = (Collection<?>)c; } // type mismatch\n" +
6985 			"	                                    ^^^^^^^^^^^^^^^^\n" +
6986 			"Type mismatch: cannot convert from Collection<capture#2-of ?> to List\n" +
6987 			"----------\n");
6988 	}
6989 	// conversion from raw to X<?> is safe (no unsafe warning)
6990 	public void test0228() {
6991 		this.runConformTest(
6992 			new String[] {
6993 				"X.java",
6994 				" import java.util.*;\n" +
6995 				" public class X {\n" +
6996 				" 	List<?> list = new ArrayList();\n" +
6997 				" }\n",
6998 			},
6999 			"");
7000 	}
7001 	// can resolve member through type variable
7002 	public void test0229() {
7003 		runConformTest(
7004 			true,
7005 			new String[] {
7006 				"X.java",
7007 				" public class X <T extends XC> {\n" +
7008 				" 	T.MXC f;\n" +
7009 				" 	public static void main(String[] args) {\n" +
7010 				"		System.out.println(\"SUCCESS\");\n" +
7011 				"	}\n" +
7012 				" }\n" +
7013 				" class XC {\n" +
7014 				" 	class MXC {}\n" +
7015 				" }\n",
7016 			},
7017 			null,
7018 			"SUCCESS",
7019 			null,
7020 			JavacTestOptions.JavacHasABug.JavacBug6569404);
7021 	}
7022 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69375 - equivalence of wildcards
7023 	public void test0230() {
7024 		this.runNegativeTest(
7025 			new String[] {
7026 				"X.java",
7027 				"import java.util.List;\n" +
7028 				"\n" +
7029 				"public class X {\n" +
7030 				"	void foo() {\n" +
7031 				"		List<? extends Integer> li= null;\n" +
7032 				"		List<? extends Number> ln= null;\n" +
7033 				"		ln = li;\n" +
7034 				"		li= ln;\n" +
7035 				"	}\n" +
7036 				"}\n",
7037 			},
7038 			"----------\n" +
7039 			"1. ERROR in X.java (at line 8)\n" +
7040 			"	li= ln;\n" +
7041 			"	    ^^\n" +
7042 			"Type mismatch: cannot convert from List<capture#4-of ? extends Number> to List<? extends Integer>\n" +
7043 			"----------\n");
7044 	}
7045 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69170 - variation
7046 	public void test0231() {
7047 		this.runNegativeTest(
7048 			new String[] {
7049 				"X.java",
7050 				"public class X<T>{\n" +
7051 				"	 Object x1= new X<?>[0];	 \n" +
7052 				"	 Object x2= new X<? super String>[0];	 \n" +
7053 				"	 Object x3= new X<? extends Thread>[0];	 \n" +
7054 				"}\n",
7055 			},
7056 			"----------\n" +
7057 			"1. ERROR in X.java (at line 3)\n" +
7058 			"	Object x2= new X<? super String>[0];	 \n" +
7059 			"	           ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
7060 			"Cannot create a generic array of X<? super String>\n" +
7061 			"----------\n" +
7062 			"2. ERROR in X.java (at line 4)\n" +
7063 			"	Object x3= new X<? extends Thread>[0];	 \n" +
7064 			"	           ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
7065 			"Cannot create a generic array of X<? extends Thread>\n" +
7066 			"----------\n");
7067 	}
7068 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69542 - generic cast should be less strict
7069 	public void test0232() {
7070 		this.runConformTest(
7071 			new String[] {
7072 				"X.java",
7073 				"public class X {\n" +
7074 				" 	static class Container<T>{\n" +
7075 				"	    private T val;\n" +
7076 				"	    public T getVal() {\n" +
7077 				"	        return val;\n" +
7078 				"	    }\n" +
7079 				"	    public void setVal(T val) {\n" +
7080 				"	        this.val = val;\n" +
7081 				"	    }\n" +
7082 				"	}\n" +
7083 				"	public static void badMethod(Container<?> param){\n" +
7084 				"	    Container x=param;\n" +
7085 				"	    x.setVal(\"BAD\");\n" +
7086 				"	}\n" +
7087 				"	public static void main(String[] args) {\n" +
7088 				"	    Container<Integer> cont=new Container<Integer>();\n" +
7089 				"	    cont.setVal(new Integer(0));\n" +
7090 				"	    badMethod(cont);\n" +
7091 				"	    Object someVal = cont.getVal(); // no cast \n" +
7092 				"	    System.out.println(cont.getVal()); // no cast \n" +
7093 				"	}\n" +
7094 				"}\n",
7095 			},
7096 			"BAD");
7097 	}
7098 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69542 - variation
7099 	public void test0233() {
7100 		this.runConformTest(
7101 			new String[] {
7102 				"X.java",
7103 				"public class X {\n" +
7104 				" 	static class Container<T>{\n" +
7105 				"	    private T val;\n" +
7106 				"	    public T getVal() {\n" +
7107 				"	        return val;\n" +
7108 				"	    }\n" +
7109 				"	    public void setVal(T val) {\n" +
7110 				"	        this.val = val;\n" +
7111 				"	    }\n" +
7112 				"	}\n" +
7113 				"	public static void badMethod(Container<?> param){\n" +
7114 				"	    Container x=param;\n" +
7115 				"	    x.setVal(new Long(0));\n" +
7116 				"	}\n" +
7117 				"	public static void main(String[] args) {\n" +
7118 				"	    Container<Integer> cont=new Container<Integer>();\n" +
7119 				"	    cont.setVal(new Integer(0));\n" +
7120 				"	    badMethod(cont);\n" +
7121 				"	    Number someVal = cont.getVal();// only cast to Number \n" +
7122 				"	    System.out.println(\"SUCCESS\"); \n" +
7123 				"	}\n" +
7124 				"}\n",
7125 			},
7126 			"SUCCESS");
7127 	}
7128 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69542 - variation
7129 	public void test0234() {
7130 		this.runConformTest(
7131 			new String[] {
7132 				"X.java",
7133 				"public class X {\n" +
7134 				" 	static class Container<T>{\n" +
7135 				"	    public T val;\n" +
7136 				"	    public T getVal() {\n" +
7137 				"	        return val;\n" +
7138 				"	    }\n" +
7139 				"	    public void setVal(T val) {\n" +
7140 				"	        this.val = val;\n" +
7141 				"	    }\n" +
7142 				"	}\n" +
7143 				"	public static void badMethod(Container<?> param){\n" +
7144 				"	    Container x=param;\n" +
7145 				"	    x.setVal(\"BAD\");\n" +
7146 				"	}\n" +
7147 				"	public static void main(String[] args) {\n" +
7148 				"	    Container<Integer> cont=new Container<Integer>();\n" +
7149 				"	    cont.setVal(new Integer(0));\n" +
7150 				"	    badMethod(cont);\n" +
7151 				"	    Object someVal = cont.val; // no cast \n" +
7152 				"	    System.out.println(cont.val); // no cast \n" +
7153 				"	}\n" +
7154 				"}\n",
7155 			},
7156 			"BAD");
7157 	}
7158 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69542 - variation
7159 	public void test0235() {
7160 		this.runConformTest(
7161 			new String[] {
7162 				"X.java",
7163 				"public class X {\n" +
7164 				" 	static class Container<T>{\n" +
7165 				"	    public T val;\n" +
7166 				"	    public T getVal() {\n" +
7167 				"	        return val;\n" +
7168 				"	    }\n" +
7169 				"	    public void setVal(T val) {\n" +
7170 				"	        this.val = val;\n" +
7171 				"	    }\n" +
7172 				"	}\n" +
7173 				"	public static void badMethod(Container<?> param){\n" +
7174 				"	    Container x=param;\n" +
7175 				"	    x.setVal(new Long(0));\n" +
7176 				"	}\n" +
7177 				"	public static void main(String[] args) {\n" +
7178 				"	    Container<Integer> cont=new Container<Integer>();\n" +
7179 				"	    cont.setVal(new Integer(0));\n" +
7180 				"	    badMethod(cont);\n" +
7181 				"	    Number someVal = cont.val;// only cast to Number \n" +
7182 				"	    System.out.println(\"SUCCESS\"); \n" +
7183 				"	}\n" +
7184 				"}\n",
7185 			},
7186 			"SUCCESS");
7187 	}
7188 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69542 - variation
7189 	public void test0236() {
7190 		this.runConformTest(
7191 			new String[] {
7192 				"X.java",
7193 				"public class X {\n" +
7194 				" 	static class Container<T>{\n" +
7195 				"	    public T val;\n" +
7196 				"	    public T getVal() {\n" +
7197 				"	        return val;\n" +
7198 				"	    }\n" +
7199 				"	    public void setVal(T val) {\n" +
7200 				"	        this.val = val;\n" +
7201 				"	    }\n" +
7202 				"	}\n" +
7203 				"	public static void badMethod(Container<?> param){\n" +
7204 				"	    Container x=param;\n" +
7205 				"	    x.setVal(\"BAD\");\n" +
7206 				"	}\n" +
7207 				"	public static void main(String[] args) {\n" +
7208 				"	    Container<Integer> cont=new Container<Integer>();\n" +
7209 				"	    cont.setVal(new Integer(0));\n" +
7210 				"	    badMethod(cont);\n" +
7211 				"	    Object someVal = (cont).val; // no cast \n" +
7212 				"	    System.out.println((cont).val); // no cast \n" +
7213 				"	}\n" +
7214 				"}\n",
7215 			},
7216 			"BAD");
7217 	}
7218 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69542 - variation
7219 	public void test0237() {
7220 		this.runConformTest(
7221 			new String[] {
7222 				"X.java",
7223 				"public class X {\n" +
7224 				" 	static class Container<T>{\n" +
7225 				"	    public T val;\n" +
7226 				"	    public T getVal() {\n" +
7227 				"	        return val;\n" +
7228 				"	    }\n" +
7229 				"	    public void setVal(T val) {\n" +
7230 				"	        this.val = val;\n" +
7231 				"	    }\n" +
7232 				"	}\n" +
7233 				"	public static void badMethod(Container<?> param){\n" +
7234 				"	    Container x=param;\n" +
7235 				"	    x.setVal(new Long(0));\n" +
7236 				"	}\n" +
7237 				"	public static void main(String[] args) {\n" +
7238 				"	    Container<Integer> cont=new Container<Integer>();\n" +
7239 				"	    cont.setVal(new Integer(0));\n" +
7240 				"	    badMethod(cont);\n" +
7241 				"	    Number someVal = (cont).val;// only cast to Number \n" +
7242 				"	    System.out.println(\"SUCCESS\"); \n" +
7243 				"	}\n" +
7244 				"}\n",
7245 			},
7246 			"SUCCESS");
7247 	}
7248 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69542 - variation
7249 	public void test0238() {
7250 		this.runConformTest(
7251 			new String[] {
7252 				"X.java",
7253 				"public class X {\n" +
7254 				" 	static class Container<T>{\n" +
7255 				"	    public T val;\n" +
7256 				"		Container<T> next;\n" +
7257 				"	    public T getVal() {\n" +
7258 				"	        return val;\n" +
7259 				"	    }\n" +
7260 				"	    public void setVal(T val) {\n" +
7261 				"	        this.val = val;\n" +
7262 				"	    }\n" +
7263 				"	}\n" +
7264 				"	public static void badMethod(Container<?> param){\n" +
7265 				"	    Container x=param;\n" +
7266 				"	    x.setVal(\"BAD\");\n" +
7267 				"	}\n" +
7268 				"	public static void main(String[] args) {\n" +
7269 				"	    Container<Integer> cont = new Container<Integer>();\n" +
7270 				"		cont.next = new Container<Integer>();\n" +
7271 				"	    cont.next.setVal(new Integer(0));\n" +
7272 				"	    badMethod(cont.next);\n" +
7273 				"	    Object someVal = cont.next.val; // no cast \n" +
7274 				"	    System.out.println(cont.next.val); // no cast \n" +
7275 				"	}\n" +
7276 				"}\n",
7277 			},
7278 			"BAD");
7279 	}
7280 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69542 - variation
7281 	public void test0239() {
7282 		this.runConformTest(
7283 			new String[] {
7284 				"X.java",
7285 				"public class X {\n" +
7286 				" 	static class Container<T>{\n" +
7287 				"	    public T val;\n" +
7288 				"		Container<T> next;\n" +
7289 				"	    public T getVal() {\n" +
7290 				"	        return val;\n" +
7291 				"	    }\n" +
7292 				"	    public void setVal(T val) {\n" +
7293 				"	        this.val = val;\n" +
7294 				"	    }\n" +
7295 				"	}\n" +
7296 				"	public static void badMethod(Container<?> param){\n" +
7297 				"	    Container x=param;\n" +
7298 				"	    x.setVal(new Long(0));\n" +
7299 				"	}\n" +
7300 				"	public static void main(String[] args) {\n" +
7301 				"	    Container<Integer> cont = new Container<Integer>();\n" +
7302 				"		cont.next = new Container<Integer>();\n" +
7303 				"	    cont.next.setVal(new Integer(0));\n" +
7304 				"	    badMethod(cont.next);\n" +
7305 				"	    Number someVal = cont.next.val;// only cast to Number \n" +
7306 				"	    System.out.println(\"SUCCESS\"); \n" +
7307 				"	}\n" +
7308 				"}\n",
7309 			},
7310 			"SUCCESS");
7311 	}
7312 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69713 NPE due to length pseudo field
7313 	public void test0240() {
7314 		this.runNegativeTest(
7315 			new String[] {
7316 				"X.java",
7317 			"public class X {\n" +
7318 			"    String[] elements = null;\n" +
7319 			"	\n" +
7320 			"    public X() {\n" +
7321 			"        String s = \"a, b, c, d\";\n" +
7322 			"        elements = s.split(\",\");\n" +
7323 			"        if(elements.length = 3) {\n" +
7324 			"        }\n" +
7325 			"    }\n" +
7326 			"}\n"
7327 			},
7328 			"----------\n" +
7329 			"1. ERROR in X.java (at line 7)\n" +
7330 			"	if(elements.length = 3) {\n" +
7331 			"	   ^^^^^^^^^^^^^^^^^^^\n" +
7332 			"Type mismatch: cannot convert from int to boolean\n" +
7333 			"----------\n");
7334 	}
7335 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69776 - missing checkcast on cast operation
7336 	public void test0241() {
7337 		this.runConformTest(
7338 			new String[] {
7339 				"X.java",
7340 				"import java.util.HashMap;\n" +
7341 				"import java.util.Map;\n" +
7342 				"public class X {\n" +
7343 				"    private static final Map<String, Class> classes = new HashMap<String, Class>();\n" +
7344 				"    public static void main(String[] args) throws Exception {\n" +
7345 				"    	classes.put(\"test\", X.class);\n" +
7346 				"        final Class<? extends Object> clazz = (Class<? extends Object>) classes.get(\"test\");\n" +
7347 				"        Object o = clazz.newInstance();\n" +
7348 				"        System.out.println(\"SUCCESS\");\n" +
7349 				"    }\n" +
7350 				"}\n",
7351 			},
7352 			"SUCCESS");
7353 	}
7354 	// 69776 - variation
7355 	public void test0242() {
7356 		Map<String,String> options = getCompilerOptions();
7357 		options.put(CompilerOptions.OPTION_ReportDeprecation, CompilerOptions.IGNORE);
7358 		this.runNegativeTest(
7359 			new String[] {
7360 				"X.java",
7361 				"import java.util.HashMap;\n" +
7362 				"import java.util.Map;\n" +
7363 				"@SuppressWarnings({\"rawtypes\"})\n" +
7364 				"public class X {\n" +
7365 				"    private static final Map<String, Class> classes = new HashMap<String, Class>();\n" +
7366 				"    public static void main(String[] args) throws Exception {\n" +
7367 				"    	classes.put(\"test\", X.class);\n" +
7368 				"        final Class<? extends Object> clazz = (Class<? extends Object>) classes.get(\"test\");\n" +
7369 				"        final Class<? extends String> clazz2 = (Class<? extends String>) classes.get(\"test\");\n" +
7370 				"        final Class<String> clazz3 = (Class<String>) classes.get(\"test\");\n" +
7371 				"        Object o = clazz.newInstance();\n" +
7372 				"    }\n" +
7373 				"}", // =================
7374 			},
7375 			"----------\n" +
7376 			"1. WARNING in X.java (at line 8)\n" +
7377 			"	final Class<? extends Object> clazz = (Class<? extends Object>) classes.get(\"test\");\n" +
7378 			"	                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
7379 			"Type safety: Unchecked cast from Class to Class<? extends Object>\n" +
7380 			"----------\n" +
7381 			"2. WARNING in X.java (at line 8)\n" +
7382 			"	final Class<? extends Object> clazz = (Class<? extends Object>) classes.get(\"test\");\n" +
7383 			"	                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
7384 			"Unnecessary cast from Class to Class<? extends Object>\n" +
7385 			"----------\n" +
7386 			"3. WARNING in X.java (at line 9)\n" +
7387 			"	final Class<? extends String> clazz2 = (Class<? extends String>) classes.get(\"test\");\n" +
7388 			"	                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
7389 			"Type safety: Unchecked cast from Class to Class<? extends String>\n" +
7390 			"----------\n" +
7391 			"4. WARNING in X.java (at line 9)\n" +
7392 			"	final Class<? extends String> clazz2 = (Class<? extends String>) classes.get(\"test\");\n" +
7393 			"	                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
7394 			"Unnecessary cast from Class to Class<? extends String>\n" +
7395 			"----------\n" +
7396 			"5. WARNING in X.java (at line 10)\n" +
7397 			"	final Class<String> clazz3 = (Class<String>) classes.get(\"test\");\n" +
7398 			"	                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
7399 			"Type safety: Unchecked cast from Class to Class<String>\n" +
7400 			"----------\n" +
7401 			"6. WARNING in X.java (at line 10)\n" +
7402 			"	final Class<String> clazz3 = (Class<String>) classes.get(\"test\");\n" +
7403 			"	                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
7404 			"Unnecessary cast from Class to Class<String>\n" +
7405 			"----------\n",
7406 			null, true, options );
7407 	}
7408 	public void test0243() {
7409 		this.runConformTest(
7410 			new String[] {
7411 				"X.java",
7412 				"public class X {\n" +
7413 				"    public X foo() {\n" +
7414 				"        System.out.println(\"Did NOT add bridge method\");\n" +
7415 				"        return this;\n" +
7416 				"    }\n" +
7417 				"    public static void main(String[] args) throws Exception {\n" +
7418 				"        X x = new A();\n" +
7419 				"        x.foo();\n" +
7420 				"        System.out.print(\" + \");\n" +
7421 				"        I i = new A();\n" +
7422 				"        i.foo();\n" +
7423 				"    }\n" +
7424 				"}\n" +
7425 				"interface I {\n" +
7426 				"    public I foo();\n" +
7427 				"}\n" +
7428 				"class A extends X implements I {\n" +
7429 				"    public A foo() {\n" +
7430 				"        System.out.print(\"Added bridge method\");\n" +
7431 				"        return this;\n" +
7432 				"    }\n" +
7433 				"}\n"
7434 			},
7435 			"Added bridge method + Added bridge method");
7436 		this.runNegativeTest(
7437 			new String[] {
7438 				"X.java",
7439 				"public class X {\n" +
7440 				"    public X foo() { return this; }\n" +
7441 				"    public static void main(String[] args) throws Exception {\n" +
7442 				"        System.out.println(\"SUCCESS\");\n" +
7443 				"    }\n" +
7444 				"}\n",
7445 				"SubTypes.java",
7446 				"class A extends X {\n" +
7447 				"    @Override public A foo() { return this; }\n" +
7448 				"}\n" +
7449 				"class B extends X {\n" +
7450 				"    @Override public X foo() { return new X(); }\n" +
7451 				"    @Override public B foo() { return this; }\n" +
7452 				"}\n" +
7453 				"class C extends A {\n" +
7454 				"    @Override public X foo() { return new X(); }\n" +
7455 				"}\n"
7456 			},
7457 			"----------\n" +
7458 			"1. ERROR in SubTypes.java (at line 5)\n" +
7459 			"	@Override public X foo() { return new X(); }\n" +
7460 			"	                   ^^^^^\n" +
7461 			"Duplicate method foo() in type B\n" +
7462 			"----------\n" +
7463 			"2. ERROR in SubTypes.java (at line 6)\n" +
7464 			"	@Override public B foo() { return this; }\n" +
7465 			"	                   ^^^^^\n" +
7466 			"Duplicate method foo() in type B\n" +
7467 			"----------\n" +
7468 			"3. ERROR in SubTypes.java (at line 9)\n" +
7469 			"	@Override public X foo() { return new X(); }\n" +
7470 			"	                 ^\n" +
7471 			"The return type is incompatible with A.foo()\n" +
7472 			"----------\n");
7473 	}
7474 	// generic method of raw type
7475 	public void test0244() {
7476 		this.runNegativeTest(
7477 			new String[] {
7478 				"X.java",
7479 				"public class X <T> { \n" +
7480 				"	<G> T foo(G g) {\n" +
7481 				"		return null;\n" +
7482 				"	}\n" +
7483 				"	\n" +
7484 				"	public static void main(String[] args) {\n" +
7485 				"		X rx = new X();\n" +
7486 				"		rx.foo(\"hello\");\n" +
7487 				"	}\n" +
7488 				"}\n"
7489 			},
7490 			"----------\n" +
7491 			"1. WARNING in X.java (at line 7)\n" +
7492 			"	X rx = new X();\n" +
7493 			"	^\n" +
7494 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
7495 			"----------\n" +
7496 			"2. WARNING in X.java (at line 7)\n" +
7497 			"	X rx = new X();\n" +
7498 			"	           ^\n" +
7499 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
7500 			"----------\n" +
7501 			"3. WARNING in X.java (at line 8)\n" +
7502 			"	rx.foo(\"hello\");\n" +
7503 			"	^^^^^^^^^^^^^^^\n" +
7504 			"Type safety: The method foo(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
7505 			"----------\n");
7506 	}
7507 	// generic method of raw type
7508 	public void test0245() {
7509 		if (this.complianceLevel < ClassFileConstants.JDK1_7) {
7510 			this.runNegativeTest(
7511 					new String[] {
7512 						"X.java",
7513 						"public class X <T> { \n" +
7514 						"        <G> T foo(G g) {\n" +
7515 						"            return null;\n" +
7516 						"        }\n" +
7517 						"        T bar(T t) {\n" +
7518 						"        	return zork;\n" +
7519 						"        }\n" +
7520 						"\n" +
7521 						"        public static void main(String[] args) {\n" +
7522 						"                X rx = new X();\n" +
7523 						"                rx.<String>foo(\"hello\"); // Eclipse error here\n" +
7524 						"                rx.<String>bar(\"hello\"); // Eclipse error here\n" +
7525 						"        }\n" +
7526 						"}\n"
7527 					},
7528 					"----------\n" +
7529 					"1. ERROR in X.java (at line 6)\n" +
7530 					"	return zork;\n" +
7531 					"	       ^^^^\n" +
7532 					"zork cannot be resolved to a variable\n" +
7533 					"----------\n" +
7534 					"2. WARNING in X.java (at line 10)\n" +
7535 					"	X rx = new X();\n" +
7536 					"	^\n" +
7537 					"X is a raw type. References to generic type X<T> should be parameterized\n" +
7538 					"----------\n" +
7539 					"3. WARNING in X.java (at line 10)\n" +
7540 					"	X rx = new X();\n" +
7541 					"	           ^\n" +
7542 					"X is a raw type. References to generic type X<T> should be parameterized\n" +
7543 					"----------\n" +
7544 					"4. ERROR in X.java (at line 11)\n" +
7545 					"	rx.<String>foo(\"hello\"); // Eclipse error here\n" +
7546 					"	           ^^^\n" +
7547 					"The method foo(Object) of raw type X is no longer generic; it cannot be parameterized with arguments <String>\n" +
7548 					"----------\n" +
7549 					"5. ERROR in X.java (at line 12)\n" +
7550 					"	rx.<String>bar(\"hello\"); // Eclipse error here\n" +
7551 					"	           ^^^\n" +
7552 					"The method bar(Object) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
7553 					"----------\n",
7554 					JavacTestOptions.EclipseHasABug.EclipseBug236242);
7555 			return;
7556 		}
7557 		this.runNegativeTest(
7558 				new String[] {
7559 					"X.java",
7560 					"public class X <T> { \n" +
7561 					"        <G> T foo(G g) {\n" +
7562 					"            return null;\n" +
7563 					"        }\n" +
7564 					"        T bar(T t) {\n" +
7565 					"        	return zork;\n" +
7566 					"        }\n" +
7567 					"\n" +
7568 					"        public static void main(String[] args) {\n" +
7569 					"                X rx = new X();\n" +
7570 					"                rx.<String>foo(\"hello\"); // Eclipse error here\n" +
7571 					"                rx.<String>bar(\"hello\"); // Eclipse error here\n" +
7572 					"        }\n" +
7573 					"}\n"
7574 				},
7575 				"----------\n" +
7576 				"1. ERROR in X.java (at line 6)\n" +
7577 				"	return zork;\n" +
7578 				"	       ^^^^\n" +
7579 				"zork cannot be resolved to a variable\n" +
7580 				"----------\n" +
7581 				"2. WARNING in X.java (at line 10)\n" +
7582 				"	X rx = new X();\n" +
7583 				"	^\n" +
7584 				"X is a raw type. References to generic type X<T> should be parameterized\n" +
7585 				"----------\n" +
7586 				"3. WARNING in X.java (at line 10)\n" +
7587 				"	X rx = new X();\n" +
7588 				"	           ^\n" +
7589 				"X is a raw type. References to generic type X<T> should be parameterized\n" +
7590 				"----------\n" +
7591 				"4. WARNING in X.java (at line 11)\n" +
7592 				"	rx.<String>foo(\"hello\"); // Eclipse error here\n" +
7593 				"	^^^^^^^^^^^^^^^^^^^^^^^\n" +
7594 				"Type safety: The method foo(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
7595 				"----------\n" +
7596 				"5. WARNING in X.java (at line 12)\n" +
7597 				"	rx.<String>bar(\"hello\"); // Eclipse error here\n" +
7598 				"	^^^^^^^^^^^^^^^^^^^^^^^\n" +
7599 				"Type safety: The method bar(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
7600 				"----------\n" +
7601 				"6. WARNING in X.java (at line 12)\n" +
7602 				"	rx.<String>bar(\"hello\"); // Eclipse error here\n" +
7603 				"	    ^^^^^^\n" +
7604 				"Unused type arguments for the non generic method bar(Object) of type X; it should not be parameterized with arguments <String>\n" +
7605 				"----------\n",
7606 				JavacTestOptions.EclipseHasABug.EclipseBug236242);
7607 	}
7608 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69320 parameterized type compatibility
7609 	public void test0246() {
7610 		this.runNegativeTest(
7611 			new String[] {
7612 				"X.java",
7613 				"public class X { \n" +
7614 				"    class MX<E> {\n" +
7615 				"    }\n" +
7616 				"    void foo() {\n" +
7617 				"      MX<Class<? extends Object>> mx2 = new MX<Class>();\n" +
7618 				"    }\n" +
7619 				"}\n"
7620 			},
7621 			"----------\n" +
7622 			"1. ERROR in X.java (at line 5)\n" +
7623 			"	MX<Class<? extends Object>> mx2 = new MX<Class>();\n" +
7624 			"	                                  ^^^^^^^^^^^^^^^\n" +
7625 			"Type mismatch: cannot convert from X.MX<Class> to X.MX<Class<? extends Object>>\n" +
7626 			"----------\n" +
7627 			"2. WARNING in X.java (at line 5)\n" +
7628 			"	MX<Class<? extends Object>> mx2 = new MX<Class>();\n" +
7629 			"	                                         ^^^^^\n" +
7630 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
7631 			"----------\n");
7632 	}
7633 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69320 variation
7634 	public void test0247() {
7635 		this.runNegativeTest(
7636 			new String[] {
7637 				"X.java",
7638 				"public class X { \n" +
7639 				"    void foo() {\n" +
7640 				"      MX<Class<? extends Object>> mx2 = new MX<Class>(); // wrong\n" +
7641 				"      MX<Class<? extends Object>> mx3 = new MX<Class<? extends String>>(); // wrong\n" +
7642 				"      MX<Class<? extends Object>> mx4 = new MX<Class<String>>(); // wrong\n" +
7643 				"      MX<? extends Class> mx5 = new MX<Class>(); // ok\n" +
7644 				"      MX<? super Class> mx6 = new MX<Class>(); // ok\n" +
7645 				"      MX<Class<? extends Class>> mx7 = new MX<Class<Class>>(); // wrong\n" +
7646 				"      MX<MX<? extends Class>> mx8 = new MX<MX<Class>>(); // wrong\n" +
7647 				"    }\n" +
7648 				"}\n" +
7649 				"\n" +
7650 				"class MX<E> {\n" +
7651 				"}\n"
7652 			},
7653 			"----------\n" +
7654 			"1. ERROR in X.java (at line 3)\n" +
7655 			"	MX<Class<? extends Object>> mx2 = new MX<Class>(); // wrong\n" +
7656 			"	                                  ^^^^^^^^^^^^^^^\n" +
7657 			"Type mismatch: cannot convert from MX<Class> to MX<Class<? extends Object>>\n" +
7658 			"----------\n" +
7659 			"2. WARNING in X.java (at line 3)\n" +
7660 			"	MX<Class<? extends Object>> mx2 = new MX<Class>(); // wrong\n" +
7661 			"	                                         ^^^^^\n" +
7662 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
7663 			"----------\n" +
7664 			"3. ERROR in X.java (at line 4)\n" +
7665 			"	MX<Class<? extends Object>> mx3 = new MX<Class<? extends String>>(); // wrong\n" +
7666 			"	                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
7667 			"Type mismatch: cannot convert from MX<Class<? extends String>> to MX<Class<? extends Object>>\n" +
7668 			"----------\n" +
7669 			"4. ERROR in X.java (at line 5)\n" +
7670 			"	MX<Class<? extends Object>> mx4 = new MX<Class<String>>(); // wrong\n" +
7671 			"	                                  ^^^^^^^^^^^^^^^^^^^^^^^\n" +
7672 			"Type mismatch: cannot convert from MX<Class<String>> to MX<Class<? extends Object>>\n" +
7673 			"----------\n" +
7674 			"5. WARNING in X.java (at line 6)\n" +
7675 			"	MX<? extends Class> mx5 = new MX<Class>(); // ok\n" +
7676 			"	             ^^^^^\n" +
7677 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
7678 			"----------\n" +
7679 			"6. WARNING in X.java (at line 6)\n" +
7680 			"	MX<? extends Class> mx5 = new MX<Class>(); // ok\n" +
7681 			"	                                 ^^^^^\n" +
7682 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
7683 			"----------\n" +
7684 			"7. WARNING in X.java (at line 7)\n" +
7685 			"	MX<? super Class> mx6 = new MX<Class>(); // ok\n" +
7686 			"	           ^^^^^\n" +
7687 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
7688 			"----------\n" +
7689 			"8. WARNING in X.java (at line 7)\n" +
7690 			"	MX<? super Class> mx6 = new MX<Class>(); // ok\n" +
7691 			"	                               ^^^^^\n" +
7692 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
7693 			"----------\n" +
7694 			"9. WARNING in X.java (at line 8)\n" +
7695 			"	MX<Class<? extends Class>> mx7 = new MX<Class<Class>>(); // wrong\n" +
7696 			"	                   ^^^^^\n" +
7697 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
7698 			"----------\n" +
7699 			"10. ERROR in X.java (at line 8)\n" +
7700 			"	MX<Class<? extends Class>> mx7 = new MX<Class<Class>>(); // wrong\n" +
7701 			"	                                 ^^^^^^^^^^^^^^^^^^^^^^\n" +
7702 			"Type mismatch: cannot convert from MX<Class<Class>> to MX<Class<? extends Class>>\n" +
7703 			"----------\n" +
7704 			"11. WARNING in X.java (at line 8)\n" +
7705 			"	MX<Class<? extends Class>> mx7 = new MX<Class<Class>>(); // wrong\n" +
7706 			"	                                              ^^^^^\n" +
7707 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
7708 			"----------\n" +
7709 			"12. WARNING in X.java (at line 9)\n" +
7710 			"	MX<MX<? extends Class>> mx8 = new MX<MX<Class>>(); // wrong\n" +
7711 			"	                ^^^^^\n" +
7712 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
7713 			"----------\n" +
7714 			"13. ERROR in X.java (at line 9)\n" +
7715 			"	MX<MX<? extends Class>> mx8 = new MX<MX<Class>>(); // wrong\n" +
7716 			"	                              ^^^^^^^^^^^^^^^^^^^\n" +
7717 			"Type mismatch: cannot convert from MX<MX<Class>> to MX<MX<? extends Class>>\n" +
7718 			"----------\n" +
7719 			"14. WARNING in X.java (at line 9)\n" +
7720 			"	MX<MX<? extends Class>> mx8 = new MX<MX<Class>>(); // wrong\n" +
7721 			"	                                        ^^^^^\n" +
7722 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
7723 			"----------\n");
7724 	}
7725 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=70247 check type variable is bound during super type resolution
7726 	public void test0248() {
7727 		this.runNegativeTest(
7728 			new String[] {
7729 				"X.java",
7730 				"import java.util.*;\n" +
7731 				"public class X<T> extends Vector<? super X<int[]>>{}\n"			},
7732 			"----------\n" +
7733 			"1. ERROR in X.java (at line 2)\n" +
7734 			"	public class X<T> extends Vector<? super X<int[]>>{}\n" +
7735 			"	                          ^^^^^^\n" +
7736 			"The type X cannot extend or implement Vector<? super X<int[]>>. A supertype may not specify any wildcard\n" +
7737 			"----------\n");
7738 	}
7739 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=70247 variation
7740 	public void test0249() {
7741 		this.runNegativeTest(
7742 			new String[] {
7743 				"X.java",
7744 				"import java.util.*;\n" +
7745 				"public class X<T> implements List<? super X<int[]>>{}\n"
7746 			},
7747 			"----------\n" +
7748 			"1. ERROR in X.java (at line 2)\n" +
7749 			"	public class X<T> implements List<? super X<int[]>>{}\n" +
7750 			"	                             ^^^^\n" +
7751 			"The type X cannot extend or implement List<? super X<int[]>>. A supertype may not specify any wildcard\n" +
7752 			"----------\n");
7753 	}
7754 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=70295 Class<? extends Object> is compatible with Class<?>
7755 	public void test0250() {
7756 		this.runConformTest(
7757 			new String[] {
7758 				"X.java",
7759 				"public class X {\n" +
7760 				"    void test(Object o) {\n" +
7761 				"        X.class.isAssignableFrom(o.getClass());\n" +
7762 				"    }\n" +
7763 				"}\n"
7764 			},
7765 			"");
7766 	}
7767 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69800 '? extends Object' is not compatible with A
7768 	public void test0251() {
7769 		this.runNegativeTest(
7770 			new String[] {
7771 				"X.java",
7772 				"@SuppressWarnings(\"deprecation\")\n" +
7773 				"public class X { \n" +
7774 				"    static class A {\n" +
7775 				"    }\n" +
7776 				"    A test() throws Exception {\n" +
7777 				"        Class<? extends Object> clazz = null;\n" +
7778 				"        return clazz.newInstance(); // ? extends Object\n" +
7779 				"    }\n" +
7780 				"}\n"
7781 			},
7782 			"----------\n" +
7783 			"1. ERROR in X.java (at line 7)\n" +
7784 			"	return clazz.newInstance(); // ? extends Object\n" +
7785 			"	       ^^^^^^^^^^^^^^^^^^^\n" +
7786 			"Type mismatch: cannot convert from capture#1-of ? extends Object to X.A\n" +
7787 			"----------\n");
7788 	}
7789 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69799 NPE in foreach checkcast
7790 	// effective result may change depending upon
7791 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=148241
7792 	// **
7793 	public void test0252() {
7794 		this.runNegativeTest(
7795 			new String[] {
7796 				"X.java",
7797 				"import java.util.*;\n" +
7798 				"public class X {\n" +
7799 				"	public static void main(String[] args) {\n" +
7800 				"		Set<X> channel = channels.get(0);\n" +
7801 				"	    for (Iterator<X> iter = channel.iterator(); iter.hasNext();) {\n" +
7802 				"	        Set<X> element;\n" +
7803 				"	        element = (Set<X>) iter.next();\n" +
7804 				"		}\n" +
7805 				"	}\n" +
7806 				"}\n"
7807 			},
7808 			"----------\n" +
7809 			"1. ERROR in X.java (at line 4)\n" +
7810 			"	Set<X> channel = channels.get(0);\n" +
7811 			"	                 ^^^^^^^^\n" +
7812 			"channels cannot be resolved\n" +
7813 			"----------\n" +
7814 			"2. WARNING in X.java (at line 7)\n" +
7815 			"	element = (Set<X>) iter.next();\n" +
7816 			"	          ^^^^^^^^^^^^^^^^^^^^\n" +
7817 			"Type safety: Unchecked cast from X to Set<X>\n" +
7818 			"----------\n");
7819 	}
7820 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=70243 unsafe cast when wildcards
7821 	public void test0253() {
7822 		this.runNegativeTest(
7823 			new String[] {
7824 				"X.java",
7825 				"import java.util.*;\n" +
7826 				"public class X {\n" +
7827 				"    public static void main(String[] args) {\n" +
7828 				"        List<Integer> li= new ArrayList<Integer>();\n" +
7829 				"        List<? extends Number> ls= li;       \n" +
7830 				"        List<Number> x2= (List<Number>)ls;//unsafe\n" +
7831 				"        x2.add(Float.valueOf(1.0f));\n" +
7832 				"        \n" +
7833 				"        Integer i= li.get(0);//ClassCastException!\n" +
7834 				"        \n" +
7835 				"        List<Number> ls2 = (List<? extends Number>)ls;\n" +
7836 				"        List<? extends Number> ls3 = (List<? extends Number>) li;\n" +
7837 				"    }\n" +
7838 				"}\n"
7839 			},
7840 			"----------\n" +
7841 			"1. WARNING in X.java (at line 6)\n" +
7842 			"	List<Number> x2= (List<Number>)ls;//unsafe\n" +
7843 			"	                 ^^^^^^^^^^^^^^^^\n" +
7844 			"Type safety: Unchecked cast from List<capture#1-of ? extends Number> to List<Number>\n" +
7845 			"----------\n" +
7846 			"2. ERROR in X.java (at line 11)\n" +
7847 			"	List<Number> ls2 = (List<? extends Number>)ls;\n" +
7848 			"	                   ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
7849 			"Type mismatch: cannot convert from List<capture#3-of ? extends Number> to List<Number>\n" +
7850 			"----------\n" +
7851 			"3. WARNING in X.java (at line 12)\n" +
7852 			"	List<? extends Number> ls3 = (List<? extends Number>) li;\n" +
7853 			"	                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
7854 			"Unnecessary cast from List<Integer> to List<? extends Number>\n" +
7855 			"----------\n");
7856 	}
7857 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=70053 missing checkcast in string concatenation
7858 	public void test0254() {
7859 		this.runConformTest(
7860 			new String[] {
7861 				"X.java",
7862 				"import java.util.*;\n" +
7863 				"public class X {\n" +
7864 				" public static void main(String[] args) {\n" +
7865 				"  X x = new X();\n" +
7866 				"  System.out.print(\"S\" + x.a() + \"U\" + x.b().get(0) + \"C\" + x.a() + \"C\");\n" +
7867 				"  System.out.println(new StringBuilder(\"E\").append(x.a()).append(\"S\").append(x.b().get(0)).append(\"S\").append(x.a()).append(\"!\"));  \n" +
7868 				" }\n" +
7869 				" String a() { return \"\"; }\n" +
7870 				" List<String> b() { \n" +
7871 				"  ArrayList<String> als = new ArrayList<String>(1);\n" +
7872 				"  als.add(a());\n" +
7873 				"  return als;\n" +
7874 				" }\n" +
7875 				"}\n"
7876 			},
7877 			"SUCCESS!");
7878 	}
7879 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69351 generic type cannot extend Throwable
7880 	public void test0255() {
7881 		this.runNegativeTest(
7882 			new String[] {
7883 				"X.java",
7884 				"public class X<T, U> extends Throwable {\n" +
7885 				"}\n"
7886 			},
7887 			"----------\n" +
7888 			"1. WARNING in X.java (at line 1)\n" +
7889 			"	public class X<T, U> extends Throwable {\n" +
7890 			"	             ^\n" +
7891 			"The serializable class X does not declare a static final serialVersionUID field of type long\n" +
7892 			"----------\n" +
7893 			"2. ERROR in X.java (at line 1)\n" +
7894 			"	public class X<T, U> extends Throwable {\n" +
7895 			"	                             ^^^^^^^^^\n" +
7896 			"The generic class X<T,U> may not subclass java.lang.Throwable\n" +
7897 			"----------\n");
7898 	}
7899 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=70616 - reference to binary Enum
7900 	public void test0256() {
7901 		this.runNegativeTest(
7902 			new String[] {
7903 				"X.java",
7904 				"public class X {\n" +
7905 				"	\n" +
7906 				"	public static void main(String[] args) {\n" +
7907 				"\n" +
7908 				"		Enum<X> ex = null;\n" +
7909 				"		String s = ex.name();\n" +
7910 				"	}\n" +
7911 				"}\n"
7912 			},
7913 			"----------\n" +
7914 			"1. ERROR in X.java (at line 5)\n" +
7915 			"	Enum<X> ex = null;\n" +
7916 			"	     ^\n" +
7917 			"Bound mismatch: The type X is not a valid substitute for the bounded parameter <E extends Enum<E>> of the type Enum<E>\n" +
7918 			"----------\n");
7919 	}
7920 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=70618 - reference to variable allowed in parameterized super type
7921 	public void test0257() {
7922 		this.runNegativeTest(
7923 			new String[] {
7924 				"X.java",
7925 				"public class X<T> {\n" +
7926 				"    public abstract class M extends java.util.AbstractList<T> {}\n" +
7927 				"}\n" +
7928 				"class Y<T> extends T {}\n" +
7929 				"class Z<T> {\n" +
7930 				"    class M extends T {}\n" +
7931 				"}\n"
7932 			},
7933 			"----------\n" +
7934 			"1. ERROR in X.java (at line 4)\n" +
7935 			"	class Y<T> extends T {}\n" +
7936 			"	                   ^\n" +
7937 			"Cannot refer to the type parameter T as a supertype\n" +
7938 			"----------\n" +
7939 			"2. ERROR in X.java (at line 6)\n" +
7940 			"	class M extends T {}\n" +
7941 			"	                ^\n" +
7942 			"Cannot refer to the type parameter T as a supertype\n" +
7943 			"----------\n");
7944 	}
7945 	public void test0258() {
7946 		this.runConformTest(
7947 			new String[] {
7948 				"X.java",
7949 				"abstract class X<K,V> implements java.util.Map<K,V> {\n" +
7950 				"    static abstract class M<K,V> implements Entry<K,V> {}\n" +
7951 				"}\n"
7952 			},
7953 			"");
7954 	}
7955 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=70767 - NPE compiling code with explicit constructor invocation
7956 	public void test0259() {
7957 		this.runConformTest(
7958 			new String[] {
7959 				"X.java",
7960 				"public class X<E> {\n" +
7961 				"	\n" +
7962 				"	<E> X(E e) {\n" +
7963 				"		<E> this();\n" +
7964 				"	}\n" +
7965 				"	\n" +
7966 				"	<E> X() {\n" +
7967 				"	}\n" +
7968 				"}\n"
7969 			},
7970 			"");
7971 	}
7972 	public void test0260() {
7973 		this.runConformTest(
7974 			new String[] {
7975 				"X.java",
7976 				"public class X <E> {\n" +
7977 				"	class MX <F> {\n" +
7978 				"	}\n" +
7979 				"}\n" +
7980 				"\n" +
7981 				"class XC<G> extends X<G> {\n" +
7982 				"	class MXC<H> extends MX<H> {\n" +
7983 				"	}\n" +
7984 				"}\n"
7985 			},
7986 			"");
7987 	}
7988 	public void test0261() {
7989 		this.runNegativeTest(
7990 			new String[] {
7991 				"X.java",
7992 				"public class X <E> {\n" +
7993 				"	void foo(){\n" +
7994 				"		X<Integer> xi = (X<Integer>) new X<String>();\n" +
7995 				"	}\n" +
7996 				"}\n"
7997 			},
7998 			"----------\n" +
7999 			"1. ERROR in X.java (at line 3)\n" +
8000 			"	X<Integer> xi = (X<Integer>) new X<String>();\n" +
8001 			"	                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
8002 			"Cannot cast from X<String> to X<Integer>\n" +
8003 			"----------\n");
8004 	}
8005 	public void test0262() {
8006 		this.runNegativeTest(
8007 			new String[] {
8008 				"X.java",
8009 				"public class X <E,F> {\n" +
8010 				"	void foo(){\n" +
8011 				"		X<E,String> xe = (X<E,String>) new X<String,String>();\n" +
8012 				"	}\n" +
8013 				"}\n"
8014 			},
8015 			"----------\n" +
8016 			"1. WARNING in X.java (at line 3)\n" +
8017 			"	X<E,String> xe = (X<E,String>) new X<String,String>();\n" +
8018 			"	                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
8019 			"Type safety: Unchecked cast from X<String,String> to X<E,String>\n" +
8020 			"----------\n");
8021 	}
8022 	public void test0263() {
8023 		this.runNegativeTest(
8024 			new String[] {
8025 				"X.java",
8026 				"public class X <E,F> {\n" +
8027 				"	void foo(){\n" +
8028 				"		XC<E,String> xe = (XC<E,String>) new X<String,String>();\n" +
8029 				"	}\n" +
8030 				"}\n" +
8031 				"class XC<G,H> extends X<G,H> {\n" +
8032 				"}\n"
8033 			},
8034 			"----------\n" +
8035 			"1. WARNING in X.java (at line 3)\n" +
8036 			"	XC<E,String> xe = (XC<E,String>) new X<String,String>();\n" +
8037 			"	                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
8038 			"Type safety: Unchecked cast from X<String,String> to XC<E,String>\n" +
8039 			"----------\n");
8040 	}
8041 	public void test0264() {
8042 		this.runNegativeTest(
8043 			new String[] {
8044 				"X.java",
8045 				"public class X <E,F> {\n" +
8046 				"	void foo(){\n" +
8047 				"		XC<E,String> xe = (XC<E,String>) new X<String,Integer>();\n" +
8048 				"	}\n" +
8049 				"}\n" +
8050 				"class XC<G,H> extends X<G,H> {\n" +
8051 				"}\n"
8052 			},
8053 			"----------\n" +
8054 			"1. ERROR in X.java (at line 3)\n" +
8055 			"	XC<E,String> xe = (XC<E,String>) new X<String,Integer>();\n" +
8056 			"	                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
8057 			"Cannot cast from X<String,Integer> to XC<E,String>\n" +
8058 			"----------\n");
8059 	}
8060 	public void test0265() {
8061 		this.runNegativeTest(
8062 			new String[] {
8063 				"X.java",
8064 				"public class X <E> {\n" +
8065 				"	<U> void foo(){\n" +
8066 				"			XC<U> xcu = (XC<U>) new X<E>();\n" +
8067 				"			XC<U> xcu1 = (XC<?>) new X<E>();			\n" +
8068 				"			XC<?> xcu2 = (XC<? extends X>) new X<E>();						\n" +
8069 				"	}\n" +
8070 				"}\n" +
8071 				"class XC<G> extends X<G> {\n" +
8072 				"}\n"
8073 			},
8074 			"----------\n" +
8075 			"1. WARNING in X.java (at line 3)\n" +
8076 			"	XC<U> xcu = (XC<U>) new X<E>();\n" +
8077 			"	            ^^^^^^^^^^^^^^^^^^\n" +
8078 			"Type safety: Unchecked cast from X<E> to XC<U>\n" +
8079 			"----------\n" +
8080 			"2. ERROR in X.java (at line 4)\n" +
8081 			"	XC<U> xcu1 = (XC<?>) new X<E>();			\n" +
8082 			"	             ^^^^^^^^^^^^^^^^^^\n" +
8083 			"Type mismatch: cannot convert from XC<capture#1-of ?> to XC<U>\n" +
8084 			"----------\n" +
8085 			"3. WARNING in X.java (at line 5)\n" +
8086 			"	XC<?> xcu2 = (XC<? extends X>) new X<E>();						\n" +
8087 			"	             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
8088 			"Type safety: Unchecked cast from X<E> to XC<? extends X>\n" +
8089 			"----------\n" +
8090 			"4. WARNING in X.java (at line 5)\n" +
8091 			"	XC<?> xcu2 = (XC<? extends X>) new X<E>();						\n" +
8092 			"	                           ^\n" +
8093 			"X is a raw type. References to generic type X<E> should be parameterized\n" +
8094 			"----------\n");
8095 	}
8096 	public void test0266() {
8097 		this.runConformTest(
8098 			new String[] {
8099 				"X.java",
8100 				"public class X <E> {\n" +
8101 				"	void bar() {\n" +
8102 				"		X<? extends E> xe = new X<E>();\n" +
8103 				"	}\n" +
8104 				"}\n"
8105 			},
8106 			"");
8107 	}
8108 	public void test0267() {
8109 		this.runConformTest(
8110 			new String[] {
8111 				"X.java",
8112 				"public class X <T> {\n" +
8113 				"	static void foo(X<?> xany) { \n" +
8114 				"		System.out.println(\"SUCCESS\");\n" +
8115 				"	}\n" +
8116 				"	public static void main(String[] args) {\n" +
8117 				"		foo(new X<Object[]>());\n" +
8118 				"	}\n" +
8119 				"}\n"
8120 			},
8121 			"SUCCESS");
8122 	}
8123 	public void test0268() {
8124 		this.runNegativeTest(
8125 			new String[] {
8126 				"X.java",
8127 				"import java.util.ArrayList;\n" +
8128 				"public class X <T> {\n" +
8129 				"	X[] foo() {\n" +
8130 				"		ArrayList<X> list = new ArrayList();\n" +
8131 				"		return list.toArray(new X[list.size()]);\n" +
8132 				"	}\n" +
8133 				"	public static void main(String[] args) {\n" +
8134 				"	}\n" +
8135 				"}\n"
8136 			},
8137 			"----------\n" +
8138 			"1. WARNING in X.java (at line 3)\n" +
8139 			"	X[] foo() {\n" +
8140 			"	^\n" +
8141 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
8142 			"----------\n" +
8143 			"2. WARNING in X.java (at line 4)\n" +
8144 			"	ArrayList<X> list = new ArrayList();\n" +
8145 			"	          ^\n" +
8146 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
8147 			"----------\n" +
8148 			"3. WARNING in X.java (at line 4)\n" +
8149 			"	ArrayList<X> list = new ArrayList();\n" +
8150 			"	                    ^^^^^^^^^^^^^^^\n" +
8151 			"Type safety: The expression of type ArrayList needs unchecked conversion to conform to ArrayList<X>\n" +
8152 			"----------\n" +
8153 			"4. WARNING in X.java (at line 4)\n" +
8154 			"	ArrayList<X> list = new ArrayList();\n" +
8155 			"	                        ^^^^^^^^^\n" +
8156 			"ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
8157 			"----------\n");
8158 	}
8159 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=70975 - test compilation against binary generic method
8160 	public void test0269() {
8161 		this.runConformTest(
8162 			new String[] {
8163 				"X.java",
8164 				"public class X<T> {\n" +
8165 				"\n" +
8166 				"	<U> U[] bar(U[] u)  { \n" +
8167 				"		System.out.println(\"SUCCESS\");\n" +
8168 				"		return null; }\n" +
8169 				"\n" +
8170 				"	static String[] foo() {\n" +
8171 				"		X<String> xs = new X<String>();\n" +
8172 				"		return xs.bar(new String[0]);\n" +
8173 				"	}\n" +
8174 				"	public static void main(String[] args) {\n" +
8175 				"		foo();\n" +
8176 				"	}\n" +
8177 				"}\n",
8178 			},
8179 			"SUCCESS");
8180 
8181 		this.runConformTest(
8182 			new String[] {
8183 				"Y.java",
8184 				"public class Y {\n" +
8185 				"    public static void main(String [] args) {\n" +
8186 				"		X<String> xs = new X<String>();\n" +
8187 				"		String[] s = xs.bar(new String[0]);\n" +
8188 				"    }\n" +
8189 				"}\n",
8190 			},
8191 			"SUCCESS",
8192 			null,
8193 			false, // do not flush output
8194 			null);
8195 	}
8196 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=70969 - lub(List<String>, List<Object>) --> List<? extends Object>
8197 	public void test0270() {
8198 		this.runNegativeTest(
8199 			new String[] {
8200 				"X.java",
8201 				"import java.util.ArrayList;\n" +
8202 				"\n" +
8203 				"public class X {\n" +
8204 				"    public void test(boolean param) {\n" +
8205 				"        ArrayList<?> ls = (param) \n" +
8206 				"        		? new ArrayList<String>()\n" +
8207 				"        		: new ArrayList<Object>();\n" +
8208 				"        		\n" +
8209 				"        X x = param ? new XY() : new XZ();\n" +
8210 				"        XY y = (XY) new XZ();\n" +
8211 				"    }\n" +
8212 				"}\n" +
8213 				"class XY extends X {}\n" +
8214 				"class XZ extends X {}\n"
8215 			},
8216 
8217 			"----------\n" +
8218 			"1. ERROR in X.java (at line 10)\n" +
8219 			"	XY y = (XY) new XZ();\n" +
8220 			"	       ^^^^^^^^^^^^^\n" +
8221 			"Cannot cast from XZ to XY\n" +
8222 			"----------\n");
8223 	}
8224 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=71080 - parameter bound <T extends Enum<T>> should be allowed
8225 	public void test0271() {
8226 		this.runConformTest(
8227 			new String[] {
8228 				"X.java",
8229 				"public class X<T extends Enum<T>> {\n" +
8230 				"}\n"
8231 			},
8232 			"");
8233 	}
8234 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=71080 - variation
8235 	public void test0272() {
8236 		this.runConformTest(
8237 			new String[] {
8238 				"X.java",
8239 				"public class X<T extends XY<T>> {\n" +
8240 				"}\n" +
8241 				"\n" +
8242 				"class XY<U extends Cloneable> implements Cloneable {\n" +
8243 				"}\n"
8244 			},
8245 			"");
8246 	}
8247 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=71080 - variation
8248 	public void test0273() {
8249 		this.runConformTest(
8250 			new String[] {
8251 				"X.java",
8252 				"public class X<T extends XY<T> & Cloneable> {\n" +
8253 				"}\n" +
8254 				"\n" +
8255 				"class XY<U extends Cloneable> {\n" +
8256 				"}\n"
8257 			},
8258 			"");
8259 	}
8260 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=71241
8261 	public void test0274() {
8262 		this.runNegativeTest(
8263 			new String[] {
8264 				"X.java",
8265 				"import java.util.List;\n" +
8266 				"public class X {\n" +
8267 				"    public List useList(List l) {\n" +
8268 				"        l.add(\"asdf\");\n" +
8269 				"        return l;\n" +
8270 				"    }\n" +
8271 				"}\n" +
8272 				"class Y extends X {\n" +
8273 				"    public List<String> useList(List<String> l) {\n" +
8274 				"        l.add(\"asdf\");\n" +
8275 				"        return l;\n" +
8276 				"    }\n" +
8277 				"}\n"
8278 			},
8279 			"----------\n" +
8280 			"1. WARNING in X.java (at line 3)\n" +
8281 			"	public List useList(List l) {\n" +
8282 			"	       ^^^^\n" +
8283 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
8284 			"----------\n" +
8285 			"2. WARNING in X.java (at line 3)\n" +
8286 			"	public List useList(List l) {\n" +
8287 			"	                    ^^^^\n" +
8288 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
8289 			"----------\n" +
8290 			"3. WARNING in X.java (at line 4)\n" +
8291 			"	l.add(\"asdf\");\n" +
8292 			"	^^^^^^^^^^^^^\n" +
8293 			"Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
8294 			"----------\n" +
8295 			"4. ERROR in X.java (at line 9)\n" +
8296 			"	public List<String> useList(List<String> l) {\n" +
8297 			"	                    ^^^^^^^^^^^^^^^^^^^^^^^\n" +
8298 			"Name clash: The method useList(List<String>) of type Y has the same erasure as useList(List) of type X but does not override it\n" +
8299 			"----------\n");
8300 	}
8301 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=71241 - variation
8302 	public void test0275() {
8303 		this.runNegativeTest(
8304 			new String[] {
8305 				"X.java",
8306 				"import java.util.List;\n" +
8307 				"public class X {\n" +
8308 				"    public List<String> useList(List<String> l) {\n" +
8309 				"        l.add(\"asdf\");\n" +
8310 				"        return l;\n" +
8311 				"    }\n" +
8312 				"}\n" +
8313 				"class Y extends X {\n" +
8314 				"    public List useList(List l) {\n" +
8315 				"        l.add(\"asdf\");\n" +
8316 				"        return l;\n" +
8317 				"    }\n" +
8318 				"}\n"
8319 			},
8320 			"----------\n" +
8321 			"1. WARNING in X.java (at line 9)\n" +
8322 			"	public List useList(List l) {\n" +
8323 			"	       ^^^^\n" +
8324 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
8325 			"----------\n" +
8326 			"2. WARNING in X.java (at line 9)\n" +
8327 			"	public List useList(List l) {\n" +
8328 			"	       ^^^^\n" +
8329 			"Type safety: The return type List for useList(List) from the type Y needs unchecked conversion to conform to List<String> from the type X\n" +
8330 			"----------\n" +
8331 			"3. WARNING in X.java (at line 9)\n" +
8332 			"	public List useList(List l) {\n" +
8333 			"	            ^^^^^^^^^^^^^^^\n" +
8334 			"The method useList(List) of type Y should be tagged with @Override since it actually overrides a superclass method\n" +
8335 			"----------\n" +
8336 			"4. WARNING in X.java (at line 9)\n" +
8337 			"	public List useList(List l) {\n" +
8338 			"	                    ^^^^\n" +
8339 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
8340 			"----------\n" +
8341 			"5. WARNING in X.java (at line 10)\n" +
8342 			"	l.add(\"asdf\");\n" +
8343 			"	^^^^^^^^^^^^^\n" +
8344 			"Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
8345 			"----------\n");
8346 	}
8347 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=71241 - variation
8348 	public void test0276() {
8349 		this.runNegativeTest(
8350 			new String[] {
8351 				"X.java",
8352 				"import java.util.List;\n" +
8353 				"public class X {\n" +
8354 				"    public void useList(List l) {}\n" +
8355 				"}\n" +
8356 				"class Y extends X {\n" +
8357 				"    public void useList(List<String> l) {\n" +
8358 				"		super.useList(l);\n" +
8359 				"	}\n" +
8360 				"}\n"
8361 			},
8362 			"----------\n" +
8363 			"1. WARNING in X.java (at line 3)\n" +
8364 			"	public void useList(List l) {}\n" +
8365 			"	                    ^^^^\n" +
8366 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
8367 			"----------\n" +
8368 			"2. ERROR in X.java (at line 6)\n" +
8369 			"	public void useList(List<String> l) {\n" +
8370 			"	            ^^^^^^^^^^^^^^^^^^^^^^^\n" +
8371 			"Name clash: The method useList(List<String>) of type Y has the same erasure as useList(List) of type X but does not override it\n" +
8372 			"----------\n");
8373 	}
8374 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=71241 - variation
8375 	public void test0277() {
8376 		this.runNegativeTest(
8377 			new String[] {
8378 				"X.java",
8379 				"import java.util.List;\n" +
8380 				"public class X {\n" +
8381 				"    public void useList(List<String> l) {}\n" +
8382 				"}\n" +
8383 				"class Y extends X {\n" +
8384 				"    public void useList(List l) {\n" +
8385 				"		super.useList(l);\n" +
8386 				"	}\n" +
8387 				"}\n"
8388 			},
8389 			"----------\n" +
8390 			"1. WARNING in X.java (at line 6)\n" +
8391 			"	public void useList(List l) {\n" +
8392 			"	            ^^^^^^^^^^^^^^^\n" +
8393 			"The method useList(List) of type Y should be tagged with @Override since it actually overrides a superclass method\n" +
8394 			"----------\n" +
8395 			"2. WARNING in X.java (at line 6)\n" +
8396 			"	public void useList(List l) {\n" +
8397 			"	                    ^^^^\n" +
8398 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
8399 			"----------\n" +
8400 			"3. WARNING in X.java (at line 7)\n" +
8401 			"	super.useList(l);\n" +
8402 			"	              ^\n" +
8403 			"Type safety: The expression of type List needs unchecked conversion to conform to List<String>\n" +
8404 			"----------\n");
8405 	}
8406 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=71241 - variation
8407 	public void test0278() {
8408 		this.runConformTest(
8409 			new String[] {
8410 				"X.java",
8411 				"public class X<T> implements I {\n" +
8412 				"    public Class<T> getDeclaringClass() { return null; }\n" +
8413 				"}\n" +
8414 				"class Y implements I {\n" +
8415 				"    public Class<?> getDeclaringClass() { return null; }\n" +
8416 				"}\n" +
8417 				"interface I {\n" +
8418 				"	public Class getDeclaringClass();\n" +
8419 				"}\n"
8420 			},
8421 			"");
8422 	}
8423 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=69901
8424 	public void test0279() {
8425 		this.runNegativeTest(
8426 			new String[] {
8427 				"X.java",
8428 				"public class X implements ISomething {\n" +
8429 				"    public Class getSomething() { return null; }\n" +
8430 				"}\n" +
8431 				"class Y {}\n" +
8432 				"interface ISomething {\n" +
8433 				"    public Class<? extends Y> getSomething();\n" +
8434 				"}\n"
8435 			},
8436 			"----------\n" +
8437 			"1. WARNING in X.java (at line 2)\n" +
8438 			"	public Class getSomething() { return null; }\n" +
8439 			"	       ^^^^^\n" +
8440 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
8441 			"----------\n" +
8442 			"2. WARNING in X.java (at line 2)\n" +
8443 			"	public Class getSomething() { return null; }\n" +
8444 			"	       ^^^^^\n" +
8445 			"Type safety: The return type Class for getSomething() from the type X needs unchecked conversion to conform to Class<? extends Y> from the type ISomething\n" +
8446 			"----------\n");
8447 	}
8448 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=62822
8449 	public void test0280() {
8450 		this.runConformTest(
8451 			new String[] {
8452 				"X.java",
8453 				"interface X<T1 extends Y<T2>, T2 extends Z> {}\n" +
8454 				"interface Y<T3 extends Z> {}\n" +
8455 				"interface Z {}\n"
8456 			},
8457 			"");
8458 	}
8459 	public void test0281() {
8460 		this.runNegativeTest(
8461 			new String[] {
8462 				"X.java",
8463 				"interface X<T1 extends Y<T2>, T2 extends Z> {}\n" +
8464 				"interface Y<T3 extends Comparable> {}\n" +
8465 				"interface Z {}\n"
8466 			},
8467 			"----------\n" +
8468 			"1. ERROR in X.java (at line 1)\n" +
8469 			"	interface X<T1 extends Y<T2>, T2 extends Z> {}\n" +
8470 			"	                         ^^\n" +
8471 			"Bound mismatch: The type T2 is not a valid substitute for the bounded parameter <T3 extends Comparable> of the type Y<T3>\n" +
8472 			"----------\n" +
8473 			"2. WARNING in X.java (at line 2)\n" +
8474 			"	interface Y<T3 extends Comparable> {}\n" +
8475 			"	                       ^^^^^^^^^^\n" +
8476 			"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
8477 			"----------\n");
8478 	}
8479 	public void test0282() {
8480 		this.runConformTest(
8481 			new String[] {
8482 				"X.java",
8483 				"public class X extends Y.Member<String> {}\n" +
8484 				"class Y { static class Member<T> {} }\n"
8485 			},
8486 			"");
8487 		this.runConformTest(
8488 			new String[] {
8489 				"p1/X.java",
8490 				"package p1;\n" +
8491 				"public class X extends p1.Y.Member<String> {}\n" +
8492 				"class Y { static class Member<T> {} }\n"
8493 			},
8494 			"");
8495 	}
8496 	public void test0283() {
8497 		this.runNegativeTest(
8498 			new String[] {
8499 				"X.java",
8500 				"public class X extends Y.Missing<String> {}\n" +
8501 				"class Y { static class Member<T> {} }\n"
8502 			},
8503 			"----------\n" +
8504 			"1. ERROR in X.java (at line 1)\n" +
8505 			"	public class X extends Y.Missing<String> {}\n" +
8506 			"	                       ^^^^^^^^^\n" +
8507 			"Y.Missing cannot be resolved to a type\n" +
8508 			"----------\n");
8509 		this.runNegativeTest(
8510 			new String[] {
8511 				"p1/X.java",
8512 				"package p1;\n" +
8513 				"public class X extends Y.Missing<String> {}\n" +
8514 				"class Y { static class Member<T> {} }\n"
8515 			},
8516 			"----------\n" +
8517 			"1. ERROR in p1\\X.java (at line 2)\n" +
8518 			"	public class X extends Y.Missing<String> {}\n" +
8519 			"	                       ^^^^^^^^^\n" +
8520 			"Y.Missing cannot be resolved to a type\n" +
8521 			"----------\n");
8522 	}
8523 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=72083
8524 	public void test0284() {
8525 		this.runConformTest(
8526 			new String[] {
8527 				"p1/A.java",
8528 				"package p1;\n" +
8529 				"public class A <T1 extends A<T1, T2>, T2 extends B<T1, T2>> {\n" +
8530 				"    public static void main(String [] args) {\n" +
8531 				"		System.out.println(\"SUCCESS\");\n" +
8532 				"    }\n" +
8533 				"}\n",
8534 				"p1/B.java",
8535 				"package p1;\n" +
8536 				"public class B <T3 extends A<T3, T4>, T4 extends B<T3, T4>> {}\n"
8537 			},
8538 			"SUCCESS");
8539 		this.runConformTest(
8540 			new String[] {
8541 				"p1/A.java",
8542 				"package p1;\n" +
8543 				"public class A <T1 extends B<T1, T2>, T2 extends A<T1, T2>> {\n" +
8544 				"    public static void main(String [] args) {\n" +
8545 				"		System.out.println(\"SUCCESS\");\n" +
8546 				"    }\n" +
8547 				"}\n",
8548 				"p1/B.java",
8549 				"package p1;\n" +
8550 				"public class B <T3 extends B<T3, T4>, T4 extends A<T3, T4>> {}\n"
8551 			},
8552 			"SUCCESS");
8553 	}
8554 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=73530
8555 	public void test0285() {
8556 		this.runConformTest(
8557 			new String[] {
8558 				"X.java",
8559 				"import java.util.Vector;\n" +
8560 				"public class X {\n" +
8561 				"  public static void main(String[] args){\n" +
8562 				"    Vector<Integer[]> v = new Vector<Integer[]>();\n" +
8563 				"    Integer[] array1 = new Integer[5];\n" +
8564 				"    array1[0] = new Integer(17);\n" +
8565 				"    array1[1] = new Integer(42);\n" +
8566 				"    v.add(array1);\n" +
8567 				"    Integer twentyfour = v.get(0)[1];  // responsible for the crash\n" +
8568 				"    System.out.println(twentyfour);\n" +
8569 				"  }\n" +
8570 				"}"
8571 			},
8572 			"42");
8573 	}
8574 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=72644
8575 	// TODO (philippe) we need a way to test these 2 methods & find them 'equivalent'... right isEquivalentTo return false
8576 	public void test0286() {
8577 		this.runConformTest(
8578 			new String[] {
8579 				"X.java",
8580 				"public class X {\n" +
8581 				"	<T extends Object> T foo(Class<T> c) {return null;}\n" +
8582 				"}\n" +
8583 				"class Y extends X {\n" +
8584 				"	<T extends Object> T foo(Class<T> c) {return null;}\n" +
8585 				"}"
8586 			},
8587 			"");
8588 	}
8589 	public void test0287() {
8590 		this.runNegativeTest(
8591 			new String[] {
8592 				"X.java",
8593 				"public class X<T> {\n" +
8594 				"\n" +
8595 				"	public class A <U> {\n" +
8596 				"		\n" +
8597 				"		public class B <V> {\n" +
8598 				"			\n" +
8599 				"		}\n" +
8600 				"	}\n" +
8601 				"	public static void main(String[] args) {\n" +
8602 				"		\n" +
8603 				"		X.A.B<String> bs;\n" +
8604 				"	}\n" +
8605 				"}\n"
8606 			},
8607 			"----------\n" +
8608 			"1. ERROR in X.java (at line 11)\n" +
8609 			"	X.A.B<String> bs;\n" +
8610 			"	^^^^^\n" +
8611 			"The member type X.A.B<String> must be qualified with a parameterized type, since it is not static\n" +
8612 			"----------\n");
8613 	}
8614 	public void test0288() {
8615 		this.runConformTest(
8616 			new String[] {
8617 				"X.java",
8618 				"public class X<T> {\n" +
8619 				"\n" +
8620 				"	public static class A <U> {\n" +
8621 				"		\n" +
8622 				"		public static class B <V> {\n" +
8623 				"			\n" +
8624 				"		}\n" +
8625 				"	}\n" +
8626 				"	public static void main(String[] args) {\n" +
8627 				"		\n" +
8628 				"		X.A.B<String> bs;\n" +
8629 				"	}\n" +
8630 				"}\n"
8631 			},
8632 			"");
8633 	}
8634 	public void test0289() {
8635 		this.runNegativeTest(
8636 			new String[] {
8637 				"X.java",
8638 				"public class X<T> {\n" +
8639 				"\n" +
8640 				"	public class A <U> {\n" +
8641 				"		\n" +
8642 				"		public class B <V> {\n" +
8643 				"			\n" +
8644 				"		}\n" +
8645 				"	}\n" +
8646 				"	public static void main(String[] args) {\n" +
8647 				"		\n" +
8648 				"		X<String>.A.B<String> bs;\n" +
8649 				"	}\n" +
8650 				"}\n"
8651 			},
8652 			"----------\n" +
8653 			"1. ERROR in X.java (at line 11)\n" +
8654 			"	X<String>.A.B<String> bs;\n" +
8655 			"	^^^^^^^^^^^\n" +
8656 			"The member type X<String>.A must be parameterized, since it is qualified with a parameterized type\n" +
8657 			"----------\n");
8658 	}
8659 	public void test0290() {
8660 		this.runNegativeTest(
8661 			new String[] {
8662 				"X.java",
8663 				"public class X<T> {\n" +
8664 				"\n" +
8665 				"	public static class A <U> {\n" +
8666 				"		\n" +
8667 				"		public class B <V> {\n" +
8668 				"			\n" +
8669 				"		}\n" +
8670 				"	}\n" +
8671 				"	public static void main(String[] args) {\n" +
8672 				"		\n" +
8673 				"		X<String>.A.B<String> bs;\n" +
8674 				"	}\n" +
8675 				"}\n"
8676 			},
8677 			"----------\n" +
8678 			"1. ERROR in X.java (at line 11)\n" +
8679 			"	X<String>.A.B<String> bs;\n" +
8680 			"	^^^^^^^^^^^\n" +
8681 			"The member type X.A<U> cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type X<String>\n" +
8682 			"----------\n");
8683 	}
8684 	// ensure bound check deals with supertype (and their enclosing type)
8685 	public void test0291() {
8686 		this.runNegativeTest(
8687 			new String[] {
8688 				"X.java",
8689 				"public class X <T extends Iterable>{\n" +
8690 				"	class MX<U extends Iterable> {\n" +
8691 				"	}\n" +
8692 				"}\n" +
8693 				"class SX extends X<Thread>.MX<Object> {\n" +
8694 				"	SX(X x){\n" +
8695 				"		x.super();\n" +
8696 				"	}\n" +
8697 				"}\n"
8698 			},
8699 			"----------\n" +
8700 			"1. WARNING in X.java (at line 1)\n" +
8701 			"	public class X <T extends Iterable>{\n" +
8702 			"	                          ^^^^^^^^\n" +
8703 			"Iterable is a raw type. References to generic type Iterable<T> should be parameterized\n" +
8704 			"----------\n" +
8705 			"2. WARNING in X.java (at line 2)\n" +
8706 			"	class MX<U extends Iterable> {\n" +
8707 			"	                   ^^^^^^^^\n" +
8708 			"Iterable is a raw type. References to generic type Iterable<T> should be parameterized\n" +
8709 			"----------\n" +
8710 			"3. ERROR in X.java (at line 5)\n" +
8711 			"	class SX extends X<Thread>.MX<Object> {\n" +
8712 			"	                   ^^^^^^\n" +
8713 			"Bound mismatch: The type Thread is not a valid substitute for the bounded parameter <T extends Iterable> of the type X<T>\n" +
8714 			"----------\n" +
8715 			"4. ERROR in X.java (at line 5)\n" +
8716 			"	class SX extends X<Thread>.MX<Object> {\n" +
8717 			"	                              ^^^^^^\n" +
8718 			"Bound mismatch: The type Object is not a valid substitute for the bounded parameter <U extends Iterable> of the type X<T>.MX<U>\n" +
8719 			"----------\n" +
8720 			"5. WARNING in X.java (at line 6)\n" +
8721 			"	SX(X x){\n" +
8722 			"	   ^\n" +
8723 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
8724 			"----------\n");
8725 	}
8726 	public void test0292() {
8727 		this.runConformTest(
8728 			new String[] {
8729 				"X.java",
8730 				"public class X <T> {\n" +
8731 				"	class Y {\n" +
8732 				"		class Z<U> {\n" +
8733 				"		}\n" +
8734 				"	}\n" +
8735 				"    public static void main(String[] args) {\n" +
8736 				"		X<Object>.Y.Z<Object> zo;\n" +
8737 				"	}\n" +
8738 				"}\n"
8739 			},
8740 			"");
8741 	}
8742 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=73837
8743 	public void test0293() {
8744 		this.runConformTest(
8745 			new String[] {
8746 				"B.java", //---------------------------
8747 				"public class B<X>{\n"+
8748 				"    public B(X str,D dValue){}\n"+
8749 				"    public static void main(String [] args) {\n" +
8750 				"        System.out.println(\"SUCCESS\");\n" +
8751 				"    }\n" +
8752 				"}\n"	,
8753 				"D.java", //---------------------------
8754 				"public class D<Y>{}\n",
8755 			},
8756 			"SUCCESS");
8757 
8758 		this.runConformTest(
8759 			new String[] {
8760 				"C.java", //---------------------------
8761 				"public class C<Z,Y> {\n" +
8762 				"    public B<Z> test(Z zValue,D<Y> yValue){ return new B<Z>(zValue,yValue); }\n" +
8763 				"    public static void main(String [] args) {\n" +
8764 				"        System.out.println(\"SUCCESS\");\n" +
8765 				"    }\n" +
8766 				"}\n",
8767 			},
8768 			"SUCCESS",
8769 			null,
8770 			false, // do not flush output
8771 			null);
8772 	}
8773 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=73837 variation
8774 	public void test0294() {
8775 		this.runConformTest(
8776 			new String[] {
8777 				"B.java", //---------------------------
8778 				"public class B<X>{\n"+
8779 				"    public B(X str, B<D> dValue){}\n"+
8780 				"    public static void main(String [] args) {\n" +
8781 				"        System.out.println(\"SUCCESS\");\n" +
8782 				"    }\n" +
8783 				"}\n"	,
8784 				"D.java", //---------------------------
8785 				"public class D<Y>{}\n",
8786 			},
8787 			"SUCCESS");
8788 
8789 		this.runNegativeTest(
8790 			new String[] {
8791 				"C.java", //---------------------------
8792 				"public class C<Z,Y> {\n" +
8793 				"    public B<Z> test(Z zValue,B<D<Y>> yValue){ return new B<Z>(zValue,yValue); }\n" +
8794 				"}\n",
8795 			},
8796 			"----------\n" +
8797 			"1. ERROR in C.java (at line 2)\n" +
8798 			"	public B<Z> test(Z zValue,B<D<Y>> yValue){ return new B<Z>(zValue,yValue); }\n" +
8799 			"	                                                  ^^^^^^^^^^^^^^^^^^^^^^^\n" +
8800 			"The constructor B<Z>(Z, B<D<Y>>) is undefined\n" +
8801 			"----------\n",
8802 			null,
8803 			false, // do not flush output
8804 			null);
8805 	}
8806 	// non-static method #start() gets its type substituted when accessed through raw type
8807 	public void test0295() {
8808 		this.runNegativeTest(
8809 			new String[] {
8810 				"C.java", //---------------------------
8811 				"public class C<U> {\n" +
8812 				"\n" +
8813 				"	void bar() {\n" +
8814 				"		new B().start().get(new B().start()).get(new B().start());\n" +
8815 				"	}\n" +
8816 				"}\n",
8817 				"B.java", //---------------------------
8818 				"public class B<X>{\n" +
8819 				"	X get(B<X> bx) { return null; }\n" +
8820 				"	B<B<D>> start() { return null; }\n" +
8821 				"}",
8822 				"D.java", //---------------------------
8823 				"public class D<Y>{}\n",
8824 			},
8825 			"----------\n" +
8826 			"1. WARNING in C.java (at line 4)\n" +
8827 			"	new B().start().get(new B().start()).get(new B().start());\n" +
8828 			"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
8829 			"Type safety: The method get(B) belongs to the raw type B. References to generic type B<X> should be parameterized\n" +
8830 			"----------\n" +
8831 			"2. WARNING in C.java (at line 4)\n" +
8832 			"	new B().start().get(new B().start()).get(new B().start());\n" +
8833 			"	    ^\n" +
8834 			"B is a raw type. References to generic type B<X> should be parameterized\n" +
8835 			"----------\n" +
8836 			"3. WARNING in C.java (at line 4)\n" +
8837 			"	new B().start().get(new B().start()).get(new B().start());\n" +
8838 			"	                        ^\n" +
8839 			"B is a raw type. References to generic type B<X> should be parameterized\n" +
8840 			"----------\n" +
8841 			"4. ERROR in C.java (at line 4)\n" +
8842 			"	new B().start().get(new B().start()).get(new B().start());\n" +
8843 			"	                                     ^^^\n" +
8844 			"The method get(B) is undefined for the type Object\n" +
8845 			"----------\n" +
8846 			"5. WARNING in C.java (at line 4)\n" +
8847 			"	new B().start().get(new B().start()).get(new B().start());\n" +
8848 			"	                                             ^\n" +
8849 			"B is a raw type. References to generic type B<X> should be parameterized\n" +
8850 			"----------\n" +
8851 			"----------\n" +
8852 			"1. WARNING in B.java (at line 3)\n" +
8853 			"	B<B<D>> start() { return null; }\n" +
8854 			"	    ^\n" +
8855 			"D is a raw type. References to generic type D<Y> should be parameterized\n" +
8856 			"----------\n");
8857 	}
8858 	// static method #start() gets its type does not get substituted when accessed through raw type
8859 	public void test0296() {
8860 		this.runNegativeTest(
8861 			new String[] {
8862 				"C.java", //---------------------------
8863 				"public class C<U> {\n" +
8864 				"\n" +
8865 				"	void bar() {\n" +
8866 				"		new B().start().get(new B().start()).get(new B().start());\n" +
8867 				"	}\n" +
8868 				"}\n",
8869 				"B.java", //---------------------------
8870 				"public class B<X>{\n" +
8871 				"	X get(B<X> bx) { return null; }\n" +
8872 				"	static B<B<D>> start() { return null; }\n" +
8873 				"}",
8874 				"D.java", //---------------------------
8875 				"public class D<Y>{}\n",
8876 			},
8877 			"----------\n" +
8878 			"1. WARNING in C.java (at line 4)\n" +
8879 			"	new B().start().get(new B().start()).get(new B().start());\n" +
8880 			"	^^^^^^^^^^^^^^^\n" +
8881 			"The static method start() from the type B should be accessed in a static way\n" +
8882 			"----------\n" +
8883 			"2. WARNING in C.java (at line 4)\n" +
8884 			"	new B().start().get(new B().start()).get(new B().start());\n" +
8885 			"	    ^\n" +
8886 			"B is a raw type. References to generic type B<X> should be parameterized\n" +
8887 			"----------\n" +
8888 			"3. WARNING in C.java (at line 4)\n" +
8889 			"	new B().start().get(new B().start()).get(new B().start());\n" +
8890 			"	                    ^^^^^^^^^^^^^^^\n" +
8891 			"The static method start() from the type B should be accessed in a static way\n" +
8892 			"----------\n" +
8893 			"4. WARNING in C.java (at line 4)\n" +
8894 			"	new B().start().get(new B().start()).get(new B().start());\n" +
8895 			"	                        ^\n" +
8896 			"B is a raw type. References to generic type B<X> should be parameterized\n" +
8897 			"----------\n" +
8898 			"5. ERROR in C.java (at line 4)\n" +
8899 			"	new B().start().get(new B().start()).get(new B().start());\n" +
8900 			"	                                     ^^^\n" +
8901 			"The method get(B<D>) in the type B<D> is not applicable for the arguments (B<B<D>>)\n" +
8902 			"----------\n" +
8903 			"6. WARNING in C.java (at line 4)\n" +
8904 			"	new B().start().get(new B().start()).get(new B().start());\n" +
8905 			"	                                         ^^^^^^^^^^^^^^^\n" +
8906 			"The static method start() from the type B should be accessed in a static way\n" +
8907 			"----------\n" +
8908 			"7. WARNING in C.java (at line 4)\n" +
8909 			"	new B().start().get(new B().start()).get(new B().start());\n" +
8910 			"	                                             ^\n" +
8911 			"B is a raw type. References to generic type B<X> should be parameterized\n" +
8912 			"----------\n" +
8913 			"----------\n" +
8914 			"1. WARNING in B.java (at line 3)\n" +
8915 			"	static B<B<D>> start() { return null; }\n" +
8916 			"	           ^\n" +
8917 			"D is a raw type. References to generic type D<Y> should be parameterized\n" +
8918 			"----------\n");
8919 	}
8920 	public void test0297() {
8921 		this.runConformTest(
8922 			new String[] {
8923 				"X.java", //---------------------------
8924 				"import java.util.HashMap;\n" +
8925 				"import java.util.Iterator;\n" +
8926 				"import java.util.Map;\n" +
8927 				"\n" +
8928 				"public class X {\n" +
8929 				"		 public static void main(String[] args) {\n" +
8930 				"		 		 Map<String, String> map = new HashMap<String, String>();\n" +
8931 				"		 		 \n" +
8932 				"		 		 map.put(\"foo\", \"bar\");\n" +
8933 				"		 		 \n" +
8934 				"		 		 // Error reported on the following line\n" +
8935 				"		 		 Iterator<Map.Entry<String,String>> i = map.entrySet().iterator();\n" +
8936 				"		 		 while (i.hasNext()) {\n" +
8937 				"		 		 		 Map.Entry<String, String> entry = i.next();\n" +
8938 				"		 		 		 System.out.println(entry.getKey() + \", \" + entry.getValue());\n" +
8939 				"		 		 }\n" +
8940 				"		 }\n" +
8941 				"}\n",
8942 			},
8943 			"foo, bar");
8944 	}
8945 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=72644
8946 	public void test0298() {
8947 		this.runNegativeTest(
8948 			new String[] {
8949 				"X.java", //---------------------------
8950 				"import java.util.Collection;\n" +
8951 				"import java.util.Map;\n" +
8952 				"import java.util.Set;\n" +
8953 				"\n" +
8954 				"public class X<V> implements Map<String, V> {\n" +
8955 				"   private Map<String, V> backingMap;\n" +
8956 				"   public int size() { return 0; }\n" +
8957 				"   public boolean isEmpty() { return false; }\n" +
8958 				"   public boolean containsKey(Object key) { return false; }\n" +
8959 				"   public boolean containsValue(Object value) { return false; }\n" +
8960 				"   public V get(Object key) { return null; }\n" +
8961 				"   public V put(String key, V value) { return null; }\n" +
8962 				"   public V remove(Object key) { return null; }\n" +
8963 				"   public void clear() { }\n" +
8964 				"   public Set<String> keySet() { return null; }\n" +
8965 				"   public Collection<V> values() { return null; }\n" +
8966 				"   public void putAll(Map<String, ? extends V> t) { }\n" +
8967 				"   public Set<Map.Entry<String, V>> entrySet() {\n" +
8968 				"      return this.backingMap.entrySet();\n" +
8969 				"   }\n" +
8970 				"}\n",
8971 			},
8972 			"----------\n" +
8973 			"1. ERROR in X.java (at line 5)\n" +
8974 			"	public class X<V> implements Map<String, V> {\n" +
8975 			"	             ^\n" +
8976 			"The type X<V> must implement the inherited abstract method Map<String,V>.putAll(Map<? extends String,? extends V>)\n" +
8977 			"----------\n" +
8978 			"2. ERROR in X.java (at line 17)\n" +
8979 			"	public void putAll(Map<String, ? extends V> t) { }\n" +
8980 			"	            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
8981 			"Name clash: The method putAll(Map<String,? extends V>) of type X<V> has the same erasure as putAll(Map<? extends K,? extends V>) of type Map<K,V> but does not override it\n" +
8982 			"----------\n");
8983 		this.runConformTest(
8984 			new String[] {
8985 				"X.java", //---------------------------
8986 				"public abstract class X<S, V> implements java.util.Map<Object, Object> {\n" +
8987 				"   public void putAll(java.util.Map<?, ?> t) { }\n" +
8988 				"}\n",
8989 			},
8990 			"");
8991 		this.runNegativeTest(
8992 			new String[] {
8993 				"X.java", //---------------------------
8994 				"public abstract class X<S, V> implements java.util.Map<S, V> {\n" +
8995 				"   public void putAll(java.util.Map<? extends String, ? extends V> t) { }\n" +
8996 				"}\n",
8997 			},
8998 			"----------\n" +
8999 			"1. ERROR in X.java (at line 2)\n" +
9000 			"	public void putAll(java.util.Map<? extends String, ? extends V> t) { }\n" +
9001 			"	            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
9002 			"Name clash: The method putAll(Map<? extends String,? extends V>) of type X<S,V> has the same erasure as putAll(Map<? extends K,? extends V>) of type Map<K,V> but does not override it\n" +
9003 			"----------\n");
9004 	}
9005 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=74244
9006 	public void test0299() {
9007 		this.runConformTest(
9008 			new String[] {
9009 				"X.java", //---------------------------
9010 				"public class X {\n" +
9011 				" public static void main(String argv[]) {\n" +
9012 				" 	System.out.println(Boolean.class == boolean.class ? \"FAILED\" : \"SUCCESS\");\n" +
9013 				" }\n" +
9014 				"}\n",
9015 			},
9016 			"SUCCESS");
9017 	}
9018 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=74119
9019 	public void test0300() {
9020 		this.runConformTest(
9021 			new String[] {
9022 				"X.java", //---------------------------
9023 				"public class X {\n" +
9024 				"    static interface I extends Visitible<I> {\n" +
9025 				"    }\n" +
9026 				"    static interface Visitible<T> {\n" +
9027 				"        void acceptVisitor(Visitor<? super T> visitor);\n" +
9028 				"    }\n" +
9029 				"    static interface Visitor<T> {\n" +
9030 				"        void visit(T t);\n" +
9031 				"    }\n" +
9032 				"    static class C implements I {\n" +
9033 				"        public void acceptVisitor(Visitor<? super I> visitor) {\n" +
9034 				"            visitor.visit(this); // should be ok\n" +
9035 				"            visitor.visit((I) this); // (2) This is a workaround\n" +
9036 				"        }\n" +
9037 				"    }\n" +
9038 				"    public static void main(String [] args) {\n" +
9039 				"        System.out.println(\"SUCCESS\");\n" +
9040 				"    }\n" +
9041 				"}\n",
9042 			},
9043 			"SUCCESS");
9044 	}
9045 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=74320: check no complaint for unused private method
9046 	public void test0301() {
9047 		this.runNegativeTest(
9048 			new String[] {
9049 				"X.java", //---------------------------
9050 				"import java.util.List;\n" +
9051 				"public class X {\n" +
9052 				"	public static void reverse(List<?> list) { \n" +
9053 				"		rev(list);\n" +
9054 				"	}\n" +
9055 				"	private static <T> void rev(List<T> list) {\n" +
9056 				"	}\n" +
9057 				"	Zork foo() {\n" +
9058 				"	}\n" +
9059 				"}\n",
9060 			},
9061 			"----------\n" +
9062 			"1. ERROR in X.java (at line 8)\n" +
9063 			"	Zork foo() {\n" +
9064 			"	^^^^\n" +
9065 			"Zork cannot be resolved to a type\n" +
9066 			"----------\n");
9067 	}
9068 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=74514
9069 	public void test0302() {
9070 		this.runNegativeTest(
9071 			new String[] {
9072 				"X.java", //---------------------------
9073 				"import java.util.ArrayList;\n" +
9074 				"import java.util.Enumeration;\n" +
9075 				"import java.util.Iterator;\n" +
9076 				"import java.util.List;\n" +
9077 				"public class X {\n" +
9078 				"	public void test02() {\n" +
9079 				"		List<String> l= new ArrayList<String>();\n" +
9080 				"		for (Iterator<String> i= l.iterator(); i.next(); ) {\n" +
9081 				"		}\n" +
9082 				"	}\n" +
9083 				"}\n",
9084 			},
9085 			"----------\n" +
9086 			"1. ERROR in X.java (at line 8)\n" +
9087 			"	for (Iterator<String> i= l.iterator(); i.next(); ) {\n" +
9088 			"	                                       ^^^^^^^^\n" +
9089 			"Type mismatch: cannot convert from String to boolean\n" +
9090 			"----------\n");
9091 	}
9092 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=74544
9093 	public void test0303() {
9094 		this.runConformTest(
9095 			new String[] {
9096 				"X.java", //---------------------------
9097 				"public  class X {\n" +
9098 				"  	public static void main(String[] args) {\n" +
9099 				"  		Y<String> ys = new Y<String>();\n" +
9100 				"	    Y<String>.Member m = ys.new Member();\n" +
9101 				"	    m.foo();\n" +
9102 				"  	}    \n" +
9103 				"  }\n" +
9104 				"  class Y<T> {\n" +
9105 				"    class Member {\n" +
9106 				"    	void foo(){\n" +
9107 				"    		System.out.println(\"SUCCESS\");\n" +
9108 				"    	}\n" +
9109 				"    }\n" +
9110 				"  }\n" +
9111 				"\n",
9112 			},
9113 			"SUCCESS");
9114 	}
9115 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=74592
9116 	public void test0304() {
9117 		this.runConformTest(
9118 			new String[] {
9119 				"X.java", //---------------------------
9120 				"public class X<T extends Y> {}\n" +
9121 				"class Y extends X {}"
9122 			},
9123 			"");
9124 	}
9125 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=74420
9126 	public void test0305() {
9127 		this.runConformTest(
9128 			new String[] {
9129 				"X.java", //---------------------------
9130 				"public class X<T> {\n" +
9131 				"  	T x;\n" +
9132 				"  	<U extends T> T foo(U u) { return u; }\n" +
9133 				"}\n"
9134 			},
9135 			"");
9136 	}
9137 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=74096
9138 	public void test0306() {
9139 		this.runNegativeTest(
9140 			new String[] {
9141 				"X.java", //---------------------------
9142 				"public class X<T extends X<T>> {\n" +
9143 				"  	static int CONSTANT = 1;\n" +
9144 				"  	private int i = 1;\n" +
9145 				"  	private int i() {return i;}\n" +
9146 				"  	private static class M { private static int j = 2; }\n" +
9147 				"  	public int foo(T t) { return t.i + t.i() + T.M.j; }\n" +
9148 				"  	public int foo2(T t) { return T.CONSTANT; }\n" + // why is this allowed?
9149 				"}\n" +
9150 				"class Y extends Zork {\n" +
9151 				"}\n"
9152 			},
9153 			this.complianceLevel <= ClassFileConstants.JDK1_6 ?
9154 			"----------\n" +
9155 			"1. WARNING in X.java (at line 6)\n" +
9156 			"	public int foo(T t) { return t.i + t.i() + T.M.j; }\n" +
9157 			"	                                               ^\n" +
9158 			"Read access to enclosing field X.M.j is emulated by a synthetic accessor method\n" +
9159 			"----------\n" +
9160 			"2. ERROR in X.java (at line 9)\n" +
9161 			"	class Y extends Zork {\n" +
9162 			"	                ^^^^\n" +
9163 			"Zork cannot be resolved to a type\n" +
9164 			"----------\n"
9165 			// 5: operator + cannot be applied to int,<any>.j
9166 			// 5: incompatible type, found : <nulltype>, required: int
9167 			:
9168 
9169 			// 1.7+ output, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=334622
9170 			"----------\n" +
9171 			"1. ERROR in X.java (at line 6)\n" +
9172 			"	public int foo(T t) { return t.i + t.i() + T.M.j; }\n" +
9173 			"	                               ^\n" +
9174 			"The field X<T>.i is not visible\n" +
9175 			"----------\n" +
9176 			"2. ERROR in X.java (at line 6)\n" +
9177 			"	public int foo(T t) { return t.i + t.i() + T.M.j; }\n" +
9178 			"	                                     ^\n" +
9179 			"The method i() from the type X<T> is not visible\n" +
9180 			"----------\n" +
9181 			"3. ERROR in X.java (at line 6)\n" +
9182 			"	public int foo(T t) { return t.i + t.i() + T.M.j; }\n" +
9183 			"	                                           ^^^\n" +
9184 			"The type T.M is not visible\n" +
9185 			"----------\n" +
9186 			"4. ERROR in X.java (at line 9)\n" +
9187 			"	class Y extends Zork {\n" +
9188 			"	                ^^^^\n" +
9189 			"Zork cannot be resolved to a type\n" +
9190 			"----------\n"
9191 		);
9192 	}
9193 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=72583
9194 	public void test0307() {
9195 		this.runConformTest(
9196 			new String[] {
9197 				"X.java", //---------------------------
9198 				"public class X {\n" +
9199 				"	static <T> T foo(T t1, T t2){ return t1; }\n" +
9200 				"	public static void main(String[] args) {\n" +
9201 				"		IX s = null;\n" +
9202 				"		 foo(new Object(), s);\n" +
9203 				"	}\n" +
9204 				"}\n" +
9205 				"interface IX {}\n"
9206 			},
9207 			"");
9208 	}
9209 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=73696
9210 	public void test0308() {
9211 		this.runConformTest(
9212 			new String[] {
9213 				"p/X.java",
9214 				"package p;\n" +
9215 					"public class X<T> {\n" +
9216 					"	class Member {}\n" +
9217 					"}\n",
9218 				"p/Y.java",
9219 				"package p;\n" +
9220 					"public class Y {\n" +
9221 					"	p.X.Member m;\n" +
9222 					"	p.X<String>.Member ms = m;\n" +
9223 					"}\n"
9224 			});
9225 	}
9226 	public void test0309() {
9227 		this.runConformTest(
9228 			new String[] {
9229 				"p/X.java",
9230 				"package p;\n" +
9231 					"public class X<T> {\n" +
9232 					"	class Member {\n" +
9233 					"		class Sub {}\n" +
9234 					"	}\n" +
9235 					"}\n",
9236 				"p/Y.java",
9237 				"package p;\n" +
9238 					"public class Y {\n" +
9239 					"	p.X.Member.Sub s;\n" +
9240 					"	p.X<Exception>.Member.Sub es = s;\n" +
9241 					"}\n"
9242 			});
9243 	}
9244 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=75156 - should report name clash
9245 	public void test0310() {
9246 		this.runNegativeTest(
9247 			new String[] {
9248 				"X.java",
9249 				"import java.util.List;\n" +
9250 				"public class X extends X2 {\n" +
9251 				"	void foo(List<X> lx) { }\n" +
9252 				"}\n" +
9253 				"\n" +
9254 				"abstract class X2 {\n" +
9255 				"	void foo(List<Object> lo) { }\n" +
9256 				"}"
9257 			},
9258 			"----------\n" +
9259 			"1. ERROR in X.java (at line 3)\n" +
9260 			"	void foo(List<X> lx) { }\n" +
9261 			"	     ^^^^^^^^^^^^^^^\n" +
9262 			"Name clash: The method foo(List<X>) of type X has the same erasure as foo(List<Object>) of type X2 but does not override it\n" +
9263 			"----------\n");
9264 	}
9265 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=75156 variation - should report name clash and ambiguity
9266 	public void test0311() {
9267 		this.runNegativeTest(
9268 			new String[] {
9269 				"X.java",
9270 				"import java.util.List;\n" +
9271 				"public class X extends X2 {\n" +
9272 				"	void foo(List<X> lx) { }\n" +
9273 				"	void bar(){\n" +
9274 				"		this.foo((List)null);\n" +
9275 				"	}\n" +
9276 				"}\n" +
9277 				"\n" +
9278 				"abstract class X2 {\n" +
9279 				"	void foo(List<Object> lo) { }\n" +
9280 				"}"
9281 			},
9282 			"----------\n" +
9283 			"1. ERROR in X.java (at line 3)\n" +
9284 			"	void foo(List<X> lx) { }\n" +
9285 			"	     ^^^^^^^^^^^^^^^\n" +
9286 			"Name clash: The method foo(List<X>) of type X has the same erasure as foo(List<Object>) of type X2 but does not override it\n" +
9287 			"----------\n" +
9288 			"2. ERROR in X.java (at line 5)\n" +
9289 			"	this.foo((List)null);\n" +
9290 			"	     ^^^\n" +
9291 			"The method foo(List<X>) is ambiguous for the type X\n" +
9292 			"----------\n" +
9293 			"3. WARNING in X.java (at line 5)\n" +
9294 			"	this.foo((List)null);\n" +
9295 			"	          ^^^^\n" +
9296 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
9297 			"----------\n");
9298 	}
9299 	// 75156 variation - should report name clash instead of final method override
9300 	public void test0312() {
9301 		this.runNegativeTest(
9302 			new String[] {
9303 				"X.java",
9304 				"import java.util.List;\n" +
9305 				"public class X extends X2 {\n" +
9306 				"	void foo(List<X> lx) { }\n" +
9307 				"}\n" +
9308 				"\n" +
9309 				"abstract class X2 {\n" +
9310 				"	final void foo(List<Object> lo) { }\n" +
9311 				"}"
9312 			},
9313 			"----------\n" +
9314 			"1. ERROR in X.java (at line 3)\n" +
9315 			"	void foo(List<X> lx) { }\n" +
9316 			"	     ^^^^^^^^^^^^^^^\n" +
9317 			"Name clash: The method foo(List<X>) of type X has the same erasure as foo(List<Object>) of type X2 but does not override it\n" +
9318 			"----------\n");
9319 	}
9320 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=73963
9321 	public void test0313() {
9322 		this.runConformTest(
9323 			new String[] {
9324 				"X.java",
9325 				"import java.net.Inet6Address;\n" +
9326 				"import java.net.InetAddress;\n" +
9327 				"import java.util.AbstractList;\n" +
9328 				"import java.util.ArrayList;\n" +
9329 				"import java.util.List;\n" +
9330 				"\n" +
9331 				"public class X {\n" +
9332 				"void takeAbstract(AbstractList<? extends InetAddress> arg) { }\n" +
9333 				"\n" +
9334 				"void takeList(List<? extends InetAddress> arg) { }\n" +
9335 				"\n" +
9336 				"void construct() {\n" +
9337 				"	AbstractList<InetAddress> a= new ArrayList<InetAddress>();\n" +
9338 				"	takeAbstract(a);\n" +
9339 				"	takeAbstract(new ArrayList<InetAddress>()); // a inlined: error 1:\n" +
9340 				"//The method takeAbstract(AbstractList<? extends InetAddress>) in the type A\n" +
9341 				"// is not applicable for the arguments (ArrayList<InetAddress>)\n" +
9342 				"	\n" +
9343 				"	List<InetAddress> l= new ArrayList<InetAddress>();\n" +
9344 				"	takeList(l);\n" +
9345 				"	takeList(new ArrayList<InetAddress>()); // l inlined: ok\n" +
9346 				"	\n" +
9347 				"	ArrayList<? extends InetAddress> aw= new ArrayList<InetAddress>();\n" +
9348 				"	takeAbstract(aw);\n" +
9349 				"	takeAbstract(new ArrayList<Inet6Address>()); // aw inlined: error 2:\n" +
9350 				"//The method takeAbstract(AbstractList<? extends InetAddress>) in the type A\n" +
9351 				"// is not applicable for the arguments (ArrayList<Inet6Address>)\n" +
9352 				"\n" +
9353 				"	takeList(aw);\n" +
9354 				"	takeList(new ArrayList<Inet6Address>()); //aw inlined: ok\n" +
9355 				"}\n" +
9356 				"}"
9357 			},
9358 			"");
9359 	}
9360 	public void test0314() {
9361 		this.runConformTest(
9362 			new String[] {
9363 				"X.java",
9364 				"public class X <E> {\n" +
9365 				"	static class XMember<F> {}\n" +
9366 				"\n" +
9367 				"	// with toplevel element type\n" +
9368 				"	void foo() {\n" +
9369 				"		XIter<XElement<E>> iter = fooSet().iterator();\n" +
9370 				"	}\n" +
9371 				"	XSet<XElement<E>> fooSet()	 { return null; }\n" +
9372 				"\n" +
9373 				"	// with member element type\n" +
9374 				"	void bar() {\n" +
9375 				"		XIter<XMember<E>> iter = barSet().iterator();\n" +
9376 				"	}\n" +
9377 				"	XSet<XMember<E>> barSet()	 { return null; }\n" +
9378 				"\n" +
9379 				"	\n" +
9380 				"}\n" +
9381 				"\n" +
9382 				"class XSet<G> {\n" +
9383 				"	XIter<G> iterator() { return null; }\n" +
9384 				"}\n" +
9385 				"class XIter<H> {\n" +
9386 				"}\n" +
9387 				"class XElement<I> {\n" +
9388 				"}\n"
9389 			},
9390 			"");
9391 	}
9392 	public void test0315() {
9393 		this.runConformTest(
9394 			new String[] {
9395 				"X.java",
9396 				"public class X <E> {\n" +
9397 				"	static class XMember<F> {}\n" +
9398 				"\n" +
9399 				"	// with member element type\n" +
9400 				"	void bar() {\n" +
9401 				"		XIter<X.XMember<E>> iter = barSet().iterator();\n" +
9402 				"	}\n" +
9403 				"	XSet<XMember<E>> barSet()	 { return null; }\n" +
9404 				"\n" +
9405 				"	\n" +
9406 				"}\n" +
9407 				"\n" +
9408 				"class XSet<G> {\n" +
9409 				"	XIter<G> iterator() { return null; }\n" +
9410 				"}\n" +
9411 				"class XIter<H> {\n" +
9412 				"}\n" +
9413 				"class XElement<I> {\n" +
9414 				"}\n"
9415 			},
9416 			"");
9417 	}
9418 	public void test0316() {
9419 		this.runNegativeTest(
9420 			new String[] {
9421 				"X.java",
9422 				"import java.util.List;\n" +
9423 				"\n" +
9424 				"public class X <E extends List & Runnable> {\n" +
9425 				"	\n" +
9426 				"	E element() { return null; }\n" +
9427 				"	\n" +
9428 				"	void bar(X<E> xe) {\n" +
9429 				"		xe.element().add(this);\n" +
9430 				"		xe.element().run();\n" +
9431 				"	}\n" +
9432 				"	void foo(X<?> xe) {\n" +
9433 				"		xe.element().add(this);\n" +
9434 				"		xe.element().run();\n" +
9435 				"	}\n" +
9436 				"	void baz(X<? extends XM> xe) {\n" +
9437 				"		xe.element().add(this);\n" +
9438 				"		xe.element().run();\n" +
9439 				"	}\n" +
9440 				"	abstract class XM implements List, Runnable {}\n" +
9441 				"  Zork z;\n" +
9442 				"}\n"
9443 			},
9444 			"----------\n" +
9445 			"1. WARNING in X.java (at line 3)\n" +
9446 			"	public class X <E extends List & Runnable> {\n" +
9447 			"	                          ^^^^\n" +
9448 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
9449 			"----------\n" +
9450 			"2. WARNING in X.java (at line 8)\n" +
9451 			"	xe.element().add(this);\n" +
9452 			"	^^^^^^^^^^^^^^^^^^^^^^\n" +
9453 			"Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
9454 			"----------\n" +
9455 			"3. WARNING in X.java (at line 12)\n" +
9456 			"	xe.element().add(this);\n" +
9457 			"	^^^^^^^^^^^^^^^^^^^^^^\n" +
9458 			"Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
9459 			"----------\n" +
9460 			"4. WARNING in X.java (at line 16)\n" +
9461 			"	xe.element().add(this);\n" +
9462 			"	^^^^^^^^^^^^^^^^^^^^^^\n" +
9463 			"Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
9464 			"----------\n" +
9465 			"5. WARNING in X.java (at line 19)\n" +
9466 			"	abstract class XM implements List, Runnable {}\n" +
9467 			"	                             ^^^^\n" +
9468 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
9469 			"----------\n" +
9470 			"6. ERROR in X.java (at line 20)\n" +
9471 			"	Zork z;\n" +
9472 			"	^^^^\n" +
9473 			"Zork cannot be resolved to a type\n" +
9474 			"----------\n");
9475 	}
9476 	public void test0317() {
9477 		this.runNegativeTest(
9478 			new String[] {
9479 				"X.java",
9480 				"import java.util.List;\n" +
9481 				"\n" +
9482 				"public class X <E extends List & Runnable> {\n" +
9483 				"	\n" +
9484 				"	E element() { return null; }\n" +
9485 				"	\n" +
9486 				"	void foo(X<? extends XI> xe) {\n" +
9487 				"		xe.element().add(this);\n" +
9488 				"		xe.element().run();\n" +
9489 				"	}\n" +
9490 				"	void baz(X<? extends XM> xe) {\n" +
9491 				"		xe.element().add(this);\n" +
9492 				"		xe.element().run();\n" +
9493 				"	}\n" +
9494 				"	interface XI extends Runnable {}\n" +
9495 				"	\n" +
9496 				"	class XM {\n" +
9497 				"		void foo() {}\n" +
9498 				"	}\n" +
9499 				"  Zork z;\n" +
9500 				"}\n"
9501 			},
9502 			"----------\n" +
9503 			"1. WARNING in X.java (at line 3)\n" +
9504 			"	public class X <E extends List & Runnable> {\n" +
9505 			"	                          ^^^^\n" +
9506 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
9507 			"----------\n" +
9508 			"2. WARNING in X.java (at line 8)\n" +
9509 			"	xe.element().add(this);\n" +
9510 			"	^^^^^^^^^^^^^^^^^^^^^^\n" +
9511 			"Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
9512 			"----------\n" +
9513 			"3. WARNING in X.java (at line 12)\n" +
9514 			"	xe.element().add(this);\n" +
9515 			"	^^^^^^^^^^^^^^^^^^^^^^\n" +
9516 			"Type safety: The method add(Object) belongs to the raw type List. References to generic type List<E> should be parameterized\n" +
9517 			"----------\n" +
9518 			"4. ERROR in X.java (at line 20)\n" +
9519 			"	Zork z;\n" +
9520 			"	^^^^\n" +
9521 			"Zork cannot be resolved to a type\n" +
9522 			"----------\n");
9523 	}
9524 
9525 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=75548
9526 	public void test0318() {
9527 		this.runConformTest(
9528 			new String[] {
9529 				"MyCache.java",
9530 				"class Cache<K, V> {\n" +
9531 				"}\n" +
9532 				"\n" +
9533 				"class Index<K, V> {\n" +
9534 				"  public Index(Cache<?, V> parentCache) {\n" +
9535 				"  }\n" +
9536 				"}\n" +
9537 				"\n" +
9538 				"public class MyCache extends Cache<Integer, String> {\n" +
9539 				"  class AnIndex extends Index<String, String> {\n" +
9540 				"    public AnIndex() {\n" +
9541 				"      super(MyCache.this); // <-- Eclipse cannot find the constructor!\n" +
9542 				"    }\n" +
9543 				"  }\n" +
9544 				"}\n"
9545 			},
9546 			"");
9547 	}
9548 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=76729
9549 	public void test0319() {
9550 		this.runConformTest(
9551 			new String[] {
9552 				"test/Test1.java",
9553 				"package test;\n" +
9554 				"\n" +
9555 				"class A<BB extends B>\n" +
9556 				"{}\n" +
9557 				"\n" +
9558 				"class B<AA extends A>\n" +
9559 				"{}\n" +
9560 				"\n" +
9561 				"public interface Test1<C extends B<?>, D extends A<?>>\n" +
9562 				"{}\n" +
9563 				"\n" +
9564 				"class AbstractA extends A<AbstractB> {};\n" +
9565 				"class AbstractB extends B<AbstractA> {};\n" +
9566 				"\n" +
9567 				"class Test2<E extends AbstractB, F extends AbstractA> implements Test1<E, F>\n" +
9568 				"{}"
9569 			},
9570 			"");
9571 	}
9572 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=74032
9573 	public void test0320() {
9574 		this.runConformTest(
9575 			new String[] {
9576 				"X.java",
9577 				"import java.util.ArrayList;\n" +
9578 				"import java.util.List;\n" +
9579 				"class TestElement extends ArrayList implements Runnable {\n" +
9580 				"  public void run() {\n" +
9581 				"  }\n" +
9582 				"}\n" +
9583 				"public class X <E extends List & Runnable> {\n" +
9584 				"  public X(E element) {\n" +
9585 				"    element.run();\n" +
9586 				"  }\n" +
9587 				"  public static void main(String[] args) {\n" +
9588 				"    new X<TestElement>(new TestElement());\n" +
9589 				"    System.out.println(\"SUCCESS\");\n" +
9590 				"  }\n" +
9591 				"}\n"
9592 			},
9593 			"SUCCESS");
9594 	}
9595 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=74032 - variation with wildcard
9596 	public void test0321() {
9597 		this.runConformTest(
9598 			new String[] {
9599 				"X.java",
9600 				"import java.util.ArrayList;\n" +
9601 				"import java.util.List;\n" +
9602 				"class TestElement extends ArrayList implements Runnable {\n" +
9603 				"  static final long serialVersionUID = 1l;\n" +
9604 				"  public void run() {\n" +
9605 				"  	// empty\n" +
9606 				"  }\n" +
9607 				"}\n" +
9608 				"public class X <E extends List & Runnable> {\n" +
9609 				"	E element;\n" +
9610 				"  public X(E element) {\n" +
9611 				"  	this.element = element;\n" +
9612 				"    element.run();\n" +
9613 				"  }\n" +
9614 				"  public X(X<?> x) {\n" +
9615 				"    x.element.run();\n" + // should be able to bind to #run()
9616 				"  }\n" +
9617 				"  public static void main(String[] args) {\n" +
9618 				"    new X<TestElement>(new TestElement());\n" +
9619 				"    System.out.println(\"SUCCESS\");\n" +
9620 				"  }\n" +
9621 				"}\n"
9622 			},
9623 			"SUCCESS");
9624 	}
9625 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=75134
9626 	public void test0322() {
9627 		this.runConformTest(
9628 			new String[] {
9629 				"X.java",
9630 				"import java.util.*;\n" +
9631 				"public class X<A> {\n" +
9632 				"\n" +
9633 				"  A v2;\n" +
9634 				"  X(A a) { v2 = a; }\n" +
9635 				"  \n" +
9636 				"  void func() {\n" +
9637 				"    List<B<A>> l = new ArrayList<B<A>>();\n" +
9638 				"  }\n" +
9639 				"\n" +
9640 				"  class B<T> {\n" +
9641 				"    T v1;\n" +
9642 				"    B(T b) {  v1 = b; }\n" +
9643 				"  }\n" +
9644 				"  \n" +
9645 				"}\n"
9646 			},
9647 			"");
9648 	}
9649 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=76359 - also check warnings for raw conversion
9650 	public void test0323() {
9651 		this.runNegativeTest(
9652 			new String[] {
9653 				"X.java",
9654 				"class G<T> {\n" +
9655 				"	class Member {}\n" +
9656 				"}\n" +
9657 				"public class X {\n" +
9658 				"	G<String> g = new G();\n" +
9659 				"	G<String>.Member gsm = g.new Member();\n" +
9660 				"	G.Member gm = null;\n" +
9661 				"	G<Thread>.Member gtm = gm;\n" +
9662 				"	Zork z;\n" +
9663 				"}\n"
9664 			},
9665 			"----------\n" +
9666 			"1. WARNING in X.java (at line 5)\n" +
9667 			"	G<String> g = new G();\n" +
9668 			"	              ^^^^^^^\n" +
9669 			"Type safety: The expression of type G needs unchecked conversion to conform to G<String>\n" +
9670 			"----------\n" +
9671 			"2. WARNING in X.java (at line 5)\n" +
9672 			"	G<String> g = new G();\n" +
9673 			"	                  ^\n" +
9674 			"G is a raw type. References to generic type G<T> should be parameterized\n" +
9675 			"----------\n" +
9676 			"3. WARNING in X.java (at line 7)\n" +
9677 			"	G.Member gm = null;\n" +
9678 			"	^^^^^^^^\n" +
9679 			"G.Member is a raw type. References to generic type G<T>.Member should be parameterized\n" +
9680 			"----------\n" +
9681 			"4. WARNING in X.java (at line 8)\n" +
9682 			"	G<Thread>.Member gtm = gm;\n" +
9683 			"	                       ^^\n" +
9684 			"Type safety: The expression of type G.Member needs unchecked conversion to conform to G<Thread>.Member\n" +
9685 			"----------\n" +
9686 			"5. ERROR in X.java (at line 9)\n" +
9687 			"	Zork z;\n" +
9688 			"	^^^^\n" +
9689 			"Zork cannot be resolved to a type\n" +
9690 			"----------\n");
9691 	}
9692 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=72998
9693 	public void test0324() {
9694 		this.runConformTest(
9695 			new String[] {
9696 				"X.java",
9697 				"import java.util.Iterator;\n" +
9698 				"import java.util.Set;\n" +
9699 				"\n" +
9700 				"public class X<E> {\n" +
9701 				"   private TreeNode<E> root;\n" +
9702 				"\n" +
9703 				"   public void doSomething() {\n" +
9704 				"      for (TreeNode<E> child : root.children()) {\n" +
9705 				"         // root.children() should work??\n" +
9706 				"      }\n" +
9707 				"   }\n" +
9708 				"\n" +
9709 				"   public void doSomethingElse() {\n" +
9710 				"      for (Iterator<TreeNode<E>> it = root.children().iterator(); it.hasNext();) {\n" +
9711 				"         // this also should work\n" +
9712 				"      }\n" +
9713 				"   }\n" +
9714 				"}\n" +
9715 				"\n" +
9716 				"class TreeNode<E> {\n" +
9717 				"   private Set<TreeNode<E>> children;\n" +
9718 				"   \n" +
9719 				"   public Set<TreeNode<E>> children() {\n" +
9720 				"      return children;\n" +
9721 				"   }\n" +
9722 				"}\n"
9723 			},
9724 			"");
9725 	}
9726 	public void test0325() {
9727 		this.runNegativeTest(
9728 			new String[] {
9729 				"X.java",
9730 				"public class X <T> {\n" +
9731 				"	void foo1() {\n" +
9732 				"		X<String>.Item<Thread> i = new X<Exception>().new Item<Thread>();\n" +
9733 				"	}\n" +
9734 				"	void foo2() {\n" +
9735 				"		X<Exception>.Item<Thread> j = new X<Exception>.Item<Thread>();\n" + // allowed per grammar
9736 				"	}\n" +
9737 				"	void foo3() {\n" +
9738 				"		X.Item k = new X.Item();\n" +
9739 				"	}\n" +
9740 				"	static void foo4() {\n" +
9741 				"		X.Item k = new X.Item();\n" +
9742 				"	}\n" +
9743 				"	class Item <E> {}\n" +
9744 				"}\n"
9745 			},
9746 			"----------\n" +
9747 			"1. ERROR in X.java (at line 3)\n" +
9748 			"	X<String>.Item<Thread> i = new X<Exception>().new Item<Thread>();\n" +
9749 			"	                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
9750 			"Type mismatch: cannot convert from X<Exception>.Item<Thread> to X<String>.Item<Thread>\n" +
9751 			"----------\n" +
9752 			"2. ERROR in X.java (at line 6)\n" +
9753 			"	X<Exception>.Item<Thread> j = new X<Exception>.Item<Thread>();\n" +
9754 			"	                                  ^^^^^^^^^^^^^^^^^\n" +
9755 			"Cannot allocate the member type X<Exception>.Item<Thread> using a parameterized compound name; use its simple name and an enclosing instance of type X<Exception>\n" +
9756 			"----------\n" +
9757 			"3. WARNING in X.java (at line 9)\n" +
9758 			"	X.Item k = new X.Item();\n" +
9759 			"	^^^^^^\n" +
9760 			"X.Item is a raw type. References to generic type X<T>.Item<E> should be parameterized\n" +
9761 			"----------\n" +
9762 			"4. WARNING in X.java (at line 9)\n" +
9763 			"	X.Item k = new X.Item();\n" +
9764 			"	               ^^^^^^\n" +
9765 			"X.Item is a raw type. References to generic type X<T>.Item<E> should be parameterized\n" +
9766 			"----------\n" +
9767 			"5. WARNING in X.java (at line 12)\n" +
9768 			"	X.Item k = new X.Item();\n" +
9769 			"	^^^^^^\n" +
9770 			"X.Item is a raw type. References to generic type X<T>.Item<E> should be parameterized\n" +
9771 			"----------\n" +
9772 			"6. ERROR in X.java (at line 12)\n" +
9773 			"	X.Item k = new X.Item();\n" +
9774 			"	           ^^^^^^^^^^^^\n" +
9775 			"No enclosing instance of type X<T> is accessible. Must qualify the allocation with an enclosing instance of type X<T> (e.g. x.new A() where x is an instance of X<T>).\n" +
9776 			"----------\n" +
9777 			"7. WARNING in X.java (at line 12)\n" +
9778 			"	X.Item k = new X.Item();\n" +
9779 			"	               ^^^^^^\n" +
9780 			"X.Item is a raw type. References to generic type X<T>.Item<E> should be parameterized\n" +
9781 			"----------\n");
9782 	}
9783 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=75400
9784 	public void test0326() {
9785 		this.runConformTest(
9786 			new String[] {
9787 				"X.java",
9788 				"public class X<T> implements I<T> {\n" +
9789 				"    public I.A foo() {\n" +
9790 				"        return a;\n" +
9791 				"    }\n" +
9792 				"}    \n" +
9793 				"interface I<T> {\n" +
9794 				"    A a = new A();\n" +
9795 				"    class A {\n" +
9796 				"    }\n" +
9797 				"}\n" +
9798 				"\n" +
9799 				"class XM<T> {\n" +
9800 				"    A a = new A();\n" +
9801 				"    class A {\n" +
9802 				"    }\n" +
9803 				"}	\n" +
9804 				"\n" +
9805 				"class XMSub<T> extends XM<T> {\n" +
9806 				"    public XM.A foo() {\n" +
9807 				"        return a;\n" +
9808 				"    }\n" +
9809 				"}    \n" +
9810 				"\n"
9811 			},
9812 			"");
9813 	}
9814 	// wildcard captures bound and variable superinterfaces
9815 	public void test0327() {
9816 		this.runConformTest(
9817 	 		// test directory preparation
9818 			new String[] { /* test files */
9819 				"X.java",
9820 				"public class X<T extends IFoo> {\n" +
9821 				"	\n" +
9822 				"	T element() { return null; }\n" +
9823 				"	void baz(X<? extends IBar> x) {\n" +
9824 				"		x.element().foo();\n" +
9825 				"		x.element().bar();\n" +
9826 				"	}\n" +
9827 				"}\n" +
9828 				"interface IFoo {\n" +
9829 				"	void foo();\n" +
9830 				"}\n" +
9831 				"interface IBar {\n" +
9832 				"	void bar();\n" +
9833 				"}\n"
9834 			},
9835 			// javac options
9836 			JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
9837 	}
9838 	// wildcard captures bound and variable superinterfaces
9839 	public void test0328() {
9840 		this.runNegativeTest(
9841 			new String[] {
9842 				"X.java",
9843 				"public class X<T extends IFoo> {\n" +
9844 				"	T element;\n" +
9845 				"	X(T element) { \n" +
9846 				"		this.element = element; \n" +
9847 				"	}\n" +
9848 				"	static void baz(X<? extends IBar> x) {\n" +
9849 				"		x.element.foo();\n" +
9850 				"		x.element.bar();\n" +
9851 				"	}\n" +
9852 				"	public static void main(String[] args) {\n" +
9853 				"		X<Foo> x1 = new X<Foo>(new Foo());\n" +
9854 				"		baz(x1);\n" +
9855 				"		X<Bar> x2 = new X<Bar>(new Bar());\n" +
9856 				"		baz(x2);\n" +
9857 				"		X<FooBar> x3 = new X<FooBar>(new FooBar());\n" +
9858 				"		baz(x3);\n" +
9859 				"	}\n" +
9860 				"}\n" +
9861 				"interface IFoo {\n" +
9862 				"	void foo();\n" +
9863 				"}\n" +
9864 				"interface IBar {\n" +
9865 				"	void bar();\n" +
9866 				"}\n" +
9867 				"class Foo implements IFoo {\n" +
9868 				"	public void foo() {\n" +
9869 				"		System.out.print(\"FOO\");\n" +
9870 				"	}\n" +
9871 				"}\n" +
9872 				"class Bar implements IBar {\n" +
9873 				"	public void bar() {\n" +
9874 				"		System.out.print(\"BAR\");\n" +
9875 				"	}\n" +
9876 				"}\n" +
9877 				"class FooBar extends Foo implements IBar {\n" +
9878 				"	public void bar() {\n" +
9879 				"		System.out.print(\"BAR\");\n" +
9880 				"	}\n" +
9881 				"}\n"
9882 			},
9883 			"----------\n" +
9884 			"1. ERROR in X.java (at line 12)\n" +
9885 			"	baz(x1);\n" +
9886 			"	^^^\n" +
9887 			"The method baz(X<? extends IBar>) in the type X<T> is not applicable for the arguments (X<Foo>)\n" +
9888 			"----------\n" +
9889 			"2. ERROR in X.java (at line 13)\n" +
9890 			"	X<Bar> x2 = new X<Bar>(new Bar());\n" +
9891 			"	  ^^^\n" +
9892 			"Bound mismatch: The type Bar is not a valid substitute for the bounded parameter <T extends IFoo> of the type X<T>\n" +
9893 			"----------\n" +
9894 			"3. ERROR in X.java (at line 13)\n" +
9895 			"	X<Bar> x2 = new X<Bar>(new Bar());\n" +
9896 			"	                  ^^^\n" +
9897 			"Bound mismatch: The type Bar is not a valid substitute for the bounded parameter <T extends IFoo> of the type X<T>\n" +
9898 			"----------\n");
9899 	}
9900 	// wildcard captures bound and variable superinterfaces
9901 	public void test0329() {
9902 		this.runConformTest(
9903 			// test directory preparation
9904 			true /* flush output directory */,
9905 			new String[] { /* test files */
9906 				"X.java",
9907 				"public class X<T extends IFoo> {\n" +
9908 				"	T element;\n" +
9909 				"	X(T element) { \n" +
9910 				"		this.element = element; \n" +
9911 				"	}\n" +
9912 				"	static void baz(X<? extends IBar> x) {\n" +
9913 				"		x.element.foo();\n" +
9914 				"		x.element.bar();\n" +
9915 				"	}\n" +
9916 				"	public static void main(String[] args) {\n" +
9917 				"		X<FooBar> x3 = new X<FooBar>(new FooBar());\n" +
9918 				"		baz(x3);\n" +
9919 				"	}\n" +
9920 				"}\n" +
9921 				"interface IFoo {\n" +
9922 				"	void foo();\n" +
9923 				"}\n" +
9924 				"interface IBar {\n" +
9925 				"	void bar();\n" +
9926 				"}\n" +
9927 				"class FooBar implements IFoo, IBar {\n" +
9928 				"	public void foo() {\n" +
9929 				"		System.out.print(\"FOO\");\n" +
9930 				"	}\n" +
9931 				"	public void bar() {\n" +
9932 				"		System.out.print(\"BAR\");\n" +
9933 				"	}\n" +
9934 				"}\n",
9935 			},
9936 			// compiler results
9937 			null /* do not check compiler log */,
9938 			// runtime results
9939 			"FOOBAR" /* expected output string */,
9940 			null /* do not check error string */,
9941 			// javac options
9942 			JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
9943 	}
9944 	// wildcard captures bound superclass and variable superclass
9945 	public void test0330() {
9946 		this.runConformTest(
9947 			new String[] {
9948 				"X.java",
9949 				"public class X<T extends Foo> {\n" +
9950 				"	T element;\n" +
9951 				"	X(T element) { \n" +
9952 				"		this.element = element; \n" +
9953 				"	}\n" +
9954 				"	static void baz(X<? extends FooBar> x) {\n" +
9955 				"		x.element.foo();\n" +
9956 				"		x.element.bar();\n" +
9957 				"	}\n" +
9958 				"	public static void main(String[] args) {\n" +
9959 				"		X<FooBar> x3 = new X<FooBar>(new FooBar());\n" +
9960 				"		baz(x3);\n" +
9961 				"	}\n" +
9962 				"}\n" +
9963 				"interface IBar {\n" +
9964 				"	void bar();\n" +
9965 				"}\n" +
9966 				"class Foo {\n" +
9967 				"	public void foo() {\n" +
9968 				"		System.out.print(\"FOO\");\n" +
9969 				"	}\n" +
9970 				"}\n" +
9971 				"class FooBar extends Foo implements IBar {\n" +
9972 				"	public void bar() {\n" +
9973 				"		System.out.print(\"BAR\");\n" +
9974 				"	}\n" +
9975 				"}\n",
9976 			},
9977 			"FOOBAR");
9978 	}
9979 	// wildcard captures bound superclass and variable superclass
9980 	public void test0331() {
9981 		this.runConformTest(
9982 			// test directory preparation
9983 			true /* flush output directory */,
9984 			new String[] { /* test files */
9985 				"X.java",
9986 				"public class X<T extends Foo> {\n" +
9987 				"	T element;\n" +
9988 				"	X(T element) { \n" +
9989 				"		this.element = element; \n" +
9990 				"	}\n" +
9991 				"	static void baz(X<? extends IBar> x) {\n" +
9992 				"		x.element.foo();\n" +
9993 				"		x.element.bar();\n" +
9994 				"	}\n" +
9995 				"	public static void main(String[] args) {\n" +
9996 				"		X<FooBar> x3 = new X<FooBar>(new FooBar());\n" +
9997 				"		baz(x3);\n" +
9998 				"	}\n" +
9999 				"}\n" +
10000 				"interface IBar {\n" +
10001 				"	void bar();\n" +
10002 				"}\n" +
10003 				"class Foo {\n" +
10004 				"	public void foo() {\n" +
10005 				"		System.out.print(\"FOO\");\n" +
10006 				"	}\n" +
10007 				"}\n" +
10008 				"class FooBar extends Foo implements IBar {\n" +
10009 				"	public void bar() {\n" +
10010 				"		System.out.print(\"BAR\");\n" +
10011 				"	}\n" +
10012 				"}\n",
10013 			},
10014 			// compiler results
10015 			null /* do not check compiler log */,
10016 			// runtime results
10017 			"FOOBAR" /* expected output string */,
10018 			null /* do not check error string */,
10019 			// javac options
10020 			JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
10021 	}
10022 	// wildcard considers bound superclass or variable superclass
10023 	public void test0332() {
10024 		this.runNegativeTest(
10025 			new String[] {
10026 				"X.java",
10027 				"public class X<T extends Foo> {\n" +
10028 				"	T element;\n" +
10029 				"	X(T element) { \n" +
10030 				"		this.element = element; \n" +
10031 				"	}\n" +
10032 				"	static void baz(X<? extends IBar> x) {\n" + // captures Foo & IBar
10033 				"		x.element.foo();\n" +
10034 				"		x.element.bar();\n" +
10035 				"	}\n" +
10036 				"	public static void main(String[] args) {\n" +
10037 				"		baz(new X<FooBar>(new FooBar()));\n" +
10038 				"		baz(new X<Bar>(new Bar()));\n" +
10039 				"	}\n" +
10040 				"}\n" +
10041 				"interface IBar {\n" +
10042 				"	void bar();\n" +
10043 				"}\n" +
10044 				"\n" +
10045 				"class Bar implements IBar {\n" +
10046 				"	public void bar() {\n" +
10047 				"		System.out.print(\"BAR\");\n" +
10048 				"	}\n" +
10049 				"}\n" +
10050 				"\n" +
10051 				"class Foo {\n" +
10052 				"	public void foo() {\n" +
10053 				"		System.out.print(\"FOO\");\n" +
10054 				"	}\n" +
10055 				"}\n" +
10056 				"\n" +
10057 				"class FooBar extends Foo implements IBar {\n" +
10058 				"	public void bar() {\n" +
10059 				"		System.out.print(\"BAR\");\n" +
10060 				"	}\n" +
10061 				"}\n"	,
10062 			},
10063 		"----------\n" +
10064 		"1. ERROR in X.java (at line 12)\n" +
10065 		"	baz(new X<Bar>(new Bar()));\n" +
10066 		"	          ^^^\n" +
10067 		"Bound mismatch: The type Bar is not a valid substitute for the bounded parameter <T extends Foo> of the type X<T>\n" +
10068 		"----------\n");
10069 	}
10070 	// receveir generic cast matches receiver type (not declaring class)
10071 	public void test0333() {
10072 		this.runConformTest(
10073 			new String[] {
10074 				"X.java",
10075 				"public class X<T> {\n" +
10076 				"	T element;\n" +
10077 				"	X(T element) { this.element = element; }\n" +
10078 				"	T element() { return this.element; }\n" +
10079 				"	public static void main(String[] args) {\n" +
10080 				"		new X<XB>(new XB()).element().afoo();\n" +
10081 				"	}\n" +
10082 				"}\n" +
10083 				"\n" +
10084 				"class XA {\n" +
10085 				"	void afoo() {\n" +
10086 				"		System.out.println(\"SUCCESS\");\n" +
10087 				"   }\n" +
10088 				"}\n" +
10089 				"class XB extends XA {\n" +
10090 				"	void bfoo() {}\n" +
10091 				"}\n"	,
10092 			},
10093 		"SUCCESS");
10094 	}
10095 	// check cannot allocate type parameters
10096 	public void test0334() {
10097 		this.runNegativeTest(
10098 			new String[] {
10099 				"X.java",
10100 				"public class X <E> {\n" +
10101 				"  public X() {\n" +
10102 				"  	new E();\n" +
10103 				"  	new E() {\n" +
10104 				"  		void perform() {\n" +
10105 				"  			run();\n" +
10106 				"  		}\n" +
10107 				"  	}.perform();\n" +
10108 				"  }\n" +
10109 				"}\n",
10110 			},
10111 			"----------\n" +
10112 			"1. ERROR in X.java (at line 3)\n" +
10113 			"	new E();\n" +
10114 			"	    ^\n" +
10115 			"Cannot instantiate the type E\n" +
10116 			"----------\n" +
10117 			"2. ERROR in X.java (at line 4)\n" +
10118 			"	new E() {\n" +
10119 			"  		void perform() {\n" +
10120 			"  			run();\n" +
10121 			"  		}\n" +
10122 			"  	}.perform();\n" +
10123 			"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
10124 			"Cannot refer to the type parameter E as a supertype\n" +
10125 			"----------\n");
10126 	}
10127 	// variation - check cannot allocate type parameters
10128 	public void test0335() {
10129 		this.runNegativeTest(
10130 			new String[] {
10131 				"X.java",
10132 				"public class X <E extends String> {\n" + // firstBound is class, still cannot be instantiated
10133 				"  public X() {\n" +
10134 				"  	new E();\n" +
10135 				"  	new E() {\n" +
10136 				"  		void perform() {\n" +
10137 				"  			run();\n" +
10138 				"  		}\n" +
10139 				"  	}.perform();\n" +
10140 				"  }\n" +
10141 				"}\n",
10142 			},
10143 			"----------\n" +
10144 			"1. WARNING in X.java (at line 1)\n" +
10145 			"	public class X <E extends String> {\n" +
10146 			"	                          ^^^^^^\n" +
10147 			"The type parameter E should not be bounded by the final type String. Final types cannot be further extended\n" +
10148 			"----------\n" +
10149 			"2. ERROR in X.java (at line 3)\n" +
10150 			"	new E();\n" +
10151 			"	    ^\n" +
10152 			"Cannot instantiate the type E\n" +
10153 			"----------\n" +
10154 			"3. ERROR in X.java (at line 4)\n" +
10155 			"	new E() {\n" +
10156 			"  		void perform() {\n" +
10157 			"  			run();\n" +
10158 			"  		}\n" +
10159 			"  	}.perform();\n" +
10160 			"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
10161 			"Cannot refer to the type parameter E as a supertype\n" +
10162 			"----------\n");
10163 	}
10164 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=74669
10165 	public void test0336() {
10166 		this.runNegativeTest(
10167 			new String[] {
10168 				"X.java",
10169 				"interface IMyInterface {\n" +
10170 				"}\n" +
10171 				"class MyClass <Type> {\n" +
10172 				"\n" +
10173 				"	public <Type> Type myMethod(Object obj, Class type) {\n" +
10174 				"		return null;\n" +
10175 				"	}\n" +
10176 				"	public static <Type> Type myStaticMethod(Object obj, Class type) {\n" +
10177 				"		return null;\n" +
10178 				"	}\n" +
10179 				"}\n" +
10180 				"public class X {\n" +
10181 				"    public IMyInterface getThis() {\n" +
10182 				"		if (true)\n" +
10183 				"			return new MyClass().myMethod(this, IMyInterface.class);\n" +
10184 				"		else\n" +
10185 				"			return MyClass.myStaticMethod(this, IMyInterface.class);\n" +
10186 				"    }\n" +
10187 				"}\n",
10188 			},
10189 			"----------\n" +
10190 			"1. WARNING in X.java (at line 5)\n" +
10191 			"	public <Type> Type myMethod(Object obj, Class type) {\n" +
10192 			"	        ^^^^\n" +
10193 			"The type parameter Type is hiding the type Type\n" +
10194 			"----------\n" +
10195 			"2. WARNING in X.java (at line 5)\n" +
10196 			"	public <Type> Type myMethod(Object obj, Class type) {\n" +
10197 			"	                                        ^^^^^\n" +
10198 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
10199 			"----------\n" +
10200 			"3. WARNING in X.java (at line 8)\n" +
10201 			"	public static <Type> Type myStaticMethod(Object obj, Class type) {\n" +
10202 			"	                                                     ^^^^^\n" +
10203 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
10204 			"----------\n" +
10205 			"4. ERROR in X.java (at line 15)\n" +
10206 			"	return new MyClass().myMethod(this, IMyInterface.class);\n" +
10207 			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
10208 			"Type mismatch: cannot convert from Object to IMyInterface\n" +
10209 			"----------\n" +
10210 			"5. WARNING in X.java (at line 15)\n" +
10211 			"	return new MyClass().myMethod(this, IMyInterface.class);\n" +
10212 			"	           ^^^^^^^\n" +
10213 			"MyClass is a raw type. References to generic type MyClass<Type> should be parameterized\n" +
10214 			"----------\n");
10215 	}
10216 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=77078
10217 	public void test0337() {
10218 		this.runConformTest(
10219 			new String[] {
10220 				"X.java",
10221 				"import java.util.Vector;\n" +
10222 				"public class X {\n" +
10223 				"    public void foo() {\n" +
10224 				"        Vector<Object> objectVector = new Vector<Object>() {\n" +
10225 				"            protected void bar() {\n" +
10226 				"                baz(this); /* ERROR */\n" +
10227 				"            }\n" +
10228 				"        };\n" +
10229 				"        baz(objectVector);\n" +
10230 				"        baz(new Vector<Object>());\n" +
10231 				"    }\n" +
10232 				"    public void baz(Vector<?> mysteryVector) { }\n" +
10233 				"}\n",
10234 			},
10235 			"");
10236 	}
10237 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=77052
10238 	public void test0338() {
10239 		this.runConformTest(
10240 			new String[] {
10241 				"X.java",
10242 				"interface M<X> { }\n" +
10243 				"\n" +
10244 				"class N<C> { \n" +
10245 				"  M<N<C>> pni = null;\n" +
10246 				"}\n" +
10247 				"\n" +
10248 				"public class X<I> {\n" +
10249 				"  N<I> var1 = null;\n" +
10250 				"\n" +
10251 				"  M<N<I>> var2 = var1.pni;\n" +
10252 				"  // Above line reports as error in Eclipse. \n" +
10253 				"  // \"var2\" is underlined and the error message is: \n" +
10254 				"  // Type mismatch: cannot convert from M<N<C>> to M<N<I>>\n" +
10255 				"}\n",
10256 			},
10257 			"");
10258 	}
10259 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=77052 - variation
10260 	public void test0339() {
10261 		this.runConformTest(
10262 			new String[] {
10263 				"X.java",
10264 				"import java.util.Iterator;\n" +
10265 				"import java.util.Set;\n" +
10266 				"\n" +
10267 				"class X <K, V> {\n" +
10268 				"	static class Entry<K, V> {}\n" +
10269 				"	void foo() {\n" +
10270 				"		Iterator<Entry<K,V>> i = entrySet().iterator();\n" +
10271 				"	}\n" +
10272 				"	Set<Entry<K,V>> entrySet()	 { return null; }\n" +
10273 				"}\n",
10274 			},
10275 			"");
10276 	}
10277 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=76313
10278 	public void test0340() {
10279 		this.runConformTest(
10280 			new String[] {
10281 				"X.java",
10282 				"public class X<T> {\n" +
10283 				"	private T data;\n" +
10284 				"	private X(T data){ this.data=data; }\n" +
10285 				"	public static <S> X<S> createObject(S data){\n" +
10286 				"		System.out.println(data);\n" +
10287 				"		return new X<S>(data);\n" +
10288 				"	}\n" +
10289 				"	public static void main(String[] args) {\n" +
10290 				"		X<String> res=X.createObject(\"Hallo\");\n" +
10291 				"	}\n" +
10292 				"}\n",
10293 			},
10294 			"Hallo");
10295 	}
10296 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=77118
10297 	public void test0341() {
10298 		this.runConformTest(
10299 			new String[] {
10300 				"X.java",
10301 				"public class X {\n" +
10302 				"	public Object getItem() { return null; }\n" +
10303 				"}\n",
10304 				"Y.java",
10305 				"public class Y extends X {\n" +
10306 				"	public String getItem() { return null; }\n" +
10307 				"}\n",
10308 				"Z.java",
10309 				"public class Z extends X {\n" +
10310 				"	public Comparable getItem() { return null; }\n" +
10311 				"}\n",
10312 			},
10313 			"");
10314 	}
10315 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=77142 - check no raw unsafe warning is issued when accessing generic method from raw type
10316 	public void test0342() {
10317 		this.runNegativeTest(
10318 			new String[] {
10319 				"Test.java",
10320 				"class MyClass<T> {\n" +
10321 				"		 \n" +
10322 				"		 private T thing;\n" +
10323 				"       { Zork z; }\n" +
10324 				"		 \n" +
10325 				"		 public\n" +
10326 				"		 MyClass(T thing) {\n" +
10327 				"		 		 this.thing = thing;\n" +
10328 				"		 }\n" +
10329 				"		 \n" +
10330 				"		 public static <U> MyClass<U>\n" +
10331 				"		 factoryMakeMyClass(U thing)		 {\n" +
10332 				"		 		 return new MyClass<U>(thing);\n" +
10333 				"		 }\n" +
10334 				"}\n" +
10335 				"\n" +
10336 				"class External {\n" +
10337 				"\n" +
10338 				"		 public static <U> MyClass<U>\n" +
10339 				"		 factoryMakeMyClass(U thing)		 {\n" +
10340 				"		 		 return new MyClass<U>(thing);\n" +
10341 				"		 }\n" +
10342 				"}\n" +
10343 				"\n" +
10344 				"public class Test {\n" +
10345 				"		 public static void\n" +
10346 				"		 test()\n" +
10347 				"		 {\n" +
10348 				"		 		 // No problem with this line:\n" +
10349 				"		 		 MyClass<String> foo = External.factoryMakeMyClass(\"hi\");\n" +
10350 				"		 		 \n" +
10351 				"		 		 // This line gives me an error:\n" +
10352 				"		 		 // Type mismatch: cannot convert from MyClass<Object> to MyClass<String>\n" +
10353 				"		 		 MyClass<String> bar = MyClass.factoryMakeMyClass(\"hi\");\n" +
10354 				"		 		 MyClass<String> bar2 = MyClass.<String>factoryMakeMyClass(\"hi\");\n" +
10355 				"		 }\n" +
10356 				"}\n",
10357 			},
10358 			"----------\n" +
10359 			"1. ERROR in Test.java (at line 4)\n" +
10360 			"	{ Zork z; }\n" +
10361 			"	  ^^^^\n" +
10362 			"Zork cannot be resolved to a type\n" +
10363 			"----------\n");
10364 	}
10365 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=74588
10366 	public void test0343() {
10367 		this.runConformTest(
10368 			new String[] {
10369 				"X.java",
10370 				"public class X<T extends Number> {\n" +
10371 				"    T m;\n" +
10372 				"\n" +
10373 				"    class Y<T> {\n" +
10374 				"        void test() {\n" +
10375 				"            new Y<Integer>() {\n" +
10376 				"                void test() {\n" +
10377 				"                    System.out.println(X.this.m);\n" +
10378 				"                }\n" +
10379 				"            }.test();\n" +
10380 				"        }\n" +
10381 				"    }\n" +
10382 				"}\n" +
10383 				"\n",
10384 			},
10385 			"");
10386 	}
10387 	// checking scenario where generic type and method share the same type parameter name
10388 	public void test0344() {
10389 		if (this.complianceLevel < ClassFileConstants.JDK1_7) {
10390 			this.runNegativeTest(
10391 				new String[] {
10392 					"X.java",
10393 					"import java.io.IOException;\n" +
10394 					"\n" +
10395 					"public abstract class X<T extends Runnable> {\n" +
10396 					"	\n" +
10397 					"	public abstract <T extends Exception> T bar(T t);\n" +
10398 					"\n" +
10399 					"	static void foo(X x) {\n" +
10400 					"		x.<Exception>bar(null);\n" +
10401 					"		\n" +
10402 					"		class R implements Runnable {\n" +
10403 					"			public void run() {\n" +
10404 					"			}\n" +
10405 					"		}\n" +
10406 					"		X<R> xr = new X<R>(){  \n" +
10407 					"			public <T> T bar(T t) { \n" +
10408 					"				return t; \n" +
10409 					"			}\n" +
10410 					"		};\n" +
10411 					"		IOException e = xr.bar(new IOException());\n" +
10412 					"	}\n" +
10413 					"}\n"
10414 				},
10415 				"----------\n" +
10416 				"1. WARNING in X.java (at line 5)\n" +
10417 				"	public abstract <T extends Exception> T bar(T t);\n" +
10418 				"	                 ^\n" +
10419 				"The type parameter T is hiding the type T\n" +
10420 				"----------\n" +
10421 				"2. WARNING in X.java (at line 7)\n" +
10422 				"	static void foo(X x) {\n" +
10423 				"	                ^\n" +
10424 				"X is a raw type. References to generic type X<T> should be parameterized\n" +
10425 				"----------\n" +
10426 				"3. ERROR in X.java (at line 8)\n" +
10427 				"	x.<Exception>bar(null);\n" +
10428 				"	             ^^^\n" +
10429 				"The method bar(Exception) of raw type X is no longer generic; it cannot be parameterized with arguments <Exception>\n" +
10430 				"----------\n" +
10431 				"4. ERROR in X.java (at line 14)\n" +
10432 				"	X<R> xr = new X<R>(){  \n" +
10433 				"	              ^^^^^^\n" +
10434 				"The type new X<R>(){} must implement the inherited abstract method X<R>.bar(T)\n" +
10435 				"----------\n");
10436 			return;
10437 		}
10438 		this.runNegativeTest(
10439 				new String[] {
10440 					"X.java",
10441 					"import java.io.IOException;\n" +
10442 					"\n" +
10443 					"public abstract class X<T extends Runnable> {\n" +
10444 					"	\n" +
10445 					"	public abstract <T extends Exception> T bar(T t);\n" +
10446 					"\n" +
10447 					"	static void foo(X x) {\n" +
10448 					"		x.<Exception>bar(null);\n" +
10449 					"		\n" +
10450 					"		class R implements Runnable {\n" +
10451 					"			public void run() {\n" +
10452 					"			}\n" +
10453 					"		}\n" +
10454 					"		X<R> xr = new X<R>(){  \n" +
10455 					"			public <T> T bar(T t) { \n" +
10456 					"				return t; \n" +
10457 					"			}\n" +
10458 					"		};\n" +
10459 					"		IOException e = xr.bar(new IOException());\n" +
10460 					"	}\n" +
10461 					"}\n"
10462 				},
10463 				"----------\n" +
10464 				"1. WARNING in X.java (at line 5)\n" +
10465 				"	public abstract <T extends Exception> T bar(T t);\n" +
10466 				"	                 ^\n" +
10467 				"The type parameter T is hiding the type T\n" +
10468 				"----------\n" +
10469 				"2. WARNING in X.java (at line 7)\n" +
10470 				"	static void foo(X x) {\n" +
10471 				"	                ^\n" +
10472 				"X is a raw type. References to generic type X<T> should be parameterized\n" +
10473 				"----------\n" +
10474 				"3. WARNING in X.java (at line 8)\n" +
10475 				"	x.<Exception>bar(null);\n" +
10476 				"	^^^^^^^^^^^^^^^^^^^^^^\n" +
10477 				"Type safety: The method bar(Exception) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
10478 				"----------\n" +
10479 				"4. ERROR in X.java (at line 14)\n" +
10480 				"	X<R> xr = new X<R>(){  \n" +
10481 				"	              ^^^^^^\n" +
10482 				"The type new X<R>(){} must implement the inherited abstract method X<R>.bar(T)\n" +
10483 				"----------\n");
10484 	}
10485 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=74594
10486 	public void test0345() {
10487 		this.runConformTest(
10488 			new String[] {
10489 				"X.java",
10490 				"public class X {\n" +
10491 				"    public static void main(String argv[]) {\n" +
10492 				"       X1<Integer> o1 = new X1<Integer>();\n" +
10493 				"        ((J<Integer>)o1).get();\n" +
10494 				"    }\n" +
10495 				"}\n" +
10496 				"\n" +
10497 				"class X1<T> implements I<T> {\n" +
10498 				"    public X1 get() {\n" +
10499 				"    	System.out.println(\"SUCCESS\");\n" +
10500 				"        return this;\n" +
10501 				"    }\n" +
10502 				"}\n" +
10503 				"\n" +
10504 				"interface I<T> extends J<T> {\n" +
10505 				"    I get();\n" +
10506 				"}\n" +
10507 				"\n" +
10508 				"interface J<T>  {\n" +
10509 				"    J get();\n" +
10510 				"}",
10511 			},
10512 			"SUCCESS");
10513 	}
10514 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=74594
10515 	public void test0346() {
10516 		this.runConformTest(
10517 			new String[] {
10518 				"X.java",
10519 				"public class X {\n" +
10520 				"    public static void main(String argv[]) {\n" +
10521 				"       X1<Integer> o1 = new X1<Integer>(new Integer(4));\n" +
10522 				"        System.out.println(o1.get().t);\n" +
10523 				"    }\n" +
10524 				"}\n" +
10525 				"\n" +
10526 				"class X1<T> implements I<T> {\n" +
10527 				"    T t;\n" +
10528 				"    X1(T arg) {\n" +
10529 				"        t = arg;\n" +
10530 				"    }\n" +
10531 				"    public X1 get() {\n" +
10532 				"        return this;\n" +
10533 				"    }\n" +
10534 				"}\n" +
10535 				"\n" +
10536 				"interface I<T> extends J<T> {\n" +
10537 				"    I get();\n" +
10538 				"}\n" +
10539 				"\n" +
10540 				"interface J<T>  {\n" +
10541 				"    J get();\n" +
10542 				"}"
10543 	,
10544 			},
10545 			"4");
10546 	}
10547 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=74594
10548 	public void test0347() {
10549 		this.runConformTest(
10550 			new String[] {
10551 				"X.java",
10552 				"public class X {\n" +
10553 				"    public static void main(String argv[]) {\n" +
10554 				"        X1<Integer> o = new X1<Integer>(new Integer(4));\n" +
10555 				"        System.out.println(o.get().t);\n" +
10556 				"    }\n" +
10557 				"}\n" +
10558 				"\n" +
10559 				"class X1<T> implements I<T> {\n" +
10560 				"    T t;\n" +
10561 				"    X1(T arg) {\n" +
10562 				"        t = arg;\n" +
10563 				"    }\n" +
10564 				"    public X1 get() {\n" +
10565 				"        return this;\n" +
10566 				"    }\n" +
10567 				"}    \n" +
10568 				"\n" +
10569 				"interface I<T> extends K<T>, L<T> {\n" +
10570 				"    I get();\n" +
10571 				"}\n" +
10572 				"\n" +
10573 				"interface J<T>  {\n" +
10574 				"    J get();\n" +
10575 				"}\n" +
10576 				"\n" +
10577 				"interface K<T> extends J<T> {\n" +
10578 				"}\n" +
10579 				"\n" +
10580 				"interface L<T>  {\n" +
10581 				"    K get();\n" +
10582 				"}",
10583 			},
10584 			"4");
10585 	}
10586 	// checking scenario where generic type and method share the same type parameter name
10587 	public void test0348() {
10588 		if (this.complianceLevel < ClassFileConstants.JDK1_7) {
10589 			this.runNegativeTest(
10590 				new String[] {
10591 					"X.java",
10592 					"import java.io.IOException;\n" +
10593 					"public abstract class X<T extends Runnable> {\n" +
10594 					"	public abstract <T extends Exception> T bar(T t);\n" +
10595 					"	static void foo(X x) {\n" +
10596 					"		x.<Exception>bar(null);\n" +
10597 					"		class R implements Runnable {\n" +
10598 					"			public void run() {}\n" +
10599 					"		}\n" +
10600 					"		X<R> xr = new X<R>(){  \n" +
10601 					"			public <T extends Exception> T bar(T t) { return t; }\n" +
10602 					"		};\n" +
10603 					"		IOException e = xr.bar(new IOException());\n" +
10604 					"	}\n" +
10605 					"}\n"
10606 				},
10607 				"----------\n" +
10608 				"1. WARNING in X.java (at line 3)\n" +
10609 				"	public abstract <T extends Exception> T bar(T t);\n" +
10610 				"	                 ^\n" +
10611 				"The type parameter T is hiding the type T\n" +
10612 				"----------\n" +
10613 				"2. WARNING in X.java (at line 4)\n" +
10614 				"	static void foo(X x) {\n" +
10615 				"	                ^\n" +
10616 				"X is a raw type. References to generic type X<T> should be parameterized\n" +
10617 				"----------\n" +
10618 				"3. ERROR in X.java (at line 5)\n" +
10619 				"	x.<Exception>bar(null);\n" +
10620 				"	             ^^^\n" +
10621 				"The method bar(Exception) of raw type X is no longer generic; it cannot be parameterized with arguments <Exception>\n" +
10622 				"----------\n" +
10623 				"4. WARNING in X.java (at line 10)\n" +
10624 				"	public <T extends Exception> T bar(T t) { return t; }\n" +
10625 				"	                               ^^^^^^^^\n" +
10626 				"The method bar(T) of type new X<R>(){} should be tagged with @Override since it actually overrides a superclass method\n" +
10627 				"----------\n",
10628 				JavacTestOptions.EclipseHasABug.EclipseBug236242);
10629 			return;
10630 		}
10631 		this.runNegativeTest(
10632 				new String[] {
10633 					"X.java",
10634 					"import java.io.IOException;\n" +
10635 					"public abstract class X<T extends Runnable> {\n" +
10636 					"	public abstract <T extends Exception> T bar(T t);\n" +
10637 					"	static void foo(X x) {\n" +
10638 					"		x.<Exception>bar(null);\n" +
10639 					"		class R implements Runnable {\n" +
10640 					"			public void run() { zork = 0; }\n" +
10641 					"		}\n" +
10642 					"		X<R> xr = new X<R>(){  \n" +
10643 					"			public <T extends Exception> T bar(T t) { return t; }\n" +
10644 					"		};\n" +
10645 					"		IOException e = xr.bar(new IOException());\n" +
10646 					"	}\n" +
10647 					"}\n"
10648 				},
10649 				"----------\n" +
10650 				"1. WARNING in X.java (at line 3)\n" +
10651 				"	public abstract <T extends Exception> T bar(T t);\n" +
10652 				"	                 ^\n" +
10653 				"The type parameter T is hiding the type T\n" +
10654 				"----------\n" +
10655 				"2. WARNING in X.java (at line 4)\n" +
10656 				"	static void foo(X x) {\n" +
10657 				"	                ^\n" +
10658 				"X is a raw type. References to generic type X<T> should be parameterized\n" +
10659 				"----------\n" +
10660 				"3. WARNING in X.java (at line 5)\n" +
10661 				"	x.<Exception>bar(null);\n" +
10662 				"	^^^^^^^^^^^^^^^^^^^^^^\n" +
10663 				"Type safety: The method bar(Exception) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
10664 				"----------\n" +
10665 				"4. ERROR in X.java (at line 7)\n" +
10666 				"	public void run() { zork = 0; }\n" +
10667 				"	                    ^^^^\n" +
10668 				"zork cannot be resolved to a variable\n" +
10669 				"----------\n" +
10670 				"5. WARNING in X.java (at line 10)\n" +
10671 				"	public <T extends Exception> T bar(T t) { return t; }\n" +
10672 				"	                               ^^^^^^^^\n" +
10673 				"The method bar(T) of type new X<R>(){} should be tagged with @Override since it actually overrides a superclass method\n" +
10674 				"----------\n",
10675 				JavacTestOptions.EclipseHasABug.EclipseBug236242);
10676 	}
10677 	// test wildcard compatibilities
10678 	public void test0349() {
10679 		this.runConformTest(
10680 			new String[] {
10681 				"X.java",
10682 				"public class X<T> {\n" +
10683 				"	T element;\n" +
10684 				"	static void foo(X<? super Exception> out, X1<? extends Exception> in) {\n" +
10685 				"		out.element = in.element;\n" +
10686 				"	}\n" +
10687 				"	public static void main(String[] args) {\n" +
10688 				"		System.out.println(\"SUCCESS\");\n" +
10689 				"	}\n" +
10690 				"}\n" +
10691 				"class X1<U>{\n" +
10692 				"	U element;\n" +
10693 				"}\n",
10694 			},
10695 			"SUCCESS");
10696 	}
10697 	// test wildcard compatibilities
10698 	public void test0350() {
10699 		this.runNegativeTest(
10700 			new String[] {
10701 				"X.java",
10702 				"public class X<T> {\n" +
10703 				"	T element;\n" +
10704 				"	static void foo(X<?> out, X1<?> in) {\n" +
10705 				"		out.element = in.element;\n" +
10706 				"	}\n" +
10707 				"}\n" +
10708 				"class X1<U>{\n" +
10709 				"	U element;\n" +
10710 				"}\n",
10711 			},
10712 			"----------\n" +
10713 			"1. ERROR in X.java (at line 4)\n" +
10714 			"	out.element = in.element;\n" +
10715 			"	              ^^^^^^^^^^\n" +
10716 			"Type mismatch: cannot convert from capture#2-of ? to capture#1-of ?\n" +
10717 			"----------\n");
10718 	}
10719 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=75328
10720 	public void test0351() {
10721 		this.runConformTest(
10722 			new String[] {
10723 				"X.java",
10724 				"interface Intf<D extends Comparable<D>, I extends Comparable<D>> { \n" +
10725 				"  public void f(Intf<D,?> val);\n" +
10726 				"}\n" +
10727 				"\n" +
10728 				"public class X <M extends Comparable<M>, P extends Comparable<M>>  implements Intf<M,P> {\n" +
10729 				"\n" +
10730 				"  public void f(Intf<M,?> val) { } \n" +
10731 				"}\n",
10732 			},
10733 			"");
10734 	}
10735 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=77051
10736 	public void test0352() {
10737 		this.runConformTest(
10738 			new String[] {
10739 				"X.java",
10740 				"interface C<A> { }\n" +
10741 				"interface PC<X> extends C<X> { } \n" +
10742 				"interface PO<Y>  {  \n" +
10743 				"	  C<Y> proc1();\n" +
10744 				"	  C<? super Y> proc2();\n" +
10745 				"	  C<? extends Y> proc3();\n" +
10746 				"}\n" +
10747 				"abstract class X<Z> implements PO<Z> {\n" +
10748 				"	  public C<Z> proc1() { return result1; }\n" +
10749 				"	  private final PC<Z> result1 = null;\n" +
10750 				"	  public C<? super Z> proc2() { return result2; }\n" +
10751 				"	  private final PC<? super Z> result2 = null;\n" +
10752 				"	  public C<? extends Z> proc3() { return result3; }\n" +
10753 				"	  private final PC<? extends Z> result3 = null;\n" +
10754 				"}\n",
10755 			},
10756 			"");
10757 	}
10758 	public void test0353() {
10759 		this.runConformTest(
10760 			new String[] {
10761 				"X.java",
10762 				"public class X extends Y {\n" +
10763 				"	<T> T foo(Class<T> c) { return null; }\n" +
10764 				"}\n" +
10765 				"class Y {\n" +
10766 				"	<T> T foo(Class<T> c) { return null; }\n" +
10767 				"}"
10768 			},
10769 			"");
10770 	}
10771 	public void test0354() {
10772 		this.runConformTest(
10773 			new String[] {
10774 				"X.java",
10775 				"public class X extends Y {\n" +
10776 				"	<T, S> S foo(Class<T> c) { return null; }\n" +
10777 				"}\n" +
10778 				"class Y {\n" +
10779 				"	<S, T> T foo(Class<S> c) { return null; }\n" +
10780 				"}"
10781 			},
10782 			"");
10783 	}
10784 	public void test0355() {
10785 		this.runNegativeTest(
10786 			new String[] {
10787 				"X.java",
10788 				"public class X extends Y {\n" +
10789 				"	<T, S> S foo(Class<S> c) { return null; }\n" +
10790 				"}\n" +
10791 				"class Y {\n" +
10792 				"	<S, T> S foo(Class<S> c) { return null; }\n" +
10793 				"}"
10794 			},
10795 			"----------\n" +
10796 			"1. ERROR in X.java (at line 2)\n" +
10797 			"	<T, S> S foo(Class<S> c) { return null; }\n" +
10798 			"	         ^^^^^^^^^^^^^^^\n" +
10799 			"Name clash: The method foo(Class<S>) of type X has the same erasure as foo(Class<S>) of type Y but does not override it\n" +
10800 			"----------\n");
10801 	}
10802 	public void test0356() {
10803 		this.runNegativeTest(
10804 			new String[] {
10805 				"X.java",
10806 				"public class X extends Y {\n" +
10807 				"	<T, S> T foo(Class<T> c) { return null; }\n" +
10808 				"}\n" +
10809 				"class Y {\n" +
10810 				"	<T> T foo(Class<T> c) { return null; }\n" +
10811 				"}"
10812 			},
10813 			"----------\n" +
10814 			"1. ERROR in X.java (at line 2)\n" +
10815 			"	<T, S> T foo(Class<T> c) { return null; }\n" +
10816 			"	         ^^^^^^^^^^^^^^^\n" +
10817 			"Name clash: The method foo(Class<T>) of type X has the same erasure as foo(Class<T>) of type Y but does not override it\n" +
10818 			"----------\n");
10819 	}
10820 	public void test0357() {
10821 		this.runNegativeTest(
10822 			new String[] {
10823 				"X.java",
10824 				"public class X extends Y {\n" +
10825 				"	<T> T foo(Class<T> c) { return null; }\n" +
10826 				"}\n" +
10827 				"class Y {\n" +
10828 				"	<T, S> T foo(Class<T> c) { return null; }\n" +
10829 				"}"
10830 			},
10831 			"----------\n" +
10832 			"1. ERROR in X.java (at line 2)\n" +
10833 			"	<T> T foo(Class<T> c) { return null; }\n" +
10834 			"	      ^^^^^^^^^^^^^^^\n" +
10835 			"Name clash: The method foo(Class<T>) of type X has the same erasure as foo(Class<T>) of type Y but does not override it\n" +
10836 			"----------\n");
10837 	}
10838 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=76720
10839 	public void test0358() {
10840 		this.runConformTest(
10841 			new String[] {
10842 				"MyClass.java",
10843 				"public class MyClass {}\n",
10844 				"A.java",
10845 				"public interface A<M extends MyClass> {}\n",
10846 				"B.java",
10847 				"public interface B<M extends MyClass> extends A<M> {}\n",
10848 				"C.java",
10849 				"public class C implements B<MyClass> {}\n", // compile against sources
10850 				"D.java",
10851 				"public class D implements A<MyClass>{}\n", // compile against sources
10852 			},
10853 			"");
10854 		// compile against generated binaries
10855 		this.runConformTest(
10856 			new String[] {
10857 				"C.java",
10858 				"public class C implements B<MyClass> {}\n",
10859 				"D.java",
10860 				"public class D implements A<MyClass>{}\n",
10861 			},
10862 			"",
10863 			null,
10864 			false,
10865 			null);
10866 	}
10867 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=76790
10868 	public void test0359() {
10869 		this.runConformTest(
10870 			new String[] {
10871 				"X.java",
10872 				"import java.util.*;\n" +
10873 					"public class X {\n" +
10874 					"    class List1<E> extends LinkedList<E> {};\n" +
10875 					"    public static void main (String[] args) {\n" +
10876 					"        Map<String, List<Integer>> x = new HashMap<String, List<Integer>>();\n" +
10877 					"        Map<String, List1<Integer>> m = new HashMap<String, List1<Integer>>();\n" +
10878 					"    }\n" +
10879 					"}"
10880 			}
10881 		);
10882 	}
10883 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=76786
10884 	public void test0360() {
10885 		this.runConformTest(
10886 			new String[] {
10887 				"Test.java",
10888 				"import java.lang.Comparable;\n" +
10889 					"public class Test {\n" +
10890 					"    private static final class X<T1, T2> implements Comparable<X<T1, T2>> {\n" +
10891 					"        public int compareTo(X<T1, T2> arg0) { return 0; }\n" +
10892 					"    };\n" +
10893 					"    private static class Y<T1, T2> {};\n" +
10894 					"    private static final class Z<T1, T2> extends Y<T1, T2> implements Comparable<Z<T1, T2>> {\n" +
10895 					"        public int compareTo(Z<T1, T2> arg0) { return 0; }\n" +
10896 					"    };\n" +
10897 					"    public static <T> void doSomething(Comparable<? super T> a, Comparable<? super T> b) {}\n" +
10898 					"    public static <V1, V2> void doSomethingElse(Z<V1, V2> a, Z<V1, V2> b) {\n" +
10899 					"        doSomething(a, b);\n" +
10900 					"    }\n" +
10901 					"    private static final class W { };\n" +
10902 					"    public static void main(String[] args) {\n" +
10903 					"        doSomething(new X<Integer, String>(), new X<Integer, String>());\n" +
10904 					"        doSomething(new Z<Integer, String>(), new Z<Integer, String>());\n" +
10905 					"        doSomethingElse(new Z<Integer, String>(), new Z<Integer, String>());\n" +
10906 					"        doSomethingElse(new Z<W, String>(), new Z<W, String>());\n" +
10907 					"        // The next line won\'t compile.  It\'s the generic<generic which seems\n" +
10908 					"        // to be the problem\n" +
10909 					"        doSomethingElse(new Z<X<W, W>, String>(), new Z<X<W, W>, String>());\n" +
10910 					"    }\n" +
10911 					"}"
10912 			}
10913 		);
10914 	}
10915 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=75525
10916 	public void test0361() {
10917 		this.runConformTest(
10918 			new String[] {
10919 				"Test.java",
10920 				"import java.util.AbstractSet;\n" +
10921 					"import java.util.Iterator;\n" +
10922 					"import java.util.Map.Entry;\n" +
10923 					"public class Test extends AbstractSet<Entry<String,Integer>> {\n" +
10924 					"	public Iterator<Entry<String, Integer>> iterator() {\n" +
10925 					"		return new Iterator<Entry<String,Integer>>() {\n" +
10926 					"			public boolean hasNext() {return false;}\n" +
10927 					"			public Entry<String, Integer> next() {return null;}\n" +
10928 					"			public void remove() {}	\n" +
10929 					"		};\n" +
10930 					"	}\n" +
10931 					"	public int size() {return 0;}\n" +
10932 					"}"
10933 			}
10934 		);
10935 	}
10936 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=72643
10937 	public void test0362() {
10938 		Map customOptions= getCompilerOptions();
10939 		customOptions.put(CompilerOptions.OPTION_ReportUnusedPrivateMember, CompilerOptions.ERROR);
10940 		this.runConformTest(
10941 			new String[] {
10942 				"Test.java",
10943 				"import java.util.ArrayList;\n" +
10944 					"import java.util.List;\n" +
10945 					"public class Test {\n" +
10946 					"   public void a() {\n" +
10947 					"      List<String> list1 = new ArrayList<String>();\n" +
10948 					"      List<String> list2 = new ArrayList<String>();\n" +
10949 					"      compare(list1, list2);\n" +
10950 					"   }\n" +
10951 					"   private <E> void compare(List<E> list1, List<E> list2) {\n" +
10952 					"      // do some comparing logic...\n" +
10953 					"   }\n" +
10954 					"}\n" +
10955 					"\n"
10956 			},
10957 		"",
10958 		null,
10959 		true,
10960 		null,
10961 		customOptions,
10962 		null/*no custom requestor*/);
10963 	}
10964 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=76434
10965 	public void test0363() {
10966 		this.runNegativeTest(
10967 			new String[] {
10968 				"X.java",
10969 				"import java.util.Map;\n" +
10970 				"import java.util.Set;\n" +
10971 				"public class X {\n" +
10972 				"  Set<Map.Entry<Integer, ?>> m_values;\n" +
10973 				"  X(Map<Integer, ?> values) {\n" +
10974 				"    m_values = values.entrySet();\n" +
10975 				"  }\n" +
10976 				"}\n"
10977 			},
10978 			"----------\n" +
10979 			"1. ERROR in X.java (at line 6)\n" +
10980 			"	m_values = values.entrySet();\n" +
10981 			"	           ^^^^^^^^^^^^^^^^^\n" +
10982 			"Type mismatch: cannot convert from Set<Map.Entry<Integer,capture#1-of ?>> to Set<Map.Entry<Integer,?>>\n" +
10983 			"----------\n");
10984 	}
10985 	// check param type equivalences
10986 	public void test0364() {
10987 		this.runNegativeTest(
10988 			new String[] {
10989 				"X.java",
10990 				"public class X { \n" +
10991 				"	\n" +
10992 				"	void bar1(MX<Class<? extends String>> mxcs, MX<Class<? extends Object>> mxco) {\n" +
10993 				"		mxco = mxcs;\n" + // wrong
10994 				"	}\n" +
10995 				"	void bar1(Class<? extends String> cs, Class<? extends Object> co) {\n" +
10996 				"		co = cs;\n" + // ok
10997 				"	}\n" +
10998 				"	\n" +
10999 				"}\n" +
11000 				"class MX<E> {\n" +
11001 				"}\n"
11002 			},
11003 			"----------\n" +
11004 			"1. ERROR in X.java (at line 4)\n" +
11005 			"	mxco = mxcs;\n" +
11006 			"	       ^^^^\n" +
11007 			"Type mismatch: cannot convert from MX<Class<? extends String>> to MX<Class<? extends Object>>\n" +
11008 			"----------\n");
11009 	}
11010 	// check param type equivalences
11011 	public void test0365() {
11012 		this.runNegativeTest(
11013 			new String[] {
11014 				"X.java",
11015 				"public class X<T extends Runnable> {\n" +
11016 				"	\n" +
11017 				"	class MX <U> {\n" +
11018 				"	}\n" +
11019 				"	\n" +
11020 				"	MX<T> createMX() { return new MX<T>(); }\n" +
11021 				"\n" +
11022 				"	void foo(X<?> x, MX<?> mx) {\n" +
11023 				"		mx = x.createMX();\n" +
11024 				"	}\n" +
11025 				"}\n"
11026 			},
11027 			"----------\n" +
11028 			"1. ERROR in X.java (at line 9)\n" +
11029 			"	mx = x.createMX();\n" +
11030 			"	     ^^^^^^^^^^^^\n" +
11031 			"Type mismatch: cannot convert from X<capture#2-of ?>.MX<capture#2-of ?> to X<T>.MX<?>\n" +
11032 			"----------\n");
11033 	}
11034 	// check param type equivalences
11035 	public void test0366() {
11036 		this.runNegativeTest(
11037 			new String[] {
11038 				"X.java",
11039 				"public class X { \n" +
11040 				"	\n" +
11041 				"	void foo1(MX<Class<? extends Object>> target, MX<Class> value) {\n" +
11042 				"		target= value; // foo1 - wrong\n" +
11043 				"	}\n" +
11044 				"	void foo2(MX<Class<? extends Object>> target, MX<Class<? extends String>> value) {\n" +
11045 				"		target= value; // foo2 - wrong\n" +
11046 				"	}\n" +
11047 				"	void foo3(MX<Class<? extends Object>> target, MX<Class<? extends String>> value) {\n" +
11048 				"		target= value; // foo3 - wrong\n" +
11049 				"	}\n" +
11050 				"	void foo4(MX<Class<? extends Object>> target, MX<Class<String>> value) {\n" +
11051 				"		target= value; // foo4 - wrong\n" +
11052 				"	}\n" +
11053 				"	void foo5(MX<? extends Class> target, MX<Class> value) {\n" +
11054 				"		target= value; // foo5\n" +
11055 				"	}\n" +
11056 				"	void foo6(MX<? super Class> target, MX<Class> value) {\n" +
11057 				"		target= value; // foo6\n" +
11058 				"	}\n" +
11059 				"	void foo7(MX<Class<? extends Class>> target, MX<Class<Class>> value) {\n" +
11060 				"		target= value; // foo7 - wrong\n" +
11061 				"	}\n" +
11062 				"	void foo8(MX<MX<? extends Class>> target, MX<MX<Class>> value) {\n" +
11063 				"		target= value; // foo8 - wrong\n" +
11064 				"	}\n" +
11065 				"	void foo9(MX<? extends Object> target, MX<? extends String> value) {\n" +
11066 				"		target= value; // foo9\n" +
11067 				"	}\n" +
11068 				"	void foo10(MX<? extends String> target, MX<? extends Object> value) {\n" +
11069 				"		target= value; // foo10 - wrong\n" +
11070 				"	}\n" +
11071 				"	void foo11(MX<? super Object> target, MX<? super String> value) {\n" +
11072 				"		target= value; // foo11 - wrong\n" +
11073 				"	}\n" +
11074 				"	void foo12(MX<? super String> target, MX<? super Object> value) {\n" +
11075 				"		target= value; // foo12\n" +
11076 				"	}\n" +
11077 				"}\n" +
11078 				"\n" +
11079 				"class MX<E> {\n" +
11080 				"}\n"
11081 			},
11082 			"----------\n" +
11083 			"1. WARNING in X.java (at line 3)\n" +
11084 			"	void foo1(MX<Class<? extends Object>> target, MX<Class> value) {\n" +
11085 			"	                                                 ^^^^^\n" +
11086 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
11087 			"----------\n" +
11088 			"2. ERROR in X.java (at line 4)\n" +
11089 			"	target= value; // foo1 - wrong\n" +
11090 			"	        ^^^^^\n" +
11091 			"Type mismatch: cannot convert from MX<Class> to MX<Class<? extends Object>>\n" +
11092 			"----------\n" +
11093 			"3. ERROR in X.java (at line 7)\n" +
11094 			"	target= value; // foo2 - wrong\n" +
11095 			"	        ^^^^^\n" +
11096 			"Type mismatch: cannot convert from MX<Class<? extends String>> to MX<Class<? extends Object>>\n" +
11097 			"----------\n" +
11098 			"4. ERROR in X.java (at line 10)\n" +
11099 			"	target= value; // foo3 - wrong\n" +
11100 			"	        ^^^^^\n" +
11101 			"Type mismatch: cannot convert from MX<Class<? extends String>> to MX<Class<? extends Object>>\n" +
11102 			"----------\n" +
11103 			"5. ERROR in X.java (at line 13)\n" +
11104 			"	target= value; // foo4 - wrong\n" +
11105 			"	        ^^^^^\n" +
11106 			"Type mismatch: cannot convert from MX<Class<String>> to MX<Class<? extends Object>>\n" +
11107 			"----------\n" +
11108 			"6. WARNING in X.java (at line 15)\n" +
11109 			"	void foo5(MX<? extends Class> target, MX<Class> value) {\n" +
11110 			"	                       ^^^^^\n" +
11111 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
11112 			"----------\n" +
11113 			"7. WARNING in X.java (at line 15)\n" +
11114 			"	void foo5(MX<? extends Class> target, MX<Class> value) {\n" +
11115 			"	                                         ^^^^^\n" +
11116 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
11117 			"----------\n" +
11118 			"8. WARNING in X.java (at line 18)\n" +
11119 			"	void foo6(MX<? super Class> target, MX<Class> value) {\n" +
11120 			"	                     ^^^^^\n" +
11121 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
11122 			"----------\n" +
11123 			"9. WARNING in X.java (at line 18)\n" +
11124 			"	void foo6(MX<? super Class> target, MX<Class> value) {\n" +
11125 			"	                                       ^^^^^\n" +
11126 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
11127 			"----------\n" +
11128 			"10. WARNING in X.java (at line 21)\n" +
11129 			"	void foo7(MX<Class<? extends Class>> target, MX<Class<Class>> value) {\n" +
11130 			"	                             ^^^^^\n" +
11131 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
11132 			"----------\n" +
11133 			"11. WARNING in X.java (at line 21)\n" +
11134 			"	void foo7(MX<Class<? extends Class>> target, MX<Class<Class>> value) {\n" +
11135 			"	                                                      ^^^^^\n" +
11136 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
11137 			"----------\n" +
11138 			"12. ERROR in X.java (at line 22)\n" +
11139 			"	target= value; // foo7 - wrong\n" +
11140 			"	        ^^^^^\n" +
11141 			"Type mismatch: cannot convert from MX<Class<Class>> to MX<Class<? extends Class>>\n" +
11142 			"----------\n" +
11143 			"13. WARNING in X.java (at line 24)\n" +
11144 			"	void foo8(MX<MX<? extends Class>> target, MX<MX<Class>> value) {\n" +
11145 			"	                          ^^^^^\n" +
11146 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
11147 			"----------\n" +
11148 			"14. WARNING in X.java (at line 24)\n" +
11149 			"	void foo8(MX<MX<? extends Class>> target, MX<MX<Class>> value) {\n" +
11150 			"	                                                ^^^^^\n" +
11151 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
11152 			"----------\n" +
11153 			"15. ERROR in X.java (at line 25)\n" +
11154 			"	target= value; // foo8 - wrong\n" +
11155 			"	        ^^^^^\n" +
11156 			"Type mismatch: cannot convert from MX<MX<Class>> to MX<MX<? extends Class>>\n" +
11157 			"----------\n" +
11158 			"16. ERROR in X.java (at line 31)\n" +
11159 			"	target= value; // foo10 - wrong\n" +
11160 			"	        ^^^^^\n" +
11161 			"Type mismatch: cannot convert from MX<capture#6-of ? extends Object> to MX<? extends String>\n" +
11162 			"----------\n" +
11163 			"17. ERROR in X.java (at line 34)\n" +
11164 			"	target= value; // foo11 - wrong\n" +
11165 			"	        ^^^^^\n" +
11166 			"Type mismatch: cannot convert from MX<capture#7-of ? super String> to MX<? super Object>\n" +
11167 			"----------\n");
11168 	}
11169 	// check param type equivalences
11170 	public void test0367() {
11171 		this.runNegativeTest(
11172 			new String[] {
11173 				"X.java",
11174 				"public class X { \n" +
11175 				"	\n" +
11176 				"	void foo1(MX<? extends MX> target, MX<MX<String>> value) {\n" +
11177 				"		target= value; // foo1\n" +
11178 				"	}\n" +
11179 				"	void foo2(MX<?> target, MX<MX<String>> value) {\n" +
11180 				"		target= value; // foo2\n" +
11181 				"	}\n" +
11182 				"	void foo3(MX<? super MX> target, MX<MX<String>> value) {\n" +
11183 				"		target= value; // foo3\n" +
11184 				"	}\n" +
11185 				"}\n" +
11186 				"\n" +
11187 				"class MX<E> {\n" +
11188 				"}\n"	,
11189 			},
11190 			"----------\n" +
11191 			"1. WARNING in X.java (at line 3)\n" +
11192 			"	void foo1(MX<? extends MX> target, MX<MX<String>> value) {\n" +
11193 			"	                       ^^\n" +
11194 			"MX is a raw type. References to generic type MX<E> should be parameterized\n" +
11195 			"----------\n" +
11196 			"2. WARNING in X.java (at line 9)\n" +
11197 			"	void foo3(MX<? super MX> target, MX<MX<String>> value) {\n" +
11198 			"	                     ^^\n" +
11199 			"MX is a raw type. References to generic type MX<E> should be parameterized\n" +
11200 			"----------\n" +
11201 			"3. ERROR in X.java (at line 10)\n" +
11202 			"	target= value; // foo3\n" +
11203 			"	        ^^^^^\n" +
11204 			"Type mismatch: cannot convert from MX<MX<String>> to MX<? super MX>\n" +
11205 			"----------\n");
11206 	}
11207 	// check param type equivalences
11208 	public void test0368() {
11209 		this.runConformTest(
11210 			new String[] {
11211 				"X.java",
11212 				"public class X<T extends Runnable> {\n" +
11213 				"	\n" +
11214 				"	static class MX <U> {\n" +
11215 				"	}\n" +
11216 				"	\n" +
11217 				"	MX<T> createMX() { return new MX<T>(); }\n" +
11218 				"\n" +
11219 				"	void foo(X<?> x, MX<?> mx) {\n" +
11220 				"		mx = x.createMX();\n" +
11221 				"	}\n" +
11222 				"}\n"	,
11223 			},
11224 			"");
11225 	}
11226 	// bound check for Enum<T>
11227 	public void test0369() {
11228 		this.runConformTest(
11229 			new String[] {
11230 				"X.java",
11231 				"public class X {\n" +
11232 				"	\n" +
11233 				"	<T extends Enum<T>> T foo(T t) { return null; }\n" +
11234 				"}\n",
11235 			},
11236 			"");
11237 	}
11238 	// decoding raw binary type
11239 	public void test0370() {
11240 		this.runConformTest(
11241     		new String[] {
11242 				"p/B.java",
11243 				"package p;\n" +
11244 				"import java.util.Map;\n" +
11245 				"public class B {\n" +
11246 				"	public static Map<Class, String> foo(byte[] byteArray, Object o, Class c) {\n" +
11247 				"		return null;\n" +
11248 				"	}\n" +
11249 				"}"
11250     		},
11251 			"");
11252 
11253 		this.runConformTest(
11254     		new String[] {
11255     			"X.java",
11256 				"import java.util.Map;\n" +
11257 				"\n" +
11258 				"import p.B;\n" +
11259 				"\n" +
11260 				"public class X {\n" +
11261 				"	{\n" +
11262 				"		Map<Class, String> map = B.foo(null, null, null);\n" +
11263 				"	}\n" +
11264 				"}\n",
11265     		},
11266 			"",
11267 			null,
11268 			false,
11269 			null);
11270 	}
11271 	// X<? extends Y> is not compatible with X<Y>
11272 	public void test0371() {
11273 		this.runNegativeTest(
11274 			new String[] {
11275 				"X.java",
11276 				"public class X {\n" +
11277 				"   	public void foo(XC<Runnable> target, XC<? extends Runnable> value) {\n" +
11278 				"   		target = value;\n" +
11279 				"   	}\n" +
11280 				"}\n" +
11281 				"class XC <E>{\n" +
11282 				"}\n",
11283 			},
11284 			"----------\n" +
11285 			"1. ERROR in X.java (at line 3)\n" +
11286 			"	target = value;\n" +
11287 			"	         ^^^^^\n" +
11288 			"Type mismatch: cannot convert from XC<capture#1-of ? extends Runnable> to XC<Runnable>\n" +
11289 			"----------\n");
11290 	}
11291 	public void test0372() {
11292 		this.runConformTest(
11293 			new String[] {
11294 				"X.java",
11295 				"import java.util.Iterator;\n" +
11296 				"import java.util.Map;\n" +
11297 				"import java.util.Map.Entry;\n" +
11298 				"\n" +
11299 				"public class X <K, V> {\n" +
11300 				"\n" +
11301 				"	void foo(Iterator<Map.Entry<K,V>> iter) {\n" +
11302 				"		new XA.MXA<K,V>(iter.next());\n" +
11303 				"	}\n" +
11304 				"}\n" +
11305 				"class XA <K, V> {\n" +
11306 				"	static class MXA <K, V>  implements Entry<K,V> {\n" +
11307 				"		MXA(Entry<K,V> e) {\n" +
11308 				"		}\n" +
11309 				"		public K getKey() {\n" +
11310 				"			return null;\n" +
11311 				"		}\n" +
11312 				"		public V getValue() {\n" +
11313 				"			return null;\n" +
11314 				"		}\n" +
11315 				"		public V setValue(V value) {\n" +
11316 				"			return null;\n" +
11317 				"		}\n" +
11318 				"	}\n" +
11319 				"}\n"	,
11320 			},
11321 			"");
11322 	}
11323 	public void test0373() {
11324 		this.runConformTest(
11325 			new String[] {
11326 				"XA.java",
11327 				"import java.util.Map.Entry;\n" +
11328 				"\n" +
11329 				"public class XA <K, V> {\n" +
11330 				"	static class MXA <K, V>  implements Entry<K,V> {\n" +
11331 				"		MXA(Entry<K,V> e) {\n" +
11332 				"		}\n" +
11333 				"		public K getKey() {\n" +
11334 				"			return null;\n" +
11335 				"		}\n" +
11336 				"		public V getValue() {\n" +
11337 				"			return null;\n" +
11338 				"		}\n" +
11339 				"		public V setValue(V value) {\n" +
11340 				"			return null;\n" +
11341 				"		}\n" +
11342 				"	}\n" +
11343 				"}\n"	,
11344 			},
11345 			"");
11346 		// compile against binaries
11347 		this.runConformTest(
11348 			new String[] {
11349 				"X.java",
11350 				"import java.util.Iterator;\n" +
11351 				"import java.util.Map;\n" +
11352 				"import java.util.Map.Entry;\n" +
11353 				"\n" +
11354 				"public class X <K, V> {\n" +
11355 				"\n" +
11356 				"	void foo(Iterator<Map.Entry<K,V>> iter) {\n" +
11357 				"		new XA.MXA<K,V>(iter.next());\n" +
11358 				"	}\n" +
11359 				"}\n"	,
11360 			},
11361 			"",
11362 			null,
11363 			false,
11364 			null);
11365 	}
11366 	// wildcard with no upper bound uses type variable as upper bound
11367 	public void test0374() {
11368 		this.runConformTest(
11369 			new String[] {
11370 				"X.java",
11371 				"public class X <T extends Exception> {\n" +
11372 				"\n" +
11373 				"	void foo1(X <? extends Exception> target, X<?> value) {\n" +
11374 				"		target = value; // foo1\n" +
11375 				"	}\n" +
11376 				"	void foo2(X <? extends Exception> target, X<? super RuntimeException> value) {\n" +
11377 				"		target = value;  // foo2\n" +
11378 				"	}	\n" +
11379 				"}\n",
11380 			},
11381 			"");
11382 	}
11383 	public void test0375() {
11384 		this.runNegativeTest(
11385 			new String[] {
11386 				"X.java",
11387 				"public class X <T> {\n" +
11388 				"\n" +
11389 				"	void foo1(X <? super Exception> target, X<? extends Exception> value) {\n" +
11390 				"		target = value; // foo1\n" +
11391 				"	}\n" +
11392 				"}\n",
11393 			},
11394 			"----------\n" +
11395 			"1. ERROR in X.java (at line 4)\n" +
11396 			"	target = value; // foo1\n" +
11397 			"	         ^^^^^\n" +
11398 			"Type mismatch: cannot convert from X<capture#2-of ? extends Exception> to X<? super Exception>\n" +
11399 			"----------\n");
11400 	}
11401 	public void test0376() {
11402 		this.runConformTest(
11403 			new String[] {
11404 				"XA.java",
11405 				"import java.util.Map.Entry;\n" +
11406 				"\n" +
11407 				"public class XA <K, V> {\n" +
11408 				"   XA<K,V> self() { return this; } \n" +
11409 				"	static class MXA <K, V>  implements Entry<K,V> {\n" +
11410 				"		MXA(Entry<K,V> e) {\n" +
11411 				"		}\n" +
11412 				"		public K getKey() {\n" +
11413 				"			return null;\n" +
11414 				"		}\n" +
11415 				"		public V getValue() {\n" +
11416 				"			return null;\n" +
11417 				"		}\n" +
11418 				"		public V setValue(V value) {\n" +
11419 				"			return null;\n" +
11420 				"		}\n" +
11421 				"	}\n" +
11422 				"}\n"	,
11423 			},
11424 			"");
11425 		// compile against binaries
11426 		this.runConformTest(
11427 			new String[] {
11428 				"X.java",
11429 				"import java.util.Iterator;\n" +
11430 				"import java.util.Map;\n" +
11431 				"import java.util.Map.Entry;\n" +
11432 				"\n" +
11433 				"public class X <K, V> {\n" +
11434 				"\n" +
11435 				"	void foo(Iterator<Map.Entry<K,V>> iter) {\n" +
11436 				"		new XA.MXA<K,V>(iter.next());\n" +
11437 				"	}\n" +
11438 				"}\n"	,
11439 			},
11440 			"",
11441 			null,
11442 			false,
11443 			null);
11444 	}
11445 
11446 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=76601
11447 	public void test0377() {
11448 		this.runConformTest(
11449 			new String[] {
11450 				"Test.java",
11451 				"public class Test {\n" +
11452 					" public static void main (String[] args) {\n" +
11453 					"  final String val = (args == null||args.length==0 ? \"SUCC\" : args[0]) + \"ESS\";\n" +
11454 					"  class AllegedBoundMismatch<E2 extends SuperI<E2>> {\n" +
11455 					"   String field = val;\n" +
11456 					"  }\n" +
11457 					"  System.out.println(new Object() {\n" +
11458 					"   AllegedBoundMismatch<SubI<Q>> trial = new AllegedBoundMismatch<SubI<Q>>();\n" +
11459 					"  }.trial.field);\n" +
11460 					" }\n" +
11461 					"}\n" +
11462 					"class Q {}\n" +
11463 					"interface SubI<Q> extends SuperI<SubI<Q>> {}\n" +
11464 					"interface SuperI<Q> {}"
11465 			},
11466 		"SUCCESS");
11467 	}
11468 
11469 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=76219
11470 	public void test0378() {
11471 		this.runConformTest(
11472 			new String[] {
11473 				"BB.java",
11474 				"interface AA<W, Z extends AA<W, Z>> { \n" +
11475 					" public boolean m(AA<W, ?> that); \n" +
11476 					" public Z z(); \n" +
11477 					" public boolean b(); \n" +
11478 					"}\n" +
11479 					"abstract class BB<U, V extends AA<U, V>> implements AA<U,V> { \n" +
11480 					" public boolean m(AA<U, ?> wht) { return wht.z().b(); } \n" +
11481 					"}\n"}
11482 		);
11483 	}
11484 
11485 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=71612
11486 	public void test0379() {
11487 		this.runConformTest(
11488 			new String[] {
11489 				"Test.java",
11490 				"import java.util.AbstractSet;\n" +
11491 				"import java.util.Iterator;\n" +
11492 				"public class Test extends AbstractSet<Runnable>{\n" +
11493 				"    public static void main(String[] args) {\n" +
11494 				"        Test t=new Test();\n" +
11495 				"        t.add(null);\n" +
11496 				"    }\n" +
11497 				"    public boolean add(Runnable run) {\n" +
11498 				"        System.out.println(\"success\");\n" +
11499 				"        return true;\n" +
11500 				"    }\n" +
11501 				"    public Iterator<Runnable> iterator() {return null;}\n" +
11502 				"    public int size() {return 0;}\n" +
11503 				"}"
11504 				}
11505 		);
11506 	}
11507 
11508 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=77327
11509 	public void test0380() {
11510 		this.runConformTest(
11511 			new String[] {
11512 				"Test.java",
11513 				"import java.util.List;\n" +
11514 				"public class Test {\n" +
11515 				"	List<? super Number> wsn= null; // Contravariance\n" +
11516 				"	List<? super Integer> wsi= wsn; // should work!\n" +
11517 				"}\n"
11518 				}
11519 		);
11520 	}
11521 
11522 	public void test0381() {
11523 		this.runNegativeTest(
11524 			new String[] {
11525 				"X.java",
11526 				"public class X extends Y {\n" +
11527 				"	void foo(Class<? extends String> s) {}\n" +
11528 				"}\n" +
11529 				"class Y {\n" +
11530 				"	void foo(Class<String> s) {}\n" +
11531 				"}\n"
11532 			},
11533 			"----------\n" +
11534 			"1. ERROR in X.java (at line 2)\n" +
11535 			"	void foo(Class<? extends String> s) {}\n" +
11536 			"	     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
11537 			"Name clash: The method foo(Class<? extends String>) of type X has the same erasure as foo(Class<String>) of type Y but does not override it\n" +
11538 			"----------\n");
11539 		this.runNegativeTest(
11540 			new String[] {
11541 				"X.java",
11542 				"public class X extends Y {\n" +
11543 				"	void foo(Class<String> s) {}\n" +
11544 				"}\n" +
11545 				"class Y {\n" +
11546 				"	void foo(Class<? extends String> s) {}\n" +
11547 				"}\n"
11548 			},
11549 			"----------\n" +
11550 			"1. ERROR in X.java (at line 2)\n" +
11551 			"	void foo(Class<String> s) {}\n" +
11552 			"	     ^^^^^^^^^^^^^^^^^^^^\n" +
11553 			"Name clash: The method foo(Class<String>) of type X has the same erasure as foo(Class<? extends String>) of type Y but does not override it\n" +
11554 			"----------\n");
11555 	}
11556 	public void test0382() {
11557 		this.runNegativeTest(
11558 			new String[] {
11559 				"X.java",
11560 				"public class X extends Y implements I {}\n" +
11561 				"interface I { void foo(Class<? extends String> s); }\n" +
11562 				"class Y { void foo(Class<String> s) {} }\n"
11563 			},
11564 			"----------\n" +
11565 			"1. ERROR in X.java (at line 1)\n" +
11566 			"	public class X extends Y implements I {}\n" +
11567 			"	             ^\n" +
11568 			"Name clash: The method foo(Class<String>) of type Y has the same erasure as foo(Class<? extends String>) of type I but does not override it\n" +
11569 			"----------\n" +
11570 			"2. ERROR in X.java (at line 1)\n" +
11571 			"	public class X extends Y implements I {}\n" +
11572 			"	             ^\n" +
11573 			"The type X must implement the inherited abstract method I.foo(Class<? extends String>)\n" +
11574 			"----------\n");
11575 		this.runNegativeTest(
11576 			new String[] {
11577 				"X.java",
11578 				"public abstract class X extends Y implements I {}\n" +
11579 				"interface I { void foo(Class<String> s); }\n" +
11580 				"class Y { void foo(Class<? extends String> s) {} }\n"
11581 			},
11582 			"----------\n" +
11583 			"1. ERROR in X.java (at line 1)\n" +
11584 			"	public abstract class X extends Y implements I {}\n" +
11585 			"	                      ^\n" +
11586 			"Name clash: The method foo(Class<? extends String>) of type Y has the same erasure as foo(Class<String>) of type I but does not override it\n" +
11587 			"----------\n");
11588 	}
11589 	public void test0383() {
11590 		this.runNegativeTest(
11591 			new String[] {
11592 				"X.java",
11593 				"public class X extends Y implements I { public <T> void foo(Class<T> s) {} }\n" +
11594 				"interface I { <T, S> void foo(Class<T> s); }\n" +
11595 				"class Y { public <T> void foo(Class<T> s) {} }\n"
11596 			},
11597 			"----------\n" +
11598 			"1. ERROR in X.java (at line 1)\n" +
11599 			"	public class X extends Y implements I { public <T> void foo(Class<T> s) {} }\n" +
11600 			"	             ^\n" +
11601 			"The type X must implement the inherited abstract method I.foo(Class<T>)\n" +
11602 			"----------\n" +
11603 			"2. ERROR in X.java (at line 1)\n" +
11604 			"	public class X extends Y implements I { public <T> void foo(Class<T> s) {} }\n" +
11605 			"	                                                        ^^^^^^^^^^^^^^^\n" +
11606 			"Name clash: The method foo(Class<T>) of type X has the same erasure as foo(Class<T>) of type I but does not override it\n" +
11607 			"----------\n" +
11608 			"3. WARNING in X.java (at line 1)\n" +
11609 			"	public class X extends Y implements I { public <T> void foo(Class<T> s) {} }\n" +
11610 			"	                                                        ^^^^^^^^^^^^^^^\n" +
11611 			"The method foo(Class<T>) of type X should be tagged with @Override since it actually overrides a superclass method\n" +
11612 			"----------\n");
11613 			/*
11614 			X.java:1: X is not abstract and does not override abstract method <T,S>foo(java.lang.Class<T>) in I
11615 			public class X extends Y implements I { public <T> void foo(Class<T> s) {} }
11616 			       ^
11617        		*/
11618 		this.runNegativeTest(
11619 			new String[] {
11620 				"X.java",
11621 				"public class X extends Y implements I {}\n" +
11622 				"interface I { <T, S> void foo(Class<T> s); }\n" +
11623 				"class Y { public <T> void foo(Class<T> s) {} }\n"
11624 			},
11625 			"----------\n" +
11626 			"1. ERROR in X.java (at line 1)\n" +
11627 			"	public class X extends Y implements I {}\n" +
11628 			"	             ^\n" +
11629 			"Name clash: The method foo(Class<T>) of type Y has the same erasure as foo(Class<T>) of type I but does not override it\n" +
11630 			"----------\n" +
11631 			"2. ERROR in X.java (at line 1)\n" +
11632 			"	public class X extends Y implements I {}\n" +
11633 			"	             ^\n" +
11634 			"The type X must implement the inherited abstract method I.foo(Class<T>)\n" +
11635 			"----------\n");
11636 			/*
11637 			X.java:1: X is not abstract and does not override abstract method <T,S>foo(java.lang.Class<T>) in I
11638 			public class X extends Y implements I {}
11639 			       ^
11640 			*/
11641 		this.runNegativeTest(
11642 			new String[] {
11643 				"X.java",
11644 				"public abstract class X extends Y implements I {}\n" + // NOTE: X is abstract
11645 				"interface I { <T> void foo(Class<T> s); }\n" +
11646 				"class Y { public <T, S> void foo(Class<T> s) {} }\n"
11647 			},
11648 			"----------\n" +
11649 			"1. ERROR in X.java (at line 1)\n" +
11650 			"	public abstract class X extends Y implements I {}\n" +
11651 			"	                      ^\n" +
11652 			"Name clash: The method foo(Class<T>) of type Y has the same erasure as foo(Class<T>) of type I but does not override it\n" +
11653 			"----------\n");
11654 			/*
11655 			X.java:1: name clash: <T,S>foo(java.lang.Class<T>) in Y and <T>foo(java.lang.Class<T>) in I have the same erasure, yet neither overrides the other
11656 			public abstract class X extends Y implements I {}
11657 			                ^
11658 			 */
11659 	}
11660 	public void test0384a() {
11661 		this.runConformTest(
11662 			new String[] {
11663 				"X.java",
11664 				"public class X extends Y {\n" +
11665 				"	<T> java.util.List<T> foo3(java.util.List<T> t) { return t; }\n" +
11666 				"	Class<String> foo4() { return null; }\n" +
11667 				"	Class<String>[] foo5() { return null; }\n" +
11668 				"}\n" +
11669 				"class Y {\n" +
11670 				"	<T> java.util.List<T> foo3(java.util.List<T> t) { return t; }\n" +
11671 				"	Class<? extends String> foo4() { return null; }\n" +
11672 				"	Class<? extends String>[] foo5() { return null; }\n" +
11673 				"}\n"
11674 			},
11675 			"");
11676 	}
11677 	public void test0384b() {
11678 		this.runNegativeTest(
11679 			new String[] {
11680 				"X.java",
11681 				"public class X extends Y {\n" +
11682 				"	@Override Class<? extends String> foo() { return null; }\n" +
11683 				"	@Override Class<? extends String>[] foo2() { return null; }\n" +
11684 				"}\n" +
11685 				"class Y {\n" +
11686 				"	Class<String> foo() { return null; }\n" +
11687 				"	Class<String>[] foo2() { return null; }\n" +
11688 				"}\n"
11689 			},
11690 			"----------\n" +
11691 			"1. ERROR in X.java (at line 2)\n" +
11692 			"	@Override Class<? extends String> foo() { return null; }\n" +
11693 			"	          ^^^^^^^^^^^^^^^^^^^^^^^\n" +
11694 			"The return type is incompatible with Y.foo()\n" +
11695 			"----------\n" +
11696 			"2. ERROR in X.java (at line 3)\n" +
11697 			"	@Override Class<? extends String>[] foo2() { return null; }\n" +
11698 			"	          ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
11699 			"The return type is incompatible with Y.foo2()\n" +
11700 			"----------\n");
11701 	}
11702 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=77496
11703 	public void test0385() {
11704 		this.runNegativeTest(
11705 			new String[] {
11706 				"X.java",
11707 				"import java.util.List;\n" +
11708 				"interface IDoubles { List<Double> getList(); }\n" +
11709 				"class A implements IDoubles {\n" +
11710 				"	public List<String> getList() { return null; }\n" +
11711 				"}\n" +
11712 				"class B {\n" +
11713 				"	 public List<String> getList() { return null; }\n" +
11714 				"}\n" +
11715 				"class C extends B implements IDoubles {\n" +
11716 				"	void use() { List<String> l= getList(); }\n" +
11717 				"}\n"
11718 			},
11719 			"----------\n" +
11720 			"1. ERROR in X.java (at line 4)\n" +
11721 			"	public List<String> getList() { return null; }\n" +
11722 			"	       ^^^^^^^^^^^^\n" +
11723 			"The return type is incompatible with IDoubles.getList()\n" +
11724 			"----------\n" +
11725 			"2. ERROR in X.java (at line 9)\n" +
11726 			"	class C extends B implements IDoubles {\n" +
11727 			"	      ^\n" +
11728 			"The return types are incompatible for the inherited methods IDoubles.getList(), B.getList()\n" +
11729 			"----------\n");
11730 			/*
11731 			X.java:3: A is not abstract and does not override abstract method getList() in IDoubles
11732 			class A implements IDoubles {
11733 			^
11734 			X.java:4: getList() in A cannot implement getList() in IDoubles; attempting to use incompatible return type
11735 			found   : java.util.List<java.lang.String>
11736 			required: java.util.List<java.lang.Double>
11737 				public List<String> getList() { return null; }
11738 			                            ^
11739 			X.java:9: C is not abstract and does not override abstract method getList() in IDoubles
11740 			class C extends B implements IDoubles {
11741 			 */
11742 	}
11743 
11744 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=77325
11745 	public void test0386() {
11746 		this.runNegativeTest(
11747 			new String[] {
11748 				"X.java",
11749 				"class X <R,U,V, T> {\n" +
11750 					"	private U u;\n" +
11751 					"	private V v;\n" +
11752 					"	public X(U u,V v) { this.u= u; this.v= v; }\n" +
11753 					"	public R getU() { return (R)u; } // Warning\n" +
11754 					"	public R getV() { return (R)v; } // Warning\n" +
11755 					"	Object o;\n" +
11756 					"	public T getT() { return (T)o; } // Warning\n" +
11757 					"}"
11758 			},
11759 			"----------\n" +
11760 			"1. WARNING in X.java (at line 5)\n" +
11761 			"	public R getU() { return (R)u; } // Warning\n" +
11762 			"	                         ^^^^\n" +
11763 			"Type safety: Unchecked cast from U to R\n" +
11764 			"----------\n" +
11765 			"2. WARNING in X.java (at line 6)\n" +
11766 			"	public R getV() { return (R)v; } // Warning\n" +
11767 			"	                         ^^^^\n" +
11768 			"Type safety: Unchecked cast from V to R\n" +
11769 			"----------\n" +
11770 			"3. WARNING in X.java (at line 8)\n" +
11771 			"	public T getT() { return (T)o; } // Warning\n" +
11772 			"	                         ^^^^\n" +
11773 			"Type safety: Unchecked cast from Object to T\n" +
11774 			"----------\n");
11775 	}
11776 
11777 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=77422 - generic varargs method
11778 	public void test0387() {
11779 		this.runNegativeTest(
11780 			new String[] {
11781 				"X.java",
11782 				"import java.util.*;\n" +
11783 				"\n" +
11784 				"public class X<T>\n" +
11785 				"{\n" +
11786 				"\n" +
11787 				"	public boolean test1()\n" +
11788 				"	{\n" +
11789 				"			test2(\"test\", null, 0);\n" +
11790 				"	}\n" +
11791 				"\n" +
11792 				"	public <F> List<F> test2(final List<F> list, final String... strings)\n" +
11793 				"	{\n" +
11794 				"		return null;\n" +
11795 				"	}\n" +
11796 				"}\n"
11797 			},
11798 			"----------\n" +
11799 			"1. ERROR in X.java (at line 8)\n" +
11800 			"	test2(\"test\", null, 0);\n" +
11801 			"	^^^^^\n" +
11802 			"The method test2(List<F>, String...) in the type X<T> is not applicable for the arguments (String, null, int)\n" +
11803 			"----------\n");
11804 	}
11805 
11806 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=77422 - variation
11807 	public void test0388() {
11808 		this.runConformTest(
11809 			new String[] {
11810 				"X.java",
11811 				"import java.util.*;\n" +
11812 				"\n" +
11813 				"public class X<T>\n" +
11814 				"{\n" +
11815 				"\n" +
11816 				"	public boolean test01()\n" +
11817 				"	{\n" +
11818 				"			test02(null, null, \"test\");\n" +
11819 				"			return false;\n" +
11820 				"	}\n" +
11821 				"\n" +
11822 				"	public <F> List<F> test02(final List<F> list, final String... strings)\n" +
11823 				"	{\n" +
11824 				"		return null;\n" +
11825 				"	}\n" +
11826 				"}\n"
11827 			},
11828 			""
11829 		);
11830 	}
11831 
11832 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=77422 - variation
11833 	public void test0389() {
11834 		this.runConformTest(
11835 			new String[] {
11836 				"X.java",
11837 				"public class X {\n" +
11838 				"\n" +
11839 				"	public boolean test01()	{\n" +
11840 				"		String s = foo(\"hello\");\n" +
11841 				"		return s != null;\n" +
11842 				"	}\n" +
11843 				"\n" +
11844 				"	public <F> F foo(F f, F... others) {\n" +
11845 				"		return f;\n" +
11846 				"	}\n" +
11847 				"}\n"
11848 			},
11849 			""
11850 		);
11851 	}
11852 
11853 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=77422 - variation
11854 	public void test0390() {
11855 		this.runConformTest(
11856 			new String[] {
11857 				"X.java",
11858 				"public class X {\n" +
11859 				"\n" +
11860 				"	public boolean test01()	{\n" +
11861 				"		String s = foo(null, \"hello\");\n" +
11862 				"		return s != null;\n" +
11863 				"	}\n" +
11864 				"\n" +
11865 				"	public <F> F foo(F f, F... others) {\n" +
11866 				"		return f;\n" +
11867 				"	}\n" +
11868 				"}\n"
11869 			},
11870 			""
11871 		);
11872 	}
11873 
11874 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=77422 - variation
11875 	public void test0391() {
11876 		this.runNegativeTest(
11877 			new String[] {
11878 				"X.java",
11879 				"public class X {\n" +
11880 				"\n" +
11881 				"	public boolean test01()	{\n" +
11882 				"		String[] s = foo(null, new String[]{ \"hello\" });\n" +
11883 				"		return s != null;\n" +
11884 				"	}\n" +
11885 				"\n" +
11886 				"	public <F> F foo(F f, F... others) {\n" +
11887 				"		return f;\n" +
11888 				"	}\n" +
11889 				"}\n"
11890 			},
11891 			this.complianceLevel < ClassFileConstants.JDK1_7 ?
11892 			"----------\n" +
11893 			"1. ERROR in X.java (at line 4)\n" +
11894 			"	String[] s = foo(null, new String[]{ \"hello\" });\n" +
11895 			"	             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
11896 			"Type mismatch: cannot convert from String to String[]\n" +
11897 			"----------\n" :
11898 				"----------\n" +
11899 				"1. ERROR in X.java (at line 4)\n" +
11900 				"	String[] s = foo(null, new String[]{ \"hello\" });\n" +
11901 				"	             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
11902 				"Type mismatch: cannot convert from String to String[]\n" +
11903 				"----------\n" +
11904 				"2. WARNING in X.java (at line 8)\n" +
11905 				"	public <F> F foo(F f, F... others) {\n" +
11906 				"	                           ^^^^^^\n" +
11907 				"Type safety: Potential heap pollution via varargs parameter others\n" +
11908 				"----------\n"
11909 		);
11910 	}
11911 
11912 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=77422 - variation
11913 	public void test0392() {
11914 		this.runConformTest(
11915 			new String[] {
11916 				"X.java",
11917 				"public class X {\n" +
11918 				"\n" +
11919 				"	public boolean test01()	{\n" +
11920 				"		foo(null, \"hello\");\n" + // no inference on expected type
11921 				"		return true;\n" +
11922 				"	}\n" +
11923 				"\n" +
11924 				"	public <F> F foo(F f, F... others) {\n" +
11925 				"		return f;\n" +
11926 				"	}\n" +
11927 				"}\n"
11928 			},
11929 			""
11930 		);
11931 	}
11932 
11933 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78049 - chech invalid array initializer
11934 	public void test0393() {
11935 		this.runConformTest(
11936 			new String[] {
11937 				"X.java",
11938 				"public class X {\n" +
11939 				"\n" +
11940 				"	public boolean test01()	{\n" +
11941 				"		foo(null, \"hello\");\n" + // no inference on expected type
11942 				"		return true;\n" +
11943 				"	}\n" +
11944 				"\n" +
11945 				"	public <F> F foo(F f, F... others) {\n" +
11946 				"		return f;\n" +
11947 				"	}\n" +
11948 				"}\n"
11949 			},
11950 			""
11951 		);
11952 	}
11953 
11954 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78027
11955 	public void test0394() {
11956 		this.runConformTest(
11957 			new String[] {
11958 				"X.java",
11959 				"public class X \n" +
11960 				"{\n" +
11961 				"}\n" +
11962 				"\n" +
11963 				"interface ITest<C extends X>\n" +
11964 				"{ \n" +
11965 				"}\n" +
11966 				"\n" +
11967 				"abstract class Test<C extends X> implements ITest<C>\n" +
11968 				"{\n" +
11969 				"  protected Manager<C> m_manager;\n" +
11970 				"  \n" +
11971 				"  public ITest<C> get()\n" +
11972 				"  {\n" +
11973 				"    return m_manager.getById(getClass(), new Integer(1));\n" +
11974 				"  }\n" +
11975 				"    \n" +
11976 				"  public static class Manager<C extends X>\n" +
11977 				"  {\n" +
11978 				"    public <T extends ITest<C>> T getById(Class<T> cls, Integer id)\n" +
11979 				"    {\n" +
11980 				"      return null;\n" +
11981 				"    }\n" +
11982 				"  }\n" +
11983 				"}\n"
11984 			},
11985 			""
11986 		);
11987 	}
11988 
11989 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=74119 - variation
11990 	public void test0395() {
11991 		this.runNegativeTest(
11992 			new String[] {
11993 				"X.java",
11994 				"public class X<T extends Exception> {\n" +
11995 				"	T element;\n" +
11996 				"	\n" +
11997 				"	void foo(X<? super NullPointerException> xnpe) {\n" +
11998 				"		xnpe.element = new java.io.IOException();\n" +
11999 				"	}\n" +
12000 				"}\n"
12001 			},
12002 			"----------\n" +
12003 			"1. ERROR in X.java (at line 5)\n" +
12004 			"	xnpe.element = new java.io.IOException();\n" +
12005 			"	               ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
12006 			"Type mismatch: cannot convert from IOException to capture#1-of ? super NullPointerException\n" +
12007 			"----------\n");
12008 	}
12009 
12010 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78139 - downcast generic method inference
12011 	public void test0396() {
12012 		this.runNegativeTest(
12013 			new String[] {
12014 				"X.java",
12015 				"import java.util.Collection;\n" +
12016 				"import java.util.List;\n" +
12017 				"import java.util.ArrayList;\n" +
12018 				"\n" +
12019 				"public class X\n" +
12020 				"{\n" +
12021 				"    public static <T> List<T> emptyList() {\n" +
12022 				"        return new ArrayList<T>();\n" +
12023 				"    }\n" +
12024 				"    public static <T> Collection<T> emptyCollection() {\n" +
12025 				"        return new ArrayList<T>();\n" +
12026 				"    }\n" +
12027 				"    public static <T> Iterable<T> emptyIterable() {\n" +
12028 				"        return new ArrayList<T>();\n" +
12029 				"    }\n" +
12030 				"    \n" +
12031 				"    public static void main(String[] args) {\n" +
12032 				"    	 // generic inference using expected lhs type: T --> String\n" +
12033 				"        final List<String> lL = emptyList(); // 1\n" +
12034 				"        \n" +
12035 				"    	 // generic inference using expected cast type: T --> String\n" +
12036 				"        final Collection<String> cL = (Collection<String>)emptyList(); // 2\n" +
12037 				"        \n" +
12038 				"    	 // generic inference using expected cast type: T --> String\n" +
12039 				"        final Iterable<String> iL = (Iterable<String>)emptyList(); // 3\n" +
12040 				"        \n" +
12041 				"    	 // generic inference using expected lhs type: T --> String\n" +
12042 				"        final Collection<String> cC = emptyCollection(); // 4\n" +
12043 				"        \n" +
12044 				"    	 // generic inference using expected cast type: T --> String\n" +
12045 				"        final Iterable<String> iC = (Iterable<String>)emptyCollection(); // 5\n" +
12046 				"        \n" +
12047 				"    	 // generic inference using expected lhs type: T --> String\n" +
12048 				"        final Iterable<String> iI = emptyIterable(); // 6\n" +
12049 				"        \n" +
12050 				"    	 // generic inference using expected lhs type: T --> String\n" +
12051 				"        final Collection<String> cL2 = emptyList(); // 7\n" +
12052 				"        \n" +
12053 				"    	 // generic inference using expected lhs type: T --> String\n" +
12054 				"        final Iterable<String> iC2 = emptyCollection(); // 8\n" +
12055 				"    }\n" +
12056 				"}"
12057 			},
12058 			"----------\n" +
12059 			"1. ERROR in X.java (at line 22)\n" +
12060 			"	final Collection<String> cL = (Collection<String>)emptyList(); // 2\n" +
12061 			"	                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
12062 			"Cannot cast from List<Object> to Collection<String>\n" +
12063 			"----------\n" +
12064 			"2. ERROR in X.java (at line 25)\n" +
12065 			"	final Iterable<String> iL = (Iterable<String>)emptyList(); // 3\n" +
12066 			"	                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
12067 			"Cannot cast from List<Object> to Iterable<String>\n" +
12068 			"----------\n" +
12069 			"3. ERROR in X.java (at line 31)\n" +
12070 			"	final Iterable<String> iC = (Iterable<String>)emptyCollection(); // 5\n" +
12071 			"	                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
12072 			"Cannot cast from Collection<Object> to Iterable<String>\n" +
12073 			"----------\n");
12074 	}
12075 
12076 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=76132
12077 	public void test0397() {
12078 		this.runNegativeTest(
12079 			new String[] {
12080 				"X.java",
12081 				"interface K1<A> { \n" +
12082 				"        public <B extends A> void kk(K1<B> x); \n" +
12083 				"} \n" +
12084 				" \n" +
12085 				"class K2<C> implements K1<C> { \n" +
12086 				"        public <D extends C> void kk(K1<D> y) { \n" +
12087 				"                System.out.println(\"K2::kk(\" + y.toString() + \")\"); \n" +
12088 				"        } \n" +
12089 				"} \n" +
12090 				" \n" +
12091 				"// --------------------------------------------------- \n" +
12092 				" \n" +
12093 				"interface L1<E> { \n" +
12094 				"        public void ll(L1<? extends E> a); \n" +
12095 				"} \n" +
12096 				" \n" +
12097 				"class L2<KK> implements L1<KK> { \n" +
12098 				"        public void ll(L1<? extends KK> b) { \n" +
12099 				"                ll2(b); \n" +
12100 				"        } \n" +
12101 				" \n" +
12102 				"        private <LL extends KK> void ll2(L1<LL> c) { \n" +
12103 				"                System.out.println(\"L2::ll2(\" + c.toString() + \")\"); \n" +
12104 				"        } \n" +
12105 				"} \n" +
12106 				" \n" +
12107 				"// --------------------------------------------------- \n" +
12108 				" \n" +
12109 				"interface M1<H> { \n" +
12110 				"        public void mm(M1<? extends H> p); \n" +
12111 				"} \n" +
12112 				" \n" +
12113 				"class M2<I> implements M1<I> { \n" +
12114 				"        public <J extends I> void mm(M1<J> q) { \n" +
12115 				"                System.out.println(\"M2::mm(\" + q.toString() + \")\"); \n" +
12116 				"        } \n" +
12117 				"} \n" +
12118 				" \n" +
12119 				"// =================================================== \n" +
12120 				" \n" +
12121 				"class XX            { public String toString() { return \"XX\"; } } \n" +
12122 				"class YY extends XX { public String toString() { return \"YY\"; } } \n" +
12123 				"class ZZ extends YY { public String toString() { return \"ZZ\"; } } \n" +
12124 				" \n" +
12125 				"// --------------------------------------------------- \n" +
12126 				" \n" +
12127 				"public class X { \n" +
12128 				"        public static void main(String arg[]) { \n" +
12129 				"                goK(new K2<YY>()); \n" +
12130 				"                goL(new L2<YY>()); \n" +
12131 				"                goM(new M2<YY>()); \n" +
12132 				"        } \n" +
12133 				" \n" +
12134 				" \n" +
12135 				"        public static void goK(K1<YY> k) { \n" +
12136 				"                // k.kk(new K2<XX>()); // Would fail \n" +
12137 				"                k.kk(new K2<YY>()); \n" +
12138 				"                k.kk(new K2<ZZ>()); \n" +
12139 				"        } \n" +
12140 				" \n" +
12141 				" \n" +
12142 				"        public static void goL(L1<YY> l) { \n" +
12143 				"                // l.ll(new L2<XX>()); // Would fail \n" +
12144 				"                l.ll(new L2<YY>()); \n" +
12145 				"                l.ll(new L2<ZZ>()); \n" +
12146 				"        } \n" +
12147 				" \n" +
12148 				" \n" +
12149 				"        public static void goM(M1<YY> m) { \n" +
12150 				"                // m.mm(new M2<XX>()); // Would fail \n" +
12151 				"                m.mm(new M2<YY>()); \n" +
12152 				"                m.mm(new M2<ZZ>()); \n" +
12153 				"        } \n" +
12154 				"}"
12155 			},
12156 			"----------\n" +
12157 			"1. ERROR in X.java (at line 33)\n" +
12158 			"	class M2<I> implements M1<I> { \n" +
12159 			"	      ^^\n" +
12160 			"The type M2<I> must implement the inherited abstract method M1<I>.mm(M1<? extends I>)\n" +
12161 			"----------\n" +
12162 			"2. ERROR in X.java (at line 34)\n" +
12163 			"	public <J extends I> void mm(M1<J> q) { \n" +
12164 			"	                          ^^^^^^^^^^^\n" +
12165 			"Name clash: The method mm(M1<J>) of type M2<I> has the same erasure as mm(M1<? extends H>) of type M1<H> but does not override it\n" +
12166 			"----------\n" +
12167 			"3. WARNING in X.java (at line 41)\n" +
12168 			"	class XX            { public String toString() { return \"XX\"; } } \n" +
12169 			"	                                    ^^^^^^^^^^\n" +
12170 			"The method toString() of type XX should be tagged with @Override since it actually overrides a superclass method\n" +
12171 			"----------\n" +
12172 			"4. WARNING in X.java (at line 42)\n" +
12173 			"	class YY extends XX { public String toString() { return \"YY\"; } } \n" +
12174 			"	                                    ^^^^^^^^^^\n" +
12175 			"The method toString() of type YY should be tagged with @Override since it actually overrides a superclass method\n" +
12176 			"----------\n" +
12177 			"5. WARNING in X.java (at line 43)\n" +
12178 			"	class ZZ extends YY { public String toString() { return \"ZZ\"; } } \n" +
12179 			"	                                    ^^^^^^^^^^\n" +
12180 			"The method toString() of type ZZ should be tagged with @Override since it actually overrides a superclass method\n" +
12181 			"----------\n");
12182 	}
12183 	// cannot allocate parameterized type with wildcards
12184 	public void test0398() {
12185 		this.runNegativeTest(
12186 			new String[] {
12187 				"X.java",
12188 				"public class X <T> {\n" +
12189 				"    X(){\n" +
12190 				"    }\n" +
12191 				"    public static void main(String[] args) {\n" +
12192 				"		new X<?>();\n" +
12193 				"		new X<? extends String>();\n" +
12194 				"		new X<?>(){};\n" +
12195 				"		new X<? extends String>(){};\n" +
12196 				"	}\n" +
12197 				"}\n"	,
12198 			},
12199 			"----------\n" +
12200 			"1. ERROR in X.java (at line 5)\n" +
12201 			"	new X<?>();\n" +
12202 			"	    ^\n" +
12203 			"Cannot instantiate the type X<?>\n" +
12204 			"----------\n" +
12205 			"2. ERROR in X.java (at line 6)\n" +
12206 			"	new X<? extends String>();\n" +
12207 			"	    ^\n" +
12208 			"Cannot instantiate the type X<? extends String>\n" +
12209 			"----------\n" +
12210 			"3. ERROR in X.java (at line 7)\n" +
12211 			"	new X<?>(){};\n" +
12212 			"	    ^\n" +
12213 			"The type new X(){} cannot extend or implement X<?>. A supertype may not specify any wildcard\n" +
12214 			"----------\n" +
12215 			"4. ERROR in X.java (at line 8)\n" +
12216 			"	new X<? extends String>(){};\n" +
12217 			"	    ^\n" +
12218 			"The type new X(){} cannot extend or implement X<? extends String>. A supertype may not specify any wildcard\n" +
12219 			"----------\n");
12220 	}
12221 
12222 	public void test0399() {
12223 		this.runNegativeTest(
12224 			new String[] {
12225 				"X.java",
12226 				"public class X <T> {\n" +
12227 				"    T t;\n" +
12228 				"    X(T t){\n" +
12229 				"        this.t = t;\n" +
12230 				"    }\n" +
12231 				"    public static void main(String[] args) {\n" +
12232 				"		X<? extends AX> x = new X<AX<Math>>(new AX<String>());\n" +
12233 				"	}\n" +
12234 				"}\n" +
12235 				"\n" +
12236 				"class AX<P> {\n" +
12237 				"    P foo() { return null; }\n" +
12238 				"}\n",
12239 			},
12240 			"----------\n" +
12241 			"1. WARNING in X.java (at line 7)\n" +
12242 			"	X<? extends AX> x = new X<AX<Math>>(new AX<String>());\n" +
12243 			"	            ^^\n" +
12244 			"AX is a raw type. References to generic type AX<P> should be parameterized\n" +
12245 			"----------\n" +
12246 			"2. ERROR in X.java (at line 7)\n" +
12247 			"	X<? extends AX> x = new X<AX<Math>>(new AX<String>());\n" +
12248 			"	                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
12249 			"The constructor X<AX<Math>>(AX<String>) is undefined\n" +
12250 			"----------\n");
12251 	}
12252 
12253 	public void test0400() {
12254 		this.runNegativeTest(
12255 			new String[] {
12256 				"X.java",
12257 				"public class X <T> {\n" +
12258 				"    T t;\n" +
12259 				"    X(X<? extends T> xt){\n" +
12260 				"        this.t = xt.t;\n" +
12261 				"    }\n" +
12262 				"    public static void main(String[] args) {\n" +
12263 				"		X<? extends AX> x = new X<AX<Math>>(new X<AX<String>>(null));\n" +
12264 				"	}\n" +
12265 				"}\n" +
12266 				"class AX<P> {\n" +
12267 				"    P foo() { return null; }\n" +
12268 				"}",
12269 			},
12270 			"----------\n" +
12271 			"1. WARNING in X.java (at line 7)\n" +
12272 			"	X<? extends AX> x = new X<AX<Math>>(new X<AX<String>>(null));\n" +
12273 			"	            ^^\n" +
12274 			"AX is a raw type. References to generic type AX<P> should be parameterized\n" +
12275 			"----------\n" +
12276 			"2. ERROR in X.java (at line 7)\n" +
12277 			"	X<? extends AX> x = new X<AX<Math>>(new X<AX<String>>(null));\n" +
12278 			"	                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
12279 			"The constructor X<AX<Math>>(X<AX<String>>) is undefined\n" +
12280 			"----------\n");
12281 	}
12282 
12283 	// legal to allocate/inherit from a type with wildcards, as long as non direct arguments
12284 	public void test0401() {
12285 		this.runConformTest(
12286 			new String[] {
12287 				"X.java",
12288 				"public class X<T> {\n" +
12289 				"	void foo() {\n" +
12290 				"		new X<X<?>>();\n" +
12291 				"		new X<X<? extends String>>();\n" +
12292 				"		new X<X<?>>(){};\n" +
12293 				"		new X<X<? extends String>>(){};\n" +
12294 				"	}\n" +
12295 				"}",
12296 			},
12297 			"");
12298 	}
12299 
12300 	// legal to inherit from a type with wildcards, as long as non direct arguments
12301 	public void test0402() {
12302 		this.runConformTest(
12303 			new String[] {
12304 				"X.java",
12305 				"public class X extends Y<Y<?>> {\n" +
12306 				"}\n" +
12307 				"class Y<T> {}",
12308 			},
12309 			"");
12310 	}
12311 	// check cast between generic types
12312 	public void test0403() {
12313 		this.runNegativeTest(
12314 			new String[] {
12315 				"X.java",
12316 				"public class X <T> {\n" +
12317 				"	\n" +
12318 				"	void foo(X<X<? extends String>> xs) {\n" +
12319 				"		X<X<String>> x = (X<X<String>>) xs;\n" +
12320 				"		Zork z;\n" +
12321 				"	}\n" +
12322 				"}\n",
12323 			},
12324 			"----------\n" +
12325 			"1. ERROR in X.java (at line 4)\n" +
12326 			"	X<X<String>> x = (X<X<String>>) xs;\n" +
12327 			"	                 ^^^^^^^^^^^^^^^^^\n" +
12328 			"Cannot cast from X<X<? extends String>> to X<X<String>>\n" +
12329 			"----------\n" +
12330 			"2. ERROR in X.java (at line 5)\n" +
12331 			"	Zork z;\n" +
12332 			"	^^^^\n" +
12333 			"Zork cannot be resolved to a type\n" +
12334 			"----------\n");
12335 	}
12336 
12337 	// check cast between generic types
12338 	public void test0404() {
12339 		this.runNegativeTest(
12340 			new String[] {
12341 				"X.java",
12342 				"public class X <T> {\n" +
12343 				"	\n" +
12344 				"	void foo(X<? extends String> xs) {\n" +
12345 				"		X<String> x = (X<String>) xs;\n" +
12346 				"		Zork z;\n" +
12347 				"	}\n" +
12348 				"}\n",
12349 			},
12350 			"----------\n" +
12351 			"1. WARNING in X.java (at line 4)\n" +
12352 			"	X<String> x = (X<String>) xs;\n" +
12353 			"	              ^^^^^^^^^^^^^^\n" +
12354 			"Type safety: Unchecked cast from X<capture#1-of ? extends String> to X<String>\n" +
12355 			"----------\n" +
12356 			"2. ERROR in X.java (at line 5)\n" +
12357 			"	Zork z;\n" +
12358 			"	^^^^\n" +
12359 			"Zork cannot be resolved to a type\n" +
12360 			"----------\n");
12361 	}
12362 
12363 	// check cast between generic types
12364 	public void test0405() {
12365 		this.runNegativeTest(
12366 			new String[] {
12367 				"X.java",
12368 				"public class X <E> {\n" +
12369 				"	\n" +
12370 				"	<T> void foo(X<X<T>> xs) {\n" +
12371 				"		X<X<String>> x = (X<X<String>>) xs;\n" +
12372 				"	}\n" +
12373 				"	<T> void bar(X<T> xs) {\n" +
12374 				"		X<String> x = (X<String>) xs;\n" +
12375 				"	}	\n" +
12376 				"}\n",
12377 			},
12378 			"----------\n" +
12379 			"1. ERROR in X.java (at line 4)\n" +
12380 			"	X<X<String>> x = (X<X<String>>) xs;\n" +
12381 			"	                 ^^^^^^^^^^^^^^^^^\n" +
12382 			"Cannot cast from X<X<T>> to X<X<String>>\n" +
12383 			"----------\n" +
12384 			"2. WARNING in X.java (at line 7)\n" +
12385 			"	X<String> x = (X<String>) xs;\n" +
12386 			"	              ^^^^^^^^^^^^^^\n" +
12387 			"Type safety: Unchecked cast from X<T> to X<String>\n" +
12388 			"----------\n");
12389 	}
12390 
12391 	public void test0406() {
12392 		this.runConformTest(
12393 			new String[] {
12394 				"X.java",
12395 				"public abstract class X<K1,V1> implements M<K1,V1> {\n" +
12396 				"	abstract M<K1,V1> other();\n" +
12397 				"	public S<E<K1,V1>> entrySet() {\n" +
12398 				"		return other().entrySet();\n" +
12399 				"	}\n" +
12400 				"}\n" +
12401 				"interface M<K2,V2> {\n" +
12402 				"	 interface E<K3,V3> { }\n" +
12403 				"	 S<E<K2, V2>> entrySet();\n" +
12404 				"}\n" +
12405 				"interface S<T> {}",
12406 			},
12407 			"");
12408 	}
12409 
12410 	public void test0407() {
12411 		this.runConformTest(
12412 			new String[] {
12413 				"X.java",
12414 				"public abstract class X<K1,V1> implements M<K1,V1> {\n" +
12415 				"	abstract M<K1,V1> other();\n" +
12416 				"	public S<M.E<K1,V1>> entrySet() {\n" + // qualified M.E...
12417 				"		return other().entrySet();\n" +
12418 				"	}\n" +
12419 				"}\n" +
12420 				"interface M<K2,V2> {\n" +
12421 				"	 interface E<K3,V3> { }\n" +
12422 				"	 S<E<K2, V2>> entrySet();\n" +
12423 				"}\n" +
12424 				"interface S<T> {}",
12425 			},
12426 			"");
12427 	}
12428 
12429 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78008
12430 	public void test0408() {
12431 		this.runConformTest(
12432 			new String[] {
12433 				"X.java",
12434 				"import java.util.*;\n" +
12435 				"public class X {\n" +
12436 				"    public Integer[] getTypes() {\n" +
12437 				"        List<Integer> list = new ArrayList<Integer>();\n" +
12438 				"        return list == null \n" +
12439 				"            ? new Integer[0] \n" +
12440 				"            : list.toArray(new Integer[list.size()]);\n" +
12441 				"    }\n" +
12442 				"    public static void main(String[] args) {\n" +
12443 				"        Class clazz = null;\n" +
12444 				"        try {\n" +
12445 				"            clazz = Class.forName(\"X\");\n" +
12446 				"    	     System.out.println(\"SUCCESS\");\n" +
12447 				"        } catch (Throwable e) {\n" +
12448 				"            e.printStackTrace();\n" +
12449 				"        }\n" +
12450 				"    }\n" +
12451 				"}",
12452 			},
12453 			"SUCCESS");
12454 	}
12455 
12456 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78008
12457 	public void test0409() {
12458 		this.runConformTest(
12459 			new String[] {
12460 				"X.java",
12461 				"import java.util.*;\n" +
12462 				"public class X {\n" +
12463 				"    public Number getTypes() {\n" +
12464 				"        List<Integer> list = new ArrayList<Integer>();\n" +
12465 				"        return list == null \n" +
12466 				"            ? Float.valueOf(0)\n" +
12467 				"            : list.get(0);\n" +
12468 				"    }\n" +
12469 				"    public static void main(String[] args) {\n" +
12470 				"        Class clazz = null;\n" +
12471 				"        try {\n" +
12472 				"            clazz = Class.forName(\"X\");\n" +
12473 				"    	     System.out.println(\"SUCCESS\");\n" +
12474 				"        } catch (Throwable e) {\n" +
12475 				"            e.printStackTrace();\n" +
12476 				"        }\n" +
12477 				"    }\n" +
12478 				"}",
12479 			},
12480 			"SUCCESS");
12481 	}
12482 
12483 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=74178
12484 	public void test0410() {
12485 		this.runNegativeTest(
12486 			new String[] {
12487 				"X.java",
12488 				"import java.util.List;\n" +
12489 				"\n" +
12490 				"public class X {\n" +
12491 				"\n" +
12492 				"public void write(List<? super Exception> list) {\n" +
12493 				"	\n" +
12494 				"  list.add(new RuntimeException());             // works\n" +
12495 				"  list.add(new IllegalMonitorStateException()); // works\n" +
12496 				"  Exception exc = new Exception();\n" +
12497 				"  list.add(exc);                                // works\n" +
12498 				"  list.add(new Object());                       // should fail\n" +
12499 				"  list.add(new Throwable());                    // should fail\n" +
12500 				"  list.add(new Exception());                    // works\n" +
12501 				"}\n" +
12502 				"}",
12503 			},
12504 			"----------\n" +
12505 			"1. ERROR in X.java (at line 11)\n" +
12506 			"	list.add(new Object());                       // should fail\n" +
12507 			"	     ^^^\n" +
12508 			"The method add(capture#4-of ? super Exception) in the type List<capture#4-of ? super Exception> is not applicable for the arguments (Object)\n" +
12509 			"----------\n" +
12510 			"2. ERROR in X.java (at line 12)\n" +
12511 			"	list.add(new Throwable());                    // should fail\n" +
12512 			"	     ^^^\n" +
12513 			"The method add(capture#5-of ? super Exception) in the type List<capture#5-of ? super Exception> is not applicable for the arguments (Throwable)\n" +
12514 			"----------\n");
12515 	}
12516 
12517 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78015
12518 	public void test0411() {
12519 		this.runConformTest(
12520 			new String[] {
12521 				"X.java",
12522 				"interface I<T> {\n" +
12523 				"    void m1(T t);\n" +
12524 				"    void m2(T t);\n" +
12525 				"}\n" +
12526 				"\n" +
12527 				"class A {};\n" +
12528 				"\n" +
12529 				"class B implements I<A> {\n" +
12530 				"    public void m1(A a) {\n" +
12531 				"    	System.out.println(\"SUCCESS\");\n" +
12532 				"    }\n" +
12533 				"    public void m2(A a) {}\n" +
12534 				"}\n" +
12535 				"\n" +
12536 				"public class X {\n" +
12537 				"    public static void main(String[] args) {\n" +
12538 				"        m(new B());\n" +
12539 				"    }\n" +
12540 				"\n" +
12541 				"    public static void m(I<A> x) {\n" +
12542 				"        x.m1(null);\n" +
12543 				"    }\n" +
12544 				"}",
12545 			},
12546 			"SUCCESS");
12547 	}
12548 
12549 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78467
12550 	public void test0412() {
12551 		this.runNegativeTest(
12552 			new String[] {
12553 				"X.java",
12554 				"public class X {\n" +
12555 				"\n" +
12556 				"    public static <T> T first(T... args) {\n" +
12557 				"        return args[0];\n" +
12558 				"    }\n" +
12559 				"    \n" +
12560 				"    public static void main(String[] args) {\n" +
12561 				"    	if (false) { \n" +
12562 				"    		String s = first(); \n" +
12563 				"    		int i; \n" +
12564 				"    		i++; \n" +
12565 				"    	}\n" +
12566 				"        System.out.println(first(\"SUCCESS\", \"List\"));\n" +
12567 				"    }\n" +
12568 				"   Zork z;\n" +
12569 				"}",
12570 			},
12571 			this.complianceLevel < ClassFileConstants.JDK1_7 ?
12572 			"----------\n" +
12573 			"1. ERROR in X.java (at line 15)\n" +
12574 			"	Zork z;\n" +
12575 			"	^^^^\n" +
12576 			"Zork cannot be resolved to a type\n" +
12577 			"----------\n" :
12578 				"----------\n" +
12579 				"1. WARNING in X.java (at line 3)\n" +
12580 				"	public static <T> T first(T... args) {\n" +
12581 				"	                               ^^^^\n" +
12582 				"Type safety: Potential heap pollution via varargs parameter args\n" +
12583 				"----------\n" +
12584 				"2. ERROR in X.java (at line 15)\n" +
12585 				"	Zork z;\n" +
12586 				"	^^^^\n" +
12587 				"Zork cannot be resolved to a type\n" +
12588 				"----------\n");
12589 	}
12590 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78467 - variation
12591 	public void test0412a() {
12592 		this.runNegativeTest(
12593 			new String[] {
12594 				"X.java",
12595 				"import java.util.*;\n" +
12596 				"public class X {\n" +
12597 				"\n" +
12598 				"    public static <T> T first(T... args) {\n" +
12599 				"        return args[0];\n" +
12600 				"    }\n" +
12601 				"    \n" +
12602 				"    public static void main(String[] args) {\n" +
12603 				"    	if (false) { \n" +
12604 				"    		List<String> ls = first(); \n" +
12605 				"    		int i; \n" +
12606 				"    		i++; \n" +
12607 				"    	}\n" +
12608 				"        System.out.println(first(\"SUCCESS\", \"List\"));\n" +
12609 				"    }\n" +
12610 				"   Zork z;\n" +
12611 				"}",
12612 			},
12613 			this.complianceLevel < ClassFileConstants.JDK1_7 ?
12614 			"----------\n" +
12615 			"1. WARNING in X.java (at line 10)\n" +
12616 			"	List<String> ls = first(); \n" +
12617 			"	                  ^^^^^^^\n" +
12618 			"Type safety: A generic array of List<String> is created for a varargs parameter\n" +
12619 			"----------\n" +
12620 			"2. ERROR in X.java (at line 16)\n" +
12621 			"	Zork z;\n" +
12622 			"	^^^^\n" +
12623 			"Zork cannot be resolved to a type\n" +
12624 			"----------\n" :
12625 				"----------\n" +
12626 				"1. WARNING in X.java (at line 4)\n" +
12627 				"	public static <T> T first(T... args) {\n" +
12628 				"	                               ^^^^\n" +
12629 				"Type safety: Potential heap pollution via varargs parameter args\n" +
12630 				"----------\n" +
12631 				"2. WARNING in X.java (at line 10)\n" +
12632 				"	List<String> ls = first(); \n" +
12633 				"	                  ^^^^^^^\n" +
12634 				"Type safety: A generic array of List<String> is created for a varargs parameter\n" +
12635 				"----------\n" +
12636 				"3. ERROR in X.java (at line 16)\n" +
12637 				"	Zork z;\n" +
12638 				"	^^^^\n" +
12639 				"Zork cannot be resolved to a type\n" +
12640 				"----------\n");
12641 	}
12642 
12643 	public void test0413() {
12644 		this.runConformTest(
12645 			new String[] {
12646 				"X.java",
12647 				"public class X<T> {\n" +
12648 				"	static class TLM {\n" +
12649 				"	}\n" +
12650 				"    TLM getMap(TL t) {\n" +
12651 				"        return t.tls;\n" +
12652 				"    }\n" +
12653 				"    static TLM createInheritedMap(TLM parentMap) {\n" +
12654 				"        return new TLM();\n" +
12655 				"    }  \n" +
12656 				"}\n" +
12657 				"\n" +
12658 				"class TL {\n" +
12659 				"   X.TLM tls = null;\n" +
12660 				"}",
12661 			},
12662 			"");
12663 	}
12664 
12665 	public void test0414() {
12666 		this.runConformTest(
12667 			new String[] {
12668 				"X.java",
12669 				"public class X {\n" +
12670 				"	void foo(L l, C<? super X> c) {\n" +
12671 				"		bar(l, c);\n" +
12672 				"	}\n" +
12673 				"	<T> void bar(L<T> l, C<? super T> c) { \n" +
12674 				"	}	\n" +
12675 				"}\n" +
12676 				"class C<E> {}\n" +
12677 				"class L<E> {}",
12678 			},
12679 			"");
12680 	}
12681 
12682 	public void test0415() {
12683 		this.runConformTest(
12684 			new String[] {
12685 				"X.java",
12686 				"public class X {\n" +
12687 				"    public S<M.E<Object,Object>> foo(HM hm) {\n" +
12688 				"		return C.bar(hm).foo();\n" +
12689 				"    }\n" +
12690 				"}\n" +
12691 				"class C {\n" +
12692 				"    public static <K,V> M<K,V> bar(M<? extends K,? extends V> m) {\n" +
12693 				"		return null;\n" +
12694 				"    }\n" +
12695 				"}\n" +
12696 				"class S<E> {\n" +
12697 				"}\n" +
12698 				"abstract class HM<U,V> implements M<U,V>{\n" +
12699 				"}\n" +
12700 				"interface M<A,B> {\n" +
12701 				"	static class E<S,T> {}\n" +
12702 				"	S<E<A,B>> foo();	\n" +
12703 				"}",
12704 			},
12705 			"");
12706 	}
12707 
12708 	public void test0416() {
12709 		this.runConformTest(
12710 			new String[] {
12711 				"X.java",
12712 				"public class X {\n" +
12713 				"    public S<M.E<Object,String>> foo(HM hm) {\n" +
12714 				"    	M<Object, String> m = C.bar(hm);\n" +
12715 				"    	if (false) return m.foo();\n" +
12716 				"		return C.bar(hm).foo();\n" +
12717 				"    }\n" +
12718 				"}\n" +
12719 				"class C {\n" +
12720 				"    public static <K,V> M<K,V> bar(M<? extends K,? extends V> m) {\n" +
12721 				"		return null;\n" +
12722 				"    }\n" +
12723 				"}\n" +
12724 				"class S<E> {\n" +
12725 				"}\n" +
12726 				"abstract class HM<U,V> implements M<U,V>{\n" +
12727 				"}\n" +
12728 				"interface M<A,B> {\n" +
12729 				"	static class E<S,T> {}\n" +
12730 				"	S<E<A,B>> foo();	\n" +
12731 				"}",
12732 			},
12733 			"");
12734 	}
12735 
12736 	public void test0417() {
12737 		this.runConformTest(
12738 			new String[] {
12739 				"X.java",
12740 				"public class X<E> {\n" +
12741 				"	\n" +
12742 				"	<T> X<T> foo(X<T> xt) {\n" +
12743 				"		return null;\n" +
12744 				"	}\n" +
12745 				"	X<E> identity() {\n" +
12746 				"		return this;\n" +
12747 				"	}\n" +
12748 				"	void bar(X x) {\n" +
12749 				"		X<String> xs = foo(x).identity();\n" +
12750 				"	}\n" +
12751 				"}\n",
12752 			},
12753 			"");
12754 	}
12755 
12756 	public void test0418() {
12757 		this.runConformTest(
12758 			new String[] {
12759 				"X.java",
12760 				"public class X<E> {\n" +
12761 				"	\n" +
12762 				"	<T> X<T> foo(X<T> xt, X<T> xt2) {\n" +
12763 				"		return null;\n" +
12764 				"	}\n" +
12765 				"	X<E> identity() {\n" +
12766 				"		return this;\n" +
12767 				"	}\n" +
12768 				"	void bar(X x, X<String> xs) {\n" +
12769 				"		X<String> xs2 = foo(x, xs).identity();\n" +
12770 				"	}\n" +
12771 				"}\n",
12772 			},
12773 			"");
12774 	}
12775 
12776 	public void test0419() {
12777 		this.runConformTest(
12778 			new String[] {
12779 				"X.java",
12780 				"public class X<E> {\n" +
12781 				"	\n" +
12782 				"	<T,U> X<T> foo(X<T> xt, X<U> xt2) {\n" +
12783 				"		return null;\n" +
12784 				"	}\n" +
12785 				"	X<E> identity() {\n" +
12786 				"		return this;\n" +
12787 				"	}\n" +
12788 				"	void bar(X x, X<String> xs) {\n" +
12789 				"		X<String> xs2 = foo(x, xs).identity();\n" +
12790 				"	}\n" +
12791 				"}\n",
12792 			},
12793 			"");
12794 	}
12795 
12796 	public void test0420() {
12797 		this.runConformTest(
12798 			new String[] {
12799 				"X.java",
12800 				"public class X<E> {\n" +
12801 				"	\n" +
12802 				"	<T,U> X<U> foo(X<T> xt, X<U> xt2) {\n" +
12803 				"		return null;\n" +
12804 				"	}\n" +
12805 				"	X<E> identity() {\n" +
12806 				"		return this;\n" +
12807 				"	}\n" +
12808 				"	void bar(X x, X<String> xs) {\n" +
12809 				"		X<String> xs2 = foo(x, xs).identity();\n" +
12810 				"	}\n" +
12811 				"}\n",
12812 			},
12813 			"");
12814 	}
12815 
12816 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78863
12817 	public void test0421() {
12818 		this.runConformTest(
12819 			new String[] {
12820 				"Test.java",
12821 				"import java.util.HashMap;\n" +
12822 				"import java.util.List;\n" +
12823 				"import java.util.Map;\n" +
12824 				"\n" +
12825 				"public class Test\n" +
12826 				"{\n" +
12827 				"  protected Map<Class<? extends Object>, List<Object>> m_test\n" +
12828 				"    = new HashMap<Class<? extends Object>, List<Object>>();\n" +
12829 				"}\n",
12830 				"Test2.java",
12831 				"import java.util.List;\n" +
12832 				"import java.util.Map;\n" +
12833 				"\n" +
12834 				"public class Test2 extends Test\n" +
12835 				"{\n" +
12836 				"  public Map<Class<? extends Object>, List<Object>> test()\n" +
12837 				"  {\n" +
12838 				"    return m_test;\n" +
12839 				"  }\n" +
12840 				"}\n",
12841 			},
12842 			"");
12843 	}
12844 
12845 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78704
12846 	public void test0422() {
12847 		this.runNegativeTest(
12848 			new String[] {
12849 				"X.java",
12850 				"public class X<T> {\n" +
12851 				"	String foo() {\n" +
12852 				"		return new X();\n" +
12853 				"	}\n" +
12854 				"}\n",
12855 			},
12856 			"----------\n" +
12857 			"1. ERROR in X.java (at line 3)\n" +
12858 			"	return new X();\n" +
12859 			"	       ^^^^^^^\n" +
12860 			"Type mismatch: cannot convert from X to String\n" +
12861 			"----------\n" +
12862 			"2. WARNING in X.java (at line 3)\n" +
12863 			"	return new X();\n" +
12864 			"	           ^\n" +
12865 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
12866 			"----------\n");
12867 	}
12868 
12869 	public void test0423() {
12870 		this.runConformTest(
12871 			new String[] {
12872 				"X.java",
12873 				"public class X {\n" +
12874 				"\n" +
12875 				"    static <T extends X> T bar() {\n" +
12876 				"        return null;\n" +
12877 				"    }\n" +
12878 				"    static <U extends X&Runnable> U foo() {\n" +
12879 				"        return null;\n" +
12880 				"    }\n" +
12881 				"\n" +
12882 				"    public static void main(String argv[]) {\n" +
12883 				"    	bar();\n" +
12884 				"        foo();\n" +
12885 				"    }\n" +
12886 				"\n" +
12887 				"}",
12888 			},
12889 			"");
12890 	}
12891 
12892 	public void test0424() {
12893 		this.runConformTest(
12894 			new String[] {
12895 				"X.java",
12896 				"public class X {\n" +
12897 				"	\n" +
12898 				"	<T extends A> T foo(T t) {\n" +
12899 				"		return t;\n" +
12900 				"	}\n" +
12901 				"	public static void main(String[] args) {\n" +
12902 				"		new X().bar();\n" +
12903 				"	}\n" +
12904 				"	void bar() {\n" +
12905 				"		B b = foo(new B());\n" +
12906 				"	}\n" +
12907 				"}\n" +
12908 				"\n" +
12909 				"class A {}\n" +
12910 				"class B extends A {}\n" +
12911 				"\n",
12912 			},
12913 		"");
12914 	}
12915 
12916 	// check tiebreak eliminates related generic methods which are less specific
12917 	public void test0425() {
12918 		this.runNegativeTest(
12919 			new String[] {
12920 				"X.java",
12921 				"import java.io.IOException;\n" +
12922 				"\n" +
12923 				"public class X {\n" +
12924 				"    static <E extends A> void m(E e) { System.out.println(\"A:\"+e.getClass()); }\n" +
12925 				"    static <F extends B> void m(F f) throws Exception { System.out.println(\"B:\"+f.getClass()); }\n" +
12926 				"    static <G extends C> void m(G g) throws IOException { System.out.println(\"C:\"+g.getClass()); }\n" +
12927 				"\n" +
12928 				"    public static void main(String[] args) {\n" +
12929 				"        m(new A());\n" +
12930 				"        m(new B());\n" +
12931 				"        m(new C());\n" +
12932 				"    }\n" +
12933 				"}\n" +
12934 				"\n" +
12935 				"class A {}\n" +
12936 				"class B extends A {}\n" +
12937 				"class C extends A {}\n" +
12938 				"\n",
12939 			},
12940 			"----------\n" +
12941 			"1. ERROR in X.java (at line 10)\n" +
12942 			"	m(new B());\n" +
12943 			"	^^^^^^^^^^\n" +
12944 			"Unhandled exception type Exception\n" +
12945 			"----------\n" +
12946 			"2. ERROR in X.java (at line 11)\n" +
12947 			"	m(new C());\n" +
12948 			"	^^^^^^^^^^\n" +
12949 			"Unhandled exception type IOException\n" +
12950 			"----------\n");
12951 	}
12952 
12953 	// check inferred return types are truly based on arguments, and not on parameter erasures
12954 	public void test0426() {
12955 		this.runConformTest(
12956 			new String[] {
12957 				"X.java",
12958 				"public class X {\n" +
12959 				"    static <E extends A> E m(E e) { System.out.print(\"[A:\"+e.getClass()+\"]\"); return e; }\n" +
12960 				"\n" +
12961 				"    public static void main(String[] args) {\n" +
12962 				"        A a = m(new A());\n" +
12963 				"        B b = m(new B());\n" +
12964 				"        C c = m(new C());\n" +
12965 				"    }\n" +
12966 				"}\n" +
12967 				"\n" +
12968 				"class A {}\n" +
12969 				"class B extends A {}\n" +
12970 				"class C extends A {}\n",
12971 			},
12972 			"[A:class A][A:class B][A:class C]");
12973 	}
12974 
12975 	// check inferred return types are truly based on arguments, and not on parameter erasures
12976 	public void test0427() {
12977 		this.runConformTest(
12978 			new String[] {
12979 				"X.java",
12980 				"public class X {\n" +
12981 				"    static <E extends A> E m(E e, E... e2) { System.out.print(\"[A:\"+e.getClass()+\"]\"); return e; }\n" +
12982 				"    static <F extends B> F m(F f, F... f2) { System.out.print(\"[B:\"+f.getClass()+\"]\"); return f; }\n" +
12983 				"    static <G extends C> G m(G g, G... g2) { System.out.print(\"[C:\"+g.getClass()+\"]\"); return g; }\n" +
12984 				"\n" +
12985 				"    public static void main(String[] args) {\n" +
12986 				"        A a = m(new A(), new A());\n" +
12987 				"        B b = m(new B(), new B());\n" +
12988 				"        C c = m(new C(), new C());\n" +
12989 				"    }\n" +
12990 				"}\n" +
12991 				"\n" +
12992 				"class A {}\n" +
12993 				"class B extends A {}\n" +
12994 				"class C extends A {}\n",
12995 			},
12996 			"[A:class A][B:class B][C:class C]");
12997 	}
12998 
12999 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=79390
13000 	public void test0428() {
13001 		this.runNegativeTest(
13002 			new String[] {
13003 				"X.java",
13004 				"public class X {\n" +
13005 				"   Zork z;\n" +
13006 				"	public static void foo() {\n" +
13007 				"		class A<T extends Number> {\n" +
13008 				"			T t = null;\n" +
13009 				"			T get() {\n" +
13010 				"				return t;\n" +
13011 				"			}\n" +
13012 				"		}\n" +
13013 				"		A<Long> a = new A<Long>() {\n" +
13014 				"			@Override\n" +
13015 				"			Long get() {\n" +
13016 				"				return Long.valueOf(5);\n" +
13017 				"			}\n" +
13018 				"		};\n" +
13019 				"	}\n" +
13020 				"}\n",
13021 			},
13022 			"----------\n" +
13023 			"1. ERROR in X.java (at line 2)\n" +
13024 			"	Zork z;\n" +
13025 			"	^^^^\n" +
13026 			"Zork cannot be resolved to a type\n" +
13027 			"----------\n");
13028 	}
13029 
13030 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78293
13031 	public void test0429() {
13032 		this.runConformTest(
13033 			new String[] {
13034 				"X1.java",
13035 				"class X1 <T extends Y & Comparable<Y>> {}\n" +
13036 				"abstract class Y implements Comparable<Y> {}",
13037 			},
13038 			""
13039 		);
13040 	}
13041 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78293
13042 	public void test0429a() {
13043 		this.runConformTest(
13044 			new String[] {
13045 				"X2.java",
13046 				"class X2 <T extends Y & Comparable<Y>> {}\n" +
13047 				"abstract class Y extends Z {}\n" +
13048 				"abstract class Z implements Comparable<Y> {}",
13049 			},
13050 			""
13051 		);
13052 	}
13053 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78293
13054 	public void test0429b() {
13055 		this.runConformTest(
13056 			new String[] {
13057 				"X3.java",
13058 				"class X3 <T extends Y & Comparable<Z>> {}\n" +
13059 				"abstract class Y extends Z {}\n" +
13060 				"abstract class Z implements Comparable<Z> {}",
13061 			},
13062 			""
13063 		);
13064 	}
13065 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78293
13066 	public void test0429c() {
13067 		runNegativeTest(
13068 			// test directory preparation
13069 			new String[] { /* test files */
13070 				"X4.java",
13071 				"class X4 <T extends Comparable<Z> & Comparable<Z>> {}\n" +
13072 				"abstract class Y extends Z {}\n" +
13073 				"abstract class Z implements Comparable<Z> {}",
13074 			},
13075 			// compiler results
13076 			"----------\n" + /* expected compiler log */
13077 			"1. ERROR in X4.java (at line 1)\n" +
13078 			"	class X4 <T extends Comparable<Z> & Comparable<Z>> {}\n" +
13079 			"	                                    ^^^^^^^^^^\n" +
13080 			"Duplicate bound Comparable<Z>\n" +
13081 			"----------\n",
13082 				// no complaints about duplicates if they are both parameterized with same args
13083 				// but you cannot extend Comparable & Comparable so we'll report an error
13084 			// javac options
13085 			JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
13086 	}
13087 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78293
13088 	public void test0429d() {
13089 		this.runNegativeTest(
13090 			new String[] {
13091 				"X5.java",
13092 				"class X5 <T extends Y & Comparable<X5>> {}\n" +
13093 				"abstract class Y implements Comparable<Y> {}",
13094 			},
13095 			"----------\n" +
13096 			"1. ERROR in X5.java (at line 1)\n" +
13097 			"	class X5 <T extends Y & Comparable<X5>> {}\n" +
13098 			"	                        ^^^^^^^^^^\n" +
13099 			"The interface Comparable cannot be implemented more than once with different arguments: Comparable<X5> and Comparable<Y>\n" +
13100 			"----------\n" +
13101 			"2. WARNING in X5.java (at line 1)\n" +
13102 			"	class X5 <T extends Y & Comparable<X5>> {}\n" +
13103 			"	                                   ^^\n" +
13104 			"X5 is a raw type. References to generic type X5<T> should be parameterized\n" +
13105 			"----------\n"
13106 			// Comparable cannot be inherited with different arguments: <X5> and <Y>
13107 		);
13108 	}
13109 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78293
13110 	public void test0429e() {
13111 		this.runNegativeTest(
13112 			new String[] {
13113 				"X6.java",
13114 				"class X6 <T extends Y & Comparable<X6>> {}\n" +
13115 				"abstract class Y extends Z {}\n" +
13116 				"abstract class Z implements Comparable<Z> {}",
13117 			},
13118 			"----------\n" +
13119 			"1. ERROR in X6.java (at line 1)\n" +
13120 			"	class X6 <T extends Y & Comparable<X6>> {}\n" +
13121 			"	                        ^^^^^^^^^^\n" +
13122 			"The interface Comparable cannot be implemented more than once with different arguments: Comparable<X6> and Comparable<Z>\n" +
13123 			"----------\n" +
13124 			"2. WARNING in X6.java (at line 1)\n" +
13125 			"	class X6 <T extends Y & Comparable<X6>> {}\n" +
13126 			"	                                   ^^\n" +
13127 			"X6 is a raw type. References to generic type X6<T> should be parameterized\n" +
13128 			"----------\n"
13129 			// Comparable cannot be inherited with different arguments: <X6> and <Y>
13130 		);
13131 	}
13132 
13133 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78293
13134 	public void test0429f() {
13135 		this.runNegativeTest(
13136 			new String[] {
13137 				"X7.java",
13138 				"class X7 <T extends Comparable<Z> & Comparable<X7>> {}\n" +
13139 				"abstract class Y extends Z {}\n" +
13140 				"abstract class Z implements Comparable<Z> {}",
13141 			},
13142 			"----------\n" +
13143 			"1. ERROR in X7.java (at line 1)\n" +
13144 			"	class X7 <T extends Comparable<Z> & Comparable<X7>> {}\n" +
13145 			"	                                    ^^^^^^^^^^\n" +
13146 			"The interface Comparable cannot be implemented more than once with different arguments: Comparable<X7> and Comparable<Z>\n" +
13147 			"----------\n" +
13148 			"2. WARNING in X7.java (at line 1)\n" +
13149 			"	class X7 <T extends Comparable<Z> & Comparable<X7>> {}\n" +
13150 			"	                                               ^^\n" +
13151 			"X7 is a raw type. References to generic type X7<T> should be parameterized\n" +
13152 			"----------\n"
13153 			// Comparable cannot be inherited with different arguments: <Z> and <X7>
13154 		);
13155 	}
13156 
13157 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78293
13158 	public void test0429g() {
13159 		this.runNegativeTest(new String[] {
13160 				"X.java",
13161 				"interface I<T> {}\n" +
13162 				"\n" +
13163 				"class A implements I<A>, I<A> {}\n" +
13164 				"public class X<E extends A & I<E> & I<E>>  {\n" +
13165 				"}"
13166 			},
13167 			"----------\n" +
13168 			"1. ERROR in X.java (at line 3)\n" +
13169 			"	class A implements I<A>, I<A> {}\n" +
13170 			"	                         ^\n" +
13171 			"Duplicate interface I<A> for the type A\n" +
13172 			"----------\n" +
13173 			"2. ERROR in X.java (at line 4)\n" +
13174 			"	public class X<E extends A & I<E> & I<E>>  {\n" +
13175 			"	                             ^\n" +
13176 			"The interface I cannot be implemented more than once with different arguments: I<E> and I<A>\n" +
13177 			"----------\n" +
13178 			"3. ERROR in X.java (at line 4)\n" +
13179 			"	public class X<E extends A & I<E> & I<E>>  {\n" +
13180 			"	                                    ^\n" +
13181 			"Duplicate bound I<E>\n" +
13182 			"----------\n");
13183 	}
13184 
13185 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=79797
13186 	public void test0430() {
13187 		this.runConformTest(
13188 			new String[] {
13189 				"p/MMM.java",
13190 				"package p;\n" +
13191 				"public interface MMM< F extends MMM<F,G>, G extends NNN> { } \n",
13192 				"p/NNN.java",
13193 				"package p;\n" +
13194 				"public interface NNN { } \n",
13195 			},
13196 			"");
13197 
13198 		this.runConformTest(
13199 			new String[] {
13200 				"X.java",
13201 				"import p.MMM;\n" +
13202 				"import p.NNN;\n" +
13203 				"\n" +
13204 				"interface RRR< A extends MMM<A, B>, B extends NNN> {}\n" +
13205 				"\n" +
13206 				"class J1 implements MMM<J1, J2> { }\n" +
13207 				"class J2 implements NNN { }\n" +
13208 				"\n" +
13209 				"class J3 implements RRR<J1,J2> {} \n" +
13210 				"\n" +
13211 				"public class X {\n" +
13212 				"  public static void main(String[] args) {\n" +
13213 				"    J3 thing = null;\n" +
13214 				"  }\n" +
13215 				"}\n",
13216 			},
13217 			"",
13218 			null,
13219 			false, // do not flush output
13220 			null);
13221 	}
13222 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=79891
13223 	public void test0431() {
13224 		this.runNegativeTest(
13225 			new String[] {
13226 				"X.java",
13227 				"public class X<Type> {\n" +
13228 				"  private class Element {\n" +
13229 				"  }\n" +
13230 				"  public X() {\n" +
13231 				"    Element[] eArray = new Element[10];\n" +
13232 				"  }\n" +
13233 				"}\n",
13234 			},
13235 		"----------\n" +
13236 		"1. ERROR in X.java (at line 5)\n" +
13237 		"	Element[] eArray = new Element[10];\n" +
13238 		"	                   ^^^^^^^^^^^^^^^\n" +
13239 		"Cannot create a generic array of X<Type>.Element\n" +
13240 		"----------\n");
13241 	}
13242 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=79891
13243 	public void test0432() {
13244 		this.runConformTest(
13245 			new String[] {
13246 				"X.java",
13247 				"public class X<Type> {\n" +
13248 				"  private static class Element {\n" +
13249 				"  }\n" +
13250 				"  public X() {\n" +
13251 				"    Element[] eArray = new Element[10];\n" +
13252 				"  }\n" +
13253 				"}\n",
13254 			},
13255 		"");
13256 	}
13257 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=80144
13258 	public void test0433() {
13259 		this.runConformTest(
13260 			new String[] {
13261 				"X.java",
13262 				"import java.util.*;\n" +
13263 				"\n" +
13264 				"interface Alpha<\n" +
13265 				"	A1 extends Alpha<A1, B1>, \n" +
13266 				"	B1 extends Beta<A1, B1>> {\n" +
13267 				"}\n" +
13268 				"interface Beta<\n" +
13269 				"	A2 extends Alpha<A2, B2>, \n" +
13270 				"	B2 extends Beta<A2, B2>> {\n" +
13271 				"}\n" +
13272 				"interface Phi<\n" +
13273 				"	A3 extends Alpha<A3, B3>, \n" +
13274 				"	B3 extends Beta<A3, B3>> {\n" +
13275 				"	\n" +
13276 				"	public void latinize(A3 s);\n" +
13277 				"}\n" +
13278 				"\n" +
13279 				"public class X<\n" +
13280 				"	A extends Alpha<A, B>, \n" +
13281 				"	B extends Beta<A, B>, \n" +
13282 				"	P extends Phi<A, B>> extends ArrayList<P> implements Phi<A, B> {\n" +
13283 				"	\n" +
13284 				"	public final void latinize(A a) {\n" +
13285 				"		frenchify(this, a); // (X<A,B,P>, A)\n" +
13286 				"	}\n" +
13287 				"	// -----------------------------------------------------------------\n" +
13288 				"	public static final <AA extends Alpha<AA, BB>, BB extends Beta<AA, BB>> \n" +
13289 				"	void frenchify(Collection< ? extends Phi<AA, BB>> phis, AA aa) {\n" +
13290 				"		for (final Phi<AA, BB> phi : phis)\n" +
13291 				"			phi.latinize(aa);\n" +
13292 				"	}\n" +
13293 				"}\n",
13294 			},
13295 		"");
13296 	}
13297 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=80083
13298 	public void test0434() {
13299 		this.runConformTest(
13300 			new String[] {
13301 				"X.java",
13302 				"import java.util.ArrayList;\n" +
13303 				"\n" +
13304 				"public class X\n" +
13305 				"{\n" +
13306 				"\n" +
13307 				"  public static void main(String[] args)\n" +
13308 				"  {\n" +
13309 				"    ArrayList<String> l = new ArrayList<String>();\n" +
13310 				"    l.add(\"x\");\n" +
13311 				"    String s = \"\";\n" +
13312 				"    s += l.get(0); // X\n" +
13313 				"    System.out.println(\"SUCCESS\");\n" +
13314 				"  }\n" +
13315 				"\n" +
13316 				"}\n",
13317 			},
13318 		"SUCCESS");
13319 	}
13320 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=80765
13321 	public void test0435() {
13322 		this.runNegativeTest(
13323 			new String[] {
13324 				"Test.java",//===============================
13325 				"import java.lang.reflect.InvocationTargetException;\n" +
13326 				"import java.lang.reflect.Method;\n" +
13327 				"\n" +
13328 				"import orders.DiscreteOrder;\n" +
13329 				"import orders.impl.IntegerOrder;\n" +
13330 				"import orders.impl.IntegerOrder2;\n" +
13331 				"\n" +
13332 				"public class Test {\n" +
13333 				"\n" +
13334 				"    public static void main(String[] args) throws SecurityException,\n" +
13335 				"            NoSuchMethodException, IllegalArgumentException,\n" +
13336 				"            IllegalAccessException {\n" +
13337 				"        Test test = new Test();\n" +
13338 				"\n" +
13339 				"        for (String method : new String[] { \"test01\", \"test02\", \"test03\", \"test04\" }) {\n" +
13340 				"            Method m = test.getClass().getMethod(method);\n" +
13341 				"            try {\n" +
13342 				"                m.invoke(test);\n" +
13343 				"                System.out.print(\"*** \" + m + \": success\");\n" +
13344 				"            } catch (InvocationTargetException e) {\n" +
13345 				"                System.out.print(\"*** \" + m + \": failed, stacktrace follows\");\n" +
13346 				"                e.getCause().printStackTrace(System.out);\n" +
13347 				"            }\n" +
13348 				"        }\n" +
13349 				"    }\n" +
13350 				"\n" +
13351 				"    public void test01() { // works\n" +
13352 				"        new IntegerOrder().next(Integer.valueOf(0)); // works\n" +
13353 				"    }\n" +
13354 				"\n" +
13355 				"    public void test02() { // doesn\'t work\n" +
13356 				"        final DiscreteOrder<Integer> order = new IntegerOrder();\n" +
13357 				"        order.next(Integer.valueOf(0));\n" +
13358 				"    }\n" +
13359 				"\n" +
13360 				"    public void test03() { // works\n" +
13361 				"        new IntegerOrder2().next(Integer.valueOf(0)); // works\n" +
13362 				"    }\n" +
13363 				"\n" +
13364 				"    public void test04() { // doesn\'t work\n" +
13365 				"        final DiscreteOrder<Integer> order = new IntegerOrder2();\n" +
13366 				"        order.next(Integer.valueOf(0));\n" +
13367 				"    }\n" +
13368 				"}\n",
13369 				"orders/DiscreteOrder.java",//===============================
13370 				"package orders;\n" +
13371 				"public interface DiscreteOrder<E extends Comparable<E>> {\n" +
13372 				"    /**\n" +
13373 				"     * @return The element immediately before <code>element</code> in the\n" +
13374 				"     *         discrete ordered space.\n" +
13375 				"     */\n" +
13376 				"    public E previous(E element);\n" +
13377 				"    /**\n" +
13378 				"     * @return The element immediately after <code>element</code> in the\n" +
13379 				"     *         discrete ordered space.\n" +
13380 				"     */\n" +
13381 				"    public E next(E element);\n" +
13382 				"}\n",
13383 				"orders/impl/IntegerOrder.java",//===============================
13384 				"package orders.impl;\n" +
13385 				"import orders.DiscreteOrder;\n" +
13386 				"\n" +
13387 				"public class IntegerOrder implements DiscreteOrder<Integer> {\n" +
13388 				"\n" +
13389 				"    public IntegerOrder() {\n" +
13390 				"        super();\n" +
13391 				"    }\n" +
13392 				"\n" +
13393 				"    public Integer previous(Integer arg0) {\n" +
13394 				"        return Integer.valueOf(arg0.intValue() - 1);\n" +
13395 				"    }\n" +
13396 				"\n" +
13397 				"    public Integer next(Integer arg0) {\n" +
13398 				"        return Integer.valueOf(arg0.intValue() + 1);\n" +
13399 				"    }\n" +
13400 				"}\n",
13401 				"orders/impl/IntegerOrder2.java",//===============================
13402 				"package orders.impl;\n" +
13403 				"\n" +
13404 				"\n" +
13405 				"public class IntegerOrder2 extends IntegerOrder {\n" +
13406 				"\n" +
13407 				"    public IntegerOrder2() {\n" +
13408 				"        super();\n" +
13409 				"    }\n" +
13410 				"\n" +
13411 				"    public Comparable previous(Comparable arg0) {\n" +
13412 				"        return previous((Integer) arg0);\n" +
13413 				"    }\n" +
13414 				"\n" +
13415 				"    public Comparable next(Comparable arg0) {\n" +
13416 				"        return next((Integer) arg0);\n" +
13417 				"    }\n" +
13418 				"\n" +
13419 				"}\n",
13420 			},
13421 			"----------\n" +
13422 			"1. WARNING in orders\\impl\\IntegerOrder2.java (at line 10)\n" +
13423 			"	public Comparable previous(Comparable arg0) {\n" +
13424 			"	       ^^^^^^^^^^\n" +
13425 			"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
13426 			"----------\n" +
13427 			"2. ERROR in orders\\impl\\IntegerOrder2.java (at line 10)\n" +
13428 			"	public Comparable previous(Comparable arg0) {\n" +
13429 			"	                  ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
13430 			"Name clash: The method previous(Comparable) of type IntegerOrder2 has the same erasure as previous(E) of type DiscreteOrder<E> but does not override it\n" +
13431 			"----------\n" +
13432 			"3. WARNING in orders\\impl\\IntegerOrder2.java (at line 10)\n" +
13433 			"	public Comparable previous(Comparable arg0) {\n" +
13434 			"	                           ^^^^^^^^^^\n" +
13435 			"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
13436 			"----------\n" +
13437 			"4. WARNING in orders\\impl\\IntegerOrder2.java (at line 14)\n" +
13438 			"	public Comparable next(Comparable arg0) {\n" +
13439 			"	       ^^^^^^^^^^\n" +
13440 			"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
13441 			"----------\n" +
13442 			"5. ERROR in orders\\impl\\IntegerOrder2.java (at line 14)\n" +
13443 			"	public Comparable next(Comparable arg0) {\n" +
13444 			"	                  ^^^^^^^^^^^^^^^^^^^^^\n" +
13445 			"Name clash: The method next(Comparable) of type IntegerOrder2 has the same erasure as next(E) of type DiscreteOrder<E> but does not override it\n" +
13446 			"----------\n" +
13447 			"6. WARNING in orders\\impl\\IntegerOrder2.java (at line 14)\n" +
13448 			"	public Comparable next(Comparable arg0) {\n" +
13449 			"	                       ^^^^^^^^^^\n" +
13450 			"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
13451 			"----------\n"
13452 			// "*** public void Test.test01(): success*** public void Test.test02(): success*** public void Test.test03(): success*** public void Test.test04(): success"
13453 			// name clash: next(java.lang.Comparable) in orders.impl.IntegerOrder2 and next(E) in orders.DiscreteOrder<java.lang.Integer> have the same erasure, yet neither overrides the other
13454 		);
13455 	}
13456 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=80028
13457 	public void test0436() {
13458 		this.runConformTest(
13459 			new String[] {
13460 				"A.java",
13461 				"public class A {\n" +
13462 				"	public static void main(String[] args) {\n" +
13463 				"		Number n= new Integer(1);\n" +
13464 				"		X x = new X<Number>();\n" +
13465 				"		x.m(n);\n" +
13466 				"		x.m(new Integer(2));\n" +
13467 				"		Y y= new Y();\n" +
13468 				"		y.m(n);\n" +
13469 				"		y.m(new Integer(2));\n" +
13470 				"	}\n" +
13471 				"}\n",
13472 				"X.java",
13473 				"class X<T> {\n" +
13474 				"	public void m(Number num) { System.out.print(\"X.m(Number) = \" + num + ','); }\n" +
13475 				"	public void m(T t) { System.out.print(\"X.m(T) = \" + t + ','); }\n" +
13476 				"}\n",
13477 				"Y.java",
13478 				"class Y extends X<Number> {\n" +
13479 				"	public void m(Number num) { System.out.print(\"Y.m(Number) = \" + num + ','); }\n" +
13480 				"}\n",
13481 			},
13482 		"X.m(Number) = 1,X.m(Number) = 2,Y.m(Number) = 1,Y.m(Number) = 2,");
13483 	}
13484 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=80028
13485 	public void test0437() {
13486 		this.runConformTest(
13487 			new String[] {
13488 				"A.java",
13489 				"public class A {\n" +
13490 				"	public static void main(String[] args) {\n" +
13491 				"		Number n= new Integer(1);\n" +
13492 				"		X x = new X<Number>();\n" +
13493 				"		x.m(n);\n" +
13494 				"		x.m(new Integer(2));\n" +
13495 				"		Y y= new Y();\n" +
13496 				"		y.m(n);\n" +
13497 				"		y.m(new Integer(2));\n" +
13498 				"	}\n" +
13499 				"}\n",
13500 				"X.java",
13501 				"class X<T> {\n" +
13502 				"	public void m(Number num) { System.out.print(\"X.m(Number) = \" + num + ','); }\n" +
13503 				"	public void m(T t) { System.out.print(\"X.m(T) = \" + t + ','); }\n" +
13504 				"}\n",
13505 				"Y.java",
13506 				"class Y extends X<Number> {\n" +
13507 				"	public void m(Number num) { System.out.print(\"Y.m(Number) = \" + num + ','); }\n" +
13508 				"}\n",
13509 			},
13510 		"X.m(Number) = 1,X.m(Number) = 2,Y.m(Number) = 1,Y.m(Number) = 2,");
13511 	}
13512 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78591
13513 	public void test0438() {
13514 		this.runNegativeTest(
13515 			new String[] {
13516 				"X.java",
13517 				"import java.util.List;\n" +
13518 				"public class X<T> {\n" +
13519 				"    Zork z;\n" +
13520 				"    List<T> list;\n" +
13521 				"    void add(Object abs) {\n" +
13522 				"        list.add((T) list.get(0)); // checked cast\n" +
13523 				"        list.add((T) abs); // unchecked cast\n" +
13524 				"    }\n" +
13525 				"    void bar(List<? extends T> other) {\n" +
13526 				"    	list.add((T) other.get(0)); // checked cast\n" +
13527 				"    }\n" +
13528 				"    void baz(List<? super T> other) {\n" +
13529 				"    	list.add((T) other.get(0)); // unchecked cast\n" +
13530 				"    }\n" +
13531 				"}\n",
13532 			},
13533 			"----------\n" +
13534 			"1. ERROR in X.java (at line 3)\n" +
13535 			"	Zork z;\n" +
13536 			"	^^^^\n" +
13537 			"Zork cannot be resolved to a type\n" +
13538 			"----------\n" +
13539 			"2. WARNING in X.java (at line 6)\n" +
13540 			"	list.add((T) list.get(0)); // checked cast\n" +
13541 			"	         ^^^^^^^^^^^^^^^\n" +
13542 			"Unnecessary cast from T to T\n" +
13543 			"----------\n" +
13544 			"3. WARNING in X.java (at line 7)\n" +
13545 			"	list.add((T) abs); // unchecked cast\n" +
13546 			"	         ^^^^^^^\n" +
13547 			"Type safety: Unchecked cast from Object to T\n" +
13548 			"----------\n" +
13549 			"4. WARNING in X.java (at line 10)\n" +
13550 			"	list.add((T) other.get(0)); // checked cast\n" +
13551 			"	         ^^^^^^^^^^^^^^^^\n" +
13552 			"Unnecessary cast from capture#1-of ? extends T to T\n" +
13553 			"----------\n" +
13554 			"5. WARNING in X.java (at line 13)\n" +
13555 			"	list.add((T) other.get(0)); // unchecked cast\n" +
13556 			"	         ^^^^^^^^^^^^^^^^\n" +
13557 			"Type safety: Unchecked cast from capture#2-of ? super T to T\n" +
13558 			"----------\n");
13559 	}
13560 
13561 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78592
13562 	public void test0439() {
13563 		this.runNegativeTest(
13564 			new String[] {
13565 				"X.java",
13566 				"class Node {\n" +
13567 				"}\n" +
13568 				"class Composite<E> {\n" +
13569 				"}\n" +
13570 				"class Concrete extends Composite {\n" +
13571 				"}\n" +
13572 				"public class X {\n" +
13573 				"    Composite<Node> comp = new Concrete(); // unchecked cast\n" +
13574 				"    Zork z;\n" +
13575 				"}\n",
13576 			},
13577 			"----------\n" +
13578 			"1. WARNING in X.java (at line 5)\n" +
13579 			"	class Concrete extends Composite {\n" +
13580 			"	                       ^^^^^^^^^\n" +
13581 			"Composite is a raw type. References to generic type Composite<E> should be parameterized\n" +
13582 			"----------\n" +
13583 			"2. WARNING in X.java (at line 8)\n" +
13584 			"	Composite<Node> comp = new Concrete(); // unchecked cast\n" +
13585 			"	                       ^^^^^^^^^^^^^^\n" +
13586 			"Type safety: The expression of type Concrete needs unchecked conversion to conform to Composite<Node>\n" +
13587 			"----------\n" +
13588 			"3. ERROR in X.java (at line 9)\n" +
13589 			"	Zork z;\n" +
13590 			"	^^^^\n" +
13591 			"Zork cannot be resolved to a type\n" +
13592 			"----------\n");
13593 	}
13594 
13595 	public void test0440() {
13596 		this.runNegativeTest(
13597 			new String[] {
13598 				"X.java",
13599 				"public class X<T> {\n" +
13600 				"	class Y<U> {\n" +
13601 				"		public void foo(X<T> xt) {\n" +
13602 				"			U u = (U) xt;\n" +
13603 				"		}\n" +
13604 				"	}\n" +
13605 				"  Zork z;\n" +
13606 				"}\n",
13607 			},
13608 			"----------\n" +
13609 			"1. WARNING in X.java (at line 4)\n" +
13610 			"	U u = (U) xt;\n" +
13611 			"	      ^^^^^^\n" +
13612 			"Type safety: Unchecked cast from X<T> to U\n" +
13613 			"----------\n" +
13614 			"2. ERROR in X.java (at line 7)\n" +
13615 			"	Zork z;\n" +
13616 			"	^^^^\n" +
13617 			"Zork cannot be resolved to a type\n" +
13618 			"----------\n");
13619 	}
13620 
13621 	public void test0441() {
13622 		this.runNegativeTest(
13623 			new String[] {
13624 				"X.java",
13625 				"public class X<T extends Number> {\n" +
13626 				"    T[] array;\n" +
13627 				"    X(int s) {\n" +
13628 				"        array = (T[]) new Number[s];   // Unnecessary cast from Number[] to T[]\n" +
13629 				"        array = new Number[s];   // Type mismatch: cannot convert from Number[] to T[]\n" +
13630 				"     }\n" +
13631 				"}\n",
13632 			},
13633 			"----------\n" +
13634 			"1. WARNING in X.java (at line 4)\n" +
13635 			"	array = (T[]) new Number[s];   // Unnecessary cast from Number[] to T[]\n" +
13636 			"	        ^^^^^^^^^^^^^^^^^^^\n" +
13637 			"Type safety: Unchecked cast from Number[] to T[]\n" +
13638 			"----------\n" +
13639 			"2. ERROR in X.java (at line 5)\n" +
13640 			"	array = new Number[s];   // Type mismatch: cannot convert from Number[] to T[]\n" +
13641 			"	        ^^^^^^^^^^^^^\n" +
13642 			"Type mismatch: cannot convert from Number[] to T[]\n" +
13643 			"----------\n");
13644 	}
13645 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=82053
13646 	public void test0442() {
13647 		this.runConformTest(
13648 			new String[] {
13649 				"X.java",
13650 				"class Foo {\n" +
13651 				"	public interface Model {\n" +
13652 				"	}\n" +
13653 				"	public interface View<M extends Model> {\n" +
13654 				"		M getTarget() ;\n" +
13655 				"	}\n" +
13656 				"}\n" +
13657 				"class Bar {\n" +
13658 				"	public interface Model extends Foo.Model {\n" +
13659 				"	}\n" +
13660 				"	public interface View<M extends Model> extends Foo.View<M> {\n" +
13661 				"	}\n" +
13662 				"}\n" +
13663 				"public class X {\n" +
13664 				"	public void baz() {\n" +
13665 				"		Bar.View<?> bv = null ;\n" +
13666 				"		Bar.Model m = bv.getTarget() ;\n" +
13667 				"	}\n" +
13668 				"}\n",
13669 			},
13670 			"");
13671 	}
13672 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=81757
13673 	public void test0443() {
13674 		this.runConformTest(
13675 			new String[] {
13676 				"X.java",
13677 				"import java.util.Iterator;\n" +
13678 				"public class X implements Iterator<String> {\n" +
13679 				"    public boolean hasNext() { return false; }\n" +
13680 				"    public String next() { return null; }\n" +
13681 				"    public void remove() {}\n" +
13682 				"}\n",
13683 			},
13684 			"");
13685 	}
13686 
13687 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=81824
13688 	public void test0444() {
13689 		this.runNegativeTest(
13690 			new String[] {
13691 				"X.java",
13692 				"public class X implements I<Integer>, I<String> {}\n" +
13693 				"interface I<T> {}\n"
13694 			},
13695 			"----------\n" +
13696 			"1. ERROR in X.java (at line 1)\n" +
13697 			"	public class X implements I<Integer>, I<String> {}\n" +
13698 			"	             ^\n" +
13699 			"The interface I cannot be implemented more than once with different arguments: I<String> and I<Integer>\n" +
13700 			"----------\n");
13701 	}
13702 
13703 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78810
13704 	public void test0445() {
13705 		this.runNegativeTest(
13706 			new String[] {
13707 				"X.java",
13708 				"public abstract class X {\n" +
13709 				"    public abstract Object getProperty(final Object src, final String name);\n" +
13710 				"    Zork z;\n" +
13711 				"    public <T> T getTheProperty(final Object src, final String name)\n" +
13712 				"    {\n" +
13713 				"        final T val = (T) getProperty(src, name); // this gives erroneous cast warning\n" +
13714 				"        return val;\n" +
13715 				"    }\n" +
13716 				"}\n"	,
13717 			},
13718 			"----------\n" +
13719 			"1. ERROR in X.java (at line 3)\n" +
13720 			"	Zork z;\n" +
13721 			"	^^^^\n" +
13722 			"Zork cannot be resolved to a type\n" +
13723 			"----------\n" +
13724 			"2. WARNING in X.java (at line 6)\n" +
13725 			"	final T val = (T) getProperty(src, name); // this gives erroneous cast warning\n" +
13726 			"	              ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
13727 			"Type safety: Unchecked cast from Object to T\n" +
13728 			"----------\n");
13729 	}
13730 
13731 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=82159
13732 	public void test0446() {
13733 		this.runNegativeTest(
13734 			new String[] {
13735 				"X.java",
13736 				"public class X<A> {\n" +
13737 				"  class Inner<B> { }\n" +
13738 				"\n" +
13739 				"  void method() {\n" +
13740 				"    X<String>.Inner<Integer> a= new X<String>().new Inner<Integer>();\n" +
13741 				"    Inner<Integer> b= new X<A>().new Inner<Integer>();\n" +
13742 				"    Inner<Integer> c= new Inner<Integer>();\n" +
13743 				"    // OK\n" +
13744 				"\n" +
13745 				"    X<String>.Inner<Integer> d= new X<String>.Inner<Integer>();\n" +
13746 				"    //eclipse: OK\n" +
13747 				"    //other: error: \'(\' or \'[\' expected\n" +
13748 				"\n" +
13749 				"    X<A>.Inner<Integer> e= new X<A>().new Inner<Integer>();\n" +
13750 				"    X<A>.Inner<Integer> f= new Inner<Integer>();\n" +
13751 				"    e= b;\n" +
13752 				"    f= c;\n" +
13753 				"    //other: OK\n" +
13754 				"    //eclipse: Type mismatch: cannot convert from X<A>.Inner<Integer> to X<A>.Inner<Integer>\n" +
13755 				"\n" +
13756 				"  }\n" +
13757 				"}\n" +
13758 				"\n" +
13759 				"class External {\n" +
13760 				"  void m() {\n" +
13761 				"    X<String>.Inner<Integer> x= new X<String>().new Inner<Integer>();\n" +
13762 				"    // OK\n" +
13763 				"  }\n" +
13764 				"}\n",
13765 			},
13766 			"----------\n" +
13767 			"1. ERROR in X.java (at line 10)\n" +
13768 			"	X<String>.Inner<Integer> d= new X<String>.Inner<Integer>();\n" +
13769 			"	                                ^^^^^^^^^^^^^^^\n" +
13770 			"Cannot allocate the member type X<String>.Inner<Integer> using a parameterized compound name; use its simple name and an enclosing instance of type X<String>\n" +
13771 			"----------\n",
13772 			JavacTestOptions.EclipseHasABug.EclipseBug236243);
13773 	}
13774 
13775 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=82159 - variation
13776 	public void test0447() {
13777 		this.runNegativeTest(
13778 			new String[] {
13779 				"X.java",
13780 				"public class X<A> {\n" +
13781 				"  class Inner<B> { }\n" +
13782 				"\n" +
13783 				"  void method() {\n" +
13784 				"    X<String>.Inner<Integer> d1 = new X<String>.Inner<Integer>();\n" +
13785 				"    X.Inner d2 = new X.Inner();\n" +
13786 				"    X.Inner<Integer> d3 = new X.Inner<Integer>();\n" +
13787 				"    d1 = d2;\n" +
13788 				"    d2 = d1;\n" +
13789 				"    d1 = d3;\n" +
13790 				"    d3 = d1;\n" +
13791 				"    d2 = d3;\n" +
13792 				"    d3 = d2;\n" +
13793 				"\n" +
13794 				"  }\n" +
13795 				"}\n",
13796 			},
13797 			"----------\n" +
13798 			"1. ERROR in X.java (at line 5)\n" +
13799 			"	X<String>.Inner<Integer> d1 = new X<String>.Inner<Integer>();\n" +
13800 			"	                                  ^^^^^^^^^^^^^^^\n" +
13801 			"Cannot allocate the member type X<String>.Inner<Integer> using a parameterized compound name; use its simple name and an enclosing instance of type X<String>\n" +
13802 			"----------\n" +
13803 			"2. WARNING in X.java (at line 6)\n" +
13804 			"	X.Inner d2 = new X.Inner();\n" +
13805 			"	^^^^^^^\n" +
13806 			"X.Inner is a raw type. References to generic type X<A>.Inner<B> should be parameterized\n" +
13807 			"----------\n" +
13808 			"3. WARNING in X.java (at line 6)\n" +
13809 			"	X.Inner d2 = new X.Inner();\n" +
13810 			"	                 ^^^^^^^\n" +
13811 			"X.Inner is a raw type. References to generic type X<A>.Inner<B> should be parameterized\n" +
13812 			"----------\n" +
13813 			"4. ERROR in X.java (at line 7)\n" +
13814 			"	X.Inner<Integer> d3 = new X.Inner<Integer>();\n" +
13815 			"	^^^^^^^\n" +
13816 			"The member type X.Inner<Integer> must be qualified with a parameterized type, since it is not static\n" +
13817 			"----------\n" +
13818 			"5. ERROR in X.java (at line 7)\n" +
13819 			"	X.Inner<Integer> d3 = new X.Inner<Integer>();\n" +
13820 			"	                          ^^^^^^^\n" +
13821 			"The member type X.Inner<Integer> must be qualified with a parameterized type, since it is not static\n" +
13822 			"----------\n" +
13823 			"6. WARNING in X.java (at line 8)\n" +
13824 			"	d1 = d2;\n" +
13825 			"	     ^^\n" +
13826 			"Type safety: The expression of type X.Inner needs unchecked conversion to conform to X<String>.Inner<Integer>\n" +
13827 			"----------\n" +
13828 			"7. ERROR in X.java (at line 10)\n" +
13829 			"	d1 = d3;\n" +
13830 			"	     ^^\n" +
13831 			"Type mismatch: cannot convert from X.Inner<Integer> to X<String>.Inner<Integer>\n" +
13832 			"----------\n" +
13833 			"8. ERROR in X.java (at line 11)\n" +
13834 			"	d3 = d1;\n" +
13835 			"	     ^^\n" +
13836 			"Type mismatch: cannot convert from X<String>.Inner<Integer> to X.Inner<Integer>\n" +
13837 			"----------\n" +
13838 			"9. WARNING in X.java (at line 13)\n" +
13839 			"	d3 = d2;\n" +
13840 			"	     ^^\n" +
13841 			"Type safety: The expression of type X.Inner needs unchecked conversion to conform to X.Inner<Integer>\n" +
13842 			"----------\n");
13843 	}
13844 
13845 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=82159 - variation
13846 	public void test0448() {
13847 		this.runConformTest(
13848 			new String[] {
13849 				"X.java",
13850 				"public class X<A> {\n" +
13851 				"  static class Inner<B> { }\n" +
13852 				"\n" +
13853 				"  void method() {\n" +
13854 				"    X.Inner<Integer> d = new X.Inner<Integer>();    \n" +
13855 				"  }\n" +
13856 				"}\n",
13857 			},
13858 			"");
13859 	}
13860 
13861 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=82159 - variation
13862 	public void test0448a() {
13863 		runConformTest(
13864 		// test directory preparation
13865 		new String[] { /* test files */
13866 			"X.java",
13867 			"public class X<T> {\n" +
13868 			"	class Y {}\n" +
13869 			"	X<?>.Y[] tab = new X<?>.Y[] {};\n" +
13870 			"}"
13871 		},
13872 		// javac options
13873 		JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
13874 	}
13875 
13876 
13877 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=82159 - variation
13878 	public void test0449() {
13879 		this.runNegativeTest(
13880 			new String[] {
13881 				"X.java",
13882 				"public class X<A> {\n" +
13883 				"  class Inner<B> { \n" +
13884 				"  }\n" +
13885 				"\n" +
13886 				"  void method() {\n" +
13887 				"    X<String>.Inner<Integer> d4 = new X.Inner<Integer>();\n" +
13888 				"  }\n" +
13889 				"}\n" ,
13890 			},
13891 			"----------\n" +
13892 			"1. ERROR in X.java (at line 6)\n" +
13893 			"	X<String>.Inner<Integer> d4 = new X.Inner<Integer>();\n" +
13894 			"	                              ^^^^^^^^^^^^^^^^^^^^^^\n" +
13895 			"Type mismatch: cannot convert from X.Inner<Integer> to X<String>.Inner<Integer>\n" +
13896 			"----------\n" +
13897 			"2. ERROR in X.java (at line 6)\n" +
13898 			"	X<String>.Inner<Integer> d4 = new X.Inner<Integer>();\n" +
13899 			"	                                  ^^^^^^^\n" +
13900 			"The member type X.Inner<Integer> must be qualified with a parameterized type, since it is not static\n" +
13901 			"----------\n");
13902 	}
13903 
13904 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=82159 - variation
13905 	public void test0450() {
13906 		this.runNegativeTest(
13907 			new String[] {
13908 				"X.java",
13909 				"public class X<A> {\n" +
13910 				"  static class Inner<B> { \n" +
13911 				"  }\n" +
13912 				"\n" +
13913 				"  void method() {\n" +
13914 				"    X<String>.Inner<Integer> d4 = new X<String>.Inner<Integer>();\n" +
13915 				"  }\n" +
13916 				"}\n" ,
13917 			},
13918 			"----------\n" +
13919 			"1. ERROR in X.java (at line 6)\n" +
13920 			"	X<String>.Inner<Integer> d4 = new X<String>.Inner<Integer>();\n" +
13921 			"	^^^^^^^^^^^^^^^\n" +
13922 			"The member type X.Inner<B> cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type X<String>\n" +
13923 			"----------\n" +
13924 			"2. ERROR in X.java (at line 6)\n" +
13925 			"	X<String>.Inner<Integer> d4 = new X<String>.Inner<Integer>();\n" +
13926 			"	                                  ^^^^^^^^^^^^^^^\n" +
13927 			"The member type X.Inner<B> cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type X<String>\n" +
13928 			"----------\n");
13929 	}
13930 
13931 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=82159 - variation
13932 	public void test0451() {
13933 		this.runNegativeTest(
13934 			new String[] {
13935 				"X.java",
13936 				"public class X<A> {\n" +
13937 				"  class Inner<B> { \n" +
13938 				"  }\n" +
13939 				"\n" +
13940 				"  void method() {\n" +
13941 				"    X<String>.Inner<Integer> d4 = new X<String>.Inner<Integer>() {};\n" +
13942 				"  }\n" +
13943 				"}\n" ,
13944 			},
13945 			"----------\n" +
13946 			"1. ERROR in X.java (at line 6)\n" +
13947 			"	X<String>.Inner<Integer> d4 = new X<String>.Inner<Integer>() {};\n" +
13948 			"	                                  ^^^^^^^^^^^^^^^\n" +
13949 			"Cannot allocate the member type X<String>.Inner<Integer> using a parameterized compound name; use its simple name and an enclosing instance of type X<String>\n" +
13950 			"----------\n",
13951 			JavacTestOptions.EclipseHasABug.EclipseBug236243);
13952 	}
13953 
13954 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=82187
13955 	public void test0452() {
13956 		this.runConformTest(
13957 			new String[] {
13958 				"X.java",
13959 				"import java.util.*;\n" +
13960 				"\n" +
13961 				"public class X {\n" +
13962 				"	\n" +
13963 				"	 public <E extends Object, S extends Collection<E>> S test01(S param){\n" +
13964 				"	 	System.out.println(\"SUCCESS\");\n" +
13965 				"	 	return null;\n" +
13966 				"	 }\n" +
13967 				"	 \n" +
13968 				"	 public void test02() {\n" +
13969 				"	 	test01(new Vector<String>());\n" +
13970 				"	 }\n" +
13971 				"\n" +
13972 				"	 public static void main(String[] args) {\n" +
13973 				"		new X().test02();\n" +
13974 				"	}\n" +
13975 				"}\n" ,
13976 			},
13977 			"SUCCESS");
13978 	}
13979 
13980 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=82250
13981 	public void test0453() {
13982 		this.runNegativeTest(
13983 			new String[] {
13984 				"X.java",
13985 				"public class X<T extends I & I> {}\n" +
13986 				"interface I {}\n" ,
13987 			},
13988 			"----------\n" +
13989 			"1. ERROR in X.java (at line 1)\n" +
13990 			"	public class X<T extends I & I> {}\n" +
13991 			"	                             ^\n" +
13992 			"Duplicate bound I\n" +
13993 			"----------\n"
13994 		);
13995 	}
13996 
13997 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=82504
13998 	public void test0454() {
13999 		this.runNegativeTest(
14000 			new String[] {
14001 				"X.java",
14002 				"public class X<T, U extends X> {\n" +
14003 				"	Object[] objectArr;\n" +
14004 				"	void foo(T t) {\n" +
14005 				"		T x1= (T) objectArr;\n" +
14006 				"		U x2= (U) objectArr;\n" +
14007 				"		int[] x= (int[]) t;\n" +
14008 				"	}\n" +
14009 				"}\n",
14010 			},
14011 			"----------\n" +
14012 			"1. WARNING in X.java (at line 1)\n" +
14013 			"	public class X<T, U extends X> {\n" +
14014 			"	                            ^\n" +
14015 			"X is a raw type. References to generic type X<T,U> should be parameterized\n" +
14016 			"----------\n" +
14017 			"2. WARNING in X.java (at line 4)\n" +
14018 			"	T x1= (T) objectArr;\n" +
14019 			"	      ^^^^^^^^^^^^^\n" +
14020 			"Type safety: Unchecked cast from Object[] to T\n" +
14021 			"----------\n" +
14022 			"3. ERROR in X.java (at line 5)\n" +
14023 			"	U x2= (U) objectArr;\n" +
14024 			"	      ^^^^^^^^^^^^^\n" +
14025 			"Cannot cast from Object[] to U\n" +
14026 			"----------\n");
14027 	}
14028 
14029 
14030 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=81719
14031 	public void test0455() {
14032 		this.runConformTest(
14033 			new String[] {
14034 				"AbstractTest.java",
14035 				"public abstract class AbstractTest<T> {\n" +
14036 				"  abstract void array(T[] a);\n" +
14037 				"  abstract void type(T a);\n" +
14038 				"  abstract T[] foo();\n" +
14039 				"}\n",
14040 			},
14041 			"");
14042 
14043 		this.runConformTest(
14044 			new String[] {
14045 				"Test.java",
14046 				"public class Test<T> extends AbstractTest<T> {\n" +
14047 				"  void array(T[] a) {}\n" +
14048 				"  void type(T a) {}\n" +
14049 				"  T[] foo() { return null; }\n" +
14050 				"}\n",
14051 			},
14052 			"",
14053 			null,
14054 			false, // do not flush output
14055 			null);
14056 	}
14057 
14058 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=81721
14059 	public void test0456() {
14060 		this.runConformTest(
14061 			new String[] {
14062 				"X.java",
14063 				"interface I<T> {\n" +
14064 				"	<S extends T> void doTest(S[] a);\n" +
14065 				"}\n" +
14066 				"\n" +
14067 				"abstract class AbstractTest<U> implements I<U> {\n" +
14068 				"	public <V extends U> void doTest(V[] a) {}\n" +
14069 				"}\n" +
14070 				"\n" +
14071 				"public class X<M> extends AbstractTest<M> {}\n",
14072 			},
14073 			"");
14074 	}
14075 
14076 	public void test0457() {
14077 		this.runNegativeTest(
14078 			new String[] {
14079 				"X.java",
14080 				"import java.util.List;\n" +
14081 				"\n" +
14082 				"public class X {\n" +
14083 				"	\n" +
14084 				" void add(List<? super X> l) { \n" +
14085 				" 	l.add(new X()); \n" +
14086 				" }\n" +
14087 				" void add2(List<? extends X> l) { \n" +
14088 				" 	l.add(new X()); \n" +
14089 				" }\n" +
14090 				" \n" +
14091 				" static <T> void add3(List<T> l, List<T> l2) { \n" +
14092 				" }\n" +
14093 				" public static void main(String[] args) {\n" +
14094 				"	List<X> lx = null;\n" +
14095 				"	List<String> ls = null;\n" +
14096 				"	add3(lx, ls);\n" +
14097 				" } \n" +
14098 				"}\n",
14099 			},
14100 			"----------\n" +
14101 			"1. ERROR in X.java (at line 9)\n" +
14102 			"	l.add(new X()); \n" +
14103 			"	  ^^^\n" +
14104 			"The method add(capture#2-of ? extends X) in the type List<capture#2-of ? extends X> is not applicable for the arguments (X)\n" +
14105 			"----------\n" +
14106 			"2. ERROR in X.java (at line 17)\n" +
14107 			"	add3(lx, ls);\n" +
14108 			"	^^^^\n" +
14109 			"The method add3(List<T>, List<T>) in the type X is not applicable for the arguments (List<X>, List<String>)\n" +
14110 			"----------\n");
14111 	}
14112 
14113 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=82243
14114 	public void test0458() {
14115 		this.runNegativeTest(
14116 			new String[] {
14117 				"X.java",
14118 				"interface A<E>{\n" +
14119 				"	E getOne();\n" +
14120 				"}\n" +
14121 				"\n" +
14122 				"\n" +
14123 				"abstract class B<T extends Number> implements A<T> {\n" +
14124 				"	Number getTwo() {\n" +
14125 				"		return getOne(); // succeeds\n" +
14126 				"	}\n" +
14127 				"}\n" +
14128 				"\n" +
14129 				"abstract class C extends B<Integer> {\n" +
14130 				"}\n" +
14131 				"\n" +
14132 				"public class X {\n" +
14133 				"	void foo(A a, B b, C c){\n" +
14134 				"		Object o= a.getOne();\n" +
14135 				"		Number n1= b.getOne(); // fails\n" +
14136 				"		Number n2= b.getTwo(); // succeeds, but inlining fails\n" +
14137 				"		Integer i = c.getOne(); // succeeds\n" +
14138 				"	}\n" +
14139 				"}\n",
14140 			},
14141 			"----------\n" +
14142 			"1. WARNING in X.java (at line 16)\n" +
14143 			"	void foo(A a, B b, C c){\n" +
14144 			"	         ^\n" +
14145 			"A is a raw type. References to generic type A<E> should be parameterized\n" +
14146 			"----------\n" +
14147 			"2. WARNING in X.java (at line 16)\n" +
14148 			"	void foo(A a, B b, C c){\n" +
14149 			"	              ^\n" +
14150 			"B is a raw type. References to generic type B<T> should be parameterized\n" +
14151 			"----------\n" +
14152 			"3. ERROR in X.java (at line 18)\n" +
14153 			"	Number n1= b.getOne(); // fails\n" +
14154 			"	           ^^^^^^^^^^\n" +
14155 			"Type mismatch: cannot convert from Object to Number\n" +
14156 			"----------\n");
14157 	}
14158 
14159 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=78027 - variation (check unchecked warnings)
14160 	public void test0459() {
14161 		this.runNegativeTest(
14162 			new String[] {
14163 				"X.java",
14164 				"public class X \n" +
14165 				"{\n" +
14166 				"Zork z;\n" +
14167 				"}\n" +
14168 				"\n" +
14169 				"interface ITest<C extends X>\n" +
14170 				"{ \n" +
14171 				"}\n" +
14172 				"\n" +
14173 				"abstract class Test<C extends X> implements ITest<C>\n" +
14174 				"{\n" +
14175 				"  protected Manager<C> m_manager;\n" +
14176 				"  \n" +
14177 				"  public ITest<C> get()\n" +
14178 				"  {\n" +
14179 				"    return m_manager.getById(getClass(), Integer.valueOf(1));\n" +
14180 				"  }\n" +
14181 				"    \n" +
14182 				"  public static class Manager<C extends X>\n" +
14183 				"  {\n" +
14184 				"    public <T extends ITest<C>> T getById(Class<T> cls, Integer id)\n" +
14185 				"    {\n" +
14186 				"      return null;\n" +
14187 				"    }\n" +
14188 				"  }\n" +
14189 				"}\n"
14190 			},
14191 			"----------\n" +
14192 			"1. ERROR in X.java (at line 3)\n" +
14193 			"	Zork z;\n" +
14194 			"	^^^^\n" +
14195 			"Zork cannot be resolved to a type\n" +
14196 			"----------\n" +
14197 			"2. WARNING in X.java (at line 16)\n" +
14198 			"	return m_manager.getById(getClass(), Integer.valueOf(1));\n" +
14199 			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
14200 			"Type safety: Unchecked invocation getById(Class<capture#1-of ? extends Test>, Integer) of the generic method getById(Class<T>, Integer) of type Test.Manager<C>\n" +
14201 			"----------\n" +
14202 			"3. WARNING in X.java (at line 16)\n" +
14203 			"	return m_manager.getById(getClass(), Integer.valueOf(1));\n" +
14204 			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
14205 			"Type safety: The expression of type Test needs unchecked conversion to conform to ITest<C>\n" +
14206 			"----------\n");
14207 	}
14208 
14209 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=82439
14210 	public void test0460() {
14211 		this.runNegativeTest(
14212 			new String[] {
14213 				"X.java",
14214 				"import java.util.*;\n" +
14215 				"\n" +
14216 				"public class X {\n" +
14217 				"\n" +
14218 				"	public <E extends Object, S extends Collection<E>> S test(S param) {\n" +
14219 				"		\n" +
14220 				"		Class<? extends Collection> c = param.getClass(); // ok\n" +
14221 				"		Class<? extends Collection> d = getClazz(); // ko\n" +
14222 				"		return null;\n" +
14223 				"	}\n" +
14224 				"	Class<? extends Object> getClazz() {\n" +
14225 				"		return null;\n" +
14226 				"	}\n" +
14227 				"}\n" +
14228 				"abstract class Z implements Collection<String> {\n" +
14229 				"	void foo() {\n" +
14230 				"		Class<? extends Collection> c = getClass(); // ok\n" +
14231 				"	}\n" +
14232 				"}\n"
14233 			},
14234 			"----------\n" +
14235 			"1. WARNING in X.java (at line 7)\n" +
14236 			"	Class<? extends Collection> c = param.getClass(); // ok\n" +
14237 			"	                ^^^^^^^^^^\n" +
14238 			"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
14239 			"----------\n" +
14240 			"2. WARNING in X.java (at line 8)\n" +
14241 			"	Class<? extends Collection> d = getClazz(); // ko\n" +
14242 			"	                ^^^^^^^^^^\n" +
14243 			"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
14244 			"----------\n" +
14245 			"3. ERROR in X.java (at line 8)\n" +
14246 			"	Class<? extends Collection> d = getClazz(); // ko\n" +
14247 			"	                                ^^^^^^^^^^\n" +
14248 			"Type mismatch: cannot convert from Class<capture#2-of ? extends Object> to Class<? extends Collection>\n" +
14249 			"----------\n" +
14250 			"4. WARNING in X.java (at line 17)\n" +
14251 			"	Class<? extends Collection> c = getClass(); // ok\n" +
14252 			"	                ^^^^^^^^^^\n" +
14253 			"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
14254 			"----------\n");
14255 	}
14256 
14257 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=82844
14258 	public void test0461() {
14259 		this.runNegativeTest(
14260 			new String[] {
14261 				"X.java",
14262 				"public class X<T extends int[]> {\n" +
14263 				"}\n"
14264 			},
14265 			"----------\n" +
14266 			"1. ERROR in X.java (at line 1)\n" +
14267 			"	public class X<T extends int[]> {\n" +
14268 			"	                         ^^^^^\n" +
14269 			"The array type int[] cannot be used as a type parameter bound\n" +
14270 			"----------\n");
14271 	}
14272 
14273 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=79628
14274 	public void test0462() {
14275 		this.runConformTest(
14276 			new String[] {
14277 				"PropertiedObject.java",
14278 				"interface PropertiedObject<B extends PropertiedObject<B>> {}\n" +
14279 				"interface Model extends PropertiedObject<Model> {}\n" +
14280 				"interface View<T extends Model,U> extends PropertiedObject<View<?,?>> {}\n"
14281 			},
14282 			"");
14283 	}
14284 
14285 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=79144
14286 	public void test0463() {
14287 		this.runNegativeTest(
14288 			new String[] {
14289 				"X.java",
14290 				"import java.util.Set;\n" +
14291 				"public class X {\n" +
14292 				"   Zork z;\n" +
14293 				"	public Set<String>[] test() {\n" +
14294 				"	   Set[] sets = new Set[10];\n" +
14295 				"	   return sets;\n" +
14296 				"	}\n" +
14297 				"}\n"
14298 			},
14299 			"----------\n" +
14300 			"1. ERROR in X.java (at line 3)\n" +
14301 			"	Zork z;\n" +
14302 			"	^^^^\n" +
14303 			"Zork cannot be resolved to a type\n" +
14304 			"----------\n" +
14305 			"2. WARNING in X.java (at line 5)\n" +
14306 			"	Set[] sets = new Set[10];\n" +
14307 			"	^^^\n" +
14308 			"Set is a raw type. References to generic type Set<E> should be parameterized\n" +
14309 			"----------\n" +
14310 			"3. WARNING in X.java (at line 6)\n" +
14311 			"	return sets;\n" +
14312 			"	       ^^^^\n" +
14313 			"Type safety: The expression of type Set[] needs unchecked conversion to conform to Set<String>[]\n" +
14314 			"----------\n");
14315 	}
14316 
14317 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=79144
14318 	// SHOULD FAIL AT 1.8 (RET): Type mismatch: cannot convert from List<String> to List
14319 	public void test0464() {
14320 		this.runNegativeTest(
14321 			new String[] {
14322 				"X.java",
14323 				"import java.util.*;\n" +
14324 				"\n" +
14325 				"public class X {\n" +
14326 				"    Zork z;\n" +
14327 				"    public static void main(String[] args) {\n" +
14328 				"        List<Integer>[] nums = new List[] {Collections.singletonList(\"Uh oh\")};\n" +
14329 				"        System.out.println(nums[0].get(0).intValue());\n" +
14330 				"    } \n" +
14331 				"}\n"
14332 			},
14333 			"----------\n" +
14334 			"1. ERROR in X.java (at line 4)\n" +
14335 			"	Zork z;\n" +
14336 			"	^^^^\n" +
14337 			"Zork cannot be resolved to a type\n" +
14338 			"----------\n" +
14339 			"2. WARNING in X.java (at line 6)\n" +
14340 			"	List<Integer>[] nums = new List[] {Collections.singletonList(\"Uh oh\")};\n" +
14341 			"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
14342 			"Type safety: The expression of type List[] needs unchecked conversion to conform to List<Integer>[]\n" +
14343 			"----------\n");
14344 	}
14345 
14346 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=82547
14347 	public void test0465() {
14348 		this.runNegativeTest(
14349 			new String[] {
14350 				"Cla.java",
14351 				"class Cla<T> {\n" +
14352 				"    T getT() {\n" +
14353 				"        return null;\n" +
14354 				"    }\n" +
14355 				"    \n" +
14356 				"    void m() {\n" +
14357 				"        String s= new Cla<String>.getT();\n" +
14358 				"    }\n" +
14359 				"}\n"
14360 			},
14361 			"----------\n" +
14362 			"1. ERROR in Cla.java (at line 7)\n" +
14363 			"	String s= new Cla<String>.getT();\n" +
14364 			"	              ^^^^^^^^^^^^^^^^\n" +
14365 			"Cla.getT cannot be resolved to a type\n" +
14366 			"----------\n");
14367 	}
14368 
14369 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=83096
14370 	public void test0466() {
14371 		this.runNegativeTest(
14372 			new String[] {
14373 				"X.java",
14374 				"public class X<A, A> { }\n"
14375 			},
14376 			"----------\n" +
14377 			"1. ERROR in X.java (at line 1)\n" +
14378 			"	public class X<A, A> { }\n" +
14379 			"	                  ^\n" +
14380 			"Duplicate type parameter A\n" +
14381 			"----------\n"
14382 		);
14383 	}
14384 
14385 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=82671
14386 	public void test0467() {
14387 		this.runConformTest(
14388 			new String[] {
14389 				"test/Foo.java",
14390 				"package test; \n" +
14391 				"public class Foo { \n" +
14392 				"   protected String s; \n" +
14393 				"   protected String dosomething(){ return \"done\"; } \n" +
14394 				"   protected class Bar {} \n" +
14395 				"} \n",
14396 				"test02/FooBar.java",
14397 				"package test02; \n" +
14398 				"import test.Foo; \n" +
14399 				"public class FooBar<R> extends Foo { \n" +
14400 				"   void fail() { \n" +
14401 				"      FooBar f = new FooBar(); \n" +
14402 				"      f.s = \"foo\"; \n" +
14403 				"      this.s = \"foo\";\n" +
14404 				"      f.dosomething(); \n" +
14405 				"      this.dosomething();  \n" +
14406 				"      Bar b1; \n" +
14407 				"      FooBar.Bar b2; \n" +
14408 				"      Foo.Bar b3; \n" +
14409 				"   } \n" +
14410 				"}\n"
14411 			},
14412 			""
14413 		);
14414 	}
14415 
14416 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=82671 - variation
14417 	public void test0468() {
14418 		this.runConformTest(
14419 			new String[] {
14420 				"test/Foo.java",
14421 				"package test; \n" +
14422 				"public class Foo { \n" +
14423 				"   String s; \n" +
14424 				"   String dosomething(){ return \"done\"; } \n" +
14425 				"   class Bar {} \n" +
14426 				"} \n",
14427 				"test/FooBar.java",
14428 				"package test; \n" +
14429 				"import test.Foo; \n" +
14430 				"public class FooBar<R> extends Foo { \n" +
14431 				"   void fail() { \n" +
14432 				"      FooBar f = new FooBar(); \n" +
14433 				"      f.s = \"foo\"; \n" +
14434 				"      this.s = \"foo\";\n" +
14435 				"      f.dosomething(); \n" +
14436 				"      this.dosomething();  \n" +
14437 				"      Bar b1; \n" +
14438 				"      FooBar.Bar b2; \n" +
14439 				"      Foo.Bar b3; \n" +
14440 				"   } \n" +
14441 				"}\n"
14442 			},
14443 			""
14444 		);
14445 	}
14446 
14447 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=83083
14448 	public void test0469() {
14449 		this.runConformTest(
14450 			new String[] {
14451 				"a/C.java",
14452 				"package a; \n" +
14453 				"import p.B; \n" +
14454 				"public class C extends B { \n" +
14455 				"	public void foo(Object obj) {} \n" +
14456 				"} \n",
14457 				"p/B.java",
14458 				"package p; \n" +
14459 				"public class B<E> extends A<E> {} \n",
14460 				"p/A.java",
14461 				"package p; \n" +
14462 				"public class A<E> { \n" +
14463 				"	public void foo(E e) {} \n" +
14464 				"}\n",
14465 			},
14466 			""
14467 		);
14468 		this.runConformTest(
14469 			new String[] {
14470 				"a/C.java",
14471 				"package a; \n" +
14472 				"import p.B; \n" +
14473 				"public class C extends B { \n" +
14474 				"	public void foo(Object obj) {} \n" +
14475 				"} \n",
14476 				"p/A.java",
14477 				"package p; \n" +
14478 				"public class A<E> { \n" +
14479 				"	public void foo(E e) {} \n" +
14480 				"}\n",
14481 			},
14482 			"",
14483 			null,
14484 			false, // do not flush output
14485 			null);
14486 	}
14487 
14488 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=83225
14489 	public void test0470() {
14490 		this.runNegativeTest(
14491 			new String[] {
14492 				"X.java",
14493 				"public class X {\n" +
14494 				"	public static <T> T choose(boolean b, T t1, T t2) {\n" +
14495 				"		if (b)\n" +
14496 				"			return t1;\n" +
14497 				"		return t2;\n" +
14498 				"	}\n" +
14499 				"\n" +
14500 				"	public static void foo() {\n" +
14501 				"		Comparable s1 = choose(true, \"string\", Integer.valueOf(1));\n" +
14502 				"		Number s2 = choose(true, Integer.valueOf(1), Float.valueOf(2));\n" +
14503 				"		Comparable s3 = choose(true, Integer.valueOf(1), Float.valueOf(2));\n" +
14504 				"		Cloneable s4 = choose(true, Integer.valueOf(1), Float.valueOf(2));\n" +
14505 				"		Cloneable s5 = choose(true, \"string\", Integer.valueOf(1));\n" +
14506 				"	}\n" +
14507 				"}\n"
14508 			},
14509 			"----------\n" +
14510 			"1. WARNING in X.java (at line 9)\n" +
14511 			"	Comparable s1 = choose(true, \"string\", Integer.valueOf(1));\n" +
14512 			"	^^^^^^^^^^\n" +
14513 			"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
14514 			"----------\n" +
14515 			"2. WARNING in X.java (at line 11)\n" +
14516 			"	Comparable s3 = choose(true, Integer.valueOf(1), Float.valueOf(2));\n" +
14517 			"	^^^^^^^^^^\n" +
14518 			"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
14519 			"----------\n" +
14520 			"3. ERROR in X.java (at line 12)\n" +
14521 			"	Cloneable s4 = choose(true, Integer.valueOf(1), Float.valueOf(2));\n" +
14522 			"	               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
14523 			"Type mismatch: cannot convert from "+intersection("Number","Comparable<?>")+" to Cloneable\n" +
14524 			"----------\n" +
14525 			"4. ERROR in X.java (at line 13)\n" +
14526 			"	Cloneable s5 = choose(true, \"string\", Integer.valueOf(1));\n" +
14527 			"	               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
14528 			"Type mismatch: cannot convert from "+intersection("Object","Serializable","Comparable<?>")+" to Cloneable\n" +
14529 			"----------\n");
14530 	}
14531 
14532 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=82671 - variation
14533 	public void test0471() {
14534 		this.runNegativeTest(
14535 			new String[] {
14536 				"test/Foo.java",
14537 				"package test; \n" +
14538 				"public class Foo<R> { \n" +
14539 				"   protected R s; \n" +
14540 				"   protected R dosomething(){ return s; } \n" +
14541 				"   protected class Bar {} \n" +
14542 				"} \n",
14543 				"test02/FooBar.java",
14544 				"package test02; \n" +
14545 				"import test.Foo; \n" +
14546 				"public class FooBar<R> extends Foo<R> { \n" +
14547 				"   void fail() { \n" +
14548 				"      FooBar<String> f = new FooBar<String>(); \n" +
14549 				"      f.s = \"foo\"; \n" +
14550 				"      this.s = \"foo\";\n" +
14551 				"      f.dosomething(); \n" +
14552 				"      this.dosomething();  \n" +
14553 				"      Bar b1; \n" +
14554 				"      FooBar<String>.Bar b2; \n" +
14555 				"      Foo<String>.Bar b3; \n" +
14556 				"   } \n" +
14557 				"}\n"
14558 			},
14559 			"----------\n" +
14560 			"1. ERROR in test02\\FooBar.java (at line 7)\n" +
14561 			"	this.s = \"foo\";\n" +
14562 			"	         ^^^^^\n" +
14563 			"Type mismatch: cannot convert from String to R\n" +
14564 			"----------\n"	);
14565 	}
14566 
14567 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=82671 - variation
14568 	public void test0472() {
14569 		this.runNegativeTest(
14570 			new String[] {
14571 				"test/Foo.java",
14572 				"package test; \n" +
14573 				"public class Foo<R> { \n" +
14574 				"   private R s; \n" +
14575 				"   private R dosomething(){ return s; } \n" +
14576 				"   private class Bar {} \n" +
14577 				"} \n",
14578 				"test02/FooBar.java",
14579 				"package test02; \n" +
14580 				"import test.Foo; \n" +
14581 				"public class FooBar<R> extends Foo<R> { \n" +
14582 				"   void fail() { \n" +
14583 				"      FooBar<String> f = new FooBar<String>(); \n" +
14584 				"      f.s = \"foo\"; \n" +
14585 				"      this.s = \"foo\";\n" +
14586 				"      f.dosomething(); \n" +
14587 				"      this.dosomething();  \n" +
14588 				"      Bar b1; \n" +
14589 				"      FooBar<String>.Bar b2; \n" +
14590 				"      Foo<String>.Bar b3; \n" +
14591 				"   } \n" +
14592 				"}\n"
14593 			},
14594 			"----------\n" +
14595 			"1. ERROR in test02\\FooBar.java (at line 6)\n" +
14596 			"	f.s = \"foo\"; \n" +
14597 			"	  ^\n" +
14598 			"The field Foo<String>.s is not visible\n" +
14599 			"----------\n" +
14600 			"2. ERROR in test02\\FooBar.java (at line 7)\n" +
14601 			"	this.s = \"foo\";\n" +
14602 			"	     ^\n" +
14603 			"The field Foo<R>.s is not visible\n" +
14604 			"----------\n" +
14605 			"3. ERROR in test02\\FooBar.java (at line 7)\n" +
14606 			"	this.s = \"foo\";\n" +
14607 			"	         ^^^^^\n" +
14608 			"Type mismatch: cannot convert from String to R\n" +
14609 			"----------\n" +
14610 			"4. ERROR in test02\\FooBar.java (at line 8)\n" +
14611 			"	f.dosomething(); \n" +
14612 			"	  ^^^^^^^^^^^\n" +
14613 			"The method dosomething() from the type Foo<String> is not visible\n" +
14614 			"----------\n" +
14615 			"5. ERROR in test02\\FooBar.java (at line 9)\n" +
14616 			"	this.dosomething();  \n" +
14617 			"	     ^^^^^^^^^^^\n" +
14618 			"The method dosomething() from the type Foo<R> is not visible\n" +
14619 			"----------\n" +
14620 			"6. ERROR in test02\\FooBar.java (at line 10)\n" +
14621 			"	Bar b1; \n" +
14622 			"	^^^\n" +
14623 			"The type Bar is not visible\n" +
14624 			"----------\n" +
14625 			"7. ERROR in test02\\FooBar.java (at line 11)\n" +
14626 			"	FooBar<String>.Bar b2; \n" +
14627 			"	^^^^^^^^^^^^^^^^^^\n" +
14628 			"The type FooBar.Bar is not visible\n" +
14629 			"----------\n" +
14630 			"8. ERROR in test02\\FooBar.java (at line 12)\n" +
14631 			"	Foo<String>.Bar b3; \n" +
14632 			"	^^^^^^^^^^^^^^^\n" +
14633 			"The type Foo.Bar is not visible\n" +
14634 			"----------\n");
14635 	}
14636 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=81594
14637 	public void test0473() {
14638 		this.runConformTest(
14639 			new String[] {
14640 				"X.java",
14641 				"import java.util.*;\n" +
14642 				"public class X\n" +
14643 				"{\n" +
14644 				"	List<B> itsList;\n" +
14645 				"	B itsB;\n" +
14646 				"	MyTyped itsTyped;\n" +
14647 				"	\n" +
14648 				"	\n" +
14649 				"	public void test()\n" +
14650 				"	{\n" +
14651 				"		method (itsList, itsB, itsTyped);\n" +
14652 				"	}\n" +
14653 				"	\n" +
14654 				"	public <T> void method (List<? extends T> arg1, T arg2, Typed<? super T> arg3)\n" +
14655 				"	{\n" +
14656 				"	}\n" +
14657 				"	\n" +
14658 				"	interface A{}\n" +
14659 				"	class B implements A{}\n" +
14660 				"	class Typed<T>{}\n" +
14661 				"	class MyTyped extends Typed<A>{}\n" +
14662 				"\n" +
14663 				"}\n"
14664 			},
14665 			"");
14666 	}
14667 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=81594 - variation
14668 	public void test0474() {
14669 		this.runConformTest(
14670 			new String[] {
14671 				"X.java",
14672 				"public class X {\n" +
14673 				"	Typed<B> itsList;\n" +
14674 				"	Typed<A> itsTyped;\n" +
14675 				"	public void test() {\n" +
14676 				"		method(itsList, itsTyped);\n" +
14677 				"	}\n" +
14678 				"	public <T> void method(Typed<? extends T> arg1, Typed<? super T> arg3) {\n" +
14679 				"	}\n" +
14680 				"	interface A {\n" +
14681 				"	}\n" +
14682 				"	class B implements A {\n" +
14683 				"	}\n" +
14684 				"	class Typed<T> {\n" +
14685 				"	}\n" +
14686 				"}\n"
14687 			},
14688 			"");
14689 	}
14690 
14691 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=83398
14692 	public void test0475() {
14693 		this.runNegativeTest(
14694 			new String[] {
14695 				"X.java",
14696 				"import java.util.List;\n" +
14697 				"\n" +
14698 				"public class X {\n" +
14699 				"    void method(List<? super Number> list) {\n" +
14700 				"        list.add(new Object());   // should fail\n" +
14701 				"        list.add(Integer.valueOf(3)); // correct\n" +
14702 				"    }\n" +
14703 				"}\n"
14704 			},
14705 			"----------\n" +
14706 			"1. ERROR in X.java (at line 5)\n" +
14707 			"	list.add(new Object());   // should fail\n" +
14708 			"	     ^^^\n" +
14709 			"The method add(capture#1-of ? super Number) in the type List<capture#1-of ? super Number> is not applicable for the arguments (Object)\n" +
14710 			"----------\n");
14711 	}
14712 
14713 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=83398 - variation
14714 	public void test0476() {
14715 		this.runNegativeTest(
14716 			new String[] {
14717 				"X.java",
14718 				"import java.util.List;\n" +
14719 				"\n" +
14720 				"public class X {\n" +
14721 				"    void method(List<? super Number> list, List<Object> lo) {\n" +
14722 				"    	list = lo;\n" +
14723 				"    	lo = list;\n" +
14724 				"    }\n" +
14725 				"}\n"
14726 			},
14727 			"----------\n" +
14728 			"1. ERROR in X.java (at line 6)\n" +
14729 			"	lo = list;\n" +
14730 			"	     ^^^^\n" +
14731 			"Type mismatch: cannot convert from List<capture#2-of ? super Number> to List<Object>\n" +
14732 			"----------\n");
14733 	}
14734 
14735 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=83398 - variation
14736 	public void test0477() {
14737 		this.runNegativeTest(
14738 			new String[] {
14739 				"X.java",
14740 				"import java.util.*;\n" +
14741 				"public class X<T extends Number> {\n" +
14742 				"	List<? super T> lhs;\n" +
14743 				"	List<? extends Number> rhs;\n" +
14744 				"	{\n" +
14745 				"		lhs.add(rhs.get(0));\n" +
14746 				"	}\n" +
14747 				"}\n"
14748 			},
14749 			"----------\n" +
14750 			"1. ERROR in X.java (at line 6)\n" +
14751 			"	lhs.add(rhs.get(0));\n" +
14752 			"	    ^^^\n" +
14753 			"The method add(capture#1-of ? super T) in the type List<capture#1-of ? super T> is not applicable for the arguments (capture#2-of ? extends Number)\n" +
14754 			"----------\n");
14755 	}
14756 
14757 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=83398 - variation
14758 	public void test0478() {
14759 		this.runNegativeTest(
14760 			new String[] {
14761 				"X.java",
14762 				"import java.util.*;\n" +
14763 				"public class X<U extends Number> {\n" +
14764 				"	List<? super Number> lhs;\n" +
14765 				"	List<? super U> rhs;\n" +
14766 				"	{\n" +
14767 				"		lhs.add(rhs.get(0));\n" +
14768 				"	}\n" +
14769 				"}\n"
14770 			},
14771 			"----------\n" +
14772 			"1. ERROR in X.java (at line 6)\n" +
14773 			"	lhs.add(rhs.get(0));\n" +
14774 			"	    ^^^\n" +
14775 			"The method add(capture#1-of ? super Number) in the type List<capture#1-of ? super Number> is not applicable for the arguments (capture#2-of ? super U)\n" +
14776 			"----------\n");
14777 	}
14778 
14779 
14780 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=83398 - variation
14781 	public void test0479() {
14782 		this.runConformTest(
14783 			new String[] {
14784 				"X.java",
14785 				"import java.util.*;\n" +
14786 				"public class X<U extends Number> {\n" +
14787 				"	List<? super Number> lhs;\n" +
14788 				"	List<? extends U> rhs;\n" +
14789 				"	{\n" +
14790 				"		lhs.add(rhs.get(0));\n" +
14791 				"	}\n" +
14792 				"}\n"
14793 			},
14794 			"");
14795 	}
14796 
14797 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=83398 - variation
14798 	public void test0480() {
14799 		this.runNegativeTest(
14800 			new String[] {
14801 				"X.java",
14802 				"import java.util.*;\n" +
14803 				"public class X<U extends Number> {\n" +
14804 				"	List<? super Integer> lhs;\n" +
14805 				"	List<? extends Number> rhs;\n" +
14806 				"	{\n" +
14807 				"		lhs.add(rhs.get(0));\n" +
14808 				"	}\n" +
14809 				"}\n"
14810 			},
14811 			"----------\n" +
14812 			"1. ERROR in X.java (at line 6)\n" +
14813 			"	lhs.add(rhs.get(0));\n" +
14814 			"	    ^^^\n" +
14815 			"The method add(capture#1-of ? super Integer) in the type List<capture#1-of ? super Integer> is not applicable for the arguments (capture#2-of ? extends Number)\n" +
14816 			"----------\n");
14817 	}
14818 
14819 
14820 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=83398 - variation
14821 	public void test0481() {
14822 		this.runNegativeTest(
14823 			new String[] {
14824 				"X.java",
14825 				"import java.util.*;\n" +
14826 				"public class X<U extends Number> {\n" +
14827 				"	List<? super Number> lhs;\n" +
14828 				"	List<? super Integer> rhs;\n" +
14829 				"	{\n" +
14830 				"		lhs.add(rhs.get(0));\n" +
14831 				"	}\n" +
14832 				"}\n"
14833 			},
14834 			"----------\n" +
14835 			"1. ERROR in X.java (at line 6)\n" +
14836 			"	lhs.add(rhs.get(0));\n" +
14837 			"	    ^^^\n" +
14838 			"The method add(capture#1-of ? super Number) in the type List<capture#1-of ? super Number> is not applicable for the arguments (capture#2-of ? super Integer)\n" +
14839 			"----------\n");
14840 	}
14841 
14842 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=83799
14843 	public void test0482() {
14844 		this.runConformTest(
14845 			new String[] {
14846 				"X.java",
14847 				"public final class X {\n" +
14848 				"	public <T> void testEquals(final String x, T one, T two) {\n" +
14849 				"	}\n" +
14850 				"\n" +
14851 				"	public <T1, T2> void testEqualsAlt(final String x, T1 one, T2 two) {\n" +
14852 				"	}\n" +
14853 				"\n" +
14854 				"	public interface Fooey {\n" +
14855 				"	}\n" +
14856 				"\n" +
14857 				"	public interface Bar extends Fooey {\n" +
14858 				"	}\n" +
14859 				"\n" +
14860 				"	public interface GenericFooey<T> {\n" +
14861 				"	}\n" +
14862 				"\n" +
14863 				"	public interface GenericBar<T> extends GenericFooey<T> {\n" +
14864 				"	}\n" +
14865 				"\n" +
14866 				"	public void testGeneric() {\n" +
14867 				"		testEquals(\"Should work\", new GenericBar<Long>() {\n" +
14868 				"		}, new GenericBar<Long>() {\n" +
14869 				"		});\n" +
14870 				"		final GenericBar<Long> child = new GenericBar<Long>() {\n" +
14871 				"		};\n" +
14872 				"		final GenericFooey<Long> parent = child;\n" +
14873 				"		testEquals(\"Doesn\'t work but should\", child, parent); // this\n" +
14874 				"		// fails\n" +
14875 				"		// but should work it\'s identical to next line.\n" +
14876 				"		testEquals(\"Doesn\'t work but should\", (GenericFooey<Long>) child, parent);\n" +
14877 				"		testEqualsAlt(\"Should work\", child, parent);\n" +
14878 				"	}\n" +
14879 				"	public void test() {\n" +
14880 				"		testEquals(\"Should work\", new Bar() {\n" +
14881 				"		}, new Bar() {\n" +
14882 				"		});\n" +
14883 				"		final Bar child = new Bar() {\n" +
14884 				"		};\n" +
14885 				"		final Fooey parent = child;\n" +
14886 				"		testEquals(\"Doesn\'t work but should\", child, parent);\n" +
14887 				"		testEquals(\"Doesn\'t work but should\", (Fooey) child, parent);\n" +
14888 				"		testEqualsAlt(\"Should work\", child, parent);\n" +
14889 				"	}\n" +
14890 				"}\n"
14891 			},
14892 			"");
14893 	}
14894 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=83904
14895 	public void test0483() {
14896 		this.runNegativeTest(
14897 			new String[] {
14898 				"X.java",
14899 				"class Y<T extends Number> {\n" +
14900 				"}\n" +
14901 				"\n" +
14902 				"public class X {\n" +
14903 				"    public static void main(String argv[]) {\n" +
14904 				"        m(new Y<Short>(), new Y<Integer>());\n" +
14905 				"    }\n" +
14906 				"\n" +
14907 				"    public static <T extends Number> void m(Y<T> x, Y<T> y) {\n" +
14908 				"    }\n" +
14909 				"}\n" +
14910 				"\n"
14911 			},
14912 			"----------\n" +
14913 			"1. ERROR in X.java (at line 6)\n" +
14914 			"	m(new Y<Short>(), new Y<Integer>());\n" +
14915 			"	^\n" +
14916 			"The method m(Y<T>, Y<T>) in the type X is not applicable for the arguments (Y<Short>, Y<Integer>)\n" +
14917 			"----------\n");
14918 	}
14919 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=82349
14920 	public void test0484() {
14921 		this.runConformTest(
14922 			new String[] {
14923 				"X.java",
14924 				"class Base<T> {\n" +
14925 				"	public class Inner {\n" +
14926 				"	}\n" +
14927 				"	Inner a;\n" +
14928 				"}\n" +
14929 				"\n" +
14930 				"public class X extends Base<Integer> {\n" +
14931 				"	class DerivedInner extends Inner {\n" +
14932 				"	}\n" +
14933 				"	X() {\n" +
14934 				"		a = new DerivedInner();\n" +
14935 				"	}\n" +
14936 				"}\n"
14937 			},
14938 			"");
14939 	}
14940 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=82349 - variation
14941 	public void test0485() {
14942 		this.runConformTest(
14943 			new String[] {
14944 				"X.java",
14945 				"class Base<T> {\n" +
14946 				"	public class Inner<U> {\n" +
14947 				"	}\n" +
14948 				"	Inner a;\n" +
14949 				"}\n" +
14950 				"\n" +
14951 				"public class X extends Base<Integer> {\n" +
14952 				"	class DerivedInner extends Inner {\n" +
14953 				"	}\n" +
14954 				"	X() {\n" +
14955 				"		a = new DerivedInner();\n" +
14956 				"	}\n" +
14957 				"}\n"
14958 			},
14959 			"");
14960 	}
14961 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=82349 - variation
14962 	public void test0486() {
14963 		this.runConformTest(
14964 			new String[] {
14965 				"X.java",
14966 				"class Base<T> {\n" +
14967 				"	public class Inner<U> {\n" +
14968 				"	}\n" +
14969 				"	Inner a;\n" +
14970 				"}\n" +
14971 				"\n" +
14972 				"public class X extends Base<Integer> {\n" +
14973 				"	class DerivedInner extends Inner<Float> {\n" +
14974 				"	}\n" +
14975 				"	X() {\n" +
14976 				"		a = new DerivedInner();\n" +
14977 				"	}\n" +
14978 				"}\n"
14979 			},
14980 			"");
14981 	}
14982 	public void test0487() {
14983 		this.runNegativeTest(
14984 			new String[] {
14985 				"X.java",
14986 				"import java.util.*;\n" +
14987 				"\n" +
14988 				"public class X {\n" +
14989 				"	void foo(List<String> ls) {\n" +
14990 				"		List<?> l = ls;\n" +
14991 				"		bar(l, \"\"); \n" +
14992 				"	}\n" +
14993 				"	<T> void bar(List<? super T> l, T t) {\n" +
14994 				"	}\n" +
14995 				"}\n"
14996 			},
14997 			"----------\n" +
14998 			"1. ERROR in X.java (at line 6)\n" +
14999 			"	bar(l, \"\"); \n" +
15000 			"	^^^\n" +
15001 			"The method bar(List<? super T>, T) in the type X is not applicable for the arguments (List<capture#1-of ?>, String)\n" +
15002 			"----------\n");
15003 	}
15004 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=84496
15005 	public void test0488() {
15006 		this.runNegativeTest(
15007 			new String[] {
15008 				"X.java",
15009 				"public class X {\n" +
15010 				"    public static void main(String[] args) {\n" +
15011 				"        Foo<?> f1 = new Foo<Integer>();\n" +
15012 				"        Foo<?> f2 = new Foo<String>();\n" +
15013 				"        f1.bar = f2.bar;\n" +
15014 				"    }\n" +
15015 				"    static class Foo<T> {\n" +
15016 				"       Bar<T> bar = new Bar<T>();\n" +
15017 				"    }\n" +
15018 				"    static class Bar<T> {\n" +
15019 				"        T t;\n" +
15020 				"    }\n" +
15021 				"}\n"
15022 			},
15023 			"----------\n" +
15024 			"1. ERROR in X.java (at line 5)\n" +
15025 			"	f1.bar = f2.bar;\n" +
15026 			"	         ^^^^^^\n" +
15027 			"Type mismatch: cannot convert from X.Bar<capture#2-of ?> to X.Bar<capture#1-of ?>\n" +
15028 			"----------\n");
15029 	}
15030 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=84496
15031 	public void test0489() {
15032 		this.runNegativeTest(
15033 			new String[] {
15034 				"X.java",
15035 				"public class X {\n" +
15036 				"    public static void main(String[] args) {\n" +
15037 				"        Foo<?> f1 = new Foo<Integer>();\n" +
15038 				"        f1.bar = f1.bar;\n" +
15039 				"    }\n" +
15040 				"    static class Foo<T> {\n" +
15041 				"       Bar<T> bar = new Bar<T>();\n" +
15042 				"    }\n" +
15043 				"    static class Bar<T> {\n" +
15044 				"        T t;\n" +
15045 				"    }\n" +
15046 				"}\n"
15047 			},
15048 			"----------\n" +
15049 			"1. ERROR in X.java (at line 4)\n" +
15050 			"	f1.bar = f1.bar;\n" +
15051 			"	         ^^^^^^\n" +
15052 			"Type mismatch: cannot convert from X.Bar<capture#2-of ?> to X.Bar<capture#1-of ?>\n" +
15053 			"----------\n");
15054 	}
15055 	public void test0490() {
15056 		this.runNegativeTest(
15057 			new String[] {
15058 				"X.java",
15059 				"public class X<T> {\n" +
15060 				"	T t;\n" +
15061 				"	void foo(X<?> lhs, X<?> rhs) {\n" +
15062 				"		lhs = rhs;\n" +
15063 				"		lhs.t = rhs.t;\n" +
15064 				"	}\n" +
15065 				"	void bar(X<X<?>> lhs, X<X<?>> rhs) {\n" +
15066 				"		lhs = rhs;\n" +
15067 				"		lhs.t = rhs.t;\n" +
15068 				"	}}\n" +
15069 				"\n"
15070 			},
15071 			"----------\n" +
15072 			"1. ERROR in X.java (at line 5)\n" +
15073 			"	lhs.t = rhs.t;\n" +
15074 			"	        ^^^^^\n" +
15075 			"Type mismatch: cannot convert from capture#4-of ? to capture#3-of ?\n" +
15076 			"----------\n");
15077 	}
15078 
15079 	public void test0491() {
15080 		this.runNegativeTest(
15081 			new String[] {
15082 				"X.java",
15083 				"public class X<T> {\n" +
15084 				"	T t;\n" +
15085 				"	void foo(X<?> lhs, X<?> rhs) {\n" +
15086 				"		lhs = rhs;\n" +
15087 				"		lhs.t = rhs.t;\n" +
15088 				"	}\n" +
15089 				"	void bar(X<X<?>> lhs, X<X<?>> rhs) {\n" +
15090 				"		lhs = rhs;\n" +
15091 				"		lhs.t = rhs.t;\n" +
15092 				"	}\n" +
15093 				"	void baz(X<? super Number> lhs, X<? extends Number> rhs) {\n" +
15094 				"		lhs = rhs;\n" +
15095 				"		lhs.t = rhs.t;\n" +
15096 				"	}\n" +
15097 				"	void baz2(X<? extends Number> lhs, X<? extends Number> rhs) {\n" +
15098 				"		lhs = rhs;\n" +
15099 				"		lhs.t = rhs.t;\n" +
15100 				"	}\n" +
15101 				"	void baz3(X<? extends Number> lhs, X<? super Number> rhs) {\n" +
15102 				"		lhs = rhs;\n" +
15103 				"		lhs.t = rhs.t;\n" +
15104 				"	}\n" +
15105 				"	void baz4(X<? super Number> lhs, X<? super Number> rhs) {\n" +
15106 				"		lhs = rhs;\n" +
15107 				"		lhs.t = rhs.t;\n" +
15108 				"	}\n" +
15109 				"}\n"
15110 			},
15111 			"----------\n" +
15112 			"1. ERROR in X.java (at line 5)\n" +
15113 			"	lhs.t = rhs.t;\n" +
15114 			"	        ^^^^^\n" +
15115 			"Type mismatch: cannot convert from capture#4-of ? to capture#3-of ?\n" +
15116 			"----------\n" +
15117 			"2. ERROR in X.java (at line 12)\n" +
15118 			"	lhs = rhs;\n" +
15119 			"	      ^^^\n" +
15120 			"Type mismatch: cannot convert from X<capture#8-of ? extends Number> to X<? super Number>\n" +
15121 			"----------\n" +
15122 			"3. ERROR in X.java (at line 17)\n" +
15123 			"	lhs.t = rhs.t;\n" +
15124 			"	        ^^^^^\n" +
15125 			"Type mismatch: cannot convert from capture#14-of ? extends Number to capture#13-of ? extends Number\n" +
15126 			"----------\n" +
15127 			"4. ERROR in X.java (at line 20)\n" +
15128 			"	lhs = rhs;\n" +
15129 			"	      ^^^\n" +
15130 			"Type mismatch: cannot convert from X<capture#16-of ? super Number> to X<? extends Number>\n" +
15131 			"----------\n" +
15132 			"5. ERROR in X.java (at line 21)\n" +
15133 			"	lhs.t = rhs.t;\n" +
15134 			"	        ^^^^^\n" +
15135 			"Type mismatch: cannot convert from capture#18-of ? super Number to capture#17-of ? extends Number\n" +
15136 			"----------\n" +
15137 			"6. ERROR in X.java (at line 25)\n" +
15138 			"	lhs.t = rhs.t;\n" +
15139 			"	        ^^^^^\n" +
15140 			"Type mismatch: cannot convert from capture#22-of ? super Number to capture#21-of ? super Number\n" +
15141 			"----------\n");
15142 	}
15143 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=81576
15144 	public void test0492() {
15145 		this.runConformTest(
15146 			new String[] {
15147 				"SuperType.java",//====================================
15148 				"public class SuperType<T> {\n" +
15149 				"	protected InnerType valueWrapper;\n" +
15150 				"	protected class InnerType {\n" +
15151 				"		private T value;\n" +
15152 				"		protected InnerType(T value) {\n" +
15153 				"			this.value = value;\n" +
15154 				"		}\n" +
15155 				"	}\n" +
15156 				"	public SuperType(T value) {\n" +
15157 				"		/*\n" +
15158 				"		 * This constructor exists only to show that the usage of the inner\n" +
15159 				"		 * class within its enclosing class makes no problems\n" +
15160 				"		 */\n" +
15161 				"		this.valueWrapper = new InnerType(value);\n" +
15162 				"	}\n" +
15163 				"	protected SuperType() {\n" +
15164 				"		// Provided for the convenience of subclasses\n" +
15165 				"	}\n" +
15166 				"}\n",
15167 				"SubType.java",//====================================
15168 				"public class SubType<T> extends SuperType<T> {\n" +
15169 				"\n" +
15170 				"	public SubType(T value) {\n" +
15171 				"\n" +
15172 				"		/* The constructor SuperType <T>.InnerType(T) is undefined */\n" +
15173 				"		InnerType localValueWrapper = new InnerType(value);\n" +
15174 				"\n" +
15175 				"		/*\n" +
15176 				"		 * Type mismatch: cannot convert from SuperType <T>.InnerType to\n" +
15177 				"		 * SuperType <T>.InnerType\n" +
15178 				"		 * \n" +
15179 				"		 * Type safety: The expression of raw type SuperType.InnerType is\n" +
15180 				"		 * converted to SuperType <T>.InnerType. References to generic type\n" +
15181 				"		 * SuperType <T>.InnerType should be parametrized.\n" +
15182 				"		 */\n" +
15183 				"		localValueWrapper = super.valueWrapper;\n" +
15184 				"	}\n" +
15185 				"\n" +
15186 				"}\n"
15187 			},
15188 			"");
15189 	}
15190 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=83611
15191 	public void test0493() {
15192 		this.runConformTest(
15193 			new String[] {
15194 				"X.java",
15195 				"public class X {\n" +
15196 				"	public class M<T> { M(Class<T> templateClass) {} }\n" +
15197 				"}\n",
15198 				"Y.java",
15199 				"public class Y extends X {\n" +
15200 				"	void test() { M<X> m = new M<X>(X.class); }\n" +
15201 				"}\n"
15202 			},
15203 			""
15204 		);
15205 		this.runConformTest(
15206 			new String[] {
15207 				"Y.java",
15208 				"public class Y extends X {\n" +
15209 				"	void test() { M<X> m = new M<X>(X.class); }\n" +
15210 				"}\n"
15211 			},
15212 			"",
15213 			null,
15214 			false,
15215 			null
15216 		);
15217 	}
15218 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=83615
15219 	public void test0494() {
15220 		String xSource =
15221 				"public class X {\n" +
15222 				"\n" +
15223 				"	public static void main(String[] args) {\n" +
15224 				"		Number n= null;\n" +
15225 				"		Integer i= null;\n" +
15226 				"		new X().nextTry(i, n);\n" +
15227 				"		new X().nextTry2(n, i);\n" +
15228 				"	}	\n" +
15229 				"	\n" +
15230 				"	<I, N extends I> void nextTry(I i, N n) {}\n" +
15231 				"	\n" +
15232 				"	<N, I extends N> void nextTry2(N n, I i) {}	\n" +
15233 				"}\n";
15234 		if (this.complianceLevel < ClassFileConstants.JDK1_8) {
15235 			this.runNegativeTest(
15236 				new String[] {
15237 					"X.java",
15238 					xSource
15239 				},
15240 				"----------\n" +
15241 				"1. ERROR in X.java (at line 6)\n" +
15242 				"	new X().nextTry(i, n);\n" +
15243 				"	        ^^^^^^^\n" +
15244 				"Bound mismatch: The generic method nextTry(I, N) of type X is not applicable for the arguments (Integer, Number). The inferred type Number is not a valid substitute for the bounded parameter <N extends I>\n" +
15245 				"----------\n");
15246 		} else {
15247 			runConformTest(new String[] { "X.java", xSource });
15248 		}
15249 	}
15250 
15251 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84422
15252 	public void test0495() {
15253 		this.runConformTest(
15254 			new String[] {
15255 				"X.java",//====================================
15256 				"import java.util.*;\n" +
15257 				"\n" +
15258 				"public class X {\n" +
15259 				"	List l= null; \n" +
15260 				"\n" +
15261 				"	void add(String s) {\n" +
15262 				"		l.add(s);\n" +
15263 				"	}\n" +
15264 				"	\n" +
15265 				"	void addAll(String[] ss) {\n" +
15266 				"		l.addAll(Arrays.asList(ss));\n" +
15267 				"	}\n" +
15268 				"	\n" +
15269 				"	String[] get() {\n" +
15270 				"		return (String[])l.toArray(new String[l.size()]);\n" +
15271 				"	}\n" +
15272 				"}\n"
15273 			},
15274 			"");
15275 	}
15276 
15277 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84593
15278 	public void test0496() {
15279 		this.runConformTest(
15280 			new String[] {
15281 				"X.java",//====================================
15282 				"class Super<S> {\n" +
15283 				"	class A<E> { }\n" +
15284 				"	<T> void take(A<S> o) {\n" +
15285 				"		System.out.println(\"SUCCESS\");\n" +
15286 				"	}\n" +
15287 				"}\n" +
15288 				"class Sub extends Super<Double> {\n" +
15289 				"	void test() {\n" +
15290 				"		take(new A());\n" +
15291 				"	}\n" +
15292 				"}\n" +
15293 				"public class X {\n" +
15294 				"	public static void main(String[] args) {\n" +
15295 				"		new Sub().test();\n" +
15296 				"	}\n" +
15297 				"}\n"
15298 			},
15299 			"SUCCESS");
15300 	}
15301 
15302 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84593 - variation - uncheck warnings
15303 	public void test0497() {
15304 		this.runNegativeTest(
15305 			new String[] {
15306 				"X.java",//====================================
15307 				"class Super<S> {\n" +
15308 				"	class A<E> { }\n" +
15309 				"	<T> void take(A<S> o) {\n" +
15310 				"	}\n" +
15311 				"}\n" +
15312 				"class Sub extends Super<Double> {\n" +
15313 				"	void test() {\n" +
15314 				"		take(new A());\n" +
15315 				"	}\n" +
15316 				"}\n" +
15317 				"public class X {\n" +
15318 				"	public static void main(String[] args) {\n" +
15319 				"		new Sub().test();\n" +
15320 				"		Zork z;\n" +
15321 				"	}\n" +
15322 				"}\n"
15323 			},
15324 			"----------\n" +
15325 			"1. WARNING in X.java (at line 8)\n" +
15326 			"	take(new A());\n" +
15327 			"	^^^^^^^^^^^^^\n" +
15328 			"Type safety: Unchecked invocation take(Super.A) of the generic method take(Super<S>.A<S>) of type Super<Double>\n" +
15329 			"----------\n" +
15330 			"2. WARNING in X.java (at line 8)\n" +
15331 			"	take(new A());\n" +
15332 			"	     ^^^^^^^\n" +
15333 			"Type safety: The expression of type Super.A needs unchecked conversion to conform to Super<Double>.A<Double>\n" +
15334 			"----------\n" +
15335 			"3. WARNING in X.java (at line 8)\n" +
15336 			"	take(new A());\n" +
15337 			"	         ^\n" +
15338 			"Super.A is a raw type. References to generic type Super<S>.A<E> should be parameterized\n" +
15339 			"----------\n" +
15340 			"4. ERROR in X.java (at line 14)\n" +
15341 			"	Zork z;\n" +
15342 			"	^^^^\n" +
15343 			"Zork cannot be resolved to a type\n" +
15344 			"----------\n");
15345 	}
15346 
15347 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=84743 - variation in -source 1.4 mode but 1.5 compliance (ignore covariance)
15348 public void test0498(){
15349 	Map customOptions = getCompilerOptions();
15350 	customOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4);
15351 	runNegativeTest(
15352 		// test directory preparation
15353 		true /* flush output directory */,
15354 		new String[] { /* test files */
15355 			"X.java",
15356 			"interface I {\n" +
15357 			"   String foo();\n" +
15358 			"}\n" +
15359 			"interface J {\n" +
15360 			"   Object foo();\n" +
15361 			"}\n" +
15362 			" \n" +
15363 			"public class X implements I {\n" +
15364 			"   public String foo() {\n" +
15365 			" 	return \"\";\n" +
15366 			"   }\n" +
15367 			"   public static void main(String[] args) {\n" +
15368 			"         I i = new X();\n" +
15369 			"         try {\n" +
15370 			"	        J j = (J) i;\n" +
15371 			"         } catch(ClassCastException e) {\n" +
15372 			"	        System.out.println(\"SUCCESS\");\n" +
15373 			"         }\n" +
15374 			"  }\n" +
15375 			"}\n"
15376 		},
15377 		// compiler options
15378 		null /* no class libraries */,
15379 		customOptions /* custom options */,
15380 		// compiler results
15381 		"----------\n" + /* expected compiler log */
15382 		"1. ERROR in X.java (at line 15)\n" +
15383 		"	J j = (J) i;\n" +
15384 		"	      ^^^^^\n" +
15385 		"Cannot cast from I to J\n" +
15386 		"----------\n",
15387 		// javac options
15388 		RUN_JAVAC ? /* javac test options */
15389 			new JavacTestOptions("-source 1.4") :
15390 			JavacTestOptions.DEFAULT );
15391 }
15392 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=85157
15393 public void test0499(){
15394 	this.runNegativeTest(
15395 		new String[] {
15396 			"X.java",
15397 			"public class X {\n" +
15398 			"		 public static void main(String argv[]) {\n" +
15399 			"		 		 String[] tab1 = new String[0];\n" +
15400 			"		 		 Integer[] tab2 = new Integer[0];\n" +
15401 			"		 		 boolean cond = true;\n" +
15402 			"		 		 Integer[] var = cond ? tab1 : tab2;\n" +
15403 			"		 		 System.out.println(var);\n" +
15404 			"		 }\n" +
15405 			"}\n"
15406 		},
15407 		this.complianceLevel < ClassFileConstants.JDK1_8 ?
15408 			"----------\n" +
15409 			"1. ERROR in X.java (at line 6)\n" +
15410 			"	Integer[] var = cond ? tab1 : tab2;\n" +
15411 			"	                ^^^^^^^^^^^^^^^^^^\n" +
15412 			"Type mismatch: cannot convert from Object&Serializable&" +
15413 			"" + intersection("Comparable<? extends Object&Serializable&" + intersection("Comparable<?>") + ">") +
15414 			"[] to Integer[]\n" +
15415 			"----------\n":
15416 				"----------\n" +
15417 				"1. ERROR in X.java (at line 6)\n" +
15418 				"	Integer[] var = cond ? tab1 : tab2;\n" +
15419 				"	                       ^^^^\n" +
15420 				"Type mismatch: cannot convert from String[] to Integer[]\n" +
15421 				"----------\n");
15422 }
15423 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=84251
15424 public void test0500(){
15425 	this.runConformTest(
15426 		new String[] {
15427 			"X.java",
15428 			"import java.util.ArrayList;\n" +
15429 			"import java.util.Collection;\n" +
15430 			"\n" +
15431 			"interface Sink<T> { \n" +
15432 			"	void flush(T t);\n" +
15433 			"}\n" +
15434 			"class SimpleSinkImpl<T> implements Sink<T> {\n" +
15435 			"	public void flush(T t) {}\n" +
15436 			"}\n" +
15437 			"public class X {\n" +
15438 			"\n" +
15439 			"    private <T> T writeAll(Collection<T> coll, Sink<? super T> snk) { \n" +
15440 			"        T last = null;\n" +
15441 			"        for (T t : coll) { \n" +
15442 			"            last = t;\n" +
15443 			"            snk.flush(last);\n" +
15444 			"        }\n" +
15445 			"        return last;\n" +
15446 			"    }\n" +
15447 			"\n" +
15448 			"    public void test01() {\n" +
15449 			"        Sink<Object> s = new SimpleSinkImpl<Object>();\n" +
15450 			"        Collection<String> cs = new ArrayList<String>();\n" +
15451 			"        cs.add(\"hello!\");\n" +
15452 			"        cs.add(\"goodbye\");\n" +
15453 			"        cs.add(\"see you\");\n" +
15454 			"        \n" +
15455 			"        String str = this.writeAll(cs, s);  \n" +
15456 			"    }\n" +
15457 			"\n" +
15458 			"    public static void main(String[] args) {\n" +
15459 			"        X test = new X();\n" +
15460 			"        \n" +
15461 			"        test.test01();\n" +
15462 			"    }\n" +
15463 			"}\n"
15464 		},
15465 		"");
15466 }
15467 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=85303 - variation
15468 	public void test0501() throws Exception {
15469 		this.runConformTest(
15470 			new String[] {
15471 				"X.java",
15472 				"public class X <T extends AX> {\n" +
15473 				"    T t;\n" +
15474 				"    X(T t){\n" +
15475 				"        this.t = t;\n" +
15476 				"    }\n" +
15477 				"    public static void main(String[] args) {\n" +
15478 				"		X<? extends BX> x = new X<BX<String>>(new BX<String>());\n" +
15479 				"		System.out.print(x.t.ax);\n" +
15480 				"		System.out.print(x.t.bx);\n" +
15481 				"	}\n" +
15482 				"}\n" +
15483 				"\n" +
15484 				"class AX<P> {\n" +
15485 				"	P ax;\n" +
15486 				"}\n" +
15487 				"\n" +
15488 				"class BX<Q> extends AX<Q> {\n" +
15489 				"	Q bx;\n" +
15490 				"}\n",
15491 			},
15492 			"nullnull");
15493 		String expectedOutput =
15494 			"  // Method descriptor #25 ([Ljava/lang/String;)V\n" +
15495 			"  // Stack: 4, Locals: 2\n" +
15496 			"  public static void main(java.lang.String[] args);\n" +
15497 			"     0  new X [1]\n" +
15498 			"     3  dup\n" +
15499 			"     4  new BX [26]\n" +
15500 			"     7  dup\n" +
15501 			"     8  invokespecial BX() [28]\n" +
15502 			"    11  invokespecial X(AX) [29]\n" +
15503 			"    14  astore_1 [x]\n" +
15504 			"    15  getstatic java.lang.System.out : java.io.PrintStream [31]\n" +
15505 			"    18  aload_1 [x]\n" +
15506 			"    19  getfield X.t : AX [16]\n" +
15507 			"    22  checkcast BX [26]\n" +
15508 			"    25  getfield BX.ax : java.lang.Object [37]\n" +
15509 			"    28  invokevirtual java.io.PrintStream.print(java.lang.Object) : void [41]\n" +
15510 			"    31  getstatic java.lang.System.out : java.io.PrintStream [31]\n" +
15511 			"    34  aload_1 [x]\n" +
15512 			"    35  getfield X.t : AX [16]\n" +
15513 			"    38  checkcast BX [26]\n" +
15514 			"    41  getfield BX.bx : java.lang.Object [47]\n" +
15515 			"    44  invokevirtual java.io.PrintStream.print(java.lang.Object) : void [41]\n" +
15516 			"    47  return\n" +
15517 			"      Line numbers:\n" +
15518 			"        [pc: 0, line: 7]\n" +
15519 			"        [pc: 15, line: 8]\n" +
15520 			"        [pc: 31, line: 9]\n" +
15521 			"        [pc: 47, line: 10]\n" +
15522 			"      Local variable table:\n" +
15523 			"        [pc: 0, pc: 48] local: args index: 0 type: java.lang.String[]\n" +
15524 			"        [pc: 15, pc: 48] local: x index: 1 type: X\n" +
15525 			"      Local variable type table:\n" +
15526 			"        [pc: 15, pc: 48] local: x index: 1 type: X<? extends BX>\n";
15527 
15528 		File f = new File(OUTPUT_DIR + File.separator + "X.class");
15529 		byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
15530 		ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
15531 		String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
15532 		int index = result.indexOf(expectedOutput);
15533 		if (index == -1 || expectedOutput.length() == 0) {
15534 			System.out.println(Util.displayString(result, 3));
15535 		}
15536 		if (index == -1) {
15537 			assertEquals("Wrong contents", expectedOutput, result);
15538 		}
15539 	}
15540 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=85303 - variation
15541 	public void test0502() throws Exception {
15542 		this.runConformTest(
15543 			new String[] {
15544 				"X.java",
15545 				"public class X <T extends AX> {\n" +
15546 				"    T t;\n" +
15547 				"    X(T t){\n" +
15548 				"        this.t = t;\n" +
15549 				"    }\n" +
15550 				"    public static void main(String[] args) {\n" +
15551 				"		X<? extends BX> x = new X<BX<String>>(new BX<String>());\n" +
15552 				"		System.out.print(x.self().t.ax);\n" +
15553 				"		System.out.print(x.self().t.bx);\n" +
15554 				"	}\n" +
15555 				"	X<T> self() {\n" +
15556 				"		return this;\n" +
15557 				"	}\n" +
15558 				"}\n" +
15559 				"\n" +
15560 				"class AX<P> {\n" +
15561 				"	P ax;\n" +
15562 				"}\n" +
15563 				"\n" +
15564 				"class BX<Q> extends AX<Q> {\n" +
15565 				"	Q bx;\n" +
15566 				"}\n",
15567 			},
15568 			"nullnull");
15569 		String expectedOutput =
15570 			"  // Method descriptor #25 ([Ljava/lang/String;)V\n" +
15571 			"  // Stack: 4, Locals: 2\n" +
15572 			"  public static void main(java.lang.String[] args);\n" +
15573 			"     0  new X [1]\n" +
15574 			"     3  dup\n" +
15575 			"     4  new BX [26]\n" +
15576 			"     7  dup\n" +
15577 			"     8  invokespecial BX() [28]\n" +
15578 			"    11  invokespecial X(AX) [29]\n" +
15579 			"    14  astore_1 [x]\n" +
15580 			"    15  getstatic java.lang.System.out : java.io.PrintStream [31]\n" +
15581 			"    18  aload_1 [x]\n" +
15582 			"    19  invokevirtual X.self() : X [37]\n" +
15583 			"    22  getfield X.t : AX [16]\n" +
15584 			"    25  checkcast BX [26]\n" +
15585 			"    28  getfield BX.ax : java.lang.Object [41]\n" +
15586 			"    31  invokevirtual java.io.PrintStream.print(java.lang.Object) : void [45]\n" +
15587 			"    34  getstatic java.lang.System.out : java.io.PrintStream [31]\n" +
15588 			"    37  aload_1 [x]\n" +
15589 			"    38  invokevirtual X.self() : X [37]\n" +
15590 			"    41  getfield X.t : AX [16]\n" +
15591 			"    44  checkcast BX [26]\n" +
15592 			"    47  getfield BX.bx : java.lang.Object [51]\n" +
15593 			"    50  invokevirtual java.io.PrintStream.print(java.lang.Object) : void [45]\n" +
15594 			"    53  return\n" +
15595 			"      Line numbers:\n" +
15596 			"        [pc: 0, line: 7]\n" +
15597 			"        [pc: 15, line: 8]\n" +
15598 			"        [pc: 34, line: 9]\n" +
15599 			"        [pc: 53, line: 10]\n" +
15600 			"      Local variable table:\n" +
15601 			"        [pc: 0, pc: 54] local: args index: 0 type: java.lang.String[]\n" +
15602 			"        [pc: 15, pc: 54] local: x index: 1 type: X\n" +
15603 			"      Local variable type table:\n" +
15604 			"        [pc: 15, pc: 54] local: x index: 1 type: X<? extends BX>\n";
15605 
15606 		File f = new File(OUTPUT_DIR + File.separator + "X.class");
15607 		byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
15608 		ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
15609 		String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
15610 		int index = result.indexOf(expectedOutput);
15611 		if (index == -1 || expectedOutput.length() == 0) {
15612 			System.out.println(Util.displayString(result, 3));
15613 		}
15614 		if (index == -1) {
15615 			assertEquals("Wrong contents", expectedOutput, result);
15616 		}
15617 	}
15618 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=85303 - variation
15619 	public void test0503() throws Exception {
15620 		this.runConformTest(
15621 				new String[] {
15622 					"X.java",
15623 					"class XA {}\n" +
15624 					"interface XB {\n" +
15625 					"	XB CONST = new XB(){ public String toString() { return \"SUCCESS\"; }};\n" +
15626 					"}\n" +
15627 					"class XAB extends XA implements XB {}\n" +
15628 					"\n" +
15629 					"public class X <E extends XA&XB> {\n" +
15630 					"	E e;\n" +
15631 					"  public static void main(String[] args) {\n" +
15632 					"	  System.out.print(new X<XAB>().e.CONST);\n" +
15633 					"	  new X<XAB>().foo();\n" +
15634 					"  }\n" +
15635 					"  public void foo() {\n" +
15636 					"    System.out.print(this.e.CONST);\n" +
15637 					"  }\n" +
15638 					"}\n",
15639 				},
15640 				"SUCCESSSUCCESS");
15641 			String expectedOutput =
15642 				"// Signature: <E:LXA;:LXB;>Ljava/lang/Object;\n" +
15643 				"public class X {\n" +
15644 				"  \n" +
15645 				"  // Field descriptor #6 LXA;\n" +
15646 				"  // Signature: TE;\n" +
15647 				"  XA e;\n" +
15648 				"  \n" +
15649 				"  // Method descriptor #10 ()V\n" +
15650 				"  // Stack: 1, Locals: 1\n" +
15651 				"  public X();\n" +
15652 				"    0  aload_0 [this]\n" +
15653 				"    1  invokespecial java.lang.Object() [12]\n" +
15654 				"    4  return\n" +
15655 				"      Line numbers:\n" +
15656 				"        [pc: 0, line: 7]\n" +
15657 				"      Local variable table:\n" +
15658 				"        [pc: 0, pc: 5] local: this index: 0 type: X\n" +
15659 				"      Local variable type table:\n" +
15660 				"        [pc: 0, pc: 5] local: this index: 0 type: X<E>\n" +
15661 				"  \n" +
15662 				"  // Method descriptor #21 ([Ljava/lang/String;)V\n" +
15663 				"  // Stack: 3, Locals: 1\n" +
15664 				"  public static void main(java.lang.String[] args);\n" +
15665 				"     0  getstatic java.lang.System.out : java.io.PrintStream [22]\n" +
15666 				"     3  new X [1]\n" +
15667 				"     6  dup\n" +
15668 				"     7  invokespecial X() [28]\n" +
15669 				"    10  getfield X.e : XA [29]\n" +
15670 				"    13  checkcast XAB [31]\n" +
15671 				"    16  pop\n" +
15672 				"    17  getstatic XAB.CONST : XB [33]\n" +
15673 				"    20  invokevirtual java.io.PrintStream.print(java.lang.Object) : void [37]\n" +
15674 				"    23  new X [1]\n" +
15675 				"    26  dup\n" +
15676 				"    27  invokespecial X() [28]\n" +
15677 				"    30  invokevirtual X.foo() : void [43]\n" +
15678 				"    33  return\n" +
15679 				"      Line numbers:\n" +
15680 				"        [pc: 0, line: 10]\n" +
15681 				"        [pc: 23, line: 11]\n" +
15682 				"        [pc: 33, line: 12]\n" +
15683 				"      Local variable table:\n" +
15684 				"        [pc: 0, pc: 34] local: args index: 0 type: java.lang.String[]\n" +
15685 				"  \n" +
15686 				"  // Method descriptor #10 ()V\n" +
15687 				"  // Stack: 2, Locals: 1\n" +
15688 				"  public void foo();\n" +
15689 				"     0  getstatic java.lang.System.out : java.io.PrintStream [22]\n" +
15690 				"     3  aload_0 [this]\n" +
15691 				"     4  getfield X.e : XA [29]\n" +
15692 				"     7  checkcast XB [48]\n" +
15693 				"    10  pop\n" +
15694 				"    11  getstatic XB.CONST : XB [50]\n" +
15695 				"    14  invokevirtual java.io.PrintStream.print(java.lang.Object) : void [37]\n" +
15696 				"    17  return\n" +
15697 				"      Line numbers:\n" +
15698 				"        [pc: 0, line: 14]\n" +
15699 				"        [pc: 17, line: 15]\n" +
15700 				"      Local variable table:\n" +
15701 				"        [pc: 0, pc: 18] local: this index: 0 type: X\n" +
15702 				"      Local variable type table:\n" +
15703 				"        [pc: 0, pc: 18] local: this index: 0 type: X<E>\n";
15704 
15705 			File f = new File(OUTPUT_DIR + File.separator + "X.class");
15706 			byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
15707 			ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
15708 			String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
15709 			int index = result.indexOf(expectedOutput);
15710 			if (index == -1 || expectedOutput.length() == 0) {
15711 				System.out.println(Util.displayString(result, 3));
15712 			}
15713 			if (index == -1) {
15714 				assertEquals("Wrong contents", expectedOutput, result);
15715 			}
15716 		}
15717 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=85303 - variation
15718 	public void test0504() throws Exception {
15719 		this.runConformTest(
15720 				new String[] {
15721 					"X.java",
15722 					"class XA {}\n" +
15723 					"interface XB {\n" +
15724 					"	XB CONST = new XB(){ public String toString() { return \"SUCCESS\"; }};\n" +
15725 					"}\n" +
15726 					"class XAB extends XA implements XB {}\n" +
15727 					"\n" +
15728 					"public class X <E extends XA&XB> {\n" +
15729 					"  E e() { return null; }\n" +
15730 					"  public static void main(String[] args) {\n" +
15731 					"	  System.out.print(new X<XAB>().e().CONST);\n" +
15732 					"	  new X<XAB>().foo();\n" +
15733 					"  }\n" +
15734 					"  public void foo() {\n" +
15735 					"    System.out.print(this.e().CONST);\n" +
15736 					"  }\n" +
15737 					"}\n",
15738 				},
15739 				"SUCCESSSUCCESS");
15740 			String expectedOutput =
15741 				"// Signature: <E:LXA;:LXB;>Ljava/lang/Object;\n" +
15742 				"public class X {\n" +
15743 				"  \n" +
15744 				"  // Method descriptor #6 ()V\n" +
15745 				"  // Stack: 1, Locals: 1\n" +
15746 				"  public X();\n" +
15747 				"    0  aload_0 [this]\n" +
15748 				"    1  invokespecial java.lang.Object() [8]\n" +
15749 				"    4  return\n" +
15750 				"      Line numbers:\n" +
15751 				"        [pc: 0, line: 7]\n" +
15752 				"      Local variable table:\n" +
15753 				"        [pc: 0, pc: 5] local: this index: 0 type: X\n" +
15754 				"      Local variable type table:\n" +
15755 				"        [pc: 0, pc: 5] local: this index: 0 type: X<E>\n" +
15756 				"  \n" +
15757 				"  // Method descriptor #17 ()LXA;\n" +
15758 				"  // Signature: ()TE;\n" +
15759 				"  // Stack: 1, Locals: 1\n" +
15760 				"  XA e();\n" +
15761 				"    0  aconst_null\n" +
15762 				"    1  areturn\n" +
15763 				"      Line numbers:\n" +
15764 				"        [pc: 0, line: 8]\n" +
15765 				"      Local variable table:\n" +
15766 				"        [pc: 0, pc: 2] local: this index: 0 type: X\n" +
15767 				"      Local variable type table:\n" +
15768 				"        [pc: 0, pc: 2] local: this index: 0 type: X<E>\n" +
15769 				"  \n" +
15770 				"  // Method descriptor #21 ([Ljava/lang/String;)V\n" +
15771 				"  // Stack: 3, Locals: 1\n" +
15772 				"  public static void main(java.lang.String[] args);\n" +
15773 				"     0  getstatic java.lang.System.out : java.io.PrintStream [22]\n" +
15774 				"     3  new X [1]\n" +
15775 				"     6  dup\n" +
15776 				"     7  invokespecial X() [28]\n" +
15777 				"    10  invokevirtual X.e() : XA [29]\n" +
15778 				"    13  checkcast XAB [31]\n" +
15779 				"    16  pop\n" +
15780 				"    17  getstatic XAB.CONST : XB [33]\n" +
15781 				"    20  invokevirtual java.io.PrintStream.print(java.lang.Object) : void [37]\n" +
15782 				"    23  new X [1]\n" +
15783 				"    26  dup\n" +
15784 				"    27  invokespecial X() [28]\n" +
15785 				"    30  invokevirtual X.foo() : void [43]\n" +
15786 				"    33  return\n" +
15787 				"      Line numbers:\n" +
15788 				"        [pc: 0, line: 10]\n" +
15789 				"        [pc: 23, line: 11]\n" +
15790 				"        [pc: 33, line: 12]\n" +
15791 				"      Local variable table:\n" +
15792 				"        [pc: 0, pc: 34] local: args index: 0 type: java.lang.String[]\n" +
15793 				"  \n" +
15794 				"  // Method descriptor #6 ()V\n" +
15795 				"  // Stack: 2, Locals: 1\n" +
15796 				"  public void foo();\n" +
15797 				"     0  getstatic java.lang.System.out : java.io.PrintStream [22]\n" +
15798 				"     3  aload_0 [this]\n" +
15799 				"     4  invokevirtual X.e() : XA [29]\n" +
15800 				"     7  checkcast XB [48]\n" +
15801 				"    10  pop\n" +
15802 				"    11  getstatic XB.CONST : XB [50]\n" +
15803 				"    14  invokevirtual java.io.PrintStream.print(java.lang.Object) : void [37]\n" +
15804 				"    17  return\n" +
15805 				"      Line numbers:\n" +
15806 				"        [pc: 0, line: 14]\n" +
15807 				"        [pc: 17, line: 15]\n" +
15808 				"      Local variable table:\n" +
15809 				"        [pc: 0, pc: 18] local: this index: 0 type: X\n" +
15810 				"      Local variable type table:\n" +
15811 				"        [pc: 0, pc: 18] local: this index: 0 type: X<E>\n";
15812 
15813 			File f = new File(OUTPUT_DIR + File.separator + "X.class");
15814 			byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
15815 			ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
15816 			String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
15817 			int index = result.indexOf(expectedOutput);
15818 			if (index == -1 || expectedOutput.length() == 0) {
15819 				System.out.println(Util.displayString(result, 3));
15820 			}
15821 			if (index == -1) {
15822 				assertEquals("Wrong contents", expectedOutput, result);
15823 			}
15824 		}
15825 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=85303 - variation
15826 	public void test0505() throws Exception {
15827 		this.runConformTest(
15828 			new String[] {
15829 				"X.java",
15830 				"class XA {}\n" +
15831 				"interface XB {\n" +
15832 				"	XB CONST = new XB(){ public String toString() { return \"SUCCESS\"; }};\n" +
15833 				"}\n" +
15834 				"class XAB extends XA implements XB {}\n" +
15835 				"\n" +
15836 				"public class X <E extends XA&XB> {\n" +
15837 				"  E e;\n" +
15838 				"  public static void main(String[] args) {\n" +
15839 				"	  new X<XAB>().foo();\n" +
15840 				"  }\n" +
15841 				"  public void foo() {\n" +
15842 				"	new Object() {\n" +
15843 				"		void run() {\n" +
15844 				"			System.out.print(e.CONST);\n" +
15845 				"		}\n" +
15846 				"	}.run();\n" +
15847 				"    System.out.print(e.CONST);\n" +
15848 				"  }\n" +
15849 				"}\n",
15850 			},
15851 			"SUCCESSSUCCESS");
15852 		String expectedOutput =
15853 			"// Signature: <E:LXA;:LXB;>Ljava/lang/Object;\n" +
15854 			"public class X {\n" +
15855 			"  \n" +
15856 			"  // Field descriptor #6 LXA;\n" +
15857 			"  // Signature: TE;\n" +
15858 			"  XA e;\n" +
15859 			"  \n" +
15860 			"  // Method descriptor #10 ()V\n" +
15861 			"  // Stack: 1, Locals: 1\n" +
15862 			"  public X();\n" +
15863 			"    0  aload_0 [this]\n" +
15864 			"    1  invokespecial java.lang.Object() [12]\n" +
15865 			"    4  return\n" +
15866 			"      Line numbers:\n" +
15867 			"        [pc: 0, line: 7]\n" +
15868 			"      Local variable table:\n" +
15869 			"        [pc: 0, pc: 5] local: this index: 0 type: X\n" +
15870 			"      Local variable type table:\n" +
15871 			"        [pc: 0, pc: 5] local: this index: 0 type: X<E>\n" +
15872 			"  \n" +
15873 			"  // Method descriptor #21 ([Ljava/lang/String;)V\n" +
15874 			"  // Stack: 2, Locals: 1\n" +
15875 			"  public static void main(java.lang.String[] args);\n" +
15876 			"     0  new X [1]\n" +
15877 			"     3  dup\n" +
15878 			"     4  invokespecial X() [22]\n" +
15879 			"     7  invokevirtual X.foo() : void [23]\n" +
15880 			"    10  return\n" +
15881 			"      Line numbers:\n" +
15882 			"        [pc: 0, line: 10]\n" +
15883 			"        [pc: 10, line: 11]\n" +
15884 			"      Local variable table:\n" +
15885 			"        [pc: 0, pc: 11] local: args index: 0 type: java.lang.String[]\n" +
15886 			"  \n" +
15887 			"  // Method descriptor #10 ()V\n" +
15888 			"  // Stack: 3, Locals: 1\n" +
15889 			"  public void foo();\n" +
15890 			"     0  new X$1 [28]\n" +
15891 			"     3  dup\n" +
15892 			"     4  aload_0 [this]\n" +
15893 			"     5  invokespecial X$1(X) [30]\n" +
15894 			"     8  invokevirtual X$1.run() : void [33]\n" +
15895 			"    11  getstatic java.lang.System.out : java.io.PrintStream [36]\n" +
15896 			"    14  aload_0 [this]\n" +
15897 			"    15  getfield X.e : XA [42]\n" +
15898 			"    18  checkcast XB [44]\n" +
15899 			"    21  pop\n" +
15900 			"    22  getstatic XB.CONST : XB [46]\n" +
15901 			"    25  invokevirtual java.io.PrintStream.print(java.lang.Object) : void [50]\n" +
15902 			"    28  return\n" +
15903 			"      Line numbers:\n" +
15904 			"        [pc: 0, line: 13]\n" +
15905 			"        [pc: 8, line: 17]\n" +
15906 			"        [pc: 11, line: 18]\n" +
15907 			"        [pc: 28, line: 19]\n" +
15908 			"      Local variable table:\n" +
15909 			"        [pc: 0, pc: 29] local: this index: 0 type: X\n" +
15910 			"      Local variable type table:\n" +
15911 			"        [pc: 0, pc: 29] local: this index: 0 type: X<E>\n";
15912 
15913 		File f = new File(OUTPUT_DIR + File.separator + "X.class");
15914 		byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
15915 		ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
15916 		String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
15917 		int index = result.indexOf(expectedOutput);
15918 		if (index == -1 || expectedOutput.length() == 0) {
15919 			System.out.println(Util.displayString(result, 3));
15920 		}
15921 		if (index == -1) {
15922 			assertEquals("Wrong contents", expectedOutput, result);
15923 		}
15924 	}
15925 
15926 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=85477
15927 	public void test0506() {
15928 		this.runNegativeTest(
15929 			new String[] {
15930 				"X.java",//====================================
15931 				"import java.util.Collections;\n" +
15932 				"import java.util.Comparator;\n" +
15933 				"import java.util.List;\n" +
15934 				"\n" +
15935 				"public final class X<E> {\n" +
15936 				"	public void test(List list,final Comparator comparator, X x) {\n" +
15937 				"		foo(list, comparator);\n" +
15938 				"		bar(list, comparator);\n" +
15939 				"		\n" +
15940 				"		x.foo(list, comparator);\n" +
15941 				"		x.bar(list, comparator);\n" +
15942 				"	}\n" +
15943 				"\n" +
15944 				"	<T> void foo(List<T> lt, Comparator<? super T> ct) {\n" +
15945 				"	}\n" +
15946 				"	static <T> void bar(List<T> lt, Comparator<? super T> ct) {\n" +
15947 				"	}\n" +
15948 				" Zork z;\n" +
15949 				"}\n"
15950 			},
15951 			"----------\n" +
15952 			"1. WARNING in X.java (at line 6)\n" +
15953 			"	public void test(List list,final Comparator comparator, X x) {\n" +
15954 			"	                 ^^^^\n" +
15955 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
15956 			"----------\n" +
15957 			"2. WARNING in X.java (at line 6)\n" +
15958 			"	public void test(List list,final Comparator comparator, X x) {\n" +
15959 			"	                                 ^^^^^^^^^^\n" +
15960 			"Comparator is a raw type. References to generic type Comparator<T> should be parameterized\n" +
15961 			"----------\n" +
15962 			"3. WARNING in X.java (at line 6)\n" +
15963 			"	public void test(List list,final Comparator comparator, X x) {\n" +
15964 			"	                                                        ^\n" +
15965 			"X is a raw type. References to generic type X<E> should be parameterized\n" +
15966 			"----------\n" +
15967 			"4. WARNING in X.java (at line 7)\n" +
15968 			"	foo(list, comparator);\n" +
15969 			"	^^^^^^^^^^^^^^^^^^^^^\n" +
15970 			"Type safety: Unchecked invocation foo(List, Comparator) of the generic method foo(List<T>, Comparator<? super T>) of type X<E>\n" +
15971 			"----------\n" +
15972 			"5. WARNING in X.java (at line 7)\n" +
15973 			"	foo(list, comparator);\n" +
15974 			"	    ^^^^\n" +
15975 			"Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
15976 			"----------\n" +
15977 			"6. WARNING in X.java (at line 7)\n" +
15978 			"	foo(list, comparator);\n" +
15979 			"	          ^^^^^^^^^^\n" +
15980 			"Type safety: The expression of type Comparator needs unchecked conversion to conform to Comparator<? super Object>\n" +
15981 			"----------\n" +
15982 			"7. WARNING in X.java (at line 8)\n" +
15983 			"	bar(list, comparator);\n" +
15984 			"	^^^^^^^^^^^^^^^^^^^^^\n" +
15985 			"Type safety: Unchecked invocation bar(List, Comparator) of the generic method bar(List<T>, Comparator<? super T>) of type X<E>\n" +
15986 			"----------\n" +
15987 			"8. WARNING in X.java (at line 8)\n" +
15988 			"	bar(list, comparator);\n" +
15989 			"	    ^^^^\n" +
15990 			"Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
15991 			"----------\n" +
15992 			"9. WARNING in X.java (at line 8)\n" +
15993 			"	bar(list, comparator);\n" +
15994 			"	          ^^^^^^^^^^\n" +
15995 			"Type safety: The expression of type Comparator needs unchecked conversion to conform to Comparator<? super Object>\n" +
15996 			"----------\n" +
15997 			"10. WARNING in X.java (at line 10)\n" +
15998 			"	x.foo(list, comparator);\n" +
15999 			"	^^^^^^^^^^^^^^^^^^^^^^^\n" +
16000 			"Type safety: The method foo(List, Comparator) belongs to the raw type X. References to generic type X<E> should be parameterized\n" +
16001 			"----------\n" +
16002 			"11. WARNING in X.java (at line 11)\n" +
16003 			"	x.bar(list, comparator);\n" +
16004 			"	^^^^^^^^^^^^^^^^^^^^^^^\n" +
16005 			"The static method bar(List<Object>, Comparator<? super Object>) from the type X should be accessed in a static way\n" +
16006 			"----------\n" +
16007 			"12. WARNING in X.java (at line 11)\n" +
16008 			"	x.bar(list, comparator);\n" +
16009 			"	^^^^^^^^^^^^^^^^^^^^^^^\n" +
16010 			"Type safety: Unchecked invocation bar(List, Comparator) of the generic method bar(List<T>, Comparator<? super T>) of type X\n" +
16011 			"----------\n" +
16012 			"13. WARNING in X.java (at line 11)\n" +
16013 			"	x.bar(list, comparator);\n" +
16014 			"	      ^^^^\n" +
16015 			"Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
16016 			"----------\n" +
16017 			"14. WARNING in X.java (at line 11)\n" +
16018 			"	x.bar(list, comparator);\n" +
16019 			"	            ^^^^^^^^^^\n" +
16020 			"Type safety: The expression of type Comparator needs unchecked conversion to conform to Comparator<? super Object>\n" +
16021 			"----------\n" +
16022 			"15. ERROR in X.java (at line 18)\n" +
16023 			"	Zork z;\n" +
16024 			"	^^^^\n" +
16025 			"Zork cannot be resolved to a type\n" +
16026 			"----------\n");
16027 	}
16028 	// array bound for wildcard
16029 	public void test0507() {
16030 		this.runConformTest(
16031 			new String[] {
16032 				"X.java",//====================================
16033 				"import java.io.Serializable;\n" +
16034 				"import java.util.List;\n" +
16035 				"\n" +
16036 				"public class X {\n" +
16037 				"	void foo1(List<? extends int[]> l) {\n" +
16038 				"		int i = l.get(0).length;\n" +
16039 				"	}\n" +
16040 				"	void foo2(List<? extends int[]> l) {\n" +
16041 				"		Object o = l.get(0).toString();\n" +
16042 				"	}\n" +
16043 				"	void foo3(List<? extends int[]> l, Serializable s) {\n" +
16044 				"		boolean b = true;\n" +
16045 				"		Serializable s2 = b ? l.get(0) : s;\n" +
16046 				"	}\n" +
16047 				"}\n"
16048 			},
16049 			"");
16050 	}
16051 	// array bound for wildcard
16052 	public void test0508() {
16053 		this.runNegativeTest(
16054 			new String[] {
16055 				"X.java",//====================================
16056 				"import java.io.Serializable;\n" +
16057 				"import java.util.List;\n" +
16058 				"\n" +
16059 				"public class X {\n" +
16060 				"	void foo1(List<? super int[]> l) {\n" +
16061 				"		int i = l.get(0).length;\n" +
16062 				"	}\n" +
16063 				"	void foo2(List<? super int[]> l) {\n" +
16064 				"		Object o = l.get(0).toString();\n" +
16065 				"	}\n" +
16066 				"	void foo3(List<? super int[]> l, Serializable s) {\n" +
16067 				"		boolean b = true;\n" +
16068 				"		Serializable s2 = b ? l.get(0) : s;\n" +
16069 				"	}\n" +
16070 				"}\n"
16071 			},
16072 			this.complianceLevel < ClassFileConstants.JDK1_8 ?
16073 			"----------\n" +
16074 			"1. ERROR in X.java (at line 6)\n" +
16075 			"	int i = l.get(0).length;\n" +
16076 			"	                 ^^^^^^\n" +
16077 			"length cannot be resolved or is not a field\n" +
16078 			"----------\n" +
16079 			"2. ERROR in X.java (at line 13)\n" +
16080 			"	Serializable s2 = b ? l.get(0) : s;\n" +
16081 			"	                  ^^^^^^^^^^^^^^^^\n" +
16082 			"Type mismatch: cannot convert from Object to Serializable\n" +
16083 			"----------\n" :
16084 				"----------\n" +
16085 				"1. ERROR in X.java (at line 6)\n" +
16086 				"	int i = l.get(0).length;\n" +
16087 				"	                 ^^^^^^\n" +
16088 				"length cannot be resolved or is not a field\n" +
16089 				"----------\n" +
16090 				"2. ERROR in X.java (at line 13)\n" +
16091 				"	Serializable s2 = b ? l.get(0) : s;\n" +
16092 				"	                      ^^^^^^^^\n" +
16093 				"Type mismatch: cannot convert from capture#3-of ? super int[] to Serializable\n" +
16094 				"----------\n");
16095 	}
16096 	// type parameter hiding
16097 	public void test0509() {
16098 		this.runNegativeTest(
16099 			new String[] {
16100 				"X.java",//====================================
16101 				"import java.util.*;\n" +
16102 				"public class X {\n" +
16103 				"	public static void main(String[] args) {\n" +
16104 				"        List<MyTigerSimpleObject> list = new ArrayList<MyTigerSimpleObject>();\n" +
16105 				"        list.add(new MyTigerSimpleObject(\"a\"));\n" +
16106 				"        list.add(new MyTigerSimpleObject(\"b\"));\n" +
16107 				"        \n" +
16108 				"        for (MyTigerSimpleObject so : list)\n" +
16109 				"            System.out.println(so.getSomeAttribute());		\n" +
16110 				"	}\n" +
16111 				"}\n" +
16112 				"class MyTigerSimpleObject<E> {\n" +
16113 				"	MyTigerSimpleObject(String s) {}\n" +
16114 				"	E getSomeAttribute() { return null; }\n" +
16115 				"}\n" +
16116 				"\n" +
16117 				"class TigerList<MyTigerSimpleObject> extends ArrayList<MyTigerSimpleObject> {\n" +
16118 				"    public void listAll() {\n" +
16119 				"        for (MyTigerSimpleObject so : this)\n" +
16120 				"            System.out.println(so.getSomeAttribute());\n" +
16121 				"    }\n" +
16122 				"	\n" +
16123 				"}\n"
16124 			},
16125 			"----------\n" +
16126 			"1. WARNING in X.java (at line 4)\n" +
16127 			"	List<MyTigerSimpleObject> list = new ArrayList<MyTigerSimpleObject>();\n" +
16128 			"	     ^^^^^^^^^^^^^^^^^^^\n" +
16129 			"MyTigerSimpleObject is a raw type. References to generic type MyTigerSimpleObject<E> should be parameterized\n" +
16130 			"----------\n" +
16131 			"2. WARNING in X.java (at line 4)\n" +
16132 			"	List<MyTigerSimpleObject> list = new ArrayList<MyTigerSimpleObject>();\n" +
16133 			"	                                               ^^^^^^^^^^^^^^^^^^^\n" +
16134 			"MyTigerSimpleObject is a raw type. References to generic type MyTigerSimpleObject<E> should be parameterized\n" +
16135 			"----------\n" +
16136 			"3. WARNING in X.java (at line 5)\n" +
16137 			"	list.add(new MyTigerSimpleObject(\"a\"));\n" +
16138 			"	             ^^^^^^^^^^^^^^^^^^^\n" +
16139 			"MyTigerSimpleObject is a raw type. References to generic type MyTigerSimpleObject<E> should be parameterized\n" +
16140 			"----------\n" +
16141 			"4. WARNING in X.java (at line 6)\n" +
16142 			"	list.add(new MyTigerSimpleObject(\"b\"));\n" +
16143 			"	             ^^^^^^^^^^^^^^^^^^^\n" +
16144 			"MyTigerSimpleObject is a raw type. References to generic type MyTigerSimpleObject<E> should be parameterized\n" +
16145 			"----------\n" +
16146 			"5. WARNING in X.java (at line 8)\n" +
16147 			"	for (MyTigerSimpleObject so : list)\n" +
16148 			"	     ^^^^^^^^^^^^^^^^^^^\n" +
16149 			"MyTigerSimpleObject is a raw type. References to generic type MyTigerSimpleObject<E> should be parameterized\n" +
16150 			"----------\n" +
16151 			"6. WARNING in X.java (at line 17)\n" +
16152 			"	class TigerList<MyTigerSimpleObject> extends ArrayList<MyTigerSimpleObject> {\n" +
16153 			"	      ^^^^^^^^^\n" +
16154 			"The serializable class TigerList does not declare a static final serialVersionUID field of type long\n" +
16155 			"----------\n" +
16156 			"7. WARNING in X.java (at line 17)\n" +
16157 			"	class TigerList<MyTigerSimpleObject> extends ArrayList<MyTigerSimpleObject> {\n" +
16158 			"	                ^^^^^^^^^^^^^^^^^^^\n" +
16159 			"The type parameter MyTigerSimpleObject is hiding the type MyTigerSimpleObject<E>\n" +
16160 			"----------\n" +
16161 			"8. ERROR in X.java (at line 20)\n" +
16162 			"	System.out.println(so.getSomeAttribute());\n" +
16163 			"	                      ^^^^^^^^^^^^^^^^\n" +
16164 			"The method getSomeAttribute() is undefined for the type MyTigerSimpleObject\n" +
16165 			"----------\n");
16166 	}
16167 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=84355
16168 	public void test0510() {
16169 		this.runConformTest(
16170 			new String[] {
16171 				"X.java",//====================================
16172 				"import java.io.Serializable;\n" +
16173 				"\n" +
16174 				"public class X {\n" +
16175 				"	public X() {\n" +
16176 				"		String[] strings = new String[]{\"test\"};\n" +
16177 				"\n" +
16178 				"		// this fails\n" +
16179 				"		Object obj = ClassB.doSomething((String) strings[0]);\n" +
16180 				"\n" +
16181 				"		// this works fine\n" +
16182 				"		String intermediate = ClassB.doSomething((String) strings[0]);\n" +
16183 				"		Object obj1 = intermediate;\n" +
16184 				"	}\n" +
16185 				"}\n" +
16186 				"\n" +
16187 				"class ClassB {\n" +
16188 				"	public static <T extends Serializable> T doSomething(String value) {\n" +
16189 				"		return (T) value;\n" +
16190 				"	}\n" +
16191 				"}\n"
16192 			},
16193 			"");
16194 	}
16195 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=82407
16196 	public void test0511() {
16197 		this.runConformTest(
16198 			new String[] {
16199 				"X.java",//====================================
16200 				"import java.util.HashMap;\n" +
16201 				"\n" +
16202 				"public class X {\n" +
16203 				"\n" +
16204 				"	static HashMap<Character, Character> substitutionList(String s1, String s2) {\n" +
16205 				"\n" +
16206 				"		HashMap<Character, Character> subst = new HashMap<Character, Character>();\n" +
16207 				"\n" +
16208 				"		for (int i = 0; i < s1.length(); i++) {\n" +
16209 				"			char key = s1.charAt(i);\n" +
16210 				"			char value = s2.charAt(i);\n" +
16211 				"			if (subst.containsKey(key)) {\n" +
16212 				"				if (value != subst.get(key)) {\n" +
16213 				"					return null;\n" +
16214 				"				}\n" +
16215 				"			} else if (subst.containsValue(value)) {\n" +
16216 				"				return null;\n" +
16217 				"			} else {\n" +
16218 				"				subst.put(key, value);\n" +
16219 				"			}\n" +
16220 				"		}\n" +
16221 				"\n" +
16222 				"		return subst;\n" +
16223 				"	}\n" +
16224 				"\n" +
16225 				"	public static void main(String[] args) {\n" +
16226 				"		System.out.println(\"SUCCESS\");\n" +
16227 				"	}\n" +
16228 				"}\n"
16229 			},
16230 			"SUCCESS");
16231 	}
16232 	public void test0512() {
16233 		this.runConformTest(
16234 			new String[] {
16235 				"X.java",//====================================
16236 				"public class X { \n" +
16237 				"    public static void main(String argv[]) {\n" +
16238 				"		\n" +
16239 				"		new X().new M<Exception>(null) {\n" +
16240 				"			void run() {\n" +
16241 				"				Exception e = ex;\n" +
16242 				"				System.out.println(\"SUCCESS\");\n" +
16243 				"			}\n" +
16244 				"		}.run();\n" +
16245 				"    }\n" +
16246 				"    class M<E extends Throwable> {\n" +
16247 				"        E ex;\n" +
16248 				"        M(E ex) {\n" +
16249 				"            this.ex = ex;\n" +
16250 				"        }\n" +
16251 				"    }\n" +
16252 				"}\n"
16253 			},
16254 			"SUCCESS");
16255 	}
16256 	public void test0513() {
16257 		this.runNegativeTest(
16258 			new String[] {
16259 				"X.java",//====================================
16260 				"public class X { \n" +
16261 				"    public static void main(String argv[]) {\n" +
16262 				"		\n" +
16263 				"		new X().new M(null) {\n" +
16264 				"			void run() {\n" +
16265 				"				Exception e = ex;\n" +
16266 				"				System.out.println(\"SUCCESS\");\n" +
16267 				"			}\n" +
16268 				"		}.run();\n" +
16269 				"    }\n" +
16270 				"    class M<E extends Throwable> {\n" +
16271 				"        E ex;\n" +
16272 				"        M(E ex) {\n" +
16273 				"            this.ex = ex;\n" +
16274 				"        }\n" +
16275 				"    }\n" +
16276 				"}\n"
16277 			},
16278 			"----------\n" +
16279 			"1. WARNING in X.java (at line 4)\n" +
16280 			"	new X().new M(null) {\n" +
16281 			"			void run() {\n" +
16282 			"				Exception e = ex;\n" +
16283 			"				System.out.println(\"SUCCESS\");\n" +
16284 			"			}\n" +
16285 			"		}.run();\n" +
16286 			"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
16287 			"Type safety: The constructor X.M(Throwable) belongs to the raw type X.M. References to generic type X.M<E> should be parameterized\n" +
16288 			"----------\n" +
16289 			"2. WARNING in X.java (at line 4)\n" +
16290 			"	new X().new M(null) {\n" +
16291 			"	            ^\n" +
16292 			"X.M is a raw type. References to generic type X.M<E> should be parameterized\n" +
16293 			"----------\n" +
16294 			"3. WARNING in X.java (at line 4)\n" +
16295 			"	new X().new M(null) {\n" +
16296 			"	            ^^^^^^^\n" +
16297 			"Type safety: The constructor X.M(Throwable) belongs to the raw type X.M. References to generic type X.M<E> should be parameterized\n" +
16298 			"----------\n" +
16299 			"4. ERROR in X.java (at line 6)\n" +
16300 			"	Exception e = ex;\n" +
16301 			"	              ^^\n" +
16302 			"Type mismatch: cannot convert from Throwable to Exception\n" +
16303 			"----------\n");
16304 	}
16305 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=82955
16306 	public void test0514(){
16307 		runConformTest(
16308 			new String[] {
16309 				"Test.java",
16310 				"public class Test {\n" +
16311 				"	static <T extends Base> T infer( T t1, T t2 ) { return null; }\n" +
16312 				"	public static void main( String [] args ) {\n" +
16313 				"		Base base = infer( new Sub1(), new Sub2() );\n" +
16314 				"		// Note: Eclipse 3.1 says this is an error, but it\'s not\n" +
16315 				"		Runnable runnable = infer( new Sub1(), new Sub2() );\n" +
16316 				"	}\n" +
16317 				"}\n" +
16318 				"class Base { }\n" +
16319 				"class Sub1 extends Base implements Runnable { public void run() { } }\n" +
16320 				"class Sub2 extends Base implements Runnable { public void run() { } }\n"
16321 			}
16322 		);
16323 	}
16324 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=84348
16325 	public void test0515(){
16326 		runConformTest(
16327 			new String[] {
16328 				"Test.java",
16329 				"public class Test {\n" +
16330 				"	public static <T> void myMethod(final List<? extends File> fileList) {\n" +
16331 				"		Collections.sort(fileList, new Comparator<File>(){\n" +
16332 				"			public int compare(File f1, File f2) { return 0; }\n" +
16333 				"		});\n" +
16334 				"	}\n" +
16335 				"}\n" +
16336 				"\n" +
16337 				"class List<T> {}\n" +
16338 				"class File {}\n" +
16339 				"interface Comparator<T> {}\n" +
16340 				"class Collections {\n" +
16341 				"	static <T> void sort(List<T> list, Comparator<? super T> c) {}\n" +
16342 				"}"
16343 			}
16344 		);
16345 	}
16346 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=84944
16347 	public void test0516(){
16348 		runConformTest(
16349 			new String[] {
16350 				"parser/AbstractParser.java",
16351 				"package parser;\n" +
16352 				"public abstract class AbstractParser<T> implements ValueParser<T> {\n" +
16353 				"	public T parse( final String string ) {\n" +
16354 				"		return valueOf(string); \n" +
16355 				"	}\n" +
16356 				"	protected abstract T valueOf(final String string);	\n" +
16357 				"}\n" +
16358 				"interface ValueParser<T> {\n" +
16359 				"	T parse(final String string);\n" +
16360 				"}\n",
16361 				"parser/BooleanParser.java",
16362 				"package parser;\n" +
16363 				"public class BooleanParser extends AbstractParser<Boolean> {\n" +
16364 				"	protected Boolean valueOf(final String string ) {\n" +
16365 				"		return Boolean.valueOf(string); 		\n" +
16366 				"	}\n" +
16367 				"}\n"
16368 			}
16369 		);
16370 		runConformTest(
16371 			new String[] {
16372 				"test/BooleanParserTest.java",
16373 				"package test;\n" +
16374 				"import parser.BooleanParser;\n" +
16375 				"public class BooleanParserTest {\n" +
16376 				"	static final boolean getBoolean(final String value) {\n" +
16377 				"		return new BooleanParser().parse(value).booleanValue(); // The type Boolean is not visible\n" +
16378 				"	}\n" +
16379 				"}\n"
16380 			},
16381 			null,
16382 			null,
16383 			false, // do not flush output directory
16384 			null
16385 		);
16386 	}
16387 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=84944 - check no warning for using raw member
16388 	public void test0517(){
16389 		runNegativeTest(
16390 			new String[] {
16391 				"X.java",
16392 				"class Base<T> {\n" +
16393 				"	class InnerBase {\n" +
16394 				"		java.util.List<String> list;\n" +
16395 				"	}\n" +
16396 				"  Zork z;\n" +
16397 				"}\n" +
16398 				"\n" +
16399 				"public class X extends Base<Integer> {\n" +
16400 				"	class InnerDerived extends InnerBase {\n" +
16401 				"		void method() {\n" +
16402 				"			list.add(\"Hi\"); // Warning on this method call\n" +
16403 				"		}\n" +
16404 				"	}\n" +
16405 				"}\n"
16406 			},
16407 			"----------\n" +
16408 			"1. ERROR in X.java (at line 5)\n" +
16409 			"	Zork z;\n" +
16410 			"	^^^^\n" +
16411 			"Zork cannot be resolved to a type\n" +
16412 			"----------\n");
16413 	}
16414 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=85930 - check no warning for using raw member
16415 	public void test0518(){
16416 		runNegativeTest(
16417 			new String[] {
16418 				"X.java",
16419 				"interface Callable<T> {\n" +
16420 				"	public enum Result {\n" +
16421 				"		GOOD, BAD\n" +
16422 				"	};\n" +
16423 				"	public Result call(T arg);\n" +
16424 				"}\n" +
16425 				"\n" +
16426 				"public class X implements Callable<String> {\n" +
16427 				"	public Result call(String arg) {\n" +
16428 				"		return Result.GOOD;\n" +
16429 				"	}\n" +
16430 				"  Zork z;\n" +
16431 				"}\n"
16432 			},
16433 			"----------\n" +
16434 			"1. ERROR in X.java (at line 12)\n" +
16435 			"	Zork z;\n" +
16436 			"	^^^^\n" +
16437 			"Zork cannot be resolved to a type\n" +
16438 			"----------\n");
16439 	}
16440 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=85262
16441 	public void test0519(){
16442 		runConformTest(
16443 			new String[] {
16444 				"FooImpl.java",
16445 				"interface Bar<R extends Foo<R>>  {} \n" +
16446 				" \n" +
16447 				"class BarImpl<S extends Foo<S>> implements Bar<S> {} \n" +
16448 				" \n" +
16449 				"interface Foo<T extends Foo<T>> extends Bar<T> {} \n" +
16450 				" \n" +
16451 				"public class FooImpl<U extends Foo<U>> extends BarImpl<U> implements Foo<U> {}\n" +
16452 				"\n"
16453 			},
16454 			"");
16455 	}
16456 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=85262 - variation
16457 	public void test0520(){
16458 		runConformTest(
16459 			new String[] {
16460 				"Bar.java",
16461 				"public interface Bar<R extends Foo<R>>  {} \n",
16462 				"BarImpl.java",
16463 				"public class BarImpl<S extends Foo<S>> implements Bar<S> {} \n",
16464 				"Foo.java",
16465 				"public interface Foo<T extends Foo<T>> extends Bar<T> {} \n",
16466 			},
16467 			"");
16468 		runConformTest(
16469 			new String[] {
16470 				"FooImpl.java",
16471 				"public class FooImpl<U extends Foo<U>> extends BarImpl<U> implements Foo<U> {}\n",
16472 			},
16473 			"",
16474 			null,
16475 			false, // do not flush output directory
16476 			null);
16477 	}
16478 	public void test0521(){
16479 		runConformTest(
16480 			new String[] {
16481 				"X.java",
16482 				"import java.util.*;\n" +
16483 				"\n" +
16484 				"public class X {\n" +
16485 				"	static public <T extends Collection> void addAll(T a, T b) {\n" +
16486 				"		a.addAll(b);\n" +
16487 				"	}\n" +
16488 				"	static public void main(String[] args) {\n" +
16489 				"		Collection<Integer> a = new ArrayList<Integer>();\n" +
16490 				"		Collection<String> b = new ArrayList<String>();\n" +
16491 				"		b.add(\"string\");\n" +
16492 				"		addAll(a, b);\n" +
16493 				"		try {\n" +
16494 				"			System.out.println(a.iterator().next().intValue()); // ClassCastException\n" +
16495 				"		} catch(ClassCastException e) {\n" +
16496 				"			System.out.println(\"SUCCESS\");\n" +
16497 				"		}\n" +
16498 				"	}\n" +
16499 				"}\n"
16500 			},
16501 			"SUCCESS");
16502 	}
16503 	// variation on test0521, check issuing of unchecked warning **
16504 	public void test0522(){
16505 		runNegativeTest(
16506 			new String[] {
16507 				"X.java",
16508 				"import java.util.*;\n" +
16509 				"\n" +
16510 				"public class X {\n" +
16511 				"	static public <T extends Collection> void addAll(T a, T b) {\n" +
16512 				"		a.addAll(b);\n" +
16513 				"	}\n" +
16514 				"	static public void main(String[] args) {\n" +
16515 				"		Collection<Integer> a = new ArrayList<Integer>();\n" +
16516 				"		Collection<String> b = new ArrayList<String>();\n" +
16517 				"		b.add(\"string\");\n" +
16518 				"		addAll(a, b);\n" +
16519 				"		try {\n" +
16520 				"			System.out.println(a.iterator().next().intValue()); // ClassCastException\n" +
16521 				"		} catch(ClassCastException e) {\n" +
16522 				"			System.out.println(\"SUCCESS\");\n" +
16523 				"		}\n" +
16524 				"	}\n" +
16525 				"  Zork z;\n" +
16526 				"}\n"
16527 			},
16528 			"----------\n" +
16529 			"1. WARNING in X.java (at line 4)\n" +
16530 			"	static public <T extends Collection> void addAll(T a, T b) {\n" +
16531 			"	                         ^^^^^^^^^^\n" +
16532 			"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
16533 			"----------\n" +
16534 			"2. WARNING in X.java (at line 5)\n" +
16535 			"	a.addAll(b);\n" +
16536 			"	^^^^^^^^^^^\n" +
16537 			"Type safety: The method addAll(Collection) belongs to the raw type Collection. References to generic type Collection<E> should be parameterized\n" +
16538 			"----------\n" +
16539 			"3. ERROR in X.java (at line 18)\n" +
16540 			"	Zork z;\n" +
16541 			"	^^^^\n" +
16542 			"Zork cannot be resolved to a type\n" +
16543 			"----------\n");
16544 	}
16545 	public void test0523(){
16546 		runNegativeTest(
16547 			new String[] {
16548 				"X.java",
16549 				"import java.util.*;\n" +
16550 				"public class X {\n" +
16551 				"	public X() {\n" +
16552 				"		M m = new M();\n" +
16553 				"		List<String> ls = m.list(); // rawified even though wasn\'t using T parameter\n" +
16554 				"	}\n" +
16555 				"	Zork z;\n" +
16556 				"	static class M<T> {\n" +
16557 				"		List<String> list() {\n" +
16558 				"			return null;\n" +
16559 				"		}\n" +
16560 				"	}\n" +
16561 				"}\n"
16562 			},
16563 			"----------\n" +
16564 			"1. WARNING in X.java (at line 4)\n" +
16565 			"	M m = new M();\n" +
16566 			"	^\n" +
16567 			"X.M is a raw type. References to generic type X.M<T> should be parameterized\n" +
16568 			"----------\n" +
16569 			"2. WARNING in X.java (at line 4)\n" +
16570 			"	M m = new M();\n" +
16571 			"	          ^\n" +
16572 			"X.M is a raw type. References to generic type X.M<T> should be parameterized\n" +
16573 			"----------\n" +
16574 			"3. WARNING in X.java (at line 5)\n" +
16575 			"	List<String> ls = m.list(); // rawified even though wasn\'t using T parameter\n" +
16576 			"	                  ^^^^^^^^\n" +
16577 			"Type safety: The expression of type List needs unchecked conversion to conform to List<String>\n" +
16578 			"----------\n" +
16579 			"4. ERROR in X.java (at line 7)\n" +
16580 			"	Zork z;\n" +
16581 			"	^^^^\n" +
16582 			"Zork cannot be resolved to a type\n" +
16583 			"----------\n");
16584 	}
16585 	// ensure there is no unchecked warning **
16586 	public void test0524(){
16587 		runNegativeTest(
16588 			new String[] {
16589 				"X.java",
16590 				"import java.util.*;\n" +
16591 				"class MyList extends ArrayList<String> {\n" +
16592 				"}\n" +
16593 				"\n" +
16594 				"public class X {\n" +
16595 				"    public static void main(String[] args) {\n" +
16596 				"        List<? extends String> a = new MyList();\n" +
16597 				"        List<String> b = (MyList) a;     \n" +
16598 				"    }\n" +
16599 				"	Zork z;\n" +
16600 				"}\n"
16601 			},
16602 			"----------\n" +
16603 			"1. WARNING in X.java (at line 2)\n" +
16604 			"	class MyList extends ArrayList<String> {\n" +
16605 			"	      ^^^^^^\n" +
16606 			"The serializable class MyList does not declare a static final serialVersionUID field of type long\n" +
16607 			"----------\n" +
16608 			"2. ERROR in X.java (at line 10)\n" +
16609 			"	Zork z;\n" +
16610 			"	^^^^\n" +
16611 			"Zork cannot be resolved to a type\n" +
16612 			"----------\n");
16613 	}
16614 	public void test0525(){
16615 		runConformTest(
16616 			new String[] {
16617 				"X.java",
16618 				"import java.util.*;\n" +
16619 				"\n" +
16620 				"public class X {\n" +
16621 				"	public static void main(String[] args) {\n" +
16622 				"		try {\n" +
16623 				"			List list = new ArrayList();\n" +
16624 				"			String s = \"this shouldn\'t work\";\n" +
16625 				"			list.add(s);\n" +
16626 				"			List<Integer> listInt = list;\n" +
16627 				"			int i = listInt.get(0);\n" +
16628 				"		} catch(ClassCastException e) {\n" +
16629 				"			System.out.println(\"SUCCESS\");\n" +
16630 				"		}\n" +
16631 				"	}\n" +
16632 				"}\n"
16633 			},
16634 			"SUCCESS");
16635 	}
16636 	public void test0526(){
16637 		runNegativeTest(
16638 			new String[] {
16639 				"X.java",
16640 				"public class X {\n" +
16641 				"    Zork z;\n" +
16642 				"    <T> T f(Object o) {\n" +
16643 				"	return (T) o; // OK\n" +
16644 				"    }\n" +
16645 				"\n" +
16646 				"    <U, T extends U> T g(Object o) {\n" +
16647 				"	return (T) o; // bug???\n" +
16648 				"    }\n" +
16649 				"\n" +
16650 				"    <U, T extends U> T h(Object o) {\n" +
16651 				"	return X.<T>castTo(o); // workaround\n" +
16652 				"    }\n" +
16653 				"\n" +
16654 				"    private static <T> T castTo(Object o) {\n" +
16655 				"	return (T) o;\n" +
16656 				"    }\n" +
16657 				"}\n"
16658 			},
16659 			"----------\n" +
16660 			"1. ERROR in X.java (at line 2)\n" +
16661 			"	Zork z;\n" +
16662 			"	^^^^\n" +
16663 			"Zork cannot be resolved to a type\n" +
16664 			"----------\n" +
16665 			"2. WARNING in X.java (at line 4)\n" +
16666 			"	return (T) o; // OK\n" +
16667 			"	       ^^^^^\n" +
16668 			"Type safety: Unchecked cast from Object to T\n" +
16669 			"----------\n" +
16670 			"3. WARNING in X.java (at line 8)\n" +
16671 			"	return (T) o; // bug???\n" +
16672 			"	       ^^^^^\n" +
16673 			"Type safety: Unchecked cast from Object to T\n" +
16674 			"----------\n" +
16675 			"4. WARNING in X.java (at line 16)\n" +
16676 			"	return (T) o;\n" +
16677 			"	       ^^^^^\n" +
16678 			"Type safety: Unchecked cast from Object to T\n" +
16679 			"----------\n");
16680 	}
16681 	// should not produce unchecked errors **
16682 	public void test0527(){
16683 		runNegativeTest(
16684 			new String[] {
16685 				"X.java",
16686 				"public class X {\n" +
16687 				"	<T, U extends T, V extends T> T foo(U u, V v) {\n" +
16688 				"		return this == null ? (T) u : (T)v;\n" +
16689 				"	}\n" +
16690 				"	Zork z;\n" +
16691 				"}\n"
16692 			},
16693 			"----------\n" +
16694 			"1. ERROR in X.java (at line 5)\n" +
16695 			"	Zork z;\n" +
16696 			"	^^^^\n" +
16697 			"Zork cannot be resolved to a type\n" +
16698 			"----------\n");
16699 	}
16700 
16701 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86217
16702 	public void test0528() {
16703 		this.runConformTest(
16704 			new String[] {
16705 				"X.java",
16706 				"public class X<T extends X.M> extends Y {}\n" +
16707 				"class Y { static class M {} }\n",
16708 			},
16709 			""
16710 		);
16711 	}
16712 
16713 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86463
16714 	public void test0529() {
16715 		this.runNegativeTest(
16716 			new String[] {
16717 				"X.java",
16718 				"import java.util.*;\n" +
16719 				"public class X<T extends List> {\n" +
16720 				"	void bar() {\n" +
16721 				"		T t = new ArrayList(); // BUG!!!\n" +
16722 				"	}\n" +
16723 				"}\n",
16724 			},
16725 			"----------\n" +
16726 			"1. WARNING in X.java (at line 2)\n" +
16727 			"	public class X<T extends List> {\n" +
16728 			"	                         ^^^^\n" +
16729 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
16730 			"----------\n" +
16731 			"2. ERROR in X.java (at line 4)\n" +
16732 			"	T t = new ArrayList(); // BUG!!!\n" +
16733 			"	      ^^^^^^^^^^^^^^^\n" +
16734 			"Type mismatch: cannot convert from ArrayList to T\n" +
16735 			"----------\n" +
16736 			"3. WARNING in X.java (at line 4)\n" +
16737 			"	T t = new ArrayList(); // BUG!!!\n" +
16738 			"	          ^^^^^^^^^\n" +
16739 			"ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
16740 			"----------\n");
16741 	}
16742 
16743 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86463
16744 	public void test0530() {
16745 		this.runNegativeTest(
16746 			new String[] {
16747 				"X.java",
16748 				"import java.util.*;\n" +
16749 				"\n" +
16750 				"abstract class Foo<T extends List>\n" +
16751 				" {\n" +
16752 				"  abstract void foo(T t);\n" +
16753 				"  void foo2()\n" +
16754 				"  {\n" +
16755 				"    List l = new LinkedList();\n" +
16756 				"    foo(l); // BUG!!!\n" +
16757 				"  }\n" +
16758 				"}\n" +
16759 				"\n" +
16760 				"public class X extends Foo<ArrayList>\n" +
16761 				"{\n" +
16762 				"  void foo(ArrayList l)\n" +
16763 				"  {\n" +
16764 				"    System.out.println(l);\n" +
16765 				"  }\n" +
16766 				"}\n",
16767 			},
16768 			"----------\n" +
16769 			"1. WARNING in X.java (at line 3)\n" +
16770 			"	abstract class Foo<T extends List>\n" +
16771 			"	                             ^^^^\n" +
16772 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
16773 			"----------\n" +
16774 			"2. WARNING in X.java (at line 8)\n" +
16775 			"	List l = new LinkedList();\n" +
16776 			"	^^^^\n" +
16777 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
16778 			"----------\n" +
16779 			"3. WARNING in X.java (at line 8)\n" +
16780 			"	List l = new LinkedList();\n" +
16781 			"	             ^^^^^^^^^^\n" +
16782 			"LinkedList is a raw type. References to generic type LinkedList<E> should be parameterized\n" +
16783 			"----------\n" +
16784 			"4. ERROR in X.java (at line 9)\n" +
16785 			"	foo(l); // BUG!!!\n" +
16786 			"	^^^\n" +
16787 			"The method foo(T) in the type Foo<T> is not applicable for the arguments (List)\n" +
16788 			"----------\n" +
16789 			"5. WARNING in X.java (at line 13)\n" +
16790 			"	public class X extends Foo<ArrayList>\n" +
16791 			"	                           ^^^^^^^^^\n" +
16792 			"ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
16793 			"----------\n" +
16794 			"6. WARNING in X.java (at line 15)\n" +
16795 			"	void foo(ArrayList l)\n" +
16796 			"	     ^^^^^^^^^^^^^^^^\n" +
16797 			"The method foo(ArrayList) of type X should be tagged with @Override since it actually overrides a superclass method\n" +
16798 			"----------\n" +
16799 			"7. WARNING in X.java (at line 15)\n" +
16800 			"	void foo(ArrayList l)\n" +
16801 			"	         ^^^^^^^^^\n" +
16802 			"ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
16803 			"----------\n");
16804 	}
16805 
16806 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86646
16807 	public void test0531() {
16808 		this.runNegativeTest(
16809 			new String[] {
16810 				"X.java",
16811 				"import java.util.Vector;\n" +
16812 				"\n" +
16813 				"public class X<T> {\n" +
16814 				"	public T f1(T l) {\n" +
16815 				"		Vector<T> v = new Vector<T>();\n" +
16816 				"		v.add(l);\n" +
16817 				"		return (T) v.get(0); // Expect warning here\n" +
16818 				"	}\n" +
16819 				"  Zork z;\n" +
16820 				"}\n",
16821 			},
16822 			"----------\n" +
16823 			"1. WARNING in X.java (at line 7)\n" +
16824 			"	return (T) v.get(0); // Expect warning here\n" +
16825 			"	       ^^^^^^^^^^^^\n" +
16826 			"Unnecessary cast from T to T\n" +
16827 			"----------\n" +
16828 			"2. ERROR in X.java (at line 9)\n" +
16829 			"	Zork z;\n" +
16830 			"	^^^^\n" +
16831 			"Zork cannot be resolved to a type\n" +
16832 			"----------\n");
16833 	}
16834 
16835 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84944
16836 	public void test0532() {
16837 		this.runConformTest(
16838 			new String[] {
16839 				"p/X.java",
16840 				"package p;\n" +
16841 				"public class X extends Z<Boolean> {\n" +
16842 				"	@Override public Boolean value() { return true; }\n" +
16843 				"}\n" +
16844 				"abstract class Z<T> {\n" +
16845 				"	public T foo() { return value(); }\n" +
16846 				"	public abstract T value();\n" +
16847 				"}\n",
16848 			},
16849 			""
16850 		);
16851 		this.runConformTest(
16852 			new String[] {
16853 				"Y.java",
16854 				"import p.X;\n" +
16855 				"public class Y { boolean test() { return new X().foo().booleanValue(); } }\n",
16856 			},
16857 			"",
16858 			null,
16859 			false, // do not flush output
16860 			null
16861 		);
16862 	}
16863 
16864 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86838
16865 	public void test0533() {
16866 		this.runNegativeTest(
16867 			new String[] {
16868 				"X.java",
16869 				"import java.util.EnumSet;\n" +
16870 				"\n" +
16871 				"enum Foo {\n" +
16872 				"	blargh, baz, boz;\n" +
16873 				"}\n" +
16874 				"\n" +
16875 				"public class X {\n" +
16876 				"	public static void main(String[] args) {\n" +
16877 				"		Class c = Foo.class;\n" +
16878 				"		EnumSet<Enum> eSet = EnumSet.allOf(c);\n" +
16879 				"	}\n" +
16880 				"}\n",
16881 			},
16882 			"----------\n" +
16883 			"1. WARNING in X.java (at line 9)\n" +
16884 			"	Class c = Foo.class;\n" +
16885 			"	^^^^^\n" +
16886 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
16887 			"----------\n" +
16888 			"2. WARNING in X.java (at line 10)\n" +
16889 			"	EnumSet<Enum> eSet = EnumSet.allOf(c);\n" +
16890 			"	        ^^^^\n" +
16891 			"Enum is a raw type. References to generic type Enum<E> should be parameterized\n" +
16892 			"----------\n" +
16893 			"3. ERROR in X.java (at line 10)\n" +
16894 			"	EnumSet<Enum> eSet = EnumSet.allOf(c);\n" +
16895 			"	        ^^^^\n" +
16896 			"Bound mismatch: The type Enum is not a valid substitute for the bounded parameter <E extends Enum<E>> of the type EnumSet<E>\n" +
16897 			"----------\n" +
16898 			"4. WARNING in X.java (at line 10)\n" +
16899 			"	EnumSet<Enum> eSet = EnumSet.allOf(c);\n" +
16900 			"	                     ^^^^^^^^^^^^^^^^\n" +
16901 			"Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" +
16902 			"----------\n" +
16903 			"5. WARNING in X.java (at line 10)\n" +
16904 			"	EnumSet<Enum> eSet = EnumSet.allOf(c);\n" +
16905 			"	                     ^^^^^^^^^^^^^^^^\n" +
16906 			"Type safety: The expression of type EnumSet needs unchecked conversion to conform to EnumSet<Enum>\n" +
16907 			"----------\n" +
16908 			"6. WARNING in X.java (at line 10)\n" +
16909 			"	EnumSet<Enum> eSet = EnumSet.allOf(c);\n" +
16910 			"	                                   ^\n" +
16911 			(this.complianceLevel < ClassFileConstants.JDK1_8
16912 			? "Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum>\n"
16913 			: "Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum<Enum<E>>>\n") +
16914 			"----------\n");
16915 	}
16916 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86838 - variation
16917 	public void test0534() {
16918 		this.runConformTest(
16919 			new String[] {
16920 				"X.java",
16921 				"import java.util.EnumSet;\n" +
16922 				"\n" +
16923 				"enum Foo {\n" +
16924 				"	blargh, baz, boz;\n" +
16925 				"}\n" +
16926 				"\n" +
16927 				"public class X {\n" +
16928 				"	public static void main(String[] args) {\n" +
16929 				"		Class c = Foo.class;\n" +
16930 				"		EnumSet<Foo> eSet = EnumSet.allOf(c);\n" +
16931 				"	}\n" +
16932 				"}\n",
16933 			},
16934 			""
16935 		);
16936 	}
16937 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86838 - variation
16938 	public void test0535() {
16939 		this.runConformTest(
16940 			new String[] {
16941 				"X.java",
16942 				"import java.util.EnumSet;\n" +
16943 				"\n" +
16944 				"enum Foo {\n" +
16945 				"	blargh, baz, boz;\n" +
16946 				"}\n" +
16947 				"\n" +
16948 				"public class X {\n" +
16949 				"	public static void main(String[] args) {\n" +
16950 				"		Class c = Foo.class;\n" +
16951 				"		EnumSet<? extends Enum> eSet = EnumSet.allOf(c);\n" +
16952 				"	}\n" +
16953 				"}\n",
16954 			},
16955 			""
16956 		);
16957 	}
16958 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86838 - variation
16959 	public void test0536() {
16960 		this.runNegativeTest(
16961 			new String[] {
16962 				"X.java",
16963 				"import java.util.EnumSet;\n" +
16964 				"\n" +
16965 				"enum Foo {\n" +
16966 				"	blargh, baz, boz;\n" +
16967 				"}\n" +
16968 				"\n" +
16969 				"public class X {\n" +
16970 				"	public static void main(String[] args) {\n" +
16971 				"		Class c = Foo.class;\n" +
16972 				"		EnumSet<?> eSet = (EnumSet<?>) EnumSet.allOf(c);\n" +
16973 				"	}\n" +
16974 				"  Zork z;\n" +
16975 				"}\n",
16976 			},
16977 			"----------\n" +
16978 			"1. WARNING in X.java (at line 9)\n" +
16979 			"	Class c = Foo.class;\n" +
16980 			"	^^^^^\n" +
16981 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
16982 			"----------\n" +
16983 			"2. WARNING in X.java (at line 10)\n" +
16984 			"	EnumSet<?> eSet = (EnumSet<?>) EnumSet.allOf(c);\n" +
16985 			"	                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
16986 			"Unnecessary cast from EnumSet to EnumSet<?>\n" +
16987 			"----------\n" +
16988 			"3. WARNING in X.java (at line 10)\n" +
16989 			"	EnumSet<?> eSet = (EnumSet<?>) EnumSet.allOf(c);\n" +
16990 			"	                               ^^^^^^^^^^^^^^^^\n" +
16991 			"Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" +
16992 			"----------\n" +
16993 			"4. WARNING in X.java (at line 10)\n" +
16994 			"	EnumSet<?> eSet = (EnumSet<?>) EnumSet.allOf(c);\n" +
16995 			"	                                             ^\n" +
16996 			"Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum<Enum<E>>>\n" +
16997 			"----------\n" +
16998 			"5. ERROR in X.java (at line 12)\n" +
16999 			"	Zork z;\n" +
17000 			"	^^^^\n" +
17001 			"Zork cannot be resolved to a type\n" +
17002 			"----------\n"
17003 		);
17004 	}
17005 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86838 - variation
17006 	public void test0537() {
17007 		this.runNegativeTest(
17008 			new String[] {
17009 				"X.java",
17010 				"import java.util.EnumSet;\n" +
17011 				"\n" +
17012 				"enum Foo {\n" +
17013 				"	blargh, baz, boz;\n" +
17014 				"}\n" +
17015 				"\n" +
17016 				"public class X {\n" +
17017 				"	public static void main(String[] args) {\n" +
17018 				"		Class c = Foo.class;\n" +
17019 				"		EnumSet<?> eSet = EnumSet.allOf(c);\n" +
17020 				"	}\n" +
17021 				"  Zork z;\n" +
17022 				"}\n",
17023 			},
17024 			"----------\n" +
17025 			"1. WARNING in X.java (at line 9)\n" +
17026 			"	Class c = Foo.class;\n" +
17027 			"	^^^^^\n" +
17028 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
17029 			"----------\n" +
17030 			"2. WARNING in X.java (at line 10)\n" +
17031 			"	EnumSet<?> eSet = EnumSet.allOf(c);\n" +
17032 			"	                  ^^^^^^^^^^^^^^^^\n" +
17033 			"Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" +
17034 			"----------\n" +
17035 			"3. WARNING in X.java (at line 10)\n" +
17036 			"	EnumSet<?> eSet = EnumSet.allOf(c);\n" +
17037 			"	                                ^\n" +
17038 			"Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum<Enum<E>>>\n" +
17039 			"----------\n" +
17040 			"4. ERROR in X.java (at line 12)\n" +
17041 			"	Zork z;\n" +
17042 			"	^^^^\n" +
17043 			"Zork cannot be resolved to a type\n" +
17044 			"----------\n");
17045 	}
17046 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86838 - variation
17047 	public void test0538() {
17048 		this.runNegativeTest(
17049 			new String[] {
17050 				"X.java",
17051 				"import java.util.EnumSet;\n" +
17052 				"\n" +
17053 				"enum Foo {\n" +
17054 				"	blargh, baz, boz;\n" +
17055 				"}\n" +
17056 				"\n" +
17057 				"public class X {\n" +
17058 				"	public static void main(String[] args) {\n" +
17059 				"		Class c = Foo.class;\n" +
17060 				"		EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
17061 				"	}\n" +
17062 				"}\n",
17063 			},
17064 			this.complianceLevel < ClassFileConstants.JDK1_8 ?
17065 			"----------\n" +
17066 			"1. WARNING in X.java (at line 9)\n" +
17067 			"	Class c = Foo.class;\n" +
17068 			"	^^^^^\n" +
17069 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
17070 			"----------\n" +
17071 			"2. ERROR in X.java (at line 10)\n" +
17072 			"	EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
17073 			"	        ^^^^\n" +
17074 			"Bound mismatch: The type Enum<?> is not a valid substitute for the bounded parameter <E extends Enum<E>> of the type EnumSet<E>\n" +
17075 			"----------\n" +
17076 			"3. WARNING in X.java (at line 10)\n" +
17077 			"	EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
17078 			"	                        ^^^^^^^^^^^^^^^^\n" +
17079 			"Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" +
17080 			"----------\n" +
17081 			"4. WARNING in X.java (at line 10)\n" +
17082 			"	EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
17083 			"	                        ^^^^^^^^^^^^^^^^\n" +
17084 			"Type safety: The expression of type EnumSet needs unchecked conversion to conform to EnumSet<Enum<?>>\n" +
17085 			"----------\n" +
17086 			"5. WARNING in X.java (at line 10)\n" +
17087 			"	EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
17088 			"	                                      ^\n" +
17089 			"Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum<?>>\n" +
17090 			"----------\n" :
17091 				"----------\n" +
17092 				"1. WARNING in X.java (at line 9)\n" +
17093 				"	Class c = Foo.class;\n" +
17094 				"	^^^^^\n" +
17095 				"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
17096 				"----------\n" +
17097 				"2. ERROR in X.java (at line 10)\n" +
17098 				"	EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
17099 				"	        ^^^^\n" +
17100 				"Bound mismatch: The type Enum<?> is not a valid substitute for the bounded parameter <E extends Enum<E>> of the type EnumSet<E>\n" +
17101 				"----------\n" +
17102 				"3. WARNING in X.java (at line 10)\n" +
17103 				"	EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
17104 				"	                        ^^^^^^^^^^^^^^^^\n" +
17105 				"Type safety: Unchecked invocation allOf(Class) of the generic method allOf(Class<E>) of type EnumSet\n" +
17106 				"----------\n" +
17107 				"4. WARNING in X.java (at line 10)\n" +
17108 				"	EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
17109 				"	                        ^^^^^^^^^^^^^^^^\n" +
17110 				"Type safety: The expression of type EnumSet needs unchecked conversion to conform to EnumSet<Enum<?>>\n" +
17111 				"----------\n" +
17112 				"5. WARNING in X.java (at line 10)\n" +
17113 				"	EnumSet<Enum<?>> eSet = EnumSet.allOf(c);\n" +
17114 				"	                                      ^\n" +
17115 				"Type safety: The expression of type Class needs unchecked conversion to conform to Class<Enum<Enum<E>>>\n" +
17116 				"----------\n");
17117 	}
17118 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86838 - variation
17119 	public void test0539() {
17120 		this.runNegativeTest(
17121 			new String[] {
17122 				"X.java",
17123 				"public class X {\n" +
17124 				"		 static class B<C> {\n" +
17125 				"		 		 public <T extends I1> T willBe(Class<T> c) {\n" +
17126 				"		 		 		 return (T)null;\n" +
17127 				"		 		 }\n" +
17128 				"		 }\n" +
17129 				"		 interface I1  {\n" +
17130 				"		 }\n" +
17131 				"		 interface I2  extends I1 {\n" +
17132 				"		 }\n" +
17133 				"		 \n" +
17134 				"		 public static void m1(String[] args) {\n" +
17135 				"		 		 B b = new B();\n" +
17136 				"		 		 I2 v = b.willBe(I2.class);\n" +
17137 				"		 }\n" +
17138 				"		 public static void m2(String[] args) {\n" +
17139 				"		 		 B<Void> b = new B<Void>();\n" +
17140 				"		 		 I2 v = b.willBe(I2.class);\n" +
17141 				"		 }\n" +
17142 				"\n" +
17143 				"}\n",
17144 			},
17145 			"----------\n" +
17146 			"1. WARNING in X.java (at line 4)\n" +
17147 			"	return (T)null;\n" +
17148 			"	       ^^^^^^^\n" +
17149 			"Unnecessary cast from null to T\n" +
17150 			"----------\n" +
17151 			"2. WARNING in X.java (at line 13)\n" +
17152 			"	B b = new B();\n" +
17153 			"	^\n" +
17154 			"X.B is a raw type. References to generic type X.B<C> should be parameterized\n" +
17155 			"----------\n" +
17156 			"3. WARNING in X.java (at line 13)\n" +
17157 			"	B b = new B();\n" +
17158 			"	          ^\n" +
17159 			"X.B is a raw type. References to generic type X.B<C> should be parameterized\n" +
17160 			"----------\n" +
17161 			"4. WARNING in X.java (at line 14)\n" +
17162 			"	I2 v = b.willBe(I2.class);\n" +
17163 			"	       ^^^^^^^^^^^^^^^^^^\n" +
17164 			"Type safety: The method willBe(Class) belongs to the raw type X.B. References to generic type X.B<C> should be parameterized\n" +
17165 			"----------\n" +
17166 			"5. ERROR in X.java (at line 14)\n" +
17167 			"	I2 v = b.willBe(I2.class);\n" +
17168 			"	       ^^^^^^^^^^^^^^^^^^\n" +
17169 			"Type mismatch: cannot convert from X.I1 to X.I2\n" +
17170 			"----------\n");
17171 	}
17172 	// test paramtype argument compatibility
17173 	public void test0540() {
17174 		this.runNegativeTest(
17175 			new String[] {
17176 				"Baz.java",
17177 				"import java.util.*;\n" +
17178 				"interface Foo<X> {}\n" +
17179 				"interface Bar extends Foo {\n" +
17180 				"}\n" +
17181 				"public class Baz<R,D>  {\n" +
17182 				"    public R visit(Collection<? extends Foo<?>> trees, D d) {\n" +
17183 				"	return null;\n" +
17184 				"    }\n" +
17185 				"    R test(Collection<Bar> c, D d) {\n" +
17186 				"	return visit(c, d);\n" +
17187 				"    }\n" +
17188 				"}\n",
17189 			},
17190 			"----------\n" +
17191 			"1. WARNING in Baz.java (at line 3)\n" +
17192 			"	interface Bar extends Foo {\n" +
17193 			"	                      ^^^\n" +
17194 			"Foo is a raw type. References to generic type Foo<X> should be parameterized\n" +
17195 			"----------\n" +
17196 			"2. ERROR in Baz.java (at line 10)\n" +
17197 			"	return visit(c, d);\n" +
17198 			"	       ^^^^^\n" +
17199 			"The method visit(Collection<? extends Foo<?>>, D) in the type Baz<R,D> is not applicable for the arguments (Collection<Bar>, D)\n" +
17200 			"----------\n");
17201 	}
17202 	public void test0541() {
17203 		this.runConformTest(
17204 			new String[] {
17205 				"X.java",
17206 				"import java.util.Map;\n" +
17207 				"public class X {\n" +
17208 				"   public static void main(String[] args) {\n" +
17209 				"     Map m = null;\n" +
17210 				"	 try {\n" +
17211 				"	     Map m2 = m.getClass().newInstance();\n" +
17212 				"	 } catch(Exception e) {\n" +
17213 				"	 }\n" +
17214 				"   }\n" +
17215 				"}\n",
17216 			},
17217 			"");
17218 	}
17219 	public void test0542() {
17220 		this.runConformTest(
17221 			new String[] {
17222 				"X.java",
17223 				"public class X {\n" +
17224 				"	static <T> boolean isOK(T x) {\n" +
17225 				"		return isOK(x);\n" +
17226 				"	}\n" +
17227 				"\n" +
17228 				"	static <T> boolean isStillOK(T x) {\n" +
17229 				"		return true && isOK(x);\n" +
17230 				"	}\n" +
17231 				"\n" +
17232 				"	static <T> boolean isNoMoreOK(T x) {\n" +
17233 				"		return true && isNoMoreOK(x);\n" +
17234 				"	}\n" +
17235 				"\n" +
17236 				"	static <T> boolean isOKAgain(T x) {\n" +
17237 				"		boolean res;\n" +
17238 				"		return true && (res = isOKAgain(x));\n" +
17239 				"	}\n" +
17240 				"}\n",
17241 			},
17242 			"");
17243 	}
17244 	public void test0543() {
17245 		this.runNegativeTest(
17246 			new String[] {
17247 				"X.java",
17248 				"import java.util.List;\n" +
17249 				"\n" +
17250 				"public class X {\n" +
17251 				"	public static void main(String[] args) {\n" +
17252 				"		Object obj = null;\n" +
17253 				"		List<String> ls = (List<String>) obj;\n" +
17254 				"	}\n" +
17255 				"  Zork z;\n" +
17256 				"}\n",
17257 			},
17258 			"----------\n" +
17259 			"1. WARNING in X.java (at line 6)\n" +
17260 			"	List<String> ls = (List<String>) obj;\n" +
17261 			"	                  ^^^^^^^^^^^^^^^^^^\n" +
17262 			"Type safety: Unchecked cast from Object to List<String>\n" +
17263 			"----------\n" +
17264 			"2. ERROR in X.java (at line 8)\n" +
17265 			"	Zork z;\n" +
17266 			"	^^^^\n" +
17267 			"Zork cannot be resolved to a type\n" +
17268 			"----------\n");
17269 	}
17270 	public void test0544() {
17271 		this.runNegativeTest(
17272 			new String[] {
17273 				"X.java",
17274 				"import java.util.Vector;\n" +
17275 				"\n" +
17276 				"public class X {\n" +
17277 				"	public static void main(String[] args) {\n" +
17278 				"		Vector<Integer> a = new Vector<Integer>();\n" +
17279 				"		Vector b = new Vector();\n" +
17280 				"		b.add(new Object());\n" +
17281 				"		a = b;\n" +
17282 				"		Zork z;\n" +
17283 				"	}\n" +
17284 				"}\n",
17285 			},
17286 			"----------\n" +
17287 			"1. WARNING in X.java (at line 6)\n" +
17288 			"	Vector b = new Vector();\n" +
17289 			"	^^^^^^\n" +
17290 			"Vector is a raw type. References to generic type Vector<E> should be parameterized\n" +
17291 			"----------\n" +
17292 			"2. WARNING in X.java (at line 6)\n" +
17293 			"	Vector b = new Vector();\n" +
17294 			"	               ^^^^^^\n" +
17295 			"Vector is a raw type. References to generic type Vector<E> should be parameterized\n" +
17296 			"----------\n" +
17297 			"3. WARNING in X.java (at line 7)\n" +
17298 			"	b.add(new Object());\n" +
17299 			"	^^^^^^^^^^^^^^^^^^^\n" +
17300 			"Type safety: The method add(Object) belongs to the raw type Vector. References to generic type Vector<E> should be parameterized\n" +
17301 			"----------\n" +
17302 			"4. WARNING in X.java (at line 8)\n" +
17303 			"	a = b;\n" +
17304 			"	    ^\n" +
17305 			"Type safety: The expression of type Vector needs unchecked conversion to conform to Vector<Integer>\n" +
17306 			"----------\n" +
17307 			"5. ERROR in X.java (at line 9)\n" +
17308 			"	Zork z;\n" +
17309 			"	^^^^\n" +
17310 			"Zork cannot be resolved to a type\n" +
17311 			"----------\n");
17312 	}
17313 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=86898
17314 	public void test0545() {
17315 		this.runNegativeTest(
17316 			new String[] {
17317 				"X.java",
17318 				"class B extends A<Object> {\n" +
17319 				"	void m2() {\n" +
17320 				"		m3((X2) m());  // A<Object>.m() --> X<? extends Object> - cannot cast to X2\n" +
17321 				"	}\n" +
17322 				"	void m3(X2 i) {}\n" +
17323 				"}\n" +
17324 				"class A<T> {\n" +
17325 				"	X<? extends T> m() {\n" +
17326 				"		return null;\n" +
17327 				"	}\n" +
17328 				"}\n" +
17329 				"\n" +
17330 				"class X2 extends X<String> {\n" +
17331 				"}\n" +
17332 				"\n" +
17333 				"public class X<T> {\n" +
17334 				"	void foo(X<String> lhs, X<? extends Object> rhs) {\n" +
17335 				"		lhs = rhs; // cannot convert\n" +
17336 				"	}\n" +
17337 				"	void bar(X2 lhs, X<? extends Object> rhs) {\n" +
17338 				"		lhs = rhs; // cannot convert\n" +
17339 				"	}\n" +
17340 				"}\n" +
17341 				"class C {\n" +
17342 				"	void foo(X<? extends Object> xo) {}\n" +
17343 				"	void bar(X<String> xs) {}\n" +
17344 				"}\n" +
17345 				"class D extends C {\n" +
17346 				"	void foo(X<String> xs) {}\n" +
17347 				"	void bar(X<? extends Object> xo) {}\n" +
17348 				"}\n",
17349 			},
17350 			"----------\n" +
17351 			"1. ERROR in X.java (at line 18)\n" +
17352 			"	lhs = rhs; // cannot convert\n" +
17353 			"	      ^^^\n" +
17354 			"Type mismatch: cannot convert from X<capture#2-of ? extends Object> to X<String>\n" +
17355 			"----------\n" +
17356 			"2. ERROR in X.java (at line 21)\n" +
17357 			"	lhs = rhs; // cannot convert\n" +
17358 			"	      ^^^\n" +
17359 			"Type mismatch: cannot convert from X<capture#3-of ? extends Object> to X2\n" +
17360 			"----------\n" +
17361 			"3. ERROR in X.java (at line 29)\n" +
17362 			"	void foo(X<String> xs) {}\n" +
17363 			"	     ^^^^^^^^^^^^^^^^^\n" +
17364 			"Name clash: The method foo(X<String>) of type D has the same erasure as foo(X<? extends Object>) of type C but does not override it\n" +
17365 			"----------\n" +
17366 			"4. ERROR in X.java (at line 30)\n" +
17367 			"	void bar(X<? extends Object> xo) {}\n" +
17368 			"	     ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
17369 			"Name clash: The method bar(X<? extends Object>) of type D has the same erasure as bar(X<String>) of type C but does not override it\n" +
17370 			"----------\n");
17371 	}
17372 	// ensure no unsafe cast warning **
17373 	public void test0546() {
17374 		this.runNegativeTest(
17375 			new String[] {
17376 				"X.java",
17377 				"class StringList extends java.util.LinkedList<String> {\n" +
17378 				"}\n" +
17379 				"\n" +
17380 				"public class X {\n" +
17381 				"    public static void main(String[] args) {\n" +
17382 				"        java.util.List<? extends String> a = new StringList();\n" +
17383 				"        java.util.List<String> b = (StringList) a;      // warned but safe.\n" +
17384 				"    }\n" +
17385 				"   Zork z;\n" +
17386 				"}\n",
17387 			},
17388 			"----------\n" +
17389 			"1. WARNING in X.java (at line 1)\n" +
17390 			"	class StringList extends java.util.LinkedList<String> {\n" +
17391 			"	      ^^^^^^^^^^\n" +
17392 			"The serializable class StringList does not declare a static final serialVersionUID field of type long\n" +
17393 			"----------\n" +
17394 			"2. ERROR in X.java (at line 9)\n" +
17395 			"	Zork z;\n" +
17396 			"	^^^^\n" +
17397 			"Zork cannot be resolved to a type\n" +
17398 			"----------\n");
17399 	}
17400 	public void test0547() {
17401 		runConformTest(
17402 		// test directory preparation
17403 		new String[] { /* test files */
17404 			"X.java",
17405 			"import java.util.*;\n" +
17406 			"public class X {\n" +
17407 			"	public <K> TreeMap<K,K> essai(K type) {\n" +
17408 			"		TreeMap<K,K> treeMap = new TreeMap<K,K>();\n" +
17409 			"		return treeMap;\n" +
17410 			"	}\n" +
17411 			"	public static void main(String args[]) {\n" +
17412 			"		X x = new X();\n" +
17413 			"		TreeMap<?,?> treeMap = x.essai(null);\n" +
17414 			"	}\n" +
17415 			"}\n",
17416 		},
17417 		// javac options
17418 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
17419 	}
17420 	public void test0548() {
17421 		this.runNegativeTest(
17422 			new String[] {
17423 				"X.java",
17424 				"interface DA<T> {\n" +
17425 				"}\n" +
17426 				"interface DB<T> extends DA<T> {\n" +
17427 				"}\n" +
17428 				"interface DC<T> extends DA<Integer> {\n" +
17429 				"}\n" +
17430 				"\n" +
17431 				"public class X {\n" +
17432 				"	Object o = (DC<?>) (DA<?>) null;\n" +
17433 				"  Zork z;\n" +
17434 				"}\n",
17435 			},
17436 			"----------\n" +
17437 			"1. WARNING in X.java (at line 9)\n" +
17438 			"	Object o = (DC<?>) (DA<?>) null;\n" +
17439 			"	           ^^^^^^^^^^^^^^^^^^^^\n" +
17440 			"Unnecessary cast from DA<capture#1-of ?> to DC<?>\n" +
17441 			"----------\n" +
17442 			"2. WARNING in X.java (at line 9)\n" +
17443 			"	Object o = (DC<?>) (DA<?>) null;\n" +
17444 			"	                   ^^^^^^^^^^^^\n" +
17445 			"Unnecessary cast from null to DA<?>\n" +
17446 			"----------\n" +
17447 			"3. ERROR in X.java (at line 10)\n" +
17448 			"	Zork z;\n" +
17449 			"	^^^^\n" +
17450 			"Zork cannot be resolved to a type\n" +
17451 			"----------\n");
17452 	}
17453 	// **
17454 	public void test0549() {
17455 		this.runConformTest(
17456 			new String[] {
17457 				"X.java",
17458 				"public class X<T> {\n" +
17459 				"	boolean DEBUG = this instanceof Special;\n" +
17460 				"\n" +
17461 				"	public static class Special extends X<String> {\n" +
17462 				"	}\n" +
17463 				"}\n",
17464 			},
17465 			"");
17466 	}
17467 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=148046
17468 	public void test0550() {
17469 		this.runNegativeTest(
17470 			new String[] {
17471 				"X.java",
17472 				"class A {}\n" +
17473 				"class B extends A {}\n" +
17474 				"\n" +
17475 				"public class X<T> {\n" +
17476 				"    public <U extends B> void foo(X<? super A> param) {\n" +
17477 				"        X<U> foo = (X<U>)param;\n" +
17478 				"    }\n" +
17479 				"   Zork z;\n" +
17480 				"}\n",
17481 			},
17482 			"----------\n" +
17483 			"1. ERROR in X.java (at line 6)\n" +
17484 			"	X<U> foo = (X<U>)param;\n" +
17485 			"	           ^^^^^^^^^^^\n" +
17486 			"Cannot cast from X<capture#1-of ? super A> to X<U>\n" +
17487 			"----------\n" +
17488 			"2. ERROR in X.java (at line 8)\n" +
17489 			"	Zork z;\n" +
17490 			"	^^^^\n" +
17491 			"Zork cannot be resolved to a type\n" +
17492 			"----------\n");
17493 	}
17494 	// ensure no unchecked warning
17495 	public void test0551() {
17496 		this.runNegativeTest(
17497 			new String[] {
17498 				"X.java",
17499 				"public class X {\n" +
17500 				"    <T, U extends T, V extends T> T cond1(boolean z, U x1, V x2) {\n" +
17501 				"        return (z? (T) x1: x2);\n" +
17502 				"    }\n" +
17503 				"    Zork z;\n" +
17504 				"}\n",
17505 			},
17506 			"----------\n" +
17507 			"1. WARNING in X.java (at line 2)\n" +
17508 			"	<T, U extends T, V extends T> T cond1(boolean z, U x1, V x2) {\n" +
17509 			"	                                              ^\n" +
17510 			"The parameter z is hiding a field from type X\n" +
17511 			"----------\n" +
17512 			"2. ERROR in X.java (at line 5)\n" +
17513 			"	Zork z;\n" +
17514 			"	^^^^\n" +
17515 			"Zork cannot be resolved to a type\n" +
17516 			"----------\n");
17517 	}
17518 	public void test0552() {
17519 		this.runConformTest(
17520 			new String[] {
17521 				"X.java",
17522 				"public class X {\n" +
17523 				"\n" +
17524 				"	Comparable<?> x;\n" +
17525 				"\n" +
17526 				"	void put(Comparable<?> c) {\n" +
17527 				"		this.x = c;\n" +
17528 				"	}\n" +
17529 				"\n" +
17530 				"	Comparable<?> get() {\n" +
17531 				"		return x;\n" +
17532 				"	}\n" +
17533 				"\n" +
17534 				"	void test() {\n" +
17535 				"		X ci = new X();\n" +
17536 				"		ci.put(new Integer(3));\n" +
17537 				"		Integer i = (Integer) ci.get();\n" +
17538 				"	}\n" +
17539 				"\n" +
17540 				"}\n",
17541 			},
17542 			"");
17543 	}
17544 	public void test0553() {
17545 		this.runConformTest(
17546 			new String[] {
17547 				"X.java",
17548 				"public class X {\n" +
17549 				"   public static void main(String args[]) throws Exception {\n" +
17550 				"      doIt();\n" +
17551 				"      System.out.println(\"SUCCESS\");\n" +
17552 				"   }\n" +
17553 				"   public static void doIt() {\n" +
17554 				"      Holder<Integer> association = new Holder<Integer>(new Integer(0));\n" +
17555 				"      Integer sizeHolder = (Integer)(association.getValue()); //Cast to Integer is redundant!!!\n" +
17556 				"      System.out.print(sizeHolder.intValue());\n" +
17557 				"   }\n" +
17558 				"   static class Holder<V> {\n" +
17559 				"      V value;\n" +
17560 				"      Holder(V value) {\n" +
17561 				"         this.value = value;\n" +
17562 				"      }\n" +
17563 				"      V getValue() {\n" +
17564 				"         return value;\n" +
17565 				"      }\n" +
17566 				"   }\n" +
17567 				"}\n"	,
17568 			},
17569 			"0SUCCESS");
17570 	}
17571 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=86898 - variation
17572 	public void test0554() {
17573 		this.runNegativeTest(
17574 			new String[] {
17575 				"X.java",
17576 				" import java.util.*;\n" +
17577 				" public class X<T> {\n" +
17578 				" public static void main(String[] args) {\n" +
17579 				"		X<? extends Object> xo = null;\n" +
17580 				"		X<String> xs = null;\n" +
17581 				"		X2 x2 = null;\n" +
17582 				"		\n" +
17583 				"		Object o1 = (X<String>) xo;\n" +
17584 				"		Object o2 = (X<? extends Object>) xs;\n" +
17585 				"		Object o3 = (X2) xo;\n" +
17586 				"		Object o4 = (X<? extends Object>) x2;\n" +
17587 				"		Object o5 = (X3<String>) xo;\n" +
17588 				"	}\n" +
17589 				"}\n" +
17590 				"class X2 extends X<String> {\n" +
17591 				"}\n" +
17592 				"class X3<U> extends X<U> {\n" +
17593 				"   Zork z;\n" +
17594 				"}\n",
17595 			},
17596 			"----------\n" +
17597 			"1. WARNING in X.java (at line 8)\n" +
17598 			"	Object o1 = (X<String>) xo;\n" +
17599 			"	            ^^^^^^^^^^^^^^\n" +
17600 			"Type safety: Unchecked cast from X<capture#1-of ? extends Object> to X<String>\n" +
17601 			"----------\n" +
17602 			"2. WARNING in X.java (at line 8)\n" +
17603 			"	Object o1 = (X<String>) xo;\n" +
17604 			"	            ^^^^^^^^^^^^^^\n" +
17605 			"Unnecessary cast from X<capture#1-of ? extends Object> to X<String>\n" +
17606 			"----------\n" +
17607 			"3. WARNING in X.java (at line 9)\n" +
17608 			"	Object o2 = (X<? extends Object>) xs;\n" +
17609 			"	            ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
17610 			"Unnecessary cast from X<String> to X<? extends Object>\n" +
17611 			"----------\n" +
17612 			"4. WARNING in X.java (at line 10)\n" +
17613 			"	Object o3 = (X2) xo;\n" +
17614 			"	            ^^^^^^^\n" +
17615 			"Unnecessary cast from X<capture#3-of ? extends Object> to X2\n" +
17616 			"----------\n" +
17617 			"5. WARNING in X.java (at line 11)\n" +
17618 			"	Object o4 = (X<? extends Object>) x2;\n" +
17619 			"	            ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
17620 			"Unnecessary cast from X2 to X<? extends Object>\n" +
17621 			"----------\n" +
17622 			"6. WARNING in X.java (at line 12)\n" +
17623 			"	Object o5 = (X3<String>) xo;\n" +
17624 			"	            ^^^^^^^^^^^^^^^\n" +
17625 			"Type safety: Unchecked cast from X<capture#5-of ? extends Object> to X3<String>\n" +
17626 			"----------\n" +
17627 			"7. WARNING in X.java (at line 12)\n" +
17628 			"	Object o5 = (X3<String>) xo;\n" +
17629 			"	            ^^^^^^^^^^^^^^^\n" +
17630 			"Unnecessary cast from X<capture#5-of ? extends Object> to X3<String>\n" +
17631 			"----------\n" +
17632 			"8. ERROR in X.java (at line 18)\n" +
17633 			"	Zork z;\n" +
17634 			"	^^^^\n" +
17635 			"Zork cannot be resolved to a type\n" +
17636 			"----------\n");
17637 	}
17638 	public void test0555() {
17639 		this.runNegativeTest(
17640 			new String[] {
17641 				"X.java",
17642 				" import java.util.List;\n" +
17643 				" public class X<U extends Number> {\n" +
17644 				" U u;\n" +
17645 				" void foo(X<? extends Number> xn, X<? extends U> xu) {\n" +
17646 				"		xn = xu;\n" +
17647 				"		xu = xn;\n" +
17648 				"		xu.u = xn.u; // ko\n" +
17649 				"		xn.u = xu.u; // ko\n" +
17650 				"	}\n" +
17651 				"}\n",
17652 			},
17653 			"----------\n" +
17654 			"1. ERROR in X.java (at line 6)\n" +
17655 			"	xu = xn;\n" +
17656 			"	     ^^\n" +
17657 			"Type mismatch: cannot convert from X<capture#4-of ? extends Number> to X<? extends U>\n" +
17658 			"----------\n" +
17659 			"2. ERROR in X.java (at line 7)\n" +
17660 			"	xu.u = xn.u; // ko\n" +
17661 			"	       ^^^^\n" +
17662 			"Type mismatch: cannot convert from capture#6-of ? extends Number to capture#5-of ? extends U\n" +
17663 			"----------\n" +
17664 			"3. ERROR in X.java (at line 8)\n" +
17665 			"	xn.u = xu.u; // ko\n" +
17666 			"	       ^^^^\n" +
17667 			"Type mismatch: cannot convert from capture#8-of ? extends U to capture#7-of ? extends Number\n" +
17668 			"----------\n");
17669 	}
17670 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=87273
17671 	public void test0556() {
17672 		this.runConformTest(
17673 			new String[] {
17674 				"X.java",
17675 				"interface Foo {\n" +
17676 				"	Object get();\n" +
17677 				"}\n" +
17678 				"\n" +
17679 				"interface MyList<F> extends Foo {\n" +
17680 				"	public F get();\n" +
17681 				"}\n" +
17682 				"\n" +
17683 				"class MyListImpl<G> implements MyList<G> {\n" +
17684 				"	public G get() {\n" +
17685 				"		System.out.println(\"SUCCESS\");\n" +
17686 				"		return null;\n" +
17687 				"	}\n" +
17688 				"}\n" +
17689 				"\n" +
17690 				"interface StringList extends MyList<String> {\n" +
17691 				"}\n" +
17692 				"\n" +
17693 				"class StringListImpl extends MyListImpl<String> implements StringList {\n" +
17694 				"}\n" +
17695 				"\n" +
17696 				"public class X {\n" +
17697 				"	public static void main(String[] args) {\n" +
17698 				"		Foo f = new StringListImpl();\n" +
17699 				"		f.get();\n" +
17700 				"	}\n" +
17701 				"}\n",
17702 			},
17703 			"SUCCESS");
17704 	}
17705 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=83002
17706 	public void test0557() {
17707 		this.runConformTest(
17708 			new String[] {
17709 				"X.java",
17710 				"public class X {\n" +
17711 				"	static <T extends Exception> void foo(T t) throws T {\n" + // ensure exception is properly encoded (...^ex)
17712 				"	}\n" +
17713 				"}\n",
17714 			},
17715 			"");
17716 		this.runConformTest(
17717 			new String[] {
17718 				"Y.java",
17719 				"import java.io.*;\n" +
17720 				"public class Y {\n" +
17721 				"	void foo() {\n" +
17722 				"		try {\n" +
17723 				"			X.foo(new IOException());\n" +
17724 				"		} catch(IOException e){\n" +
17725 				"		}\n" +
17726 				"	}\n" +
17727 				"}\n",
17728 			},
17729 			"",
17730 			null,
17731 			false,
17732 			null);
17733 	}
17734 
17735 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=83002
17736 	public void test0558() {
17737 		this.runConformTest(
17738 			new String[] {
17739 				"X.java",
17740 				"public class X {\n" +
17741 				"	static <T extends Exception, U extends Exception> void foo(T t, U u) throws T, U {\n" + // ensure exception is properly encoded (...^ex)
17742 				"	}\n" +
17743 				"}\n",
17744 			},
17745 			"");
17746 		this.runConformTest(
17747 			new String[] {
17748 				"Y.java",
17749 				"import java.io.*;\n" +
17750 				"public class Y {\n" +
17751 				"	void foo() {\n" +
17752 				"		try {\n" +
17753 				"			X.foo(new IOException(), new ClassNotFoundException());\n" +
17754 				"		} catch(IOException e){\n" +
17755 				"		} catch(ClassNotFoundException e){\n" +
17756 				"		}\n" +
17757 				"	}\n" +
17758 				"}\n",
17759 			},
17760 			"",
17761 			null,
17762 			false,
17763 			null);
17764 	}
17765 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=86902
17766 	// **
17767 	public void test0559() {
17768 		this.runNegativeTest(
17769 			new String[] {
17770 				"X.java",
17771 				"class Cell<T> {\n" +
17772 				"	T t;\n" +
17773 				"	public void setT(T t) {\n" +
17774 				"		this.t= t;\n" +
17775 				"	}\n" +
17776 				"	public T getT() {\n" +
17777 				"		return t;\n" +
17778 				"	}\n" +
17779 				"}\n" +
17780 				"\n" +
17781 				"public class X {\n" +
17782 				"  Zork z;\n" +
17783 				"	public static void main(String[] args) {\n" +
17784 				"		Cell c= new Cell();\n" +
17785 				"		c.setT(Boolean.FALSE); // other: warning: [unchecked] unchecked\n" +
17786 				"			// call to setT(T) as a member of the raw type p.Cell\n" +
17787 				"		c.t= Boolean.TRUE; // other: warning: [unchecked] unchecked call\n" +
17788 				"			// to setT(T) as a member of the raw type p.Cell\n" +
17789 				"		boolean b1= (Boolean) c.getT();\n" +
17790 				"		boolean b2= (Boolean) c.t;\n" +
17791 				"	}\n" +
17792 				"}\n",
17793 			},
17794 			"----------\n" +
17795 			"1. ERROR in X.java (at line 12)\n" +
17796 			"	Zork z;\n" +
17797 			"	^^^^\n" +
17798 			"Zork cannot be resolved to a type\n" +
17799 			"----------\n" +
17800 			"2. WARNING in X.java (at line 14)\n" +
17801 			"	Cell c= new Cell();\n" +
17802 			"	^^^^\n" +
17803 			"Cell is a raw type. References to generic type Cell<T> should be parameterized\n" +
17804 			"----------\n" +
17805 			"3. WARNING in X.java (at line 14)\n" +
17806 			"	Cell c= new Cell();\n" +
17807 			"	            ^^^^\n" +
17808 			"Cell is a raw type. References to generic type Cell<T> should be parameterized\n" +
17809 			"----------\n" +
17810 			"4. WARNING in X.java (at line 15)\n" +
17811 			"	c.setT(Boolean.FALSE); // other: warning: [unchecked] unchecked\n" +
17812 			"	^^^^^^^^^^^^^^^^^^^^^\n" +
17813 			"Type safety: The method setT(Object) belongs to the raw type Cell. References to generic type Cell<T> should be parameterized\n" +
17814 			"----------\n" +
17815 			"5. WARNING in X.java (at line 17)\n" +
17816 			"	c.t= Boolean.TRUE; // other: warning: [unchecked] unchecked call\n" +
17817 			"	  ^\n" +
17818 			"Type safety: The field t from the raw type Cell is assigned a value of type Boolean. References to generic type Cell<T> should be parameterized\n" +
17819 			"----------\n");
17820 	}
17821 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=85924
17822 	public void test0560() {
17823 		this.runConformTest(
17824 			new String[] {
17825 				"X.java",
17826 				"interface IController<U extends IView<?>>  {\n" +
17827 				"    public U getView() ;\n" +
17828 				"}\n" +
17829 				"interface IView<U>  {\n" +
17830 				"}\n" +
17831 				"class MatGroup   {\n" +
17832 				"	public abstract static class View implements IView<String> {\n" +
17833 				"		public void setTempAppearance() {\n" +
17834 				"			System.out.println(\"SUCCESS\");\n" +
17835 				"		}\n" +
17836 				"	}\n" +
17837 				"	\n" +
17838 				"	public abstract static class Ctrl<U extends View> implements IController<U>  {\n" +
17839 				"	}\n" +
17840 				"}\n" +
17841 				"public class X {\n" +
17842 				"	public static void main(String []args) {\n" +
17843 				"		MatGroup.Ctrl<?>children[] = { \n" +
17844 				"				new MatGroup.Ctrl<MatGroup.View>(){\n" +
17845 				"					public MatGroup.View getView() { return new MatGroup.View(){}; }	\n" +
17846 				"				}} ;\n" +
17847 				"	    for(MatGroup.Ctrl<?> glmat: children) {\n" +
17848 				"			glmat.getView().setTempAppearance() ;\n" +
17849 				"	    }\n" +
17850 				"	}\n" +
17851 				"}\n",
17852 			},
17853 			"SUCCESS");
17854 	}
17855 
17856 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=87956
17857 	public void test0561() {
17858 		// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950
17859 		String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
17860 				"----------\n" +
17861 				"1. WARNING in X.java (at line 2)\n" +
17862 				"	void foo(A<String> a) {}\n" +
17863 				"	     ^^^^^^^^^^^^^^^^\n" +
17864 				"Erasure of method foo(A<String>) is the same as another method in type X\n" +
17865 				"----------\n" +
17866 				"2. WARNING in X.java (at line 3)\n" +
17867 				"	Object foo(A<Integer> a) { return null; }\n" +
17868 				"	       ^^^^^^^^^^^^^^^^^\n" +
17869 				"Erasure of method foo(A<Integer>) is the same as another method in type X\n" +
17870 				"----------\n":
17871 					"----------\n" +
17872 					"1. ERROR in X.java (at line 2)\n" +
17873 					"	void foo(A<String> a) {}\n" +
17874 					"	     ^^^^^^^^^^^^^^^^\n" +
17875 					"Erasure of method foo(A<String>) is the same as another method in type X\n" +
17876 					"----------\n" +
17877 					"2. ERROR in X.java (at line 3)\n" +
17878 					"	Object foo(A<Integer> a) { return null; }\n" +
17879 					"	       ^^^^^^^^^^^^^^^^^\n" +
17880 					"Erasure of method foo(A<Integer>) is the same as another method in type X\n" +
17881 					"----------\n" +
17882 					"3. ERROR in X.java (at line 4)\n" +
17883 					"	void test(A<Integer> a) { foo(a); }\n" +
17884 					"	                          ^^^\n" +
17885 					"The method foo(A<String>) in the type X is not applicable for the arguments (A<Integer>)\n" +
17886 					"----------\n";
17887 		this.runNegativeTest(
17888 			new String[] {
17889 				"X.java",
17890 				"public class X {\n" +
17891 				"	void foo(A<String> a) {}\n" +
17892 				"	Object foo(A<Integer> a) { return null; }\n" +
17893 				"	 void test(A<Integer> a) { foo(a); }\n" +
17894 				"}\n" +
17895 				"class A<T> {}\n",
17896 			},
17897 			expectedCompilerLog
17898 		);
17899 /* javac 7
17900 X.java:3: name clash: foo(A<Integer>) and foo(A<String>) have the same erasure
17901         Object foo(A<Integer> a) { return null; }
17902                ^
17903 X.java:4: method foo in class X cannot be applied to given types
17904         void test(A<Integer> a) { foo(a); }
17905                                   ^
17906   required: A<String>
17907   found: A<Integer>
17908 2 errors
17909  */
17910 		String expectedCompilerLog2 = (this.complianceLevel == ClassFileConstants.JDK1_6)?
17911 				"----------\n" +
17912 				"1. WARNING in X.java (at line 2)\n" +
17913 				"	Number foo(A<String> a) { return null; }\n" +
17914 				"	       ^^^^^^^^^^^^^^^^\n" +
17915 				"Erasure of method foo(A<String>) is the same as another method in type X\n" +
17916 				"----------\n" +
17917 				"2. WARNING in X.java (at line 3)\n" +
17918 				"	Integer foo(A<Integer> a) { return null; }\n" +
17919 				"	        ^^^^^^^^^^^^^^^^^\n" +
17920 				"Erasure of method foo(A<Integer>) is the same as another method in type X\n" +
17921 				"----------\n":
17922 					"----------\n" +
17923 					"1. ERROR in X.java (at line 2)\n" +
17924 					"	Number foo(A<String> a) { return null; }\n" +
17925 					"	       ^^^^^^^^^^^^^^^^\n" +
17926 					"Erasure of method foo(A<String>) is the same as another method in type X\n" +
17927 					"----------\n" +
17928 					"2. ERROR in X.java (at line 3)\n" +
17929 					"	Integer foo(A<Integer> a) { return null; }\n" +
17930 					"	        ^^^^^^^^^^^^^^^^^\n" +
17931 					"Erasure of method foo(A<Integer>) is the same as another method in type X\n" +
17932 					"----------\n" +
17933 					"3. ERROR in X.java (at line 4)\n" +
17934 					"	void test(A<Integer> a) { foo(a); }\n" +
17935 					"	                          ^^^\n" +
17936 					"The method foo(A<String>) in the type X is not applicable for the arguments (A<Integer>)\n" +
17937 					"----------\n";
17938 		this.runNegativeTest(
17939 			new String[] {
17940 				"X.java",
17941 				"public class X {\n" +
17942 				"	Number foo(A<String> a) { return null; }\n" +
17943 				"	Integer foo(A<Integer> a) { return null; }\n" +
17944 				"	void test(A<Integer> a) { foo(a); }\n" +
17945 				"}\n" +
17946 				"class A<T> {}\n",
17947 			},
17948 			expectedCompilerLog2
17949 /* javac 7
17950 X.java:3: name clash: foo(A<Integer>) and foo(A<String>) have the same erasure
17951         Integer foo(A<Integer> a) { return null; }
17952                 ^
17953 X.java:4: method foo in class X cannot be applied to given types
17954         void test(A<Integer> a) { foo(a); }
17955                                   ^
17956   required: A<String>
17957   found: A<Integer>
17958 2 errors
17959  */
17960 		);
17961 	}
17962 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=87550
17963 	public void test0562() {
17964 		this.runConformTest(
17965 			new String[] {
17966 				"X.java",
17967 				"import java.util.*;\n" +
17968 				"interface Inter<A, B> {}\n" +
17969 				"public class X<T, U, V extends X<T, U, V>> extends ArrayList<V> implements Inter<T, U> {\n" +
17970 				"	public final void foo(U u) {\n" +
17971 				"		X.bar(this, u);\n" +
17972 				"	}\n" +
17973 				"	public static final <P, Q> void bar(Collection<? extends Inter<P, Q>> c, Q q) {}\n" +
17974 				"}\n",
17975 			},
17976 			"");
17977 	}
17978 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=87550 - variation
17979 	public void test0563() {
17980 		this.runConformTest(
17981 			new String[] {
17982 				"X.java",
17983 				"import java.util.*;\n" +
17984 				"interface Inter<A, B> {}\n" +
17985 				"public class X<T, U, V extends X<T, U, V>> extends ArrayList<V> implements Inter<T, U> {\n" +
17986 				"	public final void foo(U u) {\n" +
17987 				"		X.bar(this, u);\n" +
17988 				"	}\n" +
17989 				"	public static final <P, Q, R> void bar(Collection<R> c, Q q) {}\n" +
17990 				"}\n",
17991 			},
17992 			"");
17993 	}
17994 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=87550 - variation
17995 	// Awaiting clarification on http://mail.openjdk.java.net/pipermail/lambda-spec-experts/2013-November/000428.html
17996 	public void test0564() {
17997 		this.runConformTest(
17998 			new String[] {
17999 				"X.java",
18000 				"import java.util.*;\n" +
18001 				"interface Inter<A, B> {}\n" +
18002 				"public class X<T, U, V extends X<T, U, V>> extends ArrayList<V> implements Inter<T, U> {\n" +
18003 				"	public final void foo(U u) {\n" +
18004 				"		X.bar(this, u);\n" +
18005 				"	}\n" +
18006 				"	public static final <P, Q> void bar(Collection<? extends Inter<P, Q>> c, Q q) {}\n" +
18007 				"}\n",
18008 			},
18009 			"");
18010 	}
18011 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=87995	- check no warning
18012 	public void test0565() {
18013 		this.runNegativeTest(
18014 			new String[] {
18015 				"X.java",
18016 				"public class X {\n" +
18017 				"interface IFoo<T> {\n" +
18018 				"    public T get(Class<T> clazz);\n" +
18019 				"   Zork z;\n" +
18020 				"}\n" +
18021 				"\n" +
18022 				"class Bar implements IFoo<Integer> {\n" +
18023 				"    public Integer get(Class<Integer> arg0) {\n" +
18024 				"        return Integer.valueOf(3);\n" +
18025 				"    }\n" +
18026 				"}\n" +
18027 				"}\n",
18028 			},
18029 			"----------\n" +
18030 			"1. ERROR in X.java (at line 4)\n" +
18031 			"	Zork z;\n" +
18032 			"	^^^^\n" +
18033 			"Zork cannot be resolved to a type\n" +
18034 			"----------\n");
18035 	}
18036 	public void test0566() {
18037 		String xSource =
18038 				"import java.util.*;\n" +
18039 				"\n" +
18040 				"public class X {\n" +
18041 				"\n" +
18042 				"	void bar2() {\n" +
18043 				"		List<X1> le = new ArrayList<X1>(5);\n" +
18044 				"		le = fill(le, new X2());\n" +
18045 				"	}\n" +
18046 				"	<T> List<T> fill(List<? super T> lt, T t) { return null; }\n" +
18047 				"}\n" +
18048 				"class X1 {}\n" +
18049 				"class X2 extends X1 {\n" +
18050 				"	void foo(){}\n" +
18051 				"}\n";
18052 		if (this.complianceLevel < ClassFileConstants.JDK1_8) {
18053 			this.runNegativeTest(
18054 				new String[] {
18055 					"X.java",
18056 					xSource,
18057 				},
18058 				"----------\n" +
18059 				"1. ERROR in X.java (at line 7)\n" +
18060 				"	le = fill(le, new X2());\n" +
18061 				"	     ^^^^^^^^^^^^^^^^^^\n" +
18062 				"Type mismatch: cannot convert from List<X2> to List<X1>\n" +
18063 				"----------\n");
18064 		} else {
18065 			runConformTest(new String[]{ "X.java", xSource });
18066 		}
18067 	}
18068 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=89454
18069 	public void test0567() {
18070 		this.runConformTest(
18071 			new String[] {
18072 				"Thrower.java",
18073 				"public interface Thrower<E extends Exception> {\n" +
18074 				"    public void throwIt() throws E;\n" +
18075 				"}\n",
18076 			},
18077 			"");
18078 		this.runConformTest(
18079 			new String[] {
18080 				"GenericsTest.java",
18081 				"public class GenericsTest {\n" +
18082 				"    public static void main(String[] args) throws MyException {\n" +
18083 				"        Thrower<MyException> thrower = new Thrower<MyException>() {\n" +
18084 				"            public void throwIt() throws MyException {\n" +
18085 				"                throw new MyException();\n" +
18086 				"            }\n" +
18087 				"        };\n" +
18088 				"        try {\n" +
18089 				"           thrower.throwIt();\n" +
18090 				"        } catch(Exception e) {\n" +
18091 				"          System.out.println(\"SUCCESS\");\n" +
18092 				"        }\n" +
18093 				"    }\n" +
18094 				"}\n" +
18095 				"class MyException extends Exception {\n" +
18096 				"}\n",
18097 			},
18098 			"SUCCESS",
18099 			null,
18100 			false,
18101 			null);
18102 	}
18103 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=89448
18104 	public void test0568() {
18105 		this.runConformTest(
18106 			new String[] {
18107 				"X.java",
18108 				"import java.util.ArrayList;\n" +
18109 				"import java.util.List;\n" +
18110 				"\n" +
18111 				"public class X {\n" +
18112 				"\n" +
18113 				"    public static void main(String[] args) {\n" +
18114 				"\n" +
18115 				"        ArrayList<ArrayList<Long>> n = new ArrayList<ArrayList<Long>>();\n" +
18116 				"        ArrayList<Long> arr = new ArrayList<Long>();\n" +
18117 				"        arr.add(new Long(5));\n" +
18118 				"        n.add(arr);\n" +
18119 				"        \n" +
18120 				"        List<? extends List<Long>> m = n; // Whoa!\n" +
18121 				"        \n" +
18122 				"        for(Long l : m.get(0)) {\n" +
18123 				"            System.out.println(l);\n" +
18124 				"        }\n" +
18125 				"    }\n" +
18126 				"\n" +
18127 				"}\n",
18128 			},
18129 			"5");
18130 	}
18131 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=89778
18132 	public void test0569() {
18133 		this.runNegativeTest(
18134 			new String[] {
18135 				"X.java",
18136 				"public class X\n" +
18137 				"{\n" +
18138 				"    protected static <T extends Exception> void foo() throws T, Exce {\n" +
18139 				"    }\n" +
18140 				"}\n",
18141 			},
18142 			"----------\n" +
18143 			"1. ERROR in X.java (at line 3)\n" +
18144 			"	protected static <T extends Exception> void foo() throws T, Exce {\n" +
18145 			"	                                                            ^^^^\n" +
18146 			"Exce cannot be resolved to a type\n" +
18147 			"----------\n");
18148 	}
18149 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=90147
18150 	public void test0570() {
18151 		this.runNegativeTest(
18152 			new String[] {
18153 				"X.java",
18154 				"public class X<T extends Object> {\n" +
18155 				"  public class InnerClass implements Comparable<T> {\n" +
18156 				"    public int compareTo(T other) {\n" +
18157 				"      return -1;\n" +
18158 				"    }\n" +
18159 				"  }\n" +
18160 				"  \n" +
18161 				"  public void foo() {\n" +
18162 				"    InnerClass a = new InnerClass();\n" +
18163 				"    InnerClass b = new InnerClass();\n" +
18164 				"    // The following line does not compile (anymore):\n" +
18165 				"    a.compareTo(b);\n" +
18166 				"  }\n" +
18167 				"}\n",
18168 			},
18169 			"----------\n" +
18170 			"1. ERROR in X.java (at line 12)\n" +
18171 			"	a.compareTo(b);\n" +
18172 			"	  ^^^^^^^^^\n" +
18173 			"The method compareTo(T) in the type X<T>.InnerClass is not applicable for the arguments (X<T>.InnerClass)\n" +
18174 			"----------\n");
18175 	}
18176 	public void test0571() {
18177 		runConformTest(
18178 			// test directory preparation
18179 			true /* flush output directory */,
18180 			new String[] { /* test files */
18181 				"X.java",
18182 				"interface IFoo {\n" +
18183 				"	void foo();\n" +
18184 				"}\n" +
18185 				"class Box<T extends IFoo> {\n" +
18186 				"	T value() {\n" +
18187 				"		return null;\n" +
18188 				"	}\n" +
18189 				"}\n" +
18190 				"\n" +
18191 				"interface IBar {\n" +
18192 				"	void bar();\n" +
18193 				"}\n" +
18194 				"\n" +
18195 				"public class X {\n" +
18196 				"	void test01(Box<?> box) {\n" +
18197 				"		box.value().foo();\n" +
18198 				"	}\n" +
18199 				"	void test02(Box<? extends IBar> box) {\n" +
18200 				"		box.value().foo();\n" +
18201 				"		box.value().bar();\n" +
18202 				"	}\n" +
18203 				"	public static void main(String[] args) {\n" +
18204 				"		System.out.println(\"SUCCESS\");\n" +
18205 				"	}\n" +
18206 				"}\n",
18207 			},
18208 			// compiler options
18209 			null /* no class libraries */,
18210 			null /* no custom options */,
18211 			// compiler results
18212 			null /* do not check compiler log */,
18213 			// runtime results
18214 			"SUCCESS" /* expected output string */,
18215 			null /* do not check error string */,
18216 			// javac options
18217 			JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
18218 	}
18219 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90430
18220 	// SHOULD FAIL AT 1.8 (18.2.3): The method doWithEnumClass(Class<T>) in the type X is not applicable for the arguments (Class<Enum>)
18221 	public void test0572() {
18222 		this.runConformTest(
18223 			new String[] {
18224 				"X.java",
18225 				"public class X {\n" +
18226 				"	public <T extends Enum<T>> void doWithEnumClass(Class<T> enumClass) {\n" +
18227 				"	}\n" +
18228 				"\n" +
18229 				"	public void f() {\n" +
18230 				"		Class<?> cl = null; // Returned by Class.forName(\"xyz\");\n" +
18231 				"		doWithEnumClass((Class<Enum>) cl);\n" +
18232 				"	}\n" +
18233 			"}\n",
18234 			},
18235 			"");
18236 	}
18237 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90430 - check unchecked warnings
18238 	// SHOULD FAIL AT 1.8 (18.2.3): The method doWithEnumClass(Class<T>) in the type X is not applicable for the arguments (Class<Enum>)
18239 	public void test0573() {
18240 		this.runNegativeTest(
18241 			new String[] {
18242 				"X.java",
18243 				"public class X {\n" +
18244 				"	public <T extends Enum<T>> void doWithEnumClass(Class<T> enumClass) {\n" +
18245 				"		Zork z;\n" +
18246 				"	}\n" +
18247 				"\n" +
18248 				"	public void f() {\n" +
18249 				"		Class<?> cl = null; // Returned by Class.forName(\"xyz\");\n" +
18250 				"		doWithEnumClass((Class<Enum>) cl);\n" +
18251 				"	}\n" +
18252 			"}\n",
18253 			},
18254 			"----------\n" +
18255 			"1. ERROR in X.java (at line 3)\n" +
18256 			"	Zork z;\n" +
18257 			"	^^^^\n" +
18258 			"Zork cannot be resolved to a type\n" +
18259 			"----------\n" +
18260 			"2. WARNING in X.java (at line 8)\n" +
18261 			"	doWithEnumClass((Class<Enum>) cl);\n" +
18262 			"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
18263 			"Type safety: Unchecked invocation doWithEnumClass(Class<Enum>) of the generic method doWithEnumClass(Class<T>) of type X\n" +
18264 			"----------\n" +
18265 			"3. WARNING in X.java (at line 8)\n" +
18266 			"	doWithEnumClass((Class<Enum>) cl);\n" +
18267 			"	                ^^^^^^^^^^^^^^^^\n" +
18268 			"Type safety: Unchecked cast from Class<capture#1-of ?> to Class<Enum>\n" +
18269 			"----------\n" +
18270 			"4. WARNING in X.java (at line 8)\n" +
18271 			"	doWithEnumClass((Class<Enum>) cl);\n" +
18272 			"	                       ^^^^\n" +
18273 			"Enum is a raw type. References to generic type Enum<E> should be parameterized\n" +
18274 			"----------\n");
18275 	}
18276 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90423 - variation
18277 	public void test0574() {
18278 		// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950
18279 		String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
18280 				"----------\n" +
18281 				"1. WARNING in X.java (at line 6)\n" +
18282 				"	<T extends Integer> T foo(Object o) {  return null; } // ok\n" +
18283 				"	           ^^^^^^^\n" +
18284 				"The type parameter T should not be bounded by the final type Integer. Final types cannot be further extended\n" +
18285 				"----------\n" +
18286 				"2. WARNING in X.java (at line 6)\n" +
18287 				"	<T extends Integer> T foo(Object o) {  return null; } // ok\n" +
18288 				"	                      ^^^^^^^^^^^^^\n" +
18289 				"Duplicate method foo(Object) in type X.C2\n" +
18290 				"----------\n" +
18291 				"3. WARNING in X.java (at line 7)\n" +
18292 				"	<T extends String> T foo(Object o) {  return null; } // ok\n" +
18293 				"	           ^^^^^^\n" +
18294 				"The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
18295 				"----------\n" +
18296 				"4. WARNING in X.java (at line 7)\n" +
18297 				"	<T extends String> T foo(Object o) {  return null; } // ok\n" +
18298 				"	                     ^^^^^^^^^^^^^\n" +
18299 				"Duplicate method foo(Object) in type X.C2\n" +
18300 				"----------\n" +
18301 				"5. ERROR in X.java (at line 10)\n" +
18302 				"	new X().new C2().foo((List<String>) null);\n" +
18303 				"	                 ^^^\n" +
18304 				"The method foo(Object) is ambiguous for the type X.C2\n" +
18305 				"----------\n":
18306 					"----------\n" +
18307 					"1. WARNING in X.java (at line 6)\n" +
18308 					"	<T extends Integer> T foo(Object o) {  return null; } // ok\n" +
18309 					"	           ^^^^^^^\n" +
18310 					"The type parameter T should not be bounded by the final type Integer. Final types cannot be further extended\n" +
18311 					"----------\n" +
18312 					"2. ERROR in X.java (at line 6)\n" +
18313 					"	<T extends Integer> T foo(Object o) {  return null; } // ok\n" +
18314 					"	                      ^^^^^^^^^^^^^\n" +
18315 					"Duplicate method foo(Object) in type X.C2\n" +
18316 					"----------\n" +
18317 					"3. WARNING in X.java (at line 7)\n" +
18318 					"	<T extends String> T foo(Object o) {  return null; } // ok\n" +
18319 					"	           ^^^^^^\n" +
18320 					"The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
18321 					"----------\n" +
18322 					"4. ERROR in X.java (at line 7)\n" +
18323 					"	<T extends String> T foo(Object o) {  return null; } // ok\n" +
18324 					"	                     ^^^^^^^^^^^^^\n" +
18325 					"Duplicate method foo(Object) in type X.C2\n" +
18326 					"----------\n";
18327 		this.runNegativeTest(
18328 			new String[] {
18329 				"X.java",
18330 				"import java.util.List;\n" +
18331 				"\n" +
18332 				"public class X {\n" +
18333 				"\n" +
18334 				"	class C2 {\n" +
18335 				"		<T extends Integer> T foo(Object o) {  return null; } // ok\n" +
18336 				"		<T extends String> T foo(Object o) {  return null; } // ok\n" +
18337 				"	}\n" +
18338 				"	public static void main(String[] args) {\n" +
18339 				"		new X().new C2().foo((List<String>) null);\n" +
18340 				"	}\n" +
18341 				"}\n"
18342 			},
18343 			expectedCompilerLog
18344 		);
18345 /*
18346 X.java:6: name clash: <T#1>foo(Object) and <T#2>foo(Object) have the same erasure
18347                 <T extends String> T foo(Object o) {  return null; } // ok
18348                                      ^
18349   where T#1,T#2 are type-variables:
18350     T#1 extends String declared in method <T#1>foo(Object)
18351     T#2 extends Integer declared in method <T#2>foo(Object)
18352 1 error
18353  */
18354 	}
18355 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=84496 - variation with field ref
18356 	public void test0575() {
18357 		this.runNegativeTest(
18358 			new String[] {
18359 				"X.java",
18360 				"public class X {\n" +
18361 				"    public static void main(String[] args) {\n" +
18362 				"        Foo<?> f1 = new Foo<Integer>();\n" +
18363 				"        (f1).bar = (f1).bar;\n" +
18364 				"    }\n" +
18365 				"    static class Foo<T> {\n" +
18366 				"       Bar<T> bar = new Bar<T>();\n" +
18367 				"    }\n" +
18368 				"    static class Bar<T> {\n" +
18369 				"        T t;\n" +
18370 				"    }\n" +
18371 				"}\n"
18372 			},
18373 			"----------\n" +
18374 			"1. ERROR in X.java (at line 4)\n" +
18375 			"	(f1).bar = (f1).bar;\n" +
18376 			"	           ^^^^^^^^\n" +
18377 			"Type mismatch: cannot convert from X.Bar<capture#2-of ?> to X.Bar<capture#1-of ?>\n" +
18378 			"----------\n");
18379 	}
18380 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=84496 - variation with single ref
18381 	public void test0576() {
18382 		this.runConformTest(
18383 			new String[] {
18384 				"X.java",
18385 				"public class X {\n" +
18386 				"    public static void main(String[] args) {\n" +
18387 				"        Foo<?> f1 = new Foo<Integer>();\n" +
18388 				"        Foo<?> f2 = new Foo<String>();\n" +
18389 				"		f1 = f1;\n" +
18390 				"		f1 = f2;\n" +
18391 				"    }\n" +
18392 				"    static class Foo<T> {\n" +
18393 				"    }\n" +
18394 				"}\n"
18395 			},
18396 			"");
18397 	}
18398 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=84496 - variation with qualified name ref
18399 	public void test0577() {
18400 		this.runNegativeTest(
18401 			new String[] {
18402 				"X.java",
18403 				"public class X {\n" +
18404 				"    public static void main(String[] args) {\n" +
18405 				"        Foo<?> f1 = new Foo<Integer>();\n" +
18406 				"        (f1).bar = f1.bar;\n" +
18407 				"    }\n" +
18408 				"    static class Foo<T> {\n" +
18409 				"       Bar<T> bar = new Bar<T>();\n" +
18410 				"    }\n" +
18411 				"    static class Bar<T> {\n" +
18412 				"        T t;\n" +
18413 				"    }\n" +
18414 				"}\n"
18415 			},
18416 			"----------\n" +
18417 			"1. ERROR in X.java (at line 4)\n" +
18418 			"	(f1).bar = f1.bar;\n" +
18419 			"	           ^^^^^^\n" +
18420 			"Type mismatch: cannot convert from X.Bar<capture#2-of ?> to X.Bar<capture#1-of ?>\n" +
18421 			"----------\n");
18422 	}
18423 	// check array bound for wildcard
18424 	public void test0578() {
18425 		this.runConformTest(
18426 			new String[] {
18427 				"X.java",
18428 				"public class X {\n" +
18429 				"	void foo(Box<? extends int[]> box) {\n" +
18430 				"		int[] ints = box.get();\n" +
18431 				"	}\n" +
18432 				"}\n" +
18433 				"class Box<T> {\n" +
18434 				"	T get() { return null; }\n" +
18435 				"}\n"
18436 			},
18437 			"");
18438 	}
18439 	// check array bound for wildcard
18440 	public void test0579() {
18441 		this.runNegativeTest(
18442 			new String[] {
18443 				"X.java",
18444 				"public class X {\n" +
18445 				"	void foo(Box<? super int[]> box) {\n" +
18446 				"		int[] ints = box.get();\n" +
18447 				"	}\n" +
18448 				"}\n" +
18449 				"class Box<T> {\n" +
18450 				"	T get() { return null; }\n" +
18451 				"}\n"
18452 			},
18453 			"----------\n" +
18454 			"1. ERROR in X.java (at line 3)\n" +
18455 			"	int[] ints = box.get();\n" +
18456 			"	             ^^^^^^^^^\n" +
18457 			"Type mismatch: cannot convert from capture#1-of ? super int[] to int[]\n" +
18458 			"----------\n");
18459 	}
18460 	// check array bound for wildcard
18461 	public void test0580() {
18462 		this.runNegativeTest(
18463 			new String[] {
18464 				"X.java",
18465 				"public class X {\n" +
18466 				"	void foo(Box<?> box) {\n" +
18467 				"		int[] ints = box.get();\n" +
18468 				"	}\n" +
18469 				"}\n" +
18470 				"class Box<T> {\n" +
18471 				"	T get() { return null; }\n" +
18472 				"}\n"
18473 			},
18474 			"----------\n" +
18475 			"1. ERROR in X.java (at line 3)\n" +
18476 			"	int[] ints = box.get();\n" +
18477 			"	             ^^^^^^^^^\n" +
18478 			"Type mismatch: cannot convert from capture#1-of ? to int[]\n" +
18479 			"----------\n");
18480 	}
18481 
18482 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84496 - variation
18483 	public void test0581() {
18484 	    this.runNegativeTest(
18485 			new String[] {
18486 	            "X.java",
18487 	            "class X {" +
18488 	            "  public static void main(String[] args) {\n" +
18489 	            "    Foo<?> f1 = new Foo<Integer>();\n" +
18490 	            "    f1.bar = f1.bar;\n" +
18491 	            "   }\n" +
18492 	            " }\n" +
18493 	            "class Foo<T> {\n" +
18494 	            "  Bar<T> bar = new Bar<T>();\n" +
18495 	            "}\n" +
18496 	            "class Bar<T> {\n" +
18497 	            "  T t;\n" +
18498 	            "}\n"
18499 	   		},
18500 			"----------\n" +
18501 			"1. ERROR in X.java (at line 3)\n" +
18502 			"	f1.bar = f1.bar;\n" +
18503 			"	         ^^^^^^\n" +
18504 			"Type mismatch: cannot convert from Bar<capture#2-of ?> to Bar<capture#1-of ?>\n" +
18505 			"----------\n");
18506 	}
18507 
18508 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84496
18509 	public void test0582() {
18510 	    this.runConformTest(
18511             new String[] {
18512                 "X.java",
18513                 "import java.util.List;\n" +
18514                 "class X {\n" +
18515                 "  void foo(List<? extends I1> l1) {\n" +
18516                 "    C1 c1 = (C1)l1.get(0);\n" +
18517                 "  }\n" +
18518                 "}\n" +
18519                 "interface I1{}\n" +
18520                 "class C1{}\n"
18521             },
18522             "");
18523 	}
18524 
18525 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=91021
18526 	public void test0583() {
18527 	    this.runNegativeTest(
18528             new String[] {
18529                 "X.java",
18530 				"class D<U> {\n" +
18531 				"		 public D (D<U> anotherD) {\n" +
18532 				"		 }\n" +
18533 				"}\n" +
18534 				"\n" +
18535 				"public class X<S> {\n" +
18536 				"		 public static class C<T> {\n" +
18537 				"		 		 public C(C<T> anotherC) {\n" +
18538 				"		 		 }\n" +
18539 				"		 }\n" +
18540 				"\n" +
18541 				"		 public void mD(D<S> d) {\n" +
18542 				"		 		 //the following line is OK (no warning reported)\n" +
18543 				"		 		 new D<S>(d);\n" +
18544 				"		 }\n" +
18545 				"		 \n" +
18546 				"		 public void mC(C<S> c) {\n" +
18547 				"		 		 /* type safety warning\n" +
18548 				"		 		  * (The expression of type X.C<S>\n" +
18549 				"		 		  * needs unchecked conversion to conform to\n" +
18550 				"		 		  * XSB<S>.C<S>)\n" +
18551 				"		 		  */\n" +
18552 				"		 		 new C<S>(c);\n" +
18553 				"		 }\n" +
18554 				"		Zork z;\n" +
18555 				"}\n"
18556             },
18557 			"----------\n" +
18558 			"1. ERROR in X.java (at line 25)\n" +
18559 			"	Zork z;\n" +
18560 			"	^^^^\n" +
18561 			"Zork cannot be resolved to a type\n" +
18562 			"----------\n");
18563 	}
18564 
18565 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=91017
18566 	public void test0584() {
18567 	    this.runNegativeTest(
18568             new String[] {
18569                 "X.java",
18570 				"import java.util.ArrayList;\n" +
18571 				"import java.util.List;\n" +
18572 				"\n" +
18573 				"public class X {\n" +
18574 				"		 public static void main(String[] args) {\n" +
18575 				"		 		 List<String> stringList = new ArrayList<String>();\n" +
18576 				"		 		 stringList.add(\"foo\");\n" +
18577 				"		 		 List<Integer> intList = new ArrayList<Integer>();\n" +
18578 				"		 		 intList.add(1);\n" +
18579 				"\n" +
18580 				"		 		 List<?> untypedList = stringList;\n" +
18581 				"		 		 List<?> untypedList2 = intList;\n" +
18582 				"\n" +
18583 				"		 		 //correctly flagged as error: untypedList.add(new Object());\n" +
18584 				"		 		 //ditto: untypedList.add(untypedList2.get(0));\n" +
18585 				"\n" +
18586 				"		 		 //but this is not flagged at all by eclipse:\n" +
18587 				"		 		 untypedList.addAll(untypedList2);\n" +
18588 				"\n" +
18589 				"		 		 for(String s : stringList){\n" +
18590 				"		 		 		 //next line generates runtime ClassCastException\n" +
18591 				"		 		 		 Logger.log(\"Test_Lists.main: s: \" + s);\n" +
18592 				"		 		 }\n" +
18593 				"		 }\n" +
18594 				"}\n"
18595             },
18596     		"----------\n" +
18597     		"1. ERROR in X.java (at line 18)\n" +
18598     		"	untypedList.addAll(untypedList2);\n" +
18599     		"	            ^^^^^^\n" +
18600     		"The method addAll(Collection<? extends capture#1-of ?>) in the type List<capture#1-of ?> is not applicable for the arguments (List<capture#2-of ?>)\n" +
18601     		"----------\n" +
18602     		"2. ERROR in X.java (at line 22)\n" +
18603     		"	Logger.log(\"Test_Lists.main: s: \" + s);\n" +
18604     		"	^^^^^^\n" +
18605     		"Logger cannot be resolved\n" +
18606     		"----------\n");
18607 	}
18608 
18609 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=90881
18610 	public void test0585() {
18611 	    this.runNegativeTest(
18612             new String[] {
18613                 "X.java",
18614 				"import java.util.*;\n" +
18615 				"\n" +
18616 				"public class X {\n" +
18617 				"        public static void main(String[] args) {\n" +
18618 				"                Outer.Comparator<String> i = new Outer.Comparator<String>() {\n" +
18619 				"\n" +
18620 				"                        public boolean equals(String a, String b) {\n" +
18621 				"                                return false;\n" +
18622 				"                        }\n" +
18623 				"\n" +
18624 				"                        public int hashCode(String a) {\n" +
18625 				"                                return 0;\n" +
18626 				"                        }\n" +
18627 				"                };\n" +
18628 				"\n" +
18629 				"        }\n" +
18630 				"}\n" +
18631 				"\n" +
18632 				"class Outer {}\n",
18633             },
18634 			"----------\n" +
18635 			"1. ERROR in X.java (at line 5)\n" +
18636 			"	Outer.Comparator<String> i = new Outer.Comparator<String>() {\n" +
18637 			"	^^^^^^^^^^^^^^^^\n" +
18638 			"Outer.Comparator cannot be resolved to a type\n" +
18639 			"----------\n" +
18640 			"2. ERROR in X.java (at line 5)\n" +
18641 			"	Outer.Comparator<String> i = new Outer.Comparator<String>() {\n" +
18642 			"	                                 ^^^^^^^^^^^^^^^^\n" +
18643 			"Outer.Comparator cannot be resolved to a type\n" +
18644 			"----------\n");
18645 	}
18646 
18647 	// **
18648 	// note: the test does not show the needed unchecked warning, since it is
18649 	//       a conform test
18650 	public void test0586() {
18651 	    this.runConformTest(
18652             new String[] {
18653                 "X.java",
18654 				"public class X {\n" +
18655 				"    static class BB<T, S> { }\n" +
18656 				"    static class BD<T> extends BB<T, T> { }\n" +
18657 				"    void f() {\n" +
18658 				"        BB<? extends Number, ? super Integer> bb = null;\n" +
18659 				"        Object o = (BD<Number>) bb;\n" +
18660 				"    }\n" +
18661 				"}\n",
18662             },
18663 			"");
18664 	}
18665 
18666 	public void test0587() {
18667 	    this.runConformTest(
18668             new String[] {
18669                 "X.java",
18670 				"interface DA<T> {\n" +
18671 				"}\n" +
18672 				"interface DB<T> extends DA<T> {\n" +
18673 				"}\n" +
18674 				"interface DC<T> extends DA<Integer> {\n" +
18675 				"}\n" +
18676 				"\n" +
18677 				"public class X {\n" +
18678 				"	Object o = (DC<?>) (DA<?>) null;\n" +
18679 				"}\n",
18680             },
18681 			"");
18682 	}
18683 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=90433
18684 	// **
18685 	public void test0588() {
18686 	    this.runNegativeTest(
18687             new String[] {
18688                 "X.java",
18689     			"public class X<S extends Comparable<S>> {\n" +
18690     			"	public void f() {\n" +
18691     			"		Class<? extends Comparable<?>> cc = Long.class;\n" +
18692     			"		Class<S> currentClass = null;\n" +
18693     			"		boolean b = currentClass == Long.class;\n" +
18694     			"		boolean c = X.class == Long.class;\n" +
18695     			"    }\n" +
18696     			"}\n",
18697             },
18698     		"----------\n" +
18699     		"1. ERROR in X.java (at line 6)\n" +
18700     		"	boolean c = X.class == Long.class;\n" +
18701     		"	            ^^^^^^^^^^^^^^^^^^^^^\n" +
18702     		"Incompatible operand types Class<X> and Class<Long>\n" +
18703     		"----------\n");
18704 	}
18705 
18706 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=85281
18707 	public void test0589() {
18708 	    this.runNegativeTest(
18709             new String[] {
18710                 "X.java",
18711 				"import java.util.ArrayList;\n" +
18712 				"import java.util.List;\n" +
18713 				"\n" +
18714 				"public class X {\n" +
18715 				"\n" +
18716 				"	void addAll(List<? extends Number> target, List<? extends Number> source) {\n" +
18717 				"		target.addAll(source);\n" +
18718 				"	}\n" +
18719 				"\n" +
18720 				"	public static void main(String... args) {\n" +
18721 				"		List<Integer> ints = new ArrayList<Integer>();\n" +
18722 				"		ints.add(3);\n" +
18723 				"\n" +
18724 				"		List<Float> floats = new ArrayList<Float>();\n" +
18725 				"		floats.add(3f);\n" +
18726 				"\n" +
18727 				"		new X().addAll(ints, floats);\n" +
18728 				"\n" +
18729 				"		for (Integer integer : ints) {\n" +
18730 				"			System.out.println(integer.intValue());\n" +
18731 				"		}\n" +
18732 				"	}\n" +
18733 				"}\n",
18734             },
18735     		"----------\n" +
18736     		"1. ERROR in X.java (at line 7)\n" +
18737     		"	target.addAll(source);\n" +
18738     		"	       ^^^^^^\n" +
18739     		"The method addAll(Collection<? extends capture#1-of ? extends Number>) in the type List<capture#1-of ? extends Number> is not applicable for the arguments (List<capture#2-of ? extends Number>)\n" +
18740     		"----------\n");
18741 	}
18742 
18743 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=85281 - variation
18744 	public void test0590() {
18745 	    this.runNegativeTest(
18746             new String[] {
18747                 "X.java",
18748 				"import java.util.ArrayList;\n" +
18749 				"import java.util.List;\n" +
18750 				"\n" +
18751 				"public class X {\n" +
18752 				"\n" +
18753 				"	void assignAll(Class<? super Number> sup, Class<? extends Number> ext) {\n" +
18754 				"		Class<? super Number> superSup = sup.getSuperclass();\n" +
18755 				"		Class<?> superExt = ext.getSuperclass();\n" +
18756 				"		Class<? super Number> superSup2 = ext.getSuperclass();\n" +
18757 				"	}	\n" +
18758 				"}\n",
18759             },
18760     		"----------\n" +
18761     		"1. ERROR in X.java (at line 9)\n" +
18762     		"	Class<? super Number> superSup2 = ext.getSuperclass();\n" +
18763     		"	                                  ^^^^^^^^^^^^^^^^^^^\n" +
18764     		"Type mismatch: cannot convert from Class<capture#6-of ? super capture#5-of ? extends Number> to Class<? super Number>\n" +
18765     		"----------\n");
18766 	}
18767 
18768 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=85281 - variation
18769 	public void test0591() {
18770 	    this.runConformTest(
18771             new String[] {
18772                 "X.java",
18773 				"public class X<U> {\n" +
18774 				"\n" +
18775 				"	public Values<U> foo(Box<? extends U> box) {\n" +
18776 				"		return selectedValues(box.getValues());\n" +
18777 				"	}\n" +
18778 				"	public static <G> Values<G> selectedValues(Values<? extends G> v) {\n" +
18779 				"		return null;\n" +
18780 				"	}\n" +
18781 				"}\n" +
18782 				"\n" +
18783 				"abstract class Box<V> {\n" +
18784 				"	  abstract Values<V> getValues();\n" +
18785 				"}\n" +
18786 				"abstract class Values<T> {\n" +
18787 				"}\n",
18788             },
18789 			"");
18790 	}
18791 	public void test0592() {
18792 	    this.runConformTest(
18793             new String[] {
18794                 "X.java",
18795 				"import java.util.*;\n" +
18796 				"public class X {\n" +
18797 				"    List<?> l;\n" +
18798 				"    void m() {\n" +
18799 				"	m2(l);\n" +
18800 				"    }\n" +
18801 				"    <T> void m2(List<T> l2) {\n" +
18802 				"	l2.add(l2.remove(0));\n" +
18803 				"    }\n" +
18804 				"}\n",
18805             },
18806 			"");
18807 	}
18808 	public void test0593() {
18809 		Map options = getCompilerOptions();
18810 		options.put(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION, JavaCore.IGNORE);
18811 	    String xSource =
18812 				"import java.util.*;\n" +
18813 				"public class X {\n" +
18814 				"	    List<Class<?>> classes1 = Arrays.asList(String.class, Boolean.class);\n" +
18815 				"	    List<? extends Class<?>> classes2 = Arrays.asList(String.class, Boolean.class);\n" +
18816 				"}\n";
18817 	    if (this.complianceLevel < ClassFileConstants.JDK1_8) {
18818 	    	this.runNegativeTest(
18819     			new String[] {
18820     				"X.java",
18821     				xSource,
18822     			},
18823     			"----------\n" +
18824 				"1. ERROR in X.java (at line 3)\n" +
18825 				"	List<Class<?>> classes1 = Arrays.asList(String.class, Boolean.class);\n" +
18826 				"	                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
18827 				"Type mismatch: cannot convert from List<Class<? extends Object&Serializable&Comparable<?>>> to List<Class<?>>\n" +
18828 				"----------\n",
18829 				null,
18830 				true,
18831 				options);
18832 	    } else {
18833 	    	runConformTest(new String[] { "X.java", xSource }, options);
18834 	    }
18835 	}
18836 	public void test0594() {
18837 	    this.runNegativeTest(
18838             new String[] {
18839                 "X.java",
18840 				" import java.util.*;\n" +
18841 				"import static java.util.Map.*;\n" +
18842 				"\n" +
18843 				"abstract class MyIterator<E> implements Iterator<E> {\n" +
18844 				"	Set<E> iteratedSet;\n" +
18845 				"}\n" +
18846 				"public class X {\n" +
18847 				"	\n" +
18848 				"	void foo() {\n" +
18849 				"		Map<String, ?> map;\n" +
18850 				"		Iterator<Entry<String, ?>> it = map.entrySet().iterator();\n" +
18851 				"\n" +
18852 				"		Entry<String, Number> unrelatedEntry;\n" +
18853 				"		MyIterator<Entry<String, ?>> mit = (MyIterator<Entry<String, ?>>) it;\n" +
18854 				"		mit.iteratedSet.add(unrelatedEntry);\n" +
18855 				"	}\n" +
18856 				"}\n",
18857             },
18858     		"----------\n" +
18859     		"1. ERROR in X.java (at line 11)\n" +
18860     		"	Iterator<Entry<String, ?>> it = map.entrySet().iterator();\n" +
18861     		"	                                ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
18862     		"Type mismatch: cannot convert from Iterator<Map.Entry<String,capture#1-of ?>> to Iterator<Map.Entry<String,?>>\n" +
18863     		"----------\n");
18864 	}
18865 	public void test0595() {
18866 	    this.runNegativeTest(
18867             new String[] {
18868                 "X.java",
18869 				" import java.util.*;\n" +
18870 				"import static java.util.Map.*;\n" +
18871 				"\n" +
18872 				"abstract class MyIterator<E> implements Iterator<E> {\n" +
18873 				"	Set<E> iteratedSet;\n" +
18874 				"}\n" +
18875 				"public class X {\n" +
18876 				"	\n" +
18877 				"	void bar() {\n" +
18878 				"		Map<? extends String, ?> map;\n" +
18879 				"		Iterator<Entry<? extends String, ?>> it = map.entrySet().iterator();\n" +
18880 				"\n" +
18881 				"		Entry<String, Number> unrelatedEntry;\n" +
18882 				"		MyIterator<Entry<? extends String, ?>> mit = (MyIterator<Entry<? extends String, ?>>) it;\n" +
18883 				"		mit.iteratedSet.add(unrelatedEntry);\n" +
18884 				"	}\n" +
18885 				"}\n",
18886             },
18887     		"----------\n" +
18888     		"1. ERROR in X.java (at line 11)\n" +
18889     		"	Iterator<Entry<? extends String, ?>> it = map.entrySet().iterator();\n" +
18890     		"	                                          ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
18891     		"Type mismatch: cannot convert from Iterator<Map.Entry<capture#1-of ? extends String,capture#2-of ?>> to Iterator<Map.Entry<? extends String,?>>\n" +
18892     		"----------\n");
18893 	}
18894 	public void test0596() {
18895 	    this.runConformTest(
18896             new String[] {
18897                 "X.java",
18898 				"import java.util.*;\n" +
18899 				"\n" +
18900 				"public class X {\n" +
18901 				"	<T> Set<T> unmodifiableSet(Set<T> set) {\n" +
18902 				"		return set;\n" +
18903 				"	}\n" +
18904 				"	public void foo(Set<?> s) {\n" +
18905 				"		Set<?> s2 = unmodifiableSet(s);\n" +
18906 				"	}\n" +
18907 				"}\n",
18908             },
18909 			"");
18910 	}
18911 	public void test0597() {
18912 	    this.runNegativeTest(
18913             new String[] {
18914                 "X.java",
18915 				"public class X<U> {\n" +
18916 				"	Pair<U,U> m() { \n" +
18917 				"		return null; \n" +
18918 				"	}\n" +
18919 				"	void foo(X<?> x) {\n" +
18920 				"		x.m().first = x.m().second;\n" +
18921 				"	}\n" +
18922 				"}\n" +
18923 				"	\n" +
18924 				"class Pair<E, F> {\n" +
18925 				"	E first;\n" +
18926 				"	F second;\n" +
18927 				"}\n",
18928             },
18929     		"----------\n" +
18930     		"1. ERROR in X.java (at line 6)\n" +
18931     		"	x.m().first = x.m().second;\n" +
18932     		"	              ^^^^^^^^^^^^\n" +
18933     		"Type mismatch: cannot convert from capture#2-of ? to capture#1-of ?\n" +
18934     		"----------\n");
18935 	}
18936 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=90879
18937 	// SHOULD FAIL AT 1.8 (18.2.3): The method sort(List<T>) in the type Collections is not applicable for the arguments (List<X>)
18938 	public void test0598() {
18939 	    this.runConformTest(
18940             new String[] {
18941                 "X.java",
18942 				"import java.util.*;\n" +
18943 				"\n" +
18944 				"class X implements Comparable {\n" +
18945 				"\n" +
18946 				"	public int compareTo(Object o) {\n" +
18947 				"		return 0;\n" +
18948 				"	}\n" +
18949 				"\n" +
18950 				"}\n" +
18951 				"\n" +
18952 				"class Y {\n" +
18953 				"	public static void main(String[] args) {\n" +
18954 				"		List<X> lx = null;\n" +
18955 				"		Collections.sort(lx);\n" +
18956 				"	}\n" +
18957 				"}\n",
18958 			},
18959 			"");
18960 	}
18961 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=90879 - variation
18962 	// SHOULD FAIL AT 1.8 (18.2.3): The method sort1(List<T>) in the type X is not applicable for the arguments (List<X>)
18963 	public void test0599() {
18964 	    this.runNegativeTest(
18965             new String[] {
18966                 "X.java",
18967 				"import java.util.*;\n" +
18968 				"\n" +
18969 				"public class X implements Comparable {\n" +
18970 				"	public static void main(String[] args) {\n" +
18971 				"		Zork z;\n" +
18972 				"		\n" +
18973 				"		List<X> lx = null;\n" +
18974 				"		sort1(lx);\n" +
18975 				"		sort2(lx);\n" +
18976 				"		sort3(lx);\n" +
18977 				"		sort4(lx);\n" +
18978 				"		sort5(lx);\n" +
18979 				"	}\n" +
18980 				"	public int compareTo(Object o) {\n" +
18981 				"		return 0;\n" +
18982 				"	}\n" +
18983 				"	static <T extends Comparable<? super T>> void sort1(List<T> list) {}\n" +
18984 				"	static <T extends Comparable<? extends T>> void sort2(List<T> list) {}\n" +
18985 				"	static <T extends Comparable<?>> void sort3(List<T> list) {}\n" +
18986 				"	static <T extends Comparable<T>> void sort4(List<T> list) {}\n" +
18987 				"	static <T extends Comparable> void sort5(List<T> list) {}\n" +
18988 				"}\n",
18989 			},
18990 			"----------\n" +
18991 			"1. WARNING in X.java (at line 3)\n" +
18992 			"	public class X implements Comparable {\n" +
18993 			"	                          ^^^^^^^^^^\n" +
18994 			"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
18995 			"----------\n" +
18996 			"2. ERROR in X.java (at line 5)\n" +
18997 			"	Zork z;\n" +
18998 			"	^^^^\n" +
18999 			"Zork cannot be resolved to a type\n" +
19000 			"----------\n" +
19001 			"3. WARNING in X.java (at line 8)\n" +
19002 			"	sort1(lx);\n" +
19003 			"	^^^^^^^^^\n" +
19004 			"Type safety: Unchecked invocation sort1(List<X>) of the generic method sort1(List<T>) of type X\n" +
19005 			"----------\n" +
19006 			"4. WARNING in X.java (at line 9)\n" +
19007 			"	sort2(lx);\n" +
19008 			"	^^^^^^^^^\n" +
19009 			"Type safety: Unchecked invocation sort2(List<X>) of the generic method sort2(List<T>) of type X\n" +
19010 			"----------\n" +
19011 			"5. WARNING in X.java (at line 11)\n" +
19012 			"	sort4(lx);\n" +
19013 			"	^^^^^^^^^\n" +
19014 			"Type safety: Unchecked invocation sort4(List<X>) of the generic method sort4(List<T>) of type X\n" +
19015 			"----------\n" +
19016 			"6. WARNING in X.java (at line 21)\n" +
19017 			"	static <T extends Comparable> void sort5(List<T> list) {}\n" +
19018 			"	                  ^^^^^^^^^^\n" +
19019 			"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
19020 			"----------\n");
19021 	}
19022 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=90879 - variation
19023 	// SHOULD FAIL AT 1.8 (18.2.3): The method sort6(List<T>) in the type X is not applicable for the arguments (List<MyEnum>)
19024 	public void test0600() {
19025 	    this.runNegativeTest(
19026             new String[] {
19027                 "X.java",
19028 				"import java.util.*;\n" +
19029 				"\n" +
19030 				"public class X implements Comparable {\n" +
19031 				"	public static void main(String[] args) {\n" +
19032 				"		Zork z;\n" +
19033 				"		\n" +
19034 				"		List<MyEnum> le = null;\n" +
19035 				"		sort6(le);\n" +
19036 				"		sort7(le);\n" +
19037 				"		sort8(le);\n" +
19038 				"		sort9(le);\n" +
19039 				"		sort10(le);\n" +
19040 				"	}\n" +
19041 				"	public int compareTo(Object o) {\n" +
19042 				"		return 0;\n" +
19043 				"	}\n" +
19044 				"	static <T extends MyEnum<? super T>> void sort6(List<T> list) {}\n" +
19045 				"	static <T extends MyEnum<? extends T>> void sort7(List<T> list) {}\n" +
19046 				"	static <T extends MyEnum<?>> void sort8(List<T> list) {}\n" +
19047 				"	static <T extends MyEnum<T>> void sort9(List<T> list) {}\n" +
19048 				"	static <T extends MyEnum> void sort10(List<T> list) {}\n" +
19049 				"}\n" +
19050 				"class MyEnum<E extends MyEnum<E>> {}\n",
19051             },
19052             "----------\n" +
19053     		"1. WARNING in X.java (at line 3)\n" +
19054     		"	public class X implements Comparable {\n" +
19055     		"	                          ^^^^^^^^^^\n" +
19056     		"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
19057     		"----------\n" +
19058     		"2. ERROR in X.java (at line 5)\n" +
19059     		"	Zork z;\n" +
19060     		"	^^^^\n" +
19061     		"Zork cannot be resolved to a type\n" +
19062     		"----------\n" +
19063     		"3. WARNING in X.java (at line 7)\n" +
19064     		"	List<MyEnum> le = null;\n" +
19065     		"	     ^^^^^^\n" +
19066     		"MyEnum is a raw type. References to generic type MyEnum<E> should be parameterized\n" +
19067     		"----------\n" +
19068     		"4. WARNING in X.java (at line 8)\n" +
19069     		"	sort6(le);\n" +
19070     		"	^^^^^^^^^\n" +
19071     		"Type safety: Unchecked invocation sort6(List<MyEnum>) of the generic method sort6(List<T>) of type X\n" +
19072     		"----------\n" +
19073     		"5. WARNING in X.java (at line 9)\n" +
19074     		"	sort7(le);\n" +
19075     		"	^^^^^^^^^\n" +
19076     		"Type safety: Unchecked invocation sort7(List<MyEnum>) of the generic method sort7(List<T>) of type X\n" +
19077     		"----------\n" +
19078     		"6. WARNING in X.java (at line 11)\n" +
19079     		"	sort9(le);\n" +
19080     		"	^^^^^^^^^\n" +
19081     		"Type safety: Unchecked invocation sort9(List<MyEnum>) of the generic method sort9(List<T>) of type X\n" +
19082     		"----------\n" +
19083     		"7. WARNING in X.java (at line 21)\n" +
19084     		"	static <T extends MyEnum> void sort10(List<T> list) {}\n" +
19085     		"	                  ^^^^^^\n" +
19086     		"MyEnum is a raw type. References to generic type MyEnum<E> should be parameterized\n" +
19087     		"----------\n");
19088 	}
19089 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=85281 - variation
19090 	public void test0601() {
19091 	    this.runNegativeTest(
19092             new String[] {
19093                 "X.java",
19094 				"public class X<U> {\n" +
19095 				"\n" +
19096 				"	public Values<U> foo(Box<? extends U> box) {\n" +
19097 				"		return selectedValues(box.getValues());\n" +
19098 				"	}\n" +
19099 				"	public static <G> Values<G> selectedValues(Values<G> v) {\n" +
19100 				"		return null;\n" +
19101 				"	}\n" +
19102 				"}\n" +
19103 				"\n" +
19104 				"abstract class Box<V> {\n" +
19105 				"	  abstract Values<V> getValues();\n" +
19106 				"}\n" +
19107 				"abstract class Values<T> {\n" +
19108 				"}\n",
19109             },
19110     		"----------\n" +
19111     		"1. ERROR in X.java (at line 4)\n" +
19112 			"	return selectedValues(box.getValues());\n" +
19113 			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
19114     		"Type mismatch: cannot convert from Values<capture#1-of ? extends U> to Values<U>\n" +
19115     		"----------\n");
19116 	}
19117 	public void test0602() {
19118 	    this.runNegativeTest(
19119             new String[] {
19120                 "X.java",
19121 				"public class X<U> {\n" +
19122 				"\n" +
19123 				"	public void foo(Box<? extends U> box) {\n" +
19124 				"		box.getValues()[0] = box.getValues()[1];\n" +
19125 				"	}\n" +
19126 				"}\n" +
19127 				"\n" +
19128 				"abstract class Box<V> {\n" +
19129 				"	  abstract Values<V>[] getValues();\n" +
19130 				"}\n" +
19131 				"abstract class Values<T> {\n" +
19132 				"}\n",
19133             },
19134     		"----------\n" +
19135     		"1. ERROR in X.java (at line 4)\n" +
19136     		"	box.getValues()[0] = box.getValues()[1];\n" +
19137     		"	                     ^^^^^^^^^^^^^^^^^^\n" +
19138     		"Type mismatch: cannot convert from Values<capture#2-of ? extends U> to Values<capture#1-of ? extends U>\n" +
19139     		"----------\n");
19140 	}
19141 	public void test0603() {
19142 	    this.runConformTest(
19143             new String[] {
19144                 "X.java",
19145 				"public class X<U> {\n" +
19146 				"\n" +
19147 				"	public void foo(Box<? extends U>[] boxes) {\n" +
19148 				"		boxes[0] = boxes[1];\n" +
19149 				"	}\n" +
19150 				"}\n" +
19151 				"\n" +
19152 				"abstract class Box<V> {\n" +
19153 				"	  abstract Values<V>[] getValues();\n" +
19154 				"}\n" +
19155 				"abstract class Values<T> {\n" +
19156 				"}\n",
19157             },
19158 			"");
19159 	}
19160 	// capture on array ref
19161 	public void test0604() {
19162 	    this.runConformTest(
19163             new String[] {
19164                 "X.java",
19165 				"public class X<U> {\n" +
19166 				"\n" +
19167 				"	public void foo(Box<? extends U>[] boxes) {\n" +
19168 				"		bar(boxes[0], boxes[1]);\n" +
19169 				"	}\n" +
19170 				"	<V> void bar(V v1, V v2) {}\n" +
19171 				"}\n" +
19172 				"\n" +
19173 				"abstract class Box<V> {\n" +
19174 				"	  abstract Values<V>[] getValues();\n" +
19175 				"}\n" +
19176 				"abstract class Values<T> {\n" +
19177 				"}\n",
19178             },
19179 			"");
19180 	}
19181 	// capture on array ref
19182 	public void test0605() {
19183 	    this.runNegativeTest(
19184             new String[] {
19185                 "X.java",
19186 				"public class X<U> {\n" +
19187 				"\n" +
19188 				"	public void foo(Box<? extends U> box) {\n" +
19189 				"		box.getValues()[1] = box.getValues()[2];\n" +
19190 				"	}\n" +
19191 				"}\n" +
19192 				"\n" +
19193 				"abstract class Box<V> {\n" +
19194 				"	  abstract Values<V>[] getValues();\n" +
19195 				"}\n" +
19196 				"abstract class Values<T> {\n" +
19197 				"}\n",
19198             },
19199     		"----------\n" +
19200     		"1. ERROR in X.java (at line 4)\n" +
19201     		"	box.getValues()[1] = box.getValues()[2];\n" +
19202     		"	                     ^^^^^^^^^^^^^^^^^^\n" +
19203     		"Type mismatch: cannot convert from Values<capture#2-of ? extends U> to Values<capture#1-of ? extends U>\n" +
19204     		"----------\n");
19205 	}
19206 	public void test0606() {
19207 	    this.runNegativeTest(
19208             new String[] {
19209                 "X.java",
19210 				"public class X<U> {\n" +
19211 				"\n" +
19212 				"	public void foo(Box<? extends U> box) {\n" +
19213 				"		box.getValues()[1] = (Values<? extends U>) box.getValues()[2];\n" +
19214 				"	}\n" +
19215 				"	<V> void bar(V v1, V v2) {}\n" +
19216 				"}\n" +
19217 				"\n" +
19218 				"abstract class Box<V> {\n" +
19219 				"	  abstract Values<V>[] getValues();\n" +
19220 				"}\n" +
19221 				"abstract class Values<T> {\n" +
19222 				"}\n",
19223             },
19224     		"----------\n" +
19225     		"1. ERROR in X.java (at line 4)\n" +
19226     		"	box.getValues()[1] = (Values<? extends U>) box.getValues()[2];\n" +
19227     		"	                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
19228     		"Type mismatch: cannot convert from Values<capture#3-of ? extends U> to Values<capture#1-of ? extends U>\n" +
19229     		"----------\n");
19230 	}
19231 	public void test0607() {
19232 		this.runNegativeTest(
19233             new String[] {
19234                 "X.java",
19235 				"import java.util.*;\n" +
19236 				"\n" +
19237 				"public class X {\n" +
19238 				"\n" +
19239 				"	void test01() {\n" +
19240 				"		List<Comparable<Object>> lObj = new ArrayList<Comparable<Object>> ();\n" +
19241 				"		Collections.sort (lObj);	\n" +
19242 				"	}\n" +
19243 				"	void test02() {\n" +
19244 				"		List<Comparable> lComp = new ArrayList<Comparable> ();\n" +
19245 				"		Collections.sort (lComp);		\n" +
19246 				"	}\n" +
19247 				"	void test03() {\n" +
19248 				"		List<Comparable<String>> lStr = new ArrayList<Comparable<String>> ();\n" +
19249 				"		Collections.sort (lStr);\n" +
19250 				"	}\n" +
19251 				" }\n",
19252             },
19253             "----------\n" +
19254     		"1. WARNING in X.java (at line 10)\n" +
19255     		"	List<Comparable> lComp = new ArrayList<Comparable> ();\n" +
19256     		"	     ^^^^^^^^^^\n" +
19257     		"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
19258     		"----------\n" +
19259     		"2. WARNING in X.java (at line 10)\n" +
19260     		"	List<Comparable> lComp = new ArrayList<Comparable> ();\n" +
19261     		"	                                       ^^^^^^^^^^\n" +
19262     		"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
19263     		"----------\n" +
19264     		"3. WARNING in X.java (at line 11)\n" +
19265     		"	Collections.sort (lComp);		\n" +
19266     		"	^^^^^^^^^^^^^^^^^^^^^^^^\n" +
19267     		"Type safety: Unchecked invocation sort(List<Comparable>) of the generic method sort(List<T>) of type Collections\n" +
19268     		(this.complianceLevel < ClassFileConstants.JDK1_8 ?
19269     		"----------\n" +
19270     		"4. ERROR in X.java (at line 15)\n" +
19271     		"	Collections.sort (lStr);\n" +
19272     		"	            ^^^^\n" +
19273     		"Bound mismatch: The generic method sort(List<T>) of type Collections is not applicable for the arguments (List<Comparable<String>>). The inferred type Comparable<String> is not a valid substitute for the bounded parameter <T extends Comparable<? super T>>\n" +
19274     		"----------\n" :
19275     			"----------\n" +
19276     			"4. ERROR in X.java (at line 15)\n" +
19277     			"	Collections.sort (lStr);\n" +
19278     			"	            ^^^^\n" +
19279     			"The method sort(List<T>) in the type Collections is not applicable for the arguments (List<Comparable<String>>)\n" +
19280     			"----------\n"));
19281 	}
19282 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84284 - check warnings
19283 	// SHOULD FAIL AT 1.8 (18.2.3): The method sort(List<T>) in the type Collections is not applicable for the arguments (LinkedList<Ball>)
19284 	public void test0608() {
19285 	    this.runNegativeTest(
19286             new String[] {
19287                 "Ball.java",
19288 				"import java.util.*;\n" +
19289 				"class Ball implements Comparable {\n" +
19290 				"\n" +
19291 				"    public int compareTo(Object o) {\n" +
19292 				"    	return 0;\n" +
19293 				"    }\n" +
19294 				"    \n" +
19295 				"    public static void main(String[] args) {\n" +
19296 				"    	LinkedList<Ball> foo = new LinkedList<Ball>();\n" +
19297 				"    	Collections.sort(foo);\n" +
19298 				"    }\n" +
19299 				"	Zork z;\n" +
19300 				"}\n",
19301             },
19302     		"----------\n" +
19303     		"1. WARNING in Ball.java (at line 2)\n" +
19304     		"	class Ball implements Comparable {\n" +
19305     		"	                      ^^^^^^^^^^\n" +
19306     		"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
19307     		"----------\n" +
19308     		"2. WARNING in Ball.java (at line 10)\n" +
19309     		"	Collections.sort(foo);\n" +
19310     		"	^^^^^^^^^^^^^^^^^^^^^\n" +
19311     		"Type safety: Unchecked invocation sort(LinkedList<Ball>) of the generic method sort(List<T>) of type Collections\n" +
19312     		"----------\n" +
19313     		"3. ERROR in Ball.java (at line 12)\n" +
19314     		"	Zork z;\n" +
19315     		"	^^^^\n" +
19316     		"Zork cannot be resolved to a type\n" +
19317     		"----------\n");
19318 	}
19319 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=81831
19320 	public void test0609() {
19321 	    this.runConformTest(
19322             new String[] {
19323                 "I.java",
19324 				"interface I<T extends I<? super T>> {}\n",
19325             },
19326 			"");
19327 	}
19328 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=89940
19329 	public void test0610() {
19330 	    this.runNegativeTest(
19331             new String[] {
19332                 "X.java",
19333 				" import java.util.List;\n" +
19334 				"\n" +
19335 				"public class X {\n" +
19336 				"	void foo(List<Object> objects, List raw) {\n" +
19337 				"\n" +
19338 				"	    List<Number> numbers;\n" +
19339 				"	    List<? extends Number> ext;\n" +
19340 				"	    \n" +
19341 				"	    numbers= (List<Number>) objects; // correct - cast error\n" +
19342 				"	    ext= (List<? extends Number>) objects; // wrong, should fail\n" +
19343 				"\n" +
19344 				"	    ext= raw; // correct - raw conversion warning issued\n" +
19345 				"	    numbers= raw; // correct - raw conversion warning issued\n" +
19346 				"	}\n" +
19347 				"}\n",
19348             },
19349     		"----------\n" +
19350     		"1. WARNING in X.java (at line 4)\n" +
19351     		"	void foo(List<Object> objects, List raw) {\n" +
19352     		"	                               ^^^^\n" +
19353     		"List is a raw type. References to generic type List<E> should be parameterized\n" +
19354     		"----------\n" +
19355     		"2. ERROR in X.java (at line 9)\n" +
19356     		"	numbers= (List<Number>) objects; // correct - cast error\n" +
19357     		"	         ^^^^^^^^^^^^^^^^^^^^^^\n" +
19358     		"Cannot cast from List<Object> to List<Number>\n" +
19359     		"----------\n" +
19360     		"3. ERROR in X.java (at line 10)\n" +
19361     		"	ext= (List<? extends Number>) objects; // wrong, should fail\n" +
19362     		"	     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
19363     		"Cannot cast from List<Object> to List<? extends Number>\n" +
19364     		"----------\n" +
19365     		"4. WARNING in X.java (at line 12)\n" +
19366     		"	ext= raw; // correct - raw conversion warning issued\n" +
19367     		"	     ^^^\n" +
19368     		"Type safety: The expression of type List needs unchecked conversion to conform to List<? extends Number>\n" +
19369     		"----------\n" +
19370     		"5. WARNING in X.java (at line 13)\n" +
19371     		"	numbers= raw; // correct - raw conversion warning issued\n" +
19372     		"	         ^^^\n" +
19373     		"Type safety: The expression of type List needs unchecked conversion to conform to List<Number>\n" +
19374     		"----------\n");
19375 	}
19376 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=91696
19377 	public void test0611() {
19378 	    this.runConformTest(
19379             new String[] {
19380                 "C.java",
19381 				"import java.io.Serializable;\n" +
19382 				"\n" +
19383 				"interface A<K extends A.BK<S>, S extends A.BS> {\n" +
19384 				"	public interface BS extends Serializable {\n" +
19385 				"	}\n" +
19386 				"	public interface BK<SS> extends Serializable {\n" +
19387 				"		public void put(SS a);\n" +
19388 				"	}\n" +
19389 				"\n" +
19390 				"	public P<K, S> getP();\n" +
19391 				"}\n" +
19392 				"\n" +
19393 				"class P<K extends A.BK<S>, S extends A.BS> {\n" +
19394 				"	K k;\n" +
19395 				"	S s;\n" +
19396 				"\n" +
19397 				"	public void put() {\n" +
19398 				"		k.put(s);\n" +
19399 				"	}\n" +
19400 				"}\n" +
19401 				"\n" +
19402 				"public class C<T> implements A<C.K, C.S> {\n" +
19403 				"	public static class K implements A.BK<C.S> {\n" +
19404 				"		public void put(S a) {\n" +
19405 				"		}\n" +
19406 				"	}\n" +
19407 				"	protected static class S implements A.BS {\n" +
19408 				"	}\n" +
19409 				"\n" +
19410 				"	public P<K, S> getP() {\n" +
19411 				"		return null;\n" +
19412 				"	}\n" +
19413 				"}\n",
19414             },
19415 			"");
19416 	}
19417 	public void test0612() {
19418 	    this.runNegativeTest(
19419             new String[] {
19420                 "X.java",
19421 				"import java.util.*;\n" +
19422 				"\n" +
19423 				"class MPair<A,B> {}\n" +
19424 				"\n" +
19425 				"public class X<K,V> {\n" +
19426 				"    private static class Bucket extends LinkedList<MPair<K,V>> {}\n" +
19427 				"    private Bucket[] buckets = new X.Bucket[100];\n" +
19428 				"}\n",
19429             },
19430     		"----------\n" +
19431     		"1. ERROR in X.java (at line 6)\n" +
19432     		"	private static class Bucket extends LinkedList<MPair<K,V>> {}\n" +
19433     		"	                                                     ^\n" +
19434     		"Cannot make a static reference to the non-static type K\n" +
19435     		"----------\n" +
19436     		"2. ERROR in X.java (at line 6)\n" +
19437     		"	private static class Bucket extends LinkedList<MPair<K,V>> {}\n" +
19438     		"	                                                       ^\n" +
19439     		"Cannot make a static reference to the non-static type V\n" +
19440 	    	"----------\n");
19441 	}
19442 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84973
19443 	public void test0613() {
19444 	    this.runNegativeTest(
19445             new String[] {
19446                 "Map.java",
19447 				"package xy;\n" +
19448 				"import xy.Map.Entry;\n" +
19449 				"\n" +
19450 				"class Map<M> {\n" +
19451 				"    class Entry<E> { }\n" +
19452 				"}\n" +
19453 				"class User {\n" +
19454 				"    void a(Entry<String> e) { } // Entry<String> is illegal (eclipse accepts)\n" +
19455 				"    void c(Map.Entry<String> e) { } // illegal (correctly flagged)\n" +
19456 				"    void b(Entry e) { } // OK\n" +
19457 				"    void d(Map<Integer>.Entry<String> e) { } // OK\n" +
19458 				"}\n",
19459             },
19460             "----------\n" +
19461     		"1. ERROR in Map.java (at line 8)\n" +
19462     		"	void a(Entry<String> e) { } // Entry<String> is illegal (eclipse accepts)\n" +
19463     		"	       ^^^^^\n" +
19464     		"The member type Map.Entry<String> must be qualified with a parameterized type, since it is not static\n" +
19465     		"----------\n" +
19466     		"2. ERROR in Map.java (at line 9)\n" +
19467     		"	void c(Map.Entry<String> e) { } // illegal (correctly flagged)\n" +
19468     		"	       ^^^^^^^^^\n" +
19469     		"The member type Map.Entry<String> must be qualified with a parameterized type, since it is not static\n" +
19470     		"----------\n" +
19471     		"3. WARNING in Map.java (at line 10)\n" +
19472     		"	void b(Entry e) { } // OK\n" +
19473     		"	       ^^^^^\n" +
19474     		"Map.Entry is a raw type. References to generic type Map<M>.Entry<E> should be parameterized\n" +
19475     		"----------\n");
19476 	}
19477 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84973 - variation
19478 	public void test0614() {
19479 	    this.runNegativeTest(
19480             new String[] {
19481                 "X1.java",
19482 				"class X1 {\n" +
19483 				"	static class X2<T> {\n" +
19484 				"		class X3<U> {\n" +
19485 				"		}\n" +
19486 				"	}\n" +
19487 				"}\n" +
19488 				"class Y1 {\n" +
19489 				"	class Y2 extends X1.X2<Exception> {\n" +
19490 				"		void foo() {\n" +
19491 				"			X3<String> x;\n" +
19492 				"		}\n" +
19493 				"	}\n" +
19494 				"	Zork z;\n" +
19495 				"}\n",
19496             },
19497 			"----------\n" +
19498 			"1. ERROR in X1.java (at line 13)\n" +
19499 			"	Zork z;\n" +
19500 			"	^^^^\n" +
19501 			"Zork cannot be resolved to a type\n" +
19502 			"----------\n");
19503 	}
19504 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84973 - variation
19505 	public void test0615() {
19506 	    this.runNegativeTest(
19507             new String[] {
19508                 "X1.java",
19509 				"class X1 {\n" +
19510 				"	static class X2<T> {\n" +
19511 				"		class X3<U> {\n" +
19512 				"		}\n" +
19513 				"	}\n" +
19514 				"}\n" +
19515 				"class Y1 {\n" +
19516 				"	class Y2 extends X1.X2 {\n" +
19517 				"		void foo() {\n" +
19518 				"			X3<String> x;\n" +
19519 				"		}\n" +
19520 				"	}\n" +
19521 				"}\n",
19522             },
19523             "----------\n" +
19524     		"1. WARNING in X1.java (at line 8)\n" +
19525     		"	class Y2 extends X1.X2 {\n" +
19526     		"	                 ^^^^^\n" +
19527     		"X1.X2 is a raw type. References to generic type X1.X2<T> should be parameterized\n" +
19528     		"----------\n" +
19529     		"2. ERROR in X1.java (at line 10)\n" +
19530     		"	X3<String> x;\n" +
19531     		"	^^\n" +
19532     		"The member type X1.X2.X3<String> must be qualified with a parameterized type, since it is not static\n" +
19533     		"----------\n");
19534 	}
19535 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84973 - variation
19536 	public void test0616() {
19537 	    this.runNegativeTest(
19538             new String[] {
19539                 "Map.java",
19540 				"package xy;\n" +
19541 				"import xy.Map.Entry;\n" +
19542 				"\n" +
19543 				"class Map<M> {\n" +
19544 				"    class Entry<E> { }\n" +
19545 				"}\n" +
19546 				"class User extends Map<String> {\n" +
19547 				"    void a(Entry<String> e) { } // Entry<String> is illegal (eclipse accepts)\n" +
19548 				"    void c(Map.Entry<String> e) { } // illegal (correctly flagged)\n" +
19549 				"    void b(Entry e) { } // OK\n" +
19550 				"    void d(Map<Integer>.Entry<String> e) { } // OK\n" +
19551 				"}\n",
19552             },
19553             "----------\n" +
19554     		"1. ERROR in Map.java (at line 9)\n" +
19555     		"	void c(Map.Entry<String> e) { } // illegal (correctly flagged)\n" +
19556     		"	       ^^^^^^^^^\n" +
19557     		"The member type Map.Entry<String> must be qualified with a parameterized type, since it is not static\n" +
19558     		"----------\n" +
19559     		"2. WARNING in Map.java (at line 10)\n" +
19560     		"	void b(Entry e) { } // OK\n" +
19561     		"	       ^^^^^\n" +
19562     		"Map.Entry is a raw type. References to generic type Map<M>.Entry<E> should be parameterized\n" +
19563     		"----------\n");
19564 	}
19565 public void test0617() {
19566         this.runNegativeTest(
19567             new String[] {
19568                 "X.java",
19569                 "public class X {\n" +
19570                 "\n" +
19571                 "   public void foo() {\n" +
19572                 "       String s = null;\n" +
19573                 "       ZZZ1<?>.ZZZ2<?>.ZZZ3<?> var = null;\n" +
19574                 "       s = var;\n" +
19575                 "   }\n" +
19576                 "}\n" +
19577                 "\n" +
19578                 "class ZZZ1<T1> {\n" +
19579                 "  class ZZZ2<T2> {\n" +
19580                 "    class ZZZ3<T3> {}\n" +
19581                 "  }\n" +
19582                 "}\n",
19583             },
19584     		"----------\n" +
19585     		"1. ERROR in X.java (at line 6)\n" +
19586     		"	s = var;\n" +
19587     		"	    ^^^\n" +
19588     		"Type mismatch: cannot convert from ZZZ1<?>.ZZZ2<?>.ZZZ3<capture#1-of ?> to String\n" +
19589     		"----------\n");
19590     }
19591 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84973 - variation
19592 	public void test0618() {
19593 	    this.runNegativeTest(
19594             new String[] {
19595                 "Map.java",
19596 				"class Map<M> {\n" +
19597 				"    class Entry<E> { }\n" +
19598 				"    class Foo {\n" +
19599 				"    	Entry<String> entry;\n" +
19600 				"    	static void foo(Entry<String> e) { } // invalid static ref\n" +
19601 				"    }\n" +
19602 				"    static class Bar {\n" +
19603 				"    	Entry<String> entry; // invalid static ref\n" +
19604 				"    }\n" +
19605 				"    void a(Entry<String> e) { } // OK\n" +
19606 				"    void c(Map.Entry<String> e) { } // illegal \n" +
19607 				"    void b(Entry e) { } // OK\n" +
19608 				"    void d(Map<Integer>.Entry<String> e) { } // OK\n" +
19609 				"}\n",
19610             },
19611             "----------\n" +
19612     		"1. ERROR in Map.java (at line 5)\n" +
19613     		"	static void foo(Entry<String> e) { } // invalid static ref\n" +
19614     		"	            ^^^^^^^^^^^^^^^^^^^^\n" +
19615     		"The method foo cannot be declared static; static methods can only be declared in a static or top level type\n" +
19616     		"----------\n" +
19617     		"2. ERROR in Map.java (at line 5)\n" +
19618     		"	static void foo(Entry<String> e) { } // invalid static ref\n" +
19619     		"	                ^^^^^\n" +
19620     		"Cannot make a static reference to the non-static type Entry\n" +
19621     		"----------\n" +
19622     		"3. ERROR in Map.java (at line 8)\n" +
19623     		"	Entry<String> entry; // invalid static ref\n" +
19624     		"	^^^^^\n" +
19625     		"Cannot make a static reference to the non-static type Entry\n" +
19626     		"----------\n" +
19627     		"4. ERROR in Map.java (at line 11)\n" +
19628     		"	void c(Map.Entry<String> e) { } // illegal \n" +
19629     		"	       ^^^^^^^^^\n" +
19630     		"The member type Map.Entry<String> must be qualified with a parameterized type, since it is not static\n" +
19631     		"----------\n" +
19632     		"5. WARNING in Map.java (at line 12)\n" +
19633     		"	void b(Entry e) { } // OK\n" +
19634     		"	       ^^^^^\n" +
19635     		"Map.Entry is a raw type. References to generic type Map<M>.Entry<E> should be parameterized\n" +
19636     		"----------\n");
19637 	}
19638 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=89440
19639 	public void test0619() {
19640 	    this.runConformTest(
19641             new String[] {
19642                 "X.java",
19643 				"interface ISample<V> {\n" +
19644 				"	public static enum Stuff {\n" +
19645 				"		FIRST, SECOND, THIRD\n" +
19646 				"	};\n" +
19647 				"}\n" +
19648 				"\n" +
19649 				"class SampleClass {\n" +
19650 				"	public void doSomething(ISample.Stuff thing) {\n" +
19651 				"\n" +
19652 				"	}\n" +
19653 				"}\n" +
19654 				"\n" +
19655 				"public class X {\n" +
19656 				"	public void doSomething() {\n" +
19657 				"		SampleClass sample = new SampleClass();\n" +
19658 				"		sample.doSomething(ISample.Stuff.FIRST);\n" +
19659 				"	}\n" +
19660 				"}\n",
19661             },
19662 			"");
19663 	}
19664 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84551
19665 	public void test0620() {
19666 	    this.runNegativeTest(
19667             new String[] {
19668                 "Outer.java",
19669 				"public class Outer<O> {\n" +
19670 				"	class Inner { }\n" +
19671 				"	\n" +
19672 				"	static void test(Inner i) { }\n" +
19673 				"}\n",
19674             },
19675 			"----------\n" +
19676 			"1. ERROR in Outer.java (at line 4)\n" +
19677 			"	static void test(Inner i) { }\n" +
19678 			"	                 ^^^^^\n" +
19679 			"Cannot make a static reference to the non-static type Inner\n" +
19680 			"----------\n");
19681 	}
19682 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84551- variation
19683 	public void test0621() {
19684 	    this.runConformTest(
19685             new String[] {
19686                 "Outer.java",
19687 				"public class Outer {\n" +
19688 				"	class Inner { }\n" +
19689 				"	\n" +
19690 				"	static void test(Inner i) { }\n" +
19691 				"}\n",
19692             },
19693 			"");
19694 	}
19695 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84551 - variation
19696 	public void test0622() {
19697 	    this.runConformTest(
19698             new String[] {
19699                 "Outer.java",
19700 				"public class Outer<O> {\n" +
19701 				"	static class Inner { }\n" +
19702 				"	\n" +
19703 				"	static void test(Inner i) { }\n" +
19704 				"}\n",
19705             },
19706 			"");
19707 	}
19708 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84551 - variation
19709 	public void test0623() {
19710 	    this.runConformTest(
19711             new String[] {
19712                 "X.java",
19713 				"public class X<T> {\n" +
19714 				"	static class Outer {\n" +
19715 				"		class Inner { }\n" +
19716 				"		static void test(Inner i) { }\n" +
19717 				"	}\n" +
19718 				"}\n",
19719             },
19720 			"");
19721 	}
19722 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=83034
19723 	public void test0624() {
19724 	    this.runConformTest(
19725             new String[] {
19726                 "X.java",
19727 				" interface IFoo<U, V extends X<U, V>> {\n" +
19728 				"	V bar(int i);\n" +
19729 				"}\n" +
19730 				"\n" +
19731 				"public class X<E, F extends X<E, F>> {\n" +
19732 				"	\n" +
19733 				"	public boolean foo(X<E, ?> x) {\n" +
19734 				"		return false;\n" +
19735 				"	}\n" +
19736 				"	public boolean baz(IFoo<E, ?> f) {\n" +
19737 				"		return foo(f.bar(0));\n" +
19738 				"	}\n" +
19739 				"}\n",
19740             },
19741 			"");
19742 	}
19743 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=83034 - variation
19744 	public void test0625() {
19745 	    this.runConformTest(
19746             new String[] {
19747                 "Foo.java",
19748 				"public class Foo<K> {\n" +
19749 				"	public enum Mode {\n" +
19750 				"		A\n" +
19751 				"	};\n" +
19752 				"	public void test(Mode mode) {\n" +
19753 				"	}\n" +
19754 				"} \n",
19755             },
19756 			"");
19757 	    this.runConformTest(
19758             new String[] {
19759                 "X.java",
19760 				"public class X {\n" +
19761 				"	enum Keys {\n" +
19762 				"		B\n" +
19763 				"	};\n" +
19764 				"	public void test() {\n" +
19765 				"		Foo<Keys> foo = new Foo<Keys>();\n" +
19766 				"		foo.test(Foo.Mode.A); // error\n" +
19767 				"	}\n" +
19768 				"} \n",
19769             },
19770 			"",
19771 			null,
19772 			false,
19773 			null);
19774 	}
19775 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=92037
19776 	public void test0626() {
19777 		String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ?
19778 				"----------\n" +
19779 	    		"1. WARNING in X.java (at line 7)\n" +
19780 	    		"	private static class B<A> {\n" +
19781 	    		"	                       ^\n" +
19782 	    		"The type parameter A is hiding the type X.A\n" +
19783 	    		"----------\n" +
19784 	    		"2. ERROR in X.java (at line 21)\n" +
19785 	    		"	System.out.println(b instanceof C);\n" +
19786 	    		"	                   ^^^^^^^^^^^^^^\n" +
19787 	    		"Incompatible conditional operand types X.B<X.A> and X.C\n" +
19788 	    		"----------\n"
19789 	    		:
19790 	    		"----------\n" +
19791 	    		"1. WARNING in X.java (at line 7)\n" +
19792 	    		"	private static class B<A> {\n" +
19793 	    		"	                       ^\n" +
19794 	    		"The type parameter A is hiding the type X.A\n" +
19795 	    		"----------\n" +
19796 	    		"2. WARNING in X.java (at line 11)\n" +
19797 	    		"	private static class AA extends A {\n" +
19798 	    		"	                     ^^\n" +
19799 	    		"Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" +
19800 	    		"----------\n" +
19801 	    		"3. WARNING in X.java (at line 15)\n" +
19802 	    		"	private static class C extends B<AA> {\n" +
19803 	    		"	                     ^\n" +
19804 	    		"Access to enclosing constructor X.B<A>() is emulated by a synthetic accessor method\n" +
19805 	    		"----------\n" +
19806 	    		"4. ERROR in X.java (at line 21)\n" +
19807 	    		"	System.out.println(b instanceof C);\n" +
19808 	    		"	                   ^^^^^^^^^^^^^^\n" +
19809 	    		"Incompatible conditional operand types X.B<X.A> and X.C\n" +
19810 	    		"----------\n";
19811 	    this.runNegativeTest(
19812             new String[] {
19813                 "X.java",
19814 				"public class X {\n" +
19815 				"\n" +
19816 				"	private static class A {\n" +
19817 				"\n" +
19818 				"	}\n" +
19819 				"\n" +
19820 				"	private static class B<A> {\n" +
19821 				"\n" +
19822 				"	}\n" +
19823 				"\n" +
19824 				"	private static class AA extends A {\n" +
19825 				"\n" +
19826 				"	}\n" +
19827 				"\n" +
19828 				"	private static class C extends B<AA> {\n" +
19829 				"\n" +
19830 				"	}\n" +
19831 				"\n" +
19832 				"	public static void main(String[] args) {\n" +
19833 				"		B<A> b = new B<A>();\n" +
19834 				"		System.out.println(b instanceof C);\n" +
19835 				"	}\n" +
19836 				"}\n",
19837             }, errMessage);
19838 	}
19839 
19840 	public void test0627() {
19841 	    this.runNegativeTest(
19842             new String[] {
19843                 "X.java",
19844 				"import java.util.List;\n" +
19845 				"\n" +
19846 				"public class X {\n" +
19847 				"\n" +
19848 				"	<T> List<? extends T> foo(List<? extends T> l1, List<? extends T> l2) {\n" +
19849 				"		return l1;\n" +
19850 				"	}\n" +
19851 				"	void bar(List<String> l1, List<Integer> l2) {\n" +
19852 				"		String s = foo(l1, l2);\n" +
19853 				"	}\n" +
19854 				"}\n",
19855             },
19856     		"----------\n" +
19857     		"1. ERROR in X.java (at line 9)\n" +
19858     		"	String s = foo(l1, l2);\n" +
19859     		"	           ^^^^^^^^^^^\n" +
19860     		"Type mismatch: cannot convert from List<capture#2-of ? extends "+intersection("Object","Serializable","Comparable<?>")+"> to String\n" +
19861     		"----------\n");
19862 	}
19863 	// check capture for conditional operator
19864 	public void test0628() {
19865 	    this.runNegativeTest(
19866             new String[] {
19867                 "X.java",
19868 				"import java.util.List;\n" +
19869 				"\n" +
19870 				"public class X {\n" +
19871 				"\n" +
19872 				"	<T> List<? extends T> foo(List<? extends T> l1, List<? extends T> l2) {\n" +
19873 				"		return l1;\n" +
19874 				"	}\n" +
19875 				"	void bar(List<Float> l1, List<Integer> l2) {\n" +
19876 				"		List<?> l3 = null;\n" +
19877 				"		String s = l1 != null ? foo(l1, l2) : l3;\n" +
19878 				"	}\n" +
19879 				"}\n",
19880             },
19881             this.complianceLevel < ClassFileConstants.JDK1_8 ?
19882 	    		"----------\n" +
19883 	    		"1. ERROR in X.java (at line 10)\n" +
19884 	    		"	String s = l1 != null ? foo(l1, l2) : l3;\n" +
19885 	    		"	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
19886 	    		"Type mismatch: cannot convert from List<capture#4-of ? extends Object> to String\n" +
19887 	    		"----------\n" :
19888 	    			"----------\n" +
19889 	    			"1. ERROR in X.java (at line 10)\n" +
19890 	    			"	String s = l1 != null ? foo(l1, l2) : l3;\n" +
19891 		    		"	                        ^^^^^^^^^^^\n" +
19892 		    		"Type mismatch: cannot convert from List<capture#2-of ? extends Number & "+intersection("Comparable<?>")+"> to String\n" +
19893 	    			"----------\n");
19894 	}
19895 	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=92556
19896 	public void test0629() {
19897 	    this.runConformTest(
19898             new String[] {
19899                 "X.java",
19900 				"public class X {\n" +
19901 				"	public abstract class Context<N extends Number> {\n" +
19902 				"		private Strategy<N, ? super Context<N>> strategy;\n" +
19903 				"		public void setStrategy(Strategy<N, ? super Context<N>> strategy) {\n" +
19904 				"			this.strategy = strategy;\n" +
19905 				"		}\n" +
19906 				"		// m?thode qui utilise la strat?gie\n" +
19907 				"		public N call() throws Exception {\n" +
19908 				"			return this.strategy.call(this);\n" +
19909 				"		}\n" +
19910 				"	}\n" +
19911 				"	public interface Strategy<N extends Number, C extends Context<N>> {\n" +
19912 				"		public abstract N call(C context);\n" +
19913 				"	}\n" +
19914 				"\n" +
19915 				"} \n",
19916             },
19917 			"");
19918 	}
19919 	public void test0630() {
19920 	    this.runNegativeTest(
19921             new String[] {
19922                 "X.java",
19923 				"import java.util.ArrayList;\n" +
19924 				"import java.util.List;\n" +
19925 				"\n" +
19926 				"@SuppressWarnings(\"null\")\n" +
19927 				"public class X {\n" +
19928 				"\n" +
19929 				"	void test0() {\n" +
19930 				"		List<? super Number[]> arrays= new ArrayList<Number[]>();\n" +
19931 				"		Number[] a= null;\n" +
19932 				"		arrays.add(null);\n" +
19933 				"		arrays.add(a); // Error: The method add(capture-of ? super Number[]) in the type List<capture-of ? super Number[]> is not applicable for the arguments (Number[])\n" +
19934 				"	}\n" +
19935 				"\n" +
19936 				"	void test01() {\n" +
19937 				"		List<? extends Number[]> arrays= new ArrayList<Number[]>();\n" +
19938 				"		Number[] a= null;\n" +
19939 				"		arrays.add(null);\n" +
19940 				"		arrays.add(a); // Error: The method add(capture-of ? extends Number[]) in the type List<capture-of ? super Number[]> is not applicable for the arguments (Number[])\n" +
19941 				"	}\n" +
19942 				"	\n" +
19943 				"	void test02() {\n" +
19944 				"		List<? super Number> nums= null;\n" +
19945 				"		Number n= null;\n" +
19946 				"		nums.add(null);\n" +
19947 				"		nums.add(n);\n" +
19948 				"	}\n" +
19949 				"\n" +
19950 				"	void test3() {\n" +
19951 				"		List<? super List<Number>> nums= null;\n" +
19952 				"		List<Number> n= null;\n" +
19953 				"		nums.add(null);\n" +
19954 				"		nums.add(n);\n" +
19955 				"	}\n" +
19956 				"}\n",
19957 	        },
19958 			"----------\n" +
19959 			"1. ERROR in X.java (at line 18)\n" +
19960 			"	arrays.add(a); // Error: The method add(capture-of ? extends Number[]) in the type List<capture-of ? super Number[]> is not applicable for the arguments (Number[])\n" +
19961 			"	       ^^^\n" +
19962 			"The method add(capture#4-of ? extends Number[]) in the type List<capture#4-of ? extends Number[]> is not applicable for the arguments (Number[])\n" +
19963 			"----------\n");
19964 	}
19965 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=93044
19966 	public void test0631() {
19967 		this.runNegativeTest(
19968             new String[] {
19969                 "X.java",
19970 				"import java.lang.annotation.RetentionPolicy;\n" +
19971 				"\n" +
19972 				"public class X\n" +
19973 				"{\n" +
19974 				"		 public static void main(String[] args)\n" +
19975 				"		 {\n" +
19976 				"		 		 Class<? extends Enum<?>> c = RetentionPolicy.class;\n" +
19977 				"		 		 System.out.println(Enum.valueOf(c, \"CLASS\"));\n" +
19978 				"		 }\n" +
19979 				"}\n",
19980 	        },
19981 	        this.complianceLevel < ClassFileConstants.JDK1_8 ?
19982 	        "----------\n" +
19983 			"1. ERROR in X.java (at line 8)\n" +
19984 			"	System.out.println(Enum.valueOf(c, \"CLASS\"));\n" +
19985 			"	                        ^^^^^^^\n" +
19986 			"Bound mismatch: The generic method valueOf(Class<T>, String) of type Enum<E> is not applicable for the arguments (Class<capture#1-of ? extends Enum<?>>, String). The inferred type capture#1-of ? extends Enum<?> is not a valid substitute for the bounded parameter <T extends Enum<T>>\n" +
19987 			"----------\n" :
19988 				"----------\n" +
19989 				"1. ERROR in X.java (at line 8)\n" +
19990 				"	System.out.println(Enum.valueOf(c, \"CLASS\"));\n" +
19991 				"	                        ^^^^^^^\n" +
19992 				"The method valueOf(Class<T>, String) in the type Enum is not applicable for the arguments (Class<capture#1-of ? extends Enum<?>>, String)\n" +
19993 				"----------\n");
19994 	}
19995 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=92982
19996 	public void test0632() {
19997 	    this.runNegativeTest(
19998             new String[] {
19999                 "X.java",
20000 				"import java.util.Vector;\n" +
20001 				"\n" +
20002 				"@SuppressWarnings(\"null\")\n" +
20003 				"public class X {\n" +
20004 				"	void test01() {\n" +
20005 				"		Vector<? super java.lang.Object[]> lhs = null;\n" +
20006 				"		Vector<? extends java.lang.Object[]> rhs = null;\n" +
20007 				"		lhs.add(rhs.get(0));\n" +
20008 				"	}\n" +
20009 				"	void test02() {\n" +
20010 				"		Vector<? extends java.lang.Object[]> lhs = null;\n" +
20011 				"		Vector<? extends java.lang.Object[]> rhs = null;\n" +
20012 				"		lhs.add(rhs.get(0));\n" +
20013 				"	}\n" +
20014 				"	void test3() {\n" +
20015 				"		Vector<? super java.lang.Object[]> lhs = null;\n" +
20016 				"		Vector<? super java.lang.Object[]> rhs = null;\n" +
20017 				"		lhs.add(rhs.get(0));\n" +
20018 				"	}\n" +
20019 				"	void test4() {\n" +
20020 				"		Vector<?  extends java.lang.Object[]> lhs = null;\n" +
20021 				"		Vector<? super java.lang.Object[]> rhs = null;\n" +
20022 				"		lhs.add(rhs.get(0));\n" +
20023 				"	}\n" +
20024 				"}\n",
20025 	        },
20026 			"----------\n" +
20027 			"1. ERROR in X.java (at line 13)\n" +
20028 			"	lhs.add(rhs.get(0));\n" +
20029 			"	    ^^^\n" +
20030 			"The method add(capture#3-of ? extends Object[]) in the type Vector<capture#3-of ? extends Object[]> is not applicable for the arguments (capture#4-of ? extends Object[])\n" +
20031 			"----------\n" +
20032 			"2. ERROR in X.java (at line 18)\n" +
20033 			"	lhs.add(rhs.get(0));\n" +
20034 			"	    ^^^\n" +
20035 			"The method add(capture#5-of ? super Object[]) in the type Vector<capture#5-of ? super Object[]> is not applicable for the arguments (capture#6-of ? super Object[])\n" +
20036 			"----------\n" +
20037 			"3. ERROR in X.java (at line 23)\n" +
20038 			"	lhs.add(rhs.get(0));\n" +
20039 			"	    ^^^\n" +
20040 			"The method add(capture#7-of ? extends Object[]) in the type Vector<capture#7-of ? extends Object[]> is not applicable for the arguments (capture#8-of ? super Object[])\n" +
20041 			"----------\n");
20042 	}
20043 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=92982 - variation
20044 	public void test0633() {
20045 	    runConformTest(
20046     		// test directory preparation
20047     		true /* flush output directory */,
20048     		new String[] { /* test files */
20049                 "X.java",
20050 				"import java.util.Vector;\n" +
20051 				"\n" +
20052 				"public class X {\n" +
20053 				"	void test1() {\n" +
20054 				"		Vector<? super Object[]> lhs = null;\n" +
20055 				"		Vector<Object[]> rhs = null;\n" +
20056 				"		lhs.add(rhs.get(0)); \n" +
20057 				"		foo(rhs.get(0)); // ok #foo(Object[])\n" +
20058 				"	}\n" +
20059 				"	void foo(Object[] objs) {\n" +
20060 				"	}\n" +
20061 				"}\n",
20062 	        },
20063 			// compiler results
20064 			null /* do not check compiler log */,
20065 			// runtime results
20066 			"" /* expected output string */,
20067 			null /* do not check error string */,
20068 			// javac options
20069 			JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
20070 	}
20071 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=90775
20072 	public void test0634() {
20073 	    this.runNegativeTest(
20074             new String[] {
20075                 "X.java",
20076 				"import java.lang.reflect.Array;\n" +
20077 				"\n" +
20078 				"public class X<T> {\n" +
20079 				"\n" +
20080 				"	T[] theArray;\n" +
20081 				"\n" +
20082 				"	public X(Class<T> clazz) {\n" +
20083 				"		theArray = (T[]) Array.newInstance(clazz, 10); // Compiler warning\n" +
20084 				"	}\n" +
20085 				"\n" +
20086 				"	public T get(int i) {\n" +
20087 				"		return theArray[i];\n" +
20088 				"	}\n" +
20089 				"\n" +
20090 				"	public static void main(String[] args) {\n" +
20091 				"		X<Integer> t = new X<Integer>(Integer.class);\n" +
20092 				"		// GenericsArray1<Integer> t = new GenericsArray1<Integer>( int.class );\n" +
20093 				"		Object[] o = t.theArray;\n" +
20094 				"	}\n" +
20095 				"  Zork z;\n" +
20096 				"}\n",
20097 	        },
20098 	        "----------\n" +
20099 			"1. WARNING in X.java (at line 8)\n" +
20100 			"	theArray = (T[]) Array.newInstance(clazz, 10); // Compiler warning\n" +
20101 			"	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
20102 			"Type safety: Unchecked cast from Object to T[]\n" +
20103 			"----------\n" +
20104 			"2. ERROR in X.java (at line 20)\n" +
20105 			"	Zork z;\n" +
20106 			"	^^^^\n" +
20107 			"Zork cannot be resolved to a type\n" +
20108 			"----------\n");
20109 	}
20110 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=93298
20111 	public void test0635() {
20112 	    this.runConformTest(
20113             new String[] {
20114                 "X.java",
20115 				"import java.util.Iterator;\n" +
20116 				"public class X {\n" +
20117 				"	public static class Indexed <U>  {\n" +
20118 				"		public Iterator<U> foo() {\n" +
20119 				"			return new IndexedIter();\n" +
20120 				"		}\n" +
20121 				"		class IndexedIter implements Iterator<U> {\n" +
20122 				"			public boolean hasNext() {\n" +
20123 				"				return false;\n" +
20124 				"			}\n" +
20125 				"			public U next() {\n" +
20126 				"				return null;\n" +
20127 				"			}\n" +
20128 				"			public void remove() {\n" +
20129 				"			}\n" +
20130 				"		}\n" +
20131 				"	}\n" +
20132 				"}\n",
20133 	        },
20134 			"");
20135 	}
20136 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=78084
20137 	public void test0636() {
20138 	    this.runNegativeTest(
20139             new String[] {
20140                 "X.java",
20141 			"public abstract class X<T> {\n" +
20142 			"  public final T element() {\n" +
20143 			"    T result = (T) customElement(); // reports unnecessary cast\n" +
20144 			"    return result;\n" +
20145 			"  }\n" +
20146 			"  protected abstract Object customElement();\n" +
20147 			"  Zork z;\n" +
20148 			"}\n",
20149 	        },
20150 	        "----------\n" +
20151 			"1. WARNING in X.java (at line 3)\n" +
20152 			"	T result = (T) customElement(); // reports unnecessary cast\n" +
20153 			"	           ^^^^^^^^^^^^^^^^^^^\n" +
20154 			"Type safety: Unchecked cast from Object to T\n" +
20155 			"----------\n" +
20156 			"2. ERROR in X.java (at line 7)\n" +
20157 			"	Zork z;\n" +
20158 			"	^^^^\n" +
20159 			"Zork cannot be resolved to a type\n" +
20160 			"----------\n");
20161 	}
20162 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=84968
20163 	public void test0637() {
20164 	    this.runConformTest(
20165             new String[] {
20166                 "X.java",
20167 				"public class X<E> {\n" +
20168 				"	public static final class Ex1 extends Exception {\n" +
20169 				"		private static final long serialVersionUID = 1;\n" +
20170 				"	}\n" +
20171 				"\n" +
20172 				"	private void a1() {\n" +
20173 				"		try {\n" +
20174 				"			a1_1();\n" +
20175 				"		} catch (Ex1 si) {\n" +
20176 				"			assert si != null;\n" +
20177 				"		}\n" +
20178 				"	}\n" +
20179 				"\n" +
20180 				"	protected Object a1_1() throws Ex1 {\n" +
20181 				"		return null;\n" +
20182 				"	}\n" +
20183 				"\n" +
20184 				"	private void a2() {\n" +
20185 				"		try {\n" +
20186 				"			a2_1();\n" +
20187 				"		} catch (Ex2 si) {\n" +
20188 				"			assert si != null;\n" +
20189 				"		}\n" +
20190 				"	}\n" +
20191 				"\n" +
20192 				"	protected Object a2_1() throws Ex2 {\n" +
20193 				"		return null;\n" +
20194 				"	}\n" +
20195 				"\n" +
20196 				"	public final static class Ex3 extends Exception {\n" +
20197 				"		private static final long serialVersionUID = 1;\n" +
20198 				"	}\n" +
20199 				"\n" +
20200 				"	private void a3() {\n" +
20201 				"		try {\n" +
20202 				"			a3_1();\n" +
20203 				"		} catch (Ex3 si) {\n" +
20204 				"			assert si != null;\n" +
20205 				"		}\n" +
20206 				"	}\n" +
20207 				"\n" +
20208 				"	protected Object a3_1() throws Ex3 {\n" +
20209 				"		return null;\n" +
20210 				"	}\n" +
20211 				"\n" +
20212 				"}\n" +
20213 				"\n" +
20214 				"final class Ex2 extends Exception {\n" +
20215 				"	private static final long serialVersionUID = 1;\n" +
20216 				"}\n",
20217 	        },
20218 			"");
20219 	}
20220 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=93478
20221 	public void test0638() {
20222 	    this.runConformTest(
20223             new String[] {
20224                 "X.java",
20225 				"import java.util.concurrent.BlockingQueue;\n" +
20226 				"\n" +
20227 				"public class X {\n" +
20228 				"	static interface IMX<S, L> {\n" +
20229 				"		void call(L a, S b);\n" +
20230 				"	}\n" +
20231 				"	static interface Y<S, L> {\n" +
20232 				"		void addX(final IMX<S, L> a);\n" +
20233 				"		void removeX(final IMX<S, L> a);\n" +
20234 				"	}\n" +
20235 				"	static final class Pair<T, V> {\n" +
20236 				"		T first;\n" +
20237 				"\n" +
20238 				"		V second;\n" +
20239 				"	}\n" +
20240 				"	static class Bar<P> {\n" +
20241 				"		Bar(final BlockingQueue<P> a) {\n" +
20242 				"\n" +
20243 				"		}\n" +
20244 				"	}\n" +
20245 				"}\n" +
20246 				"\n" +
20247 				"final class Foo<S, L> extends X.Bar<X.Pair<L[], S>> implements X.IMX<S, L> {\n" +
20248 				"	Foo(final BlockingQueue<X.Pair<L[], S>> in) {\n" +
20249 				"		super(in);\n" +
20250 				"	}\n" +
20251 				"	public void call(L a, S b) {\n" +
20252 				"	}\n" +
20253 				"}\n",
20254 	        },
20255 			"");
20256 	}
20257 	public void test0639() {
20258 	    this.runConformTest(
20259             new String[] {
20260                 "X.java",
20261 				"import java.lang.annotation.Annotation;\n" +
20262 				"import java.lang.reflect.*;\n" +
20263 				"\n" +
20264 				"@interface MyAnnotation {\n" +
20265 				"}\n" +
20266 				"public class X {\n" +
20267 				"	void test() throws Exception {\n" +
20268 				"		Class type = X.class;\n" +
20269 				"		Method method = type.getMethod(\"test\");\n" +
20270 				"		Constructor constructor = type.getConstructor();\n" +
20271 				"		Field field = type.getField(\"field\");\n" +
20272 				"		Package packge = type.getPackage();\n" +
20273 				"		MyAnnotation typeAnnot = getAnnotation(MyAnnotation.class);\n" +
20274 				"		MyAnnotation methodAnnot = getAnnotation(MyAnnotation.class);\n" +
20275 				"		MyAnnotation constrAnnot = getAnnotation(MyAnnotation.class);\n" +
20276 				"		MyAnnotation fieldAnnot = getAnnotation(MyAnnotation.class);\n" +
20277 				"		MyAnnotation packgeAnnot = getAnnotation(MyAnnotation.class);\n" +
20278 				"	}\n" +
20279 				"\n" +
20280 				"	int field;\n" +
20281 				"	\n" +
20282 				"	<U extends Annotation> U getAnnotation(Class<U> annotatedType) {\n" +
20283 				"		return null;\n" +
20284 				"	}\n" +
20285 				"}\n",
20286 	        },
20287 			"");
20288 	}
20289 	public void test0640() {
20290 	    this.runConformTest(
20291             new String[] {
20292                 "X.java",
20293 				"import java.lang.annotation.Annotation;\n" +
20294 				"import java.lang.reflect.*;\n" +
20295 				"\n" +
20296 				"@interface MyAnnotation {\n" +
20297 				"}\n" +
20298 				"public class X {\n" +
20299 				"	void test() throws Exception {\n" +
20300 				"		Class<?> type = X.class;\n" +
20301 				"		Method method = type.getMethod(\"test\");\n" +
20302 				"		Constructor constructor = type.getConstructor();\n" +
20303 				"		Field field = type.getField(\"field\");\n" +
20304 				"		Package packge = type.getPackage();\n" +
20305 				"		MyAnnotation typeAnnot = getAnnotation(MyAnnotation.class);\n" +
20306 				"		MyAnnotation methodAnnot = getAnnotation(MyAnnotation.class);\n" +
20307 				"		MyAnnotation constrAnnot = getAnnotation(MyAnnotation.class);\n" +
20308 				"		MyAnnotation fieldAnnot = getAnnotation(MyAnnotation.class);\n" +
20309 				"		MyAnnotation packgeAnnot = getAnnotation(MyAnnotation.class);\n" +
20310 				"	}\n" +
20311 				"\n" +
20312 				"	int field;\n" +
20313 				"	\n" +
20314 				"	<U extends Annotation> U getAnnotation(Class<U> annotatedType) {\n" +
20315 				"		return null;\n" +
20316 				"	}\n" +
20317 				"}\n",
20318 	        },
20319 			"");
20320 	}
20321 	public void test0641() {
20322 	    this.runNegativeTest(
20323             new String[] {
20324                 "X.java",
20325 				"import java.lang.reflect.*;\n" +
20326 				"\n" +
20327 				"@interface MyAnnotation {\n" +
20328 				"}\n" +
20329 				"@SuppressWarnings(\"all\")\n" +
20330 				"public class X {\n" +
20331 				"	void test() throws Exception {\n" +
20332 				"		Class type = X.class;\n" +
20333 				"		Method method = type.getMethod(\"test\");\n" +
20334 				"		Constructor constructor = type.getConstructor();\n" +
20335 				"		Field field = type.getField(\"field\");\n" +
20336 				"		Package packge = type.getPackage();\n" +
20337 				"		MyAnnotation typeAnnot = type.getAnnotation(MyAnnotation.class);\n" +
20338 				"		MyAnnotation methodAnnot = method.getAnnotation(MyAnnotation.class);\n" +
20339 				"		MyAnnotation constrAnnot = constructor.getAnnotation(MyAnnotation.class);\n" +
20340 				"		MyAnnotation fieldAnnot = field.getAnnotation(MyAnnotation.class);\n" +
20341 				"		MyAnnotation packgeAnnot = packge.getAnnotation(MyAnnotation.class);\n" +
20342 				"	}\n" +
20343 				"\n" +
20344 				"	int field;\n" +
20345 				"}\n",
20346 	        },
20347 	        "----------\n" +
20348 			"1. ERROR in X.java (at line 13)\n" +
20349 			"	MyAnnotation typeAnnot = type.getAnnotation(MyAnnotation.class);\n" +
20350 			"	                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
20351 			"Type mismatch: cannot convert from Annotation to MyAnnotation\n" +
20352 			"----------\n" +
20353 			"2. ERROR in X.java (at line 15)\n" +
20354 			"	MyAnnotation constrAnnot = constructor.getAnnotation(MyAnnotation.class);\n" +
20355 			"	                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
20356 			"Type mismatch: cannot convert from Annotation to MyAnnotation\n" +
20357 			"----------\n");
20358 	}
20359 	public void test0642() {
20360 	    this.runConformTest(
20361             new String[] {
20362                 "X.java",
20363 				"import java.lang.reflect.*;\n" +
20364 				"\n" +
20365 				"@interface MyAnnotation {\n" +
20366 				"}\n" +
20367 				"@SuppressWarnings(\"all\")\n" +
20368 				"public class X {\n" +
20369 				"	void test() throws Exception {\n" +
20370 				"		Class<?> type = X.class;\n" +
20371 				"		Method method = type.getMethod(\"test\");\n" +
20372 				"		Constructor<?> constructor = type.getConstructor();\n" +
20373 				"		Field field = type.getField(\"field\");\n" +
20374 				"		Package packge = type.getPackage();\n" +
20375 				"		MyAnnotation typeAnnot = type.getAnnotation(MyAnnotation.class);\n" +
20376 				"		MyAnnotation methodAnnot = method.getAnnotation(MyAnnotation.class);\n" +
20377 				"		MyAnnotation constrAnnot = constructor.getAnnotation(MyAnnotation.class);\n" +
20378 				"		MyAnnotation fieldAnnot = field.getAnnotation(MyAnnotation.class);\n" +
20379 				"		MyAnnotation packgeAnnot = packge.getAnnotation(MyAnnotation.class);\n" +
20380 				"	}\n" +
20381 				"\n" +
20382 				"	int field;\n" +
20383 				"}\n",
20384 	        },
20385 			"");
20386 	}
20387 	public void test0643() {
20388 	    this.runConformTest(
20389             new String[] {
20390                 "X.java",
20391 				"public class X<T> {\n" +
20392 				"	\n" +
20393 				"	static <U> U foo(U u) {\n" +
20394 				"		return u;\n" +
20395 				"	}\n" +
20396 				"	\n" +
20397 				"	void bar(X x) {\n" +
20398 				"		String str = x.foo(\"hello\");\n" +
20399 				"	}\n" +
20400 				"}\n",
20401 	        },
20402 			"");
20403 	}
20404 	public void test0644() {
20405 	    this.runNegativeTest(
20406             new String[] {
20407                 "X.java",
20408 				"public class X<T> {\n" +
20409 				"	\n" +
20410 				"	<U> U foo(U u) {\n" +
20411 				"		return u;\n" +
20412 				"	}\n" +
20413 				"	\n" +
20414 				"	void bar(X x) {\n" +
20415 				"		String str = x.foo(\"hello\");\n" +
20416 				"	}\n" +
20417 				"}\n",
20418 	        },
20419 	        "----------\n" +
20420 			"1. WARNING in X.java (at line 7)\n" +
20421 			"	void bar(X x) {\n" +
20422 			"	         ^\n" +
20423 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
20424 			"----------\n" +
20425 			"2. WARNING in X.java (at line 8)\n" +
20426 			"	String str = x.foo(\"hello\");\n" +
20427 			"	             ^^^^^^^^^^^^^^\n" +
20428 			"Type safety: The method foo(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
20429 			"----------\n" +
20430 			"3. ERROR in X.java (at line 8)\n" +
20431 			"	String str = x.foo(\"hello\");\n" +
20432 			"	             ^^^^^^^^^^^^^^\n" +
20433 			"Type mismatch: cannot convert from Object to String\n" +
20434 			"----------\n");
20435 	}
20436 	public void test0645() {
20437 	    this.runNegativeTest(
20438             new String[] {
20439                 "X.java",
20440 				"import java.lang.annotation.Annotation;\n" +
20441 				"\n" +
20442 				"@interface MyAnnotation {\n" +
20443 				"}\n" +
20444 				"\n" +
20445 				"class X {\n" +
20446 				"	void bar(XClass<String> arg) {\n" +
20447 				"		XClass xc = new XClass();\n" +
20448 				"		String str = xc.getConstructor().getAnnotation(arg);\n" +
20449 				"	}\n" +
20450 				"}\n" +
20451 				"\n" +
20452 				"class XClass<U> {\n" +
20453 				"	XConstructor<U> getConstructor() {\n" +
20454 				"		return null;\n" +
20455 				"	}\n" +
20456 				"}\n" +
20457 				"class XConstructor<V> {\n" +
20458 				"	<W extends Annotation> W getAnnotation(XClass<W> cl) {\n" +
20459 				"		return null;\n" +
20460 				"	}\n" +
20461 				"}\n",
20462 	        },
20463 			"----------\n" +
20464 			"1. WARNING in X.java (at line 8)\n" +
20465 			"	XClass xc = new XClass();\n" +
20466 			"	^^^^^^\n" +
20467 			"XClass is a raw type. References to generic type XClass<U> should be parameterized\n" +
20468 			"----------\n" +
20469 			"2. WARNING in X.java (at line 8)\n" +
20470 			"	XClass xc = new XClass();\n" +
20471 			"	                ^^^^^^\n" +
20472 			"XClass is a raw type. References to generic type XClass<U> should be parameterized\n" +
20473 			"----------\n" +
20474 			"3. WARNING in X.java (at line 9)\n" +
20475 			"	String str = xc.getConstructor().getAnnotation(arg);\n" +
20476 			"	             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
20477 			"Type safety: The method getAnnotation(XClass) belongs to the raw type XConstructor. References to generic type XConstructor<V> should be parameterized\n" +
20478 			"----------\n" +
20479 			"4. ERROR in X.java (at line 9)\n" +
20480 			"	String str = xc.getConstructor().getAnnotation(arg);\n" +
20481 			"	             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
20482 			"Type mismatch: cannot convert from Annotation to String\n" +
20483 			"----------\n");
20484 	}
20485 	public void test0646() {
20486 	    this.runNegativeTest(
20487             new String[] {
20488                 "X.java",
20489 				"public class X {\n" +
20490 				"	public static void main(String[] args) {\n" +
20491 				"		Outer.Inner inner = new Outer().new Inner();\n" +
20492 				"		X x = inner.setOuterT(new X());\n" +
20493 				"		\n" +
20494 				"		Outer<String>.Inner innerS = inner;\n" +
20495 				"	}\n" +
20496 				"}\n" +
20497 				"\n" +
20498 				"class Outer<T> {\n" +
20499 				"	T t;\n" +
20500 				"	class Inner {\n" +
20501 				"		T setOuterT(T t1) {\n" +
20502 				"			t = t1;\n" +
20503 				"			return t;\n" +
20504 				"		}\n" +
20505 				"	}\n" +
20506 				"}\n",
20507 	        },
20508 	        "----------\n" +
20509 			"1. WARNING in X.java (at line 3)\n" +
20510 			"	Outer.Inner inner = new Outer().new Inner();\n" +
20511 			"	^^^^^^^^^^^\n" +
20512 			"Outer.Inner is a raw type. References to generic type Outer<T>.Inner should be parameterized\n" +
20513 			"----------\n" +
20514 			"2. WARNING in X.java (at line 3)\n" +
20515 			"	Outer.Inner inner = new Outer().new Inner();\n" +
20516 			"	                        ^^^^^\n" +
20517 			"Outer is a raw type. References to generic type Outer<T> should be parameterized\n" +
20518 			"----------\n" +
20519 			"3. WARNING in X.java (at line 3)\n" +
20520 			"	Outer.Inner inner = new Outer().new Inner();\n" +
20521 			"	                                    ^^^^^\n" +
20522 			"Outer.Inner is a raw type. References to generic type Outer<T>.Inner should be parameterized\n" +
20523 			"----------\n" +
20524 			"4. WARNING in X.java (at line 4)\n" +
20525 			"	X x = inner.setOuterT(new X());\n" +
20526 			"	      ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
20527 			"Type safety: The method setOuterT(Object) belongs to the raw type Outer.Inner. References to generic type Outer<T>.Inner should be parameterized\n" +
20528 			"----------\n" +
20529 			"5. ERROR in X.java (at line 4)\n" +
20530 			"	X x = inner.setOuterT(new X());\n" +
20531 			"	      ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
20532 			"Type mismatch: cannot convert from Object to X\n" +
20533 			"----------\n" +
20534 			"6. WARNING in X.java (at line 6)\n" +
20535 			"	Outer<String>.Inner innerS = inner;\n" +
20536 			"	                             ^^^^^\n" +
20537 			"Type safety: The expression of type Outer.Inner needs unchecked conversion to conform to Outer<String>.Inner\n" +
20538 			"----------\n");
20539 	}
20540 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=94644
20541 	public void test0647() {
20542 	    this.runNegativeTest(
20543             new String[] {
20544                 "X.java",
20545 				"public class X {\n" +
20546 				"	public static void main(String[] args) {\n" +
20547 				"		Outer.Inner inner = new Outer().new Inner();\n" +
20548 				"		X x = inner.set(new X());\n" +
20549 				"		\n" +
20550 				"		Outer<String>.Inner innerS = inner;\n" +
20551 				"	}\n" +
20552 				"}\n" +
20553 				"\n" +
20554 				"class Outer<T> {\n" +
20555 				"	T t;\n" +
20556 				"	static class Inner<U> {\n" +
20557 				"		U set(U u) {\n" +
20558 				"			return u;\n" +
20559 				"		}\n" +
20560 				"	}\n" +
20561 				"}\n",
20562 	        },
20563 	        "----------\n" +
20564 			"1. WARNING in X.java (at line 3)\n" +
20565 			"	Outer.Inner inner = new Outer().new Inner();\n" +
20566 			"	^^^^^^^^^^^\n" +
20567 			"Outer.Inner is a raw type. References to generic type Outer.Inner<U> should be parameterized\n" +
20568 			"----------\n" +
20569 			"2. WARNING in X.java (at line 3)\n" +
20570 			"	Outer.Inner inner = new Outer().new Inner();\n" +
20571 			"	                        ^^^^^\n" +
20572 			"Outer is a raw type. References to generic type Outer<T> should be parameterized\n" +
20573 			"----------\n" +
20574 			"3. WARNING in X.java (at line 3)\n" +
20575 			"	Outer.Inner inner = new Outer().new Inner();\n" +
20576 			"	                                    ^^^^^\n" +
20577 			"Outer.Inner is a raw type. References to generic type Outer.Inner<U> should be parameterized\n" +
20578 			"----------\n" +
20579 			"4. WARNING in X.java (at line 4)\n" +
20580 			"	X x = inner.set(new X());\n" +
20581 			"	      ^^^^^^^^^^^^^^^^^^\n" +
20582 			"Type safety: The method set(Object) belongs to the raw type Outer.Inner. References to generic type Outer.Inner<U> should be parameterized\n" +
20583 			"----------\n" +
20584 			"5. ERROR in X.java (at line 4)\n" +
20585 			"	X x = inner.set(new X());\n" +
20586 			"	      ^^^^^^^^^^^^^^^^^^\n" +
20587 			"Type mismatch: cannot convert from Object to X\n" +
20588 			"----------\n" +
20589 			"6. ERROR in X.java (at line 6)\n" +
20590 			"	Outer<String>.Inner innerS = inner;\n" +
20591 			"	^^^^^^^^^^^^^^^^^^^\n" +
20592 			"The member type Outer.Inner<U> cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type Outer<String>\n" +
20593 			"----------\n");
20594 	}
20595 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=94644 - variation
20596 	public void test0648() {
20597 	    this.runNegativeTest(
20598             new String[] {
20599                 "X.java",
20600 				"public class X {\n" +
20601 				"	void foo() {\n" +
20602 				"		Outer.Inner inner = new Sub().get();\n" +
20603 				"	}\n" +
20604 				"	Zork z;\n" +
20605 				"}\n" +
20606 				"class Outer<T> {\n" +
20607 				"	class Inner<U> {\n" +
20608 				"	}\n" +
20609 				"}\n" +
20610 				"class Sub extends Outer {\n" +
20611 				"	Inner get() { return null; }\n" +
20612 				"}\n",
20613 	        },
20614 	        "----------\n" +
20615 			"1. WARNING in X.java (at line 3)\n" +
20616 			"	Outer.Inner inner = new Sub().get();\n" +
20617 			"	^^^^^^^^^^^\n" +
20618 			"Outer.Inner is a raw type. References to generic type Outer<T>.Inner<U> should be parameterized\n" +
20619 			"----------\n" +
20620 			"2. ERROR in X.java (at line 5)\n" +
20621 			"	Zork z;\n" +
20622 			"	^^^^\n" +
20623 			"Zork cannot be resolved to a type\n" +
20624 			"----------\n" +
20625 			"3. WARNING in X.java (at line 11)\n" +
20626 			"	class Sub extends Outer {\n" +
20627 			"	                  ^^^^^\n" +
20628 			"Outer is a raw type. References to generic type Outer<T> should be parameterized\n" +
20629 			"----------\n" +
20630 			"4. WARNING in X.java (at line 12)\n" +
20631 			"	Inner get() { return null; }\n" +
20632 			"	^^^^^\n" +
20633 			"Outer.Inner is a raw type. References to generic type Outer<T>.Inner<U> should be parameterized\n" +
20634 			"----------\n");
20635 	}
20636 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=94644 - variation
20637 	public void test0649() {
20638 	    this.runNegativeTest(
20639             new String[] {
20640                 "X.java",
20641 				"public class X {\n" +
20642 				"	void foo() {\n" +
20643 				"		Outer<String>.Inner inner = new Sub().get();\n" +
20644 				"	}\n" +
20645 				"	Zork z;\n" +
20646 				"}\n" +
20647 				"class Outer<T> {\n" +
20648 				"	class Inner {\n" +
20649 				"	}\n" +
20650 				"}\n" +
20651 				"class Sub extends Outer {\n" +
20652 				"	Inner get() { return null; }\n" +
20653 				"}\n",
20654 	        },
20655 	        "----------\n" +
20656 			"1. WARNING in X.java (at line 3)\n" +
20657 			"	Outer<String>.Inner inner = new Sub().get();\n" +
20658 			"	                            ^^^^^^^^^^^^^^^\n" +
20659 			"Type safety: The expression of type Outer.Inner needs unchecked conversion to conform to Outer<String>.Inner\n" +
20660 			"----------\n" +
20661 			"2. ERROR in X.java (at line 5)\n" +
20662 			"	Zork z;\n" +
20663 			"	^^^^\n" +
20664 			"Zork cannot be resolved to a type\n" +
20665 			"----------\n" +
20666 			"3. WARNING in X.java (at line 11)\n" +
20667 			"	class Sub extends Outer {\n" +
20668 			"	                  ^^^^^\n" +
20669 			"Outer is a raw type. References to generic type Outer<T> should be parameterized\n" +
20670 			"----------\n" +
20671 			"4. WARNING in X.java (at line 12)\n" +
20672 			"	Inner get() { return null; }\n" +
20673 			"	^^^^^\n" +
20674 			"Outer.Inner is a raw type. References to generic type Outer<T>.Inner should be parameterized\n" +
20675 			"----------\n");
20676 	}
20677 
20678 	//https://bugs.eclipse.org/bugs/show_bug.cgi?id=89440
20679 	public void test0650() {
20680 	    this.runConformTest(
20681             new String[] {
20682 				"p/A.java",
20683 				"package p;\n" +
20684 				"\n" +
20685 				"public interface A<V> {\n" +
20686 				"	public static enum Stuff {\n" +
20687 				"		FIRST, SECOND, THIRD\n" +
20688 				"	};\n" +
20689 				"}",
20690             },
20691             "");
20692 	    this.runConformTest(
20693 	    	new String[] {
20694 				"q/SampleClass2.java",
20695 				"package q;\n" +
20696 				"\n" +
20697 				"import p.A.Stuff;\n" +
20698 				"\n" +
20699 				"public class SampleClass2 {\n" +
20700 				"  public void doSomething(Stuff thing) {\n" +
20701 				"    \n" +
20702 				"  }\n" +
20703 				"}"
20704             },
20705 			"",
20706 			null,
20707 			false,
20708 			null);
20709 		this.runConformTest(
20710 			new String[] {
20711 				"q/SampleClass3.java",
20712 				"package q;\n" +
20713 				"\n" +
20714 				"import p.A;\n" +
20715 				"\n" +
20716 				"public class SampleClass3 {\n" +
20717 				"	public void doSomething() {\n" +
20718 				"		SampleClass2 sample = new SampleClass2();\n" +
20719 				"		sample.doSomething(A.Stuff.FIRST);\n" +
20720 				"	}\n" +
20721 				"}",
20722 			},
20723 			"",
20724 			null,
20725 			false,
20726 			null);
20727 	}
20728 	public void test0651() {
20729 	    runConformTest(
20730             new String[] {
20731                 "X.java",
20732 				"public class X<U> {\n" +
20733 				"\n" +
20734 				"	int field;\n" +
20735 				"	static int FIELD;\n" +
20736 				"\n" +
20737 				"	{\n" +
20738 				"		field = 1;\n" +
20739 				"	}\n" +
20740 				"	static {\n" +
20741 				"		FIELD = 1;\n" +
20742 				"	}\n" +
20743 				"\n" +
20744 				"	public Values<U> foo(Box<? extends U> box) {\n" +
20745 				"		return selectedValues(box.getValues()); // 1\n" +
20746 				"	}\n" +
20747 				"	public static <G> Values<G> selectedValues(Values<? extends G> v) {\n" +
20748 				"		return null;\n" +
20749 				"	}\n" +
20750 				"}\n" +
20751 				"abstract class Box<V extends java.io.Serializable> { // Added bound for V\n" +
20752 				"	abstract Values<V> getValues();\n" +
20753 				"}\n" +
20754 				"abstract class Values<T> {\n" +
20755 				"}\n",
20756 	        },
20757 			JavacTestOptions.EclipseHasABug.EclipseBug236217);
20758 	}
20759 	public void test0652() {
20760 	    this.runConformTest(
20761             new String[] {
20762                 "X.java",
20763 				"import java.util.*;\n" +
20764 				"\n" +
20765 				"public class X {\n" +
20766 				"    public static void main(String[] args) {\n" +
20767 				"        Collection<?> c = new HashSet<String>();\n" +
20768 				"        Set<?> s = (Set<?>)c;\n" +
20769 				"    }\n" +
20770 				"}\n",
20771 	        },
20772 			"");
20773 	}
20774 	public void test0653() {
20775 	    this.runNegativeTest(
20776             new String[] {
20777                 "X.java",
20778 				"import java.util.*;\n" +
20779 				"\n" +
20780 				"public class X {\n" +
20781 				"	static public <T extends Collection> void workaround(T a, T b) {\n" +
20782 				"		a.addAll(b);\n" +
20783 				"	}\n" +
20784 				"	Zork z;\n" +
20785 				"}\n",
20786 	        },
20787 	        "----------\n" +
20788 			"1. WARNING in X.java (at line 4)\n" +
20789 			"	static public <T extends Collection> void workaround(T a, T b) {\n" +
20790 			"	                         ^^^^^^^^^^\n" +
20791 			"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
20792 			"----------\n" +
20793 			"2. WARNING in X.java (at line 5)\n" +
20794 			"	a.addAll(b);\n" +
20795 			"	^^^^^^^^^^^\n" +
20796 			"Type safety: The method addAll(Collection) belongs to the raw type Collection. References to generic type Collection<E> should be parameterized\n" +
20797 			"----------\n" +
20798 			"3. ERROR in X.java (at line 7)\n" +
20799 			"	Zork z;\n" +
20800 			"	^^^^\n" +
20801 			"Zork cannot be resolved to a type\n" +
20802 			"----------\n");
20803 	}
20804 	public void test0654() {
20805 	    this.runNegativeTest(
20806             new String[] {
20807                 "X.java",
20808 				"import java.util.*;\n" +
20809 				"\n" +
20810 				"public class X {\n" +
20811 				"	public static void main(String[] args) {\n" +
20812 				"		Map myMap = new HashMap();\n" +
20813 				"		myMap.put(\"key1\", \"1\");\n" +
20814 				"\n" +
20815 				"		for (Map.Entry e : myMap.entrySet())\n" +
20816 				"			System.out.println(\"Key = \" + e.getKey() + \" Value = \" + e.getValue());\n" +
20817 				"		Set<Map.Entry> set = myMap.entrySet();\n" +
20818 				"		for (Map.Entry e : set)\n" +
20819 				"			System.out.println(\"Key = \" + e.getKey() + \" Value = \" + e.getValue());\n" +
20820 				"	}\n" +
20821 				"}\n",
20822 	        },
20823 	        "----------\n" +
20824 			"1. WARNING in X.java (at line 5)\n" +
20825 			"	Map myMap = new HashMap();\n" +
20826 			"	^^^\n" +
20827 			"Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
20828 			"----------\n" +
20829 			"2. WARNING in X.java (at line 5)\n" +
20830 			"	Map myMap = new HashMap();\n" +
20831 			"	                ^^^^^^^\n" +
20832 			"HashMap is a raw type. References to generic type HashMap<K,V> should be parameterized\n" +
20833 			"----------\n" +
20834 			"3. WARNING in X.java (at line 6)\n" +
20835 			"	myMap.put(\"key1\", \"1\");\n" +
20836 			"	^^^^^^^^^^^^^^^^^^^^^^\n" +
20837 			"Type safety: The method put(Object, Object) belongs to the raw type Map. References to generic type Map<K,V> should be parameterized\n" +
20838 			"----------\n" +
20839 			"4. WARNING in X.java (at line 8)\n" +
20840 			"	for (Map.Entry e : myMap.entrySet())\n" +
20841 			"	     ^^^^^^^^^\n" +
20842 			"Map.Entry is a raw type. References to generic type Map.Entry<K,V> should be parameterized\n" +
20843 			"----------\n" +
20844 			"5. ERROR in X.java (at line 8)\n" +
20845 			"	for (Map.Entry e : myMap.entrySet())\n" +
20846 			"	                   ^^^^^^^^^^^^^^^^\n" +
20847 			"Type mismatch: cannot convert from element type Object to Map.Entry\n" +
20848 			"----------\n" +
20849 			"6. WARNING in X.java (at line 10)\n" +
20850 			"	Set<Map.Entry> set = myMap.entrySet();\n" +
20851 			"	    ^^^^^^^^^\n" +
20852 			"Map.Entry is a raw type. References to generic type Map.Entry<K,V> should be parameterized\n" +
20853 			"----------\n" +
20854 			"7. WARNING in X.java (at line 10)\n" +
20855 			"	Set<Map.Entry> set = myMap.entrySet();\n" +
20856 			"	                     ^^^^^^^^^^^^^^^^\n" +
20857 			"Type safety: The expression of type Set needs unchecked conversion to conform to Set<Map.Entry>\n" +
20858 			"----------\n" +
20859 			"8. WARNING in X.java (at line 11)\n" +
20860 			"	for (Map.Entry e : set)\n" +
20861 			"	     ^^^^^^^^^\n" +
20862 			"Map.Entry is a raw type. References to generic type Map.Entry<K,V> should be parameterized\n" +
20863 			"----------\n");
20864 	}
20865 // **
20866 public void test0655() {
20867 	this.runNegativeTest(
20868 		new String[] {
20869 			"X.java",
20870 			"public class X {\n" +
20871 			"    static class BB<T, S> { }\n" +
20872 			"    static class BD<T> extends BB<T, T> { }\n" +
20873 			"    void f() {\n" +
20874 			"        BB<? extends Number, ? super Integer> bb = null;\n" +
20875 			"        Object o = (BD<Number>) bb;\n" +
20876 			"    }\n" +
20877 			"    Zork z;\n" +
20878 			"}\n",
20879 		},
20880 		"----------\n" +
20881 		"1. WARNING in X.java (at line 6)\n" +
20882 		"	Object o = (BD<Number>) bb;\n" +
20883 		"	           ^^^^^^^^^^^^^^^\n" +
20884 		"Type safety: Unchecked cast from X.BB<capture#1-of ? extends Number,capture#2-of ? super Integer> to X.BD<Number>\n" +
20885 		"----------\n" +
20886 		"2. WARNING in X.java (at line 6)\n" +
20887 		"	Object o = (BD<Number>) bb;\n" +
20888 		"	           ^^^^^^^^^^^^^^^\n" +
20889 		"Unnecessary cast from X.BB<capture#1-of ? extends Number,capture#2-of ? super Integer> to X.BD<Number>\n" +
20890 		"----------\n" +
20891 		"3. ERROR in X.java (at line 8)\n" +
20892 		"	Zork z;\n" +
20893 		"	^^^^\n" +
20894 		"Zork cannot be resolved to a type\n" +
20895 		"----------\n");
20896 }
20897 public void test0656() {
20898 	this.runConformTest(
20899 		new String[] {
20900 			"X.java",
20901 			"import java.util.*;\n" +
20902 			"\n" +
20903 			"public class X {\n" +
20904 			"	protected Vector<String> v = null;\n" +
20905 			"\n" +
20906 			"	public void f() {\n" +
20907 			"		((String) (v.elementAt(0))).charAt(0);\n" +
20908 			"	}\n" +
20909 			"\n" +
20910 			"	public static void main(String[] args) {\n" +
20911 			"		System.out.println(\"SUCCESS\");\n" +
20912 			"	}\n" +
20913 			"}\n",
20914 		},
20915 		"SUCCESS");
20916 }
20917 public void test0657() {
20918 	this.runConformTest(
20919 		new String[] {
20920 			"X.java",
20921 			"public class X{\n" +
20922 			"	\n" +
20923 			"	private static class GenericWrapper<Elem>  {\n" +
20924 			"		private Elem theObject;\n" +
20925 			"		public GenericWrapper(Elem arg) {\n" +
20926 			"			theObject = arg;\n" +
20927 			"		}\n" +
20928 			"		public <T extends Elem> GenericWrapper (GenericWrapper<T> other) {\n" +
20929 			"			this.theObject = other.theObject;\n" +
20930 			"		}\n" +
20931 			"		public String toString() {\n" +
20932 			"			return theObject.toString();\n" +
20933 			"		}\n" +
20934 			"	}\n" +
20935 			"	private static GenericWrapper<String> method (Object wrappedString) {\n" +
20936 			"		return (GenericWrapper<String>) wrappedString;\n" +
20937 			"	}\n" +
20938 			"\n" +
20939 			"	public static void main(String[] args) {\n" +
20940 			"		System.out.print(method(new GenericWrapper<String>(\"abc\")));\n" +
20941 			"		System.out.println(method(new GenericWrapper<Exception>(new Exception())));\n" +
20942 			"	}\n" +
20943 			"}\n",
20944 		},
20945 		"abcjava.lang.Exception");
20946 }
20947 public void test0658() {
20948 	this.runNegativeTest(
20949 		new String[] {
20950 			"X.java",
20951 			"public class X{\n" +
20952 			"	\n" +
20953 			"	private static class GenericWrapper<Elem>  {\n" +
20954 			"		Zork z;\n" +
20955 			"		private Elem theObject;\n" +
20956 			"		public GenericWrapper(Elem arg) {\n" +
20957 			"			theObject = arg;\n" +
20958 			"		}\n" +
20959 			"		public <T extends Elem> GenericWrapper (GenericWrapper<T> other) {\n" +
20960 			"			this.theObject = other.theObject;\n" +
20961 			"		}\n" +
20962 			"		public String toString() {\n" +
20963 			"			return theObject.toString();\n" +
20964 			"		}\n" +
20965 			"	}\n" +
20966 			"	private static GenericWrapper<String> method (Object wrappedString) {\n" +
20967 			"		return (GenericWrapper<String>) wrappedString;\n" +
20968 			"	}\n" +
20969 			"\n" +
20970 			"	public static void main(String[] args) {\n" +
20971 			"		System.out.print(method(new GenericWrapper<String>(\"abc\")));\n" +
20972 			"		System.out.println(method(new GenericWrapper<Exception>(new Exception())));\n" +
20973 			"	}\n" +
20974 			"}\n",
20975 		},
20976 		"----------\n" +
20977 		"1. ERROR in X.java (at line 4)\n" +
20978 		"	Zork z;\n" +
20979 		"	^^^^\n" +
20980 		"Zork cannot be resolved to a type\n" +
20981 		"----------\n" +
20982 		"2. WARNING in X.java (at line 12)\n" +
20983 		"	public String toString() {\n" +
20984 		"	              ^^^^^^^^^^\n" +
20985 		"The method toString() of type X.GenericWrapper<Elem> should be tagged with @Override since it actually overrides a superclass method\n" +
20986 		"----------\n" +
20987 		"3. WARNING in X.java (at line 17)\n" +
20988 		"	return (GenericWrapper<String>) wrappedString;\n" +
20989 		"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
20990 		"Type safety: Unchecked cast from Object to X.GenericWrapper<String>\n" +
20991 		"----------\n");
20992 }
20993 public void test0659() {
20994 	this.runNegativeTest(
20995 		new String[] {
20996 			"X.java",
20997 			"import java.lang.ref.*;\n" +
20998 			"\n" +
20999 			"@SuppressWarnings(\"unused\")\n" +
21000 			"public class X<K, V> extends WeakReference<V> {\n" +
21001 			"	Zork z;\n" +
21002 			"	static ReferenceQueue<Integer> queue = new ReferenceQueue<Integer>();\n" +
21003 			"\n" +
21004 			"	private K key;\n" +
21005 			"\n" +
21006 			"	public X(K key, V value, ReferenceQueue<V> queue) {\n" +
21007 			"		super(value, queue);\n" +
21008 			"	}\n" +
21009 			"\n" +
21010 			"	public K getKey() {\n" +
21011 			"		return key;\n" +
21012 			"	}\n" +
21013 			"	@Override\n" +
21014 			"	public String toString() {\n" +
21015 			"		return \"key:\" + key;\n" +
21016 			"	}\n" +
21017 			"\n" +
21018 			"	public static void main(String[] arg) throws Exception {\n" +
21019 			"		X<String, Integer> ref = new X<String, Integer>(\"Dummy Key\", Integer.valueOf(5), queue);\n" +
21020 			"		new Thread() {\n" +
21021 			"			@Override\n" +
21022 			"			public void run() {\n" +
21023 			"				for (;;) {\n" +
21024 			"					// force ref to be cleared\n" +
21025 			"					System.gc();\n" +
21026 			"				}\n" +
21027 			"			}\n" +
21028 			"		}.start();\n" +
21029 			"\n" +
21030 			"		X<String, Integer> fromQueue = (X<String, Integer>) queue.remove();\n" +
21031 			"		System.out.println(fromQueue);\n" +
21032 			"		System.exit(0);\n" +
21033 			"	}\n" +
21034 			"}\n",
21035 		},
21036 		"----------\n" +
21037 		"1. ERROR in X.java (at line 5)\n" +
21038 		"	Zork z;\n" +
21039 		"	^^^^\n" +
21040 		"Zork cannot be resolved to a type\n" +
21041 		"----------\n" +
21042 		"2. WARNING in X.java (at line 34)\n" +
21043 		"	X<String, Integer> fromQueue = (X<String, Integer>) queue.remove();\n" +
21044 		"	                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
21045 		"Type safety: Unchecked cast from Reference<capture#1-of ? extends Integer> to X<String,Integer>\n" +
21046 		"----------\n");
21047 }
21048 public void test0660() {
21049 	this.runConformTest(
21050 		new String[] {
21051 			"X.java",
21052 			"public class X {\n" +
21053 			"\n" +
21054 			"	boolean run(X x) {\n" +
21055 			"		return false;\n" +
21056 			"	}\n" +
21057 			"	<T> void run(Class<T> ct) {\n" +
21058 			"	}\n" +
21059 			"\n" +
21060 			"	public static void main(String[] args) {\n" +
21061 			"		boolean b = new X().run(new X(){});\n" +
21062 			"		System.out.println(\"SUCCESS\");\n" +
21063 			"	}\n" +
21064 			"}\n",
21065 		},
21066 		"SUCCESS");
21067 }
21068 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=95066
21069 public void test0661() {
21070 	this.runNegativeTest(
21071 		new String[] {
21072 			"X.java",
21073 			"public class X<S extends Comparable<S>> {\n" +
21074 			"   public X() {\n" +
21075 			"       S a = (S)(Integer)3;\n" +
21076 			"   }\n" +
21077 			"	Zork z;\n" +
21078 			"}\n",
21079 		},
21080 		"----------\n" +
21081 		"1. WARNING in X.java (at line 3)\n" +
21082 		"	S a = (S)(Integer)3;\n" +
21083 		"	      ^^^^^^^^^^^^^\n" +
21084 		"Type safety: Unchecked cast from Integer to S\n" +
21085 		"----------\n" +
21086 		"2. ERROR in X.java (at line 5)\n" +
21087 		"	Zork z;\n" +
21088 		"	^^^^\n" +
21089 		"Zork cannot be resolved to a type\n" +
21090 		"----------\n");
21091 }
21092 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=95066 - variation
21093 public void test0662() {
21094 	this.runNegativeTest(
21095 		new String[] {
21096 			"X.java",
21097 			"public class X<S extends Comparable<String>> {\n" +
21098 			"   public X() {\n" +
21099 			"       S a = (S)(Integer)3; // this should fail\n" +
21100 			"   }\n" +
21101 			"	Zork z;\n" +
21102 			"}",
21103 		},
21104 		"----------\n" +
21105 		"1. ERROR in X.java (at line 3)\n" +
21106 		"	S a = (S)(Integer)3; // this should fail\n" +
21107 		"	      ^^^^^^^^^^^^^\n" +
21108 		"Cannot cast from Integer to S\n" +
21109 		"----------\n" +
21110 		"2. ERROR in X.java (at line 5)\n" +
21111 		"	Zork z;\n" +
21112 		"	^^^^\n" +
21113 		"Zork cannot be resolved to a type\n" +
21114 		"----------\n");
21115 }
21116 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=95066 - variation
21117 public void test0663() {
21118 	this.runNegativeTest(
21119 		new String[] {
21120 			"X.java",
21121 			"import java.util.List;\n" +
21122 			"\n" +
21123 			"public class X {\n" +
21124 			"   Object foo(Comparable<Integer> c) {\n" +
21125 			"	   return (Comparable<S>) c;\n" +
21126 			"   }\n" +
21127 			"   <U extends Throwable, V extends Runnable> void foo(List<V> lv) {\n" +
21128 			"	   List l = (List<U>) lv;\n" +
21129 			"   }\n" +
21130 			"   <U extends Throwable, V extends Runnable> void foo2(List<List<V>> lv) {\n" +
21131 			"	   List l = (List<List<U>>) lv;\n" +
21132 			"   }\n" +
21133 			"}\n",
21134 		},
21135 		"----------\n" +
21136 		"1. ERROR in X.java (at line 5)\n" +
21137 		"	return (Comparable<S>) c;\n" +
21138 		"	                   ^\n" +
21139 		"S cannot be resolved to a type\n" +
21140 		"----------\n" +
21141 		"2. WARNING in X.java (at line 8)\n" +
21142 		"	List l = (List<U>) lv;\n" +
21143 		"	^^^^\n" +
21144 		"List is a raw type. References to generic type List<E> should be parameterized\n" +
21145 		"----------\n" +
21146 		"3. WARNING in X.java (at line 8)\n" +
21147 		"	List l = (List<U>) lv;\n" +
21148 		"	         ^^^^^^^^^^^^\n" +
21149 		"Type safety: Unchecked cast from List<V> to List<U>\n" +
21150 		"----------\n" +
21151 		"4. WARNING in X.java (at line 8)\n" +
21152 		"	List l = (List<U>) lv;\n" +
21153 		"	         ^^^^^^^^^^^^\n" +
21154 		"Unnecessary cast from List<V> to List<U>\n" +
21155 		"----------\n" +
21156 		"5. WARNING in X.java (at line 11)\n" +
21157 		"	List l = (List<List<U>>) lv;\n" +
21158 		"	^^^^\n" +
21159 		"List is a raw type. References to generic type List<E> should be parameterized\n" +
21160 		"----------\n" +
21161 		"6. ERROR in X.java (at line 11)\n" +
21162 		"	List l = (List<List<U>>) lv;\n" +
21163 		"	         ^^^^^^^^^^^^^^^^^^\n" +
21164 		"Cannot cast from List<List<V>> to List<List<U>>\n" +
21165 		"----------\n" +
21166 		"7. WARNING in X.java (at line 11)\n" +
21167 		"	List l = (List<List<U>>) lv;\n" +
21168 		"	         ^^^^^^^^^^^^^^^^^^\n" +
21169 		"Unnecessary cast from List<List<V>> to List<List<U>>\n" +
21170 		"----------\n");
21171 }
21172 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=95066 - variation
21173 public void test0664() {
21174 	this.runNegativeTest(
21175 		new String[] {
21176 			"X.java",
21177 			"public class X<S extends Comparable<String>> {\n" +
21178 			"   public X(X2 x2) {\n" +
21179 			"       S a = (S)x2;\n" +
21180 			"   }\n" +
21181 			"}\n" +
21182 			"abstract class X2 implements Comparable<X2> {\n" +
21183 			"}\n",
21184 		},
21185 		"----------\n" +
21186 		"1. ERROR in X.java (at line 3)\n" +
21187 		"	S a = (S)x2;\n" +
21188 		"	      ^^^^^\n" +
21189 		"Cannot cast from X2 to S\n" +
21190 		"----------\n");
21191 }
21192 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=95066 - variation
21193 public void test0665() {
21194 	this.runNegativeTest(
21195 		new String[] {
21196 			"Test.java",
21197 			"public class Test<S> {\n" +
21198 			"	void foo() {\n" +
21199 			"		A a = new A();\n" +
21200 			"		Comparable<Object> c = (Comparable<Object>) a; // Fails as expected\n" +
21201 			"		Comparable<S> c2 = (Comparable<S>) a; // Should fail?\n" +
21202 			"	}\n" +
21203 			"\n" +
21204 			"}\n" +
21205 			"\n" +
21206 			"final class A implements Comparable<A> {\n" +
21207 			"	public int compareTo(A o) {\n" +
21208 			"		return 0;\n" +
21209 			"	}\n" +
21210 			"}\n",
21211 		},
21212 		"----------\n" +
21213 		"1. ERROR in Test.java (at line 4)\n" +
21214 		"	Comparable<Object> c = (Comparable<Object>) a; // Fails as expected\n" +
21215 		"	                       ^^^^^^^^^^^^^^^^^^^^^^\n" +
21216 		"Cannot cast from A to Comparable<Object>\n" +
21217 		"----------\n" +
21218 		"2. WARNING in Test.java (at line 5)\n" +
21219 		"	Comparable<S> c2 = (Comparable<S>) a; // Should fail?\n" +
21220 		"	                   ^^^^^^^^^^^^^^^^^\n" +
21221 		"Type safety: Unchecked cast from A to Comparable<S>\n" +
21222 		"----------\n");
21223 }
21224 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=89940
21225 public void test0666() {
21226 	this.runNegativeTest(
21227 		new String[] {
21228 			"X.java",
21229 			"import java.util.List;\n" +
21230 			"\n" +
21231 			"public class X {\n" +
21232 			"	void foo(List<Object> objects, List raw) {\n" +
21233 			"\n" +
21234 			"	    List<Number> numbers;\n" +
21235 			"	    List<? extends Number> ext;\n" +
21236 			"	    \n" +
21237 			"	    numbers= (List<Number>) objects; // correct - cast error\n" +
21238 			"	    ext= (List<? extends Number>) objects; // wrong, should fail\n" +
21239 			"\n" +
21240 			"	    ext= raw; // correct - raw conversion warning issued\n" +
21241 			"	    numbers= raw; // correct - raw conversion warning issued\n" +
21242 			"	}\n" +
21243 			"}\n",
21244 		},
21245 		"----------\n" +
21246 		"1. WARNING in X.java (at line 4)\n" +
21247 		"	void foo(List<Object> objects, List raw) {\n" +
21248 		"	                               ^^^^\n" +
21249 		"List is a raw type. References to generic type List<E> should be parameterized\n" +
21250 		"----------\n" +
21251 		"2. ERROR in X.java (at line 9)\n" +
21252 		"	numbers= (List<Number>) objects; // correct - cast error\n" +
21253 		"	         ^^^^^^^^^^^^^^^^^^^^^^\n" +
21254 		"Cannot cast from List<Object> to List<Number>\n" +
21255 		"----------\n" +
21256 		"3. ERROR in X.java (at line 10)\n" +
21257 		"	ext= (List<? extends Number>) objects; // wrong, should fail\n" +
21258 		"	     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
21259 		"Cannot cast from List<Object> to List<? extends Number>\n" +
21260 		"----------\n" +
21261 		"4. WARNING in X.java (at line 12)\n" +
21262 		"	ext= raw; // correct - raw conversion warning issued\n" +
21263 		"	     ^^^\n" +
21264 		"Type safety: The expression of type List needs unchecked conversion to conform to List<? extends Number>\n" +
21265 		"----------\n" +
21266 		"5. WARNING in X.java (at line 13)\n" +
21267 		"	numbers= raw; // correct - raw conversion warning issued\n" +
21268 		"	         ^^^\n" +
21269 		"Type safety: The expression of type List needs unchecked conversion to conform to List<Number>\n" +
21270 		"----------\n");
21271 }
21272 public void _test0667() {
21273 	this.runNegativeTest(
21274 		new String[] {
21275 			"X.java",
21276 			"import java.util.*;\n" +
21277 			"\n" +
21278 			"public class X {\n" +
21279 			"    public static void foo(List<? super Object[]> l) {    }\n" +
21280 			" \n" +
21281 			"    public static void foo2(List<Object[]> l) {    }\n" +
21282 			" \n" +
21283 			"    public static void foo3(List<? extends Object[]> l) {    }\n" +
21284 			" \n" +
21285 			"    public static void bar(List<? super Object> l) {    }\n" +
21286 			" \n" +
21287 			"    public static void bar2(List<Object> l) {    }\n" +
21288 			" \n" +
21289 			"    public static void bar3(List<? extends Object> l) {    }\n" +
21290 			" \n" +
21291 			"    public static void bar4(List<?> l) {    }\n" +
21292 			" \n" +
21293 			"    public static void main(String[] args) {\n" +
21294 			"        {   // can be { Object, Object[] }\n" +
21295 			"            List<? super Object[]> l = new ArrayList<Object[]>();\n" +
21296 			"            l.add(l.get(0));  // illegal [01]\n" +
21297 			"            l.add((Object) null);  // illegal [02]\n" +
21298 			"            l.add((Integer) null);  // illegal [03]\n" +
21299 			"            l.add((Object []) null); // illegal [04]\n" +
21300 			"            l.add((Integer []) null); // illegal [05]\n" +
21301 			"            l.add((Integer [][]) null); // illegal [06]\n" +
21302 			" \n" +
21303 			"            foo(l); // List<? super Object[]> - legal [07]\n" +
21304 			"            foo2(l); // List<Object[]> - illegal [08]\n" +
21305 			"            foo3(l); // List<? extends Object[]> - illegal [09]\n" +
21306 			"            bar(l); // List<? super Object> - illegal [10]\n" +
21307 			"            bar2(l); // List<Object> - illegal [11]\n" +
21308 			"            bar3(l); // List<? extends Object> - legal [12]\n" +
21309 			"            bar4(l); // List<?> - legal [13]\n" +
21310 			"        }\n" +
21311 			"        {   // can be Object[] or (? extends Object)[]\n" +
21312 			"            List<Object[]> l = new ArrayList<Object[]>();\n" +
21313 			"            l.add(l.get(0));  // legal [14]\n" +
21314 			"            l.add((Object) null);  // illegal [15]\n" +
21315 			"            l.add((Integer) null);  // illegal [16]\n" +
21316 			"            l.add((Object []) null); // legal [17]\n" +
21317 			"            l.add((Integer []) null); // legal [18]\n" +
21318 			"            l.add((Integer [][]) null); // legal [19]\n" +
21319 			" \n" +
21320 			"            foo(l); // List<? super Object[]> - legal [20]\n" +
21321 			"            foo2(l); // List<Object[]> - legal [21]\n" +
21322 			"            foo3(l); // List<? extends Object[]> - legal [22]\n" +
21323 			"            bar(l); // List<? super Object> - illegal [23]\n" +
21324 			"            bar2(l); // List<Object> - illegal [24]\n" +
21325 			"            bar3(l); // List<? extends Object> - legal [25]\n" +
21326 			"            bar4(l); // List<?> - legal [26]\n" +
21327 			"        }\n" +
21328 			"        {   // Only allows wildcards, Object is illegal.\n" +
21329 			"            List<? extends Object[]> l = new ArrayList<Object[]>();\n" +
21330 			"            l.add(l.get(0));  // illegal [27]\n" +
21331 			"            l.add((Object) null);  // illegal [28]\n" +
21332 			"            l.add((Integer) null);  // illegal [29]\n" +
21333 			"            l.add((Object []) null); // illegal [30]\n" +
21334 			"            l.add((Integer []) null); // illegal [31]\n" +
21335 			"            l.add((Integer [][]) null); // illegal [32]\n" +
21336 			" \n" +
21337 			"            foo(l); // List<? super Object[]> - illegal [33]\n" +
21338 			"            foo2(l); // List<Object[]> - illegal [34]\n" +
21339 			"            foo3(l); // List<? extends Object[]> - legal [35]\n" +
21340 			"            bar(l); // List<? super Object> - illegal [36]\n" +
21341 			"            bar2(l); // List<Object> - illegal [37]\n" +
21342 			"            bar3(l); // List<? extends Object> - legal [38]\n" +
21343 			"            bar4(l); // List<?> - legal [39]\n" +
21344 			"        }\n" +
21345 			"        {   // can add non-arrays but can only match ? super Object, ? super Object[], or ? extends Object, but not Object  \n" +
21346 			"            List<? super Object> l = new ArrayList<Object>();\n" +
21347 			"            l.add(l.get(0));  // legal [40]\n" +
21348 			"            l.add((Object) null);  // legal [41]\n" +
21349 			"            l.add((Integer) null);  // legal [42]\n" +
21350 			"            l.add((Object []) null); // illegal [43]\n" +
21351 			"            l.add((Integer []) null); // illegal [44]\n" +
21352 			"            l.add((Integer [][]) null); // illegal [45]\n" +
21353 			" \n" +
21354 			"            foo(l); // legal [46]\n" +
21355 			"            foo2(l); // illegal [47]\n" +
21356 			"            foo3(l); // illegal [48]\n" +
21357 			"            bar(l); // legal [49]\n" +
21358 			"            bar2(l); // illegal [50]\n" +
21359 			"            bar3(l); // legal [51]\n" +
21360 			"            bar4(l); // legal [52]\n" +
21361 			"        }\n" +
21362 			"        {   // can add array but cannot call a method which expects an array. 100% !\n" +
21363 			"            List<Object> l = new ArrayList<Object>();\n" +
21364 			"            l.get(0).toString();\n" +
21365 			"            l.add(l.get(0));  // legal [53]\n" +
21366 			"            l.add((Object) null);  // legal [54]\n" +
21367 			"            l.add((Integer) null);  // legal [55]\n" +
21368 			"            l.add((Object []) null); // legal [56]\n" +
21369 			"            l.add((Integer []) null); // legal [57]\n" +
21370 			"            l.add((Integer [][]) null); // legal [58]\n" +
21371 			" \n" +
21372 			"            foo(l); // legal [59]\n" +
21373 			"            foo2(l); // illegal [60]\n" +
21374 			"            foo3(l); // illegal [61]\n" +
21375 			"            bar(l); // legal [62]\n" +
21376 			"            bar2(l); // legal [63]\n" +
21377 			"            bar3(l); // legal [64]\n" +
21378 			"            bar4(l); // legal [65]\n" +
21379 			"        }\n" +
21380 			"        {   // cannot add any type but can match ? or ? extends Object.\n" +
21381 			"            List<? extends Object> l = new ArrayList<Object>();\n" +
21382 			"            l.add(l.get(0));  // illegal [66]\n" +
21383 			"            l.add((Object) null);  // illegal [67]\n" +
21384 			"            l.add((Integer) null);  // illegal [68]\n" +
21385 			"            l.add((Object []) null); // illegal [69]\n" +
21386 			"            l.add((Integer []) null); // illegal [70]\n" +
21387 			"            l.add((Integer [][]) null); // illegal [71]\n" +
21388 			" \n" +
21389 			"            foo(l); // List<? super Object[]> - illegal [72]\n" +
21390 			"            foo2(l); // List<Object[]> - illegal [73]\n" +
21391 			"            foo3(l); // List<? extends Object[]> - illegal [74]\n" +
21392 			"            bar(l); // List<? super Object> - illegal [75]\n" +
21393 			"            bar2(l); // List<Object> - illegal [76]\n" +
21394 			"            bar3(l); // List<? extends Object> - legal [77]\n" +
21395 			"            bar4(l); // List<?> - legal [78]\n" +
21396 			"        }\n" +
21397 			"        {   // same as ? extends Object.\n" +
21398 			"            List<?> l = new ArrayList<Object>();\n" +
21399 			"            l.add(l.get(0));  // illegal [79]\n" +
21400 			"            l.add((Object) null);  // illegal [80]\n" +
21401 			"            l.add((Integer) null);  // illegal [81]\n" +
21402 			"            l.add((Object []) null); // illegal [82]\n" +
21403 			"            l.add((Integer []) null); // illegal [83]\n" +
21404 			"            l.add((Integer [][]) null); // illegal [84]\n" +
21405 			" \n" +
21406 			"            foo(l); // List<? super Object[]> - illegal [85]\n" +
21407 			"            foo2(l); // List<Object[]> - illegal [86]\n" +
21408 			"            foo3(l); // List<? extends Object[]> - illegal [87]\n" +
21409 			"            bar(l); // List<? super Object> - illegal [88]\n" +
21410 			"            bar2(l); // List<Object> - illegal [89]\n" +
21411 			"            bar3(l); // List<? extends Object> - legal [90]\n" +
21412 			"            bar4(l); // List<?> - legal [91]\n" +
21413 			"        }\n" +
21414 			"    }\n" +
21415 			"}\n",
21416 		},
21417 		"----------\n" +
21418 		"1. ERROR in X.java (at line 21)\n" +
21419 		"	l.add(l.get(0));  // illegal [01]\n" +
21420 		"	  ^^^\n" +
21421 		"The method add(capture-of ? super Object[]) in the type List<capture-of ? super Object[]> is not applicable for the arguments (capture-of ? super Object[])\n" +
21422 		"----------\n" +
21423 		"2. ERROR in X.java (at line 22)\n" +
21424 		"	l.add((Object) null);  // illegal [02]\n" +
21425 		"	  ^^^\n" +
21426 		"The method add(capture-of ? super Object[]) in the type List<capture-of ? super Object[]> is not applicable for the arguments (Object)\n" +
21427 		"----------\n" +
21428 		"3. ERROR in X.java (at line 23)\n" +
21429 		"	l.add((Integer) null);  // illegal [03]\n" +
21430 		"	  ^^^\n" +
21431 		"The method add(capture-of ? super Object[]) in the type List<capture-of ? super Object[]> is not applicable for the arguments (Integer)\n" +
21432 		"----------\n" +
21433 		"4. ERROR in X.java (at line 24)\n" +
21434 		"	l.add((Object []) null); // illegal [04]\n" +
21435 		"	  ^^^\n" +
21436 		"The method add(capture-of ? super Object[]) in the type List<capture-of ? super Object[]> is not applicable for the arguments (Object[])\n" +
21437 		"----------\n" +
21438 		"5. ERROR in X.java (at line 25)\n" +
21439 		"	l.add((Integer []) null); // illegal [05]\n" +
21440 		"	  ^^^\n" +
21441 		"The method add(capture-of ? super Object[]) in the type List<capture-of ? super Object[]> is not applicable for the arguments (Integer[])\n" +
21442 		"----------\n" +
21443 		"6. ERROR in X.java (at line 26)\n" +
21444 		"	l.add((Integer [][]) null); // illegal [06]\n" +
21445 		"	  ^^^\n" +
21446 		"The method add(capture-of ? super Object[]) in the type List<capture-of ? super Object[]> is not applicable for the arguments (Integer[][])\n" +
21447 		"----------\n" +
21448 		"7. ERROR in X.java (at line 28)\n" +
21449 		"	foo(l); // List<? super Object[]> - legal [07]\n" +
21450 		"	^^^\n" +
21451 		"The method foo(List<? super Object[]>) in the type X is not applicable for the arguments (List<capture-of ? super Object[]>)\n" +
21452 		"----------\n" +
21453 		"8. ERROR in X.java (at line 29)\n" +
21454 		"	foo2(l); // List<Object[]> - illegal [08]\n" +
21455 		"	^^^^\n" +
21456 		"The method foo2(List<Object[]>) in the type X is not applicable for the arguments (List<capture-of ? super Object[]>)\n" +
21457 		"----------\n" +
21458 		"9. ERROR in X.java (at line 30)\n" +
21459 		"	foo3(l); // List<? extends Object[]> - illegal [09]\n" +
21460 		"	^^^^\n" +
21461 		"The method foo3(List<? extends Object[]>) in the type X is not applicable for the arguments (List<capture-of ? super Object[]>)\n" +
21462 		"----------\n" +
21463 		"10. ERROR in X.java (at line 31)\n" +
21464 		"	bar(l); // List<? super Object> - illegal [10]\n" +
21465 		"	^^^\n" +
21466 		"The method bar(List<? super Object>) in the type X is not applicable for the arguments (List<capture-of ? super Object[]>)\n" +
21467 		"----------\n" +
21468 		"11. ERROR in X.java (at line 32)\n" +
21469 		"	bar2(l); // List<Object> - illegal [11]\n" +
21470 		"	^^^^\n" +
21471 		"The method bar2(List<Object>) in the type X is not applicable for the arguments (List<capture-of ? super Object[]>)\n" +
21472 		"----------\n" +
21473 		"12. ERROR in X.java (at line 39)\n" +
21474 		"	l.add((Object) null);  // illegal [15]\n" +
21475 		"	  ^^^\n" +
21476 		"The method add(Object[]) in the type List<Object[]> is not applicable for the arguments (Object)\n" +
21477 		"----------\n" +
21478 		"13. ERROR in X.java (at line 40)\n" +
21479 		"	l.add((Integer) null);  // illegal [16]\n" +
21480 		"	  ^^^\n" +
21481 		"The method add(Object[]) in the type List<Object[]> is not applicable for the arguments (Integer)\n" +
21482 		"----------\n" +
21483 		"14. ERROR in X.java (at line 48)\n" +
21484 		"	bar(l); // List<? super Object> - illegal [23]\n" +
21485 		"	^^^\n" +
21486 		"The method bar(List<? super Object>) in the type X is not applicable for the arguments (List<Object[]>)\n" +
21487 		"----------\n" +
21488 		"15. ERROR in X.java (at line 49)\n" +
21489 		"	bar2(l); // List<Object> - illegal [24]\n" +
21490 		"	^^^^\n" +
21491 		"The method bar2(List<Object>) in the type X is not applicable for the arguments (List<Object[]>)\n" +
21492 		"----------\n" +
21493 		"16. ERROR in X.java (at line 55)\n" +
21494 		"	l.add(l.get(0));  // illegal [27]\n" +
21495 		"	  ^^^\n" +
21496 		"The method add(capture-of ? extends Object[]) in the type List<capture-of ? extends Object[]> is not applicable for the arguments (capture-of ? extends Object[])\n" +
21497 		"----------\n" +
21498 		"17. ERROR in X.java (at line 56)\n" +
21499 		"	l.add((Object) null);  // illegal [28]\n" +
21500 		"	  ^^^\n" +
21501 		"The method add(capture-of ? extends Object[]) in the type List<capture-of ? extends Object[]> is not applicable for the arguments (Object)\n" +
21502 		"----------\n" +
21503 		"18. ERROR in X.java (at line 57)\n" +
21504 		"	l.add((Integer) null);  // illegal [29]\n" +
21505 		"	  ^^^\n" +
21506 		"The method add(capture-of ? extends Object[]) in the type List<capture-of ? extends Object[]> is not applicable for the arguments (Integer)\n" +
21507 		"----------\n" +
21508 		"19. ERROR in X.java (at line 58)\n" +
21509 		"	l.add((Object []) null); // illegal [30]\n" +
21510 		"	  ^^^\n" +
21511 		"The method add(capture-of ? extends Object[]) in the type List<capture-of ? extends Object[]> is not applicable for the arguments (Object[])\n" +
21512 		"----------\n" +
21513 		"20. ERROR in X.java (at line 59)\n" +
21514 		"	l.add((Integer []) null); // illegal [31]\n" +
21515 		"	  ^^^\n" +
21516 		"The method add(capture-of ? extends Object[]) in the type List<capture-of ? extends Object[]> is not applicable for the arguments (Integer[])\n" +
21517 		"----------\n" +
21518 		"21. ERROR in X.java (at line 60)\n" +
21519 		"	l.add((Integer [][]) null); // illegal [32]\n" +
21520 		"	  ^^^\n" +
21521 		"The method add(capture-of ? extends Object[]) in the type List<capture-of ? extends Object[]> is not applicable for the arguments (Integer[][])\n" +
21522 		"----------\n" +
21523 		"22. ERROR in X.java (at line 62)\n" +
21524 		"	foo(l); // List<? super Object[]> - illegal [33]\n" +
21525 		"	^^^\n" +
21526 		"The method foo(List<? super Object[]>) in the type X is not applicable for the arguments (List<capture-of ? extends Object[]>)\n" +
21527 		"----------\n" +
21528 		"23. ERROR in X.java (at line 63)\n" +
21529 		"	foo2(l); // List<Object[]> - illegal [34]\n" +
21530 		"	^^^^\n" +
21531 		"The method foo2(List<Object[]>) in the type X is not applicable for the arguments (List<capture-of ? extends Object[]>)\n" +
21532 		"----------\n" +
21533 		"24. ERROR in X.java (at line 65)\n" +
21534 		"	bar(l); // List<? super Object> - illegal [36]\n" +
21535 		"	^^^\n" +
21536 		"The method bar(List<? super Object>) in the type X is not applicable for the arguments (List<capture-of ? extends Object[]>)\n" +
21537 		"----------\n" +
21538 		"25. ERROR in X.java (at line 66)\n" +
21539 		"	bar2(l); // List<Object> - illegal [37]\n" +
21540 		"	^^^^\n" +
21541 		"The method bar2(List<Object>) in the type X is not applicable for the arguments (List<capture-of ? extends Object[]>)\n" +
21542 		"----------\n" +
21543 		"26. ERROR in X.java (at line 75)\n" +
21544 		"	l.add((Object []) null); // illegal [43]\n" +
21545 		"	  ^^^\n" +
21546 		"The method add(capture-of ? super Object) in the type List<capture-of ? super Object> is not applicable for the arguments (Object[])\n" +
21547 		"----------\n" +
21548 		"27. ERROR in X.java (at line 76)\n" +
21549 		"	l.add((Integer []) null); // illegal [44]\n" +
21550 		"	  ^^^\n" +
21551 		"The method add(capture-of ? super Object) in the type List<capture-of ? super Object> is not applicable for the arguments (Integer[])\n" +
21552 		"----------\n" +
21553 		"28. ERROR in X.java (at line 77)\n" +
21554 		"	l.add((Integer [][]) null); // illegal [45]\n" +
21555 		"	  ^^^\n" +
21556 		"The method add(capture-of ? super Object) in the type List<capture-of ? super Object> is not applicable for the arguments (Integer[][])\n" +
21557 		"----------\n" +
21558 		"29. ERROR in X.java (at line 79)\n" +
21559 		"	foo(l); // legal [46]\n" +
21560 		"	^^^\n" +
21561 		"The method foo(List<? super Object[]>) in the type X is not applicable for the arguments (List<capture-of ? super Object>)\n" +
21562 		"----------\n" +
21563 		"30. ERROR in X.java (at line 80)\n" +
21564 		"	foo2(l); // illegal [47]\n" +
21565 		"	^^^^\n" +
21566 		"The method foo2(List<Object[]>) in the type X is not applicable for the arguments (List<capture-of ? super Object>)\n" +
21567 		"----------\n" +
21568 		"31. ERROR in X.java (at line 81)\n" +
21569 		"	foo3(l); // illegal [48]\n" +
21570 		"	^^^^\n" +
21571 		"The method foo3(List<? extends Object[]>) in the type X is not applicable for the arguments (List<capture-of ? super Object>)\n" +
21572 		"----------\n" +
21573 		"32. ERROR in X.java (at line 83)\n" +
21574 		"	bar2(l); // illegal [50]\n" +
21575 		"	^^^^\n" +
21576 		"The method bar2(List<Object>) in the type X is not applicable for the arguments (List<capture-of ? super Object>)\n" +
21577 		"----------\n" +
21578 		"33. ERROR in X.java (at line 98)\n" +
21579 		"	foo2(l); // illegal [60]\n" +
21580 		"	^^^^\n" +
21581 		"The method foo2(List<Object[]>) in the type X is not applicable for the arguments (List<Object>)\n" +
21582 		"----------\n" +
21583 		"34. ERROR in X.java (at line 99)\n" +
21584 		"	foo3(l); // illegal [61]\n" +
21585 		"	^^^^\n" +
21586 		"The method foo3(List<? extends Object[]>) in the type X is not applicable for the arguments (List<Object>)\n" +
21587 		"----------\n" +
21588 		"35. ERROR in X.java (at line 107)\n" +
21589 		"	l.add(l.get(0));  // illegal [66]\n" +
21590 		"	  ^^^\n" +
21591 		"The method add(capture-of ? extends Object) in the type List<capture-of ? extends Object> is not applicable for the arguments (capture-of ? extends Object)\n" +
21592 		"----------\n" +
21593 		"36. ERROR in X.java (at line 108)\n" +
21594 		"	l.add((Object) null);  // illegal [67]\n" +
21595 		"	  ^^^\n" +
21596 		"The method add(capture-of ? extends Object) in the type List<capture-of ? extends Object> is not applicable for the arguments (Object)\n" +
21597 		"----------\n" +
21598 		"37. ERROR in X.java (at line 109)\n" +
21599 		"	l.add((Integer) null);  // illegal [68]\n" +
21600 		"	  ^^^\n" +
21601 		"The method add(capture-of ? extends Object) in the type List<capture-of ? extends Object> is not applicable for the arguments (Integer)\n" +
21602 		"----------\n" +
21603 		"38. ERROR in X.java (at line 110)\n" +
21604 		"	l.add((Object []) null); // illegal [69]\n" +
21605 		"	  ^^^\n" +
21606 		"The method add(capture-of ? extends Object) in the type List<capture-of ? extends Object> is not applicable for the arguments (Object[])\n" +
21607 		"----------\n" +
21608 		"39. ERROR in X.java (at line 111)\n" +
21609 		"	l.add((Integer []) null); // illegal [70]\n" +
21610 		"	  ^^^\n" +
21611 		"The method add(capture-of ? extends Object) in the type List<capture-of ? extends Object> is not applicable for the arguments (Integer[])\n" +
21612 		"----------\n" +
21613 		"40. ERROR in X.java (at line 112)\n" +
21614 		"	l.add((Integer [][]) null); // illegal [71]\n" +
21615 		"	  ^^^\n" +
21616 		"The method add(capture-of ? extends Object) in the type List<capture-of ? extends Object> is not applicable for the arguments (Integer[][])\n" +
21617 		"----------\n" +
21618 		"41. ERROR in X.java (at line 114)\n" +
21619 		"	foo(l); // List<? super Object[]> - illegal [72]\n" +
21620 		"	^^^\n" +
21621 		"The method foo(List<? super Object[]>) in the type X is not applicable for the arguments (List<capture-of ? extends Object>)\n" +
21622 		"----------\n" +
21623 		"42. ERROR in X.java (at line 115)\n" +
21624 		"	foo2(l); // List<Object[]> - illegal [73]\n" +
21625 		"	^^^^\n" +
21626 		"The method foo2(List<Object[]>) in the type X is not applicable for the arguments (List<capture-of ? extends Object>)\n" +
21627 		"----------\n" +
21628 		"43. ERROR in X.java (at line 116)\n" +
21629 		"	foo3(l); // List<? extends Object[]> - illegal [74]\n" +
21630 		"	^^^^\n" +
21631 		"The method foo3(List<? extends Object[]>) in the type X is not applicable for the arguments (List<capture-of ? extends Object>)\n" +
21632 		"----------\n" +
21633 		"44. ERROR in X.java (at line 117)\n" +
21634 		"	bar(l); // List<? super Object> - illegal [75]\n" +
21635 		"	^^^\n" +
21636 		"The method bar(List<? super Object>) in the type X is not applicable for the arguments (List<capture-of ? extends Object>)\n" +
21637 		"----------\n" +
21638 		"45. ERROR in X.java (at line 118)\n" +
21639 		"	bar2(l); // List<Object> - illegal [76]\n" +
21640 		"	^^^^\n" +
21641 		"The method bar2(List<Object>) in the type X is not applicable for the arguments (List<capture-of ? extends Object>)\n" +
21642 		"----------\n" +
21643 		"46. ERROR in X.java (at line 124)\n" +
21644 		"	l.add(l.get(0));  // illegal [79]\n" +
21645 		"	  ^^^\n" +
21646 		"The method add(capture-of ?) in the type List<capture-of ?> is not applicable for the arguments (capture-of ?)\n" +
21647 		"----------\n" +
21648 		"47. ERROR in X.java (at line 125)\n" +
21649 		"	l.add((Object) null);  // illegal [80]\n" +
21650 		"	  ^^^\n" +
21651 		"The method add(capture-of ?) in the type List<capture-of ?> is not applicable for the arguments (Object)\n" +
21652 		"----------\n" +
21653 		"48. ERROR in X.java (at line 126)\n" +
21654 		"	l.add((Integer) null);  // illegal [81]\n" +
21655 		"	  ^^^\n" +
21656 		"The method add(capture-of ?) in the type List<capture-of ?> is not applicable for the arguments (Integer)\n" +
21657 		"----------\n" +
21658 		"49. ERROR in X.java (at line 127)\n" +
21659 		"	l.add((Object []) null); // illegal [82]\n" +
21660 		"	  ^^^\n" +
21661 		"The method add(capture-of ?) in the type List<capture-of ?> is not applicable for the arguments (Object[])\n" +
21662 		"----------\n" +
21663 		"50. ERROR in X.java (at line 128)\n" +
21664 		"	l.add((Integer []) null); // illegal [83]\n" +
21665 		"	  ^^^\n" +
21666 		"The method add(capture-of ?) in the type List<capture-of ?> is not applicable for the arguments (Integer[])\n" +
21667 		"----------\n" +
21668 		"51. ERROR in X.java (at line 129)\n" +
21669 		"	l.add((Integer [][]) null); // illegal [84]\n" +
21670 		"	  ^^^\n" +
21671 		"The method add(capture-of ?) in the type List<capture-of ?> is not applicable for the arguments (Integer[][])\n" +
21672 		"----------\n" +
21673 		"52. ERROR in X.java (at line 131)\n" +
21674 		"	foo(l); // List<? super Object[]> - illegal [85]\n" +
21675 		"	^^^\n" +
21676 		"The method foo(List<? super Object[]>) in the type X is not applicable for the arguments (List<capture-of ?>)\n" +
21677 		"----------\n" +
21678 		"53. ERROR in X.java (at line 132)\n" +
21679 		"	foo2(l); // List<Object[]> - illegal [86]\n" +
21680 		"	^^^^\n" +
21681 		"The method foo2(List<Object[]>) in the type X is not applicable for the arguments (List<capture-of ?>)\n" +
21682 		"----------\n" +
21683 		"54. ERROR in X.java (at line 133)\n" +
21684 		"	foo3(l); // List<? extends Object[]> - illegal [87]\n" +
21685 		"	^^^^\n" +
21686 		"The method foo3(List<? extends Object[]>) in the type X is not applicable for the arguments (List<capture-of ?>)\n" +
21687 		"----------\n" +
21688 		"55. ERROR in X.java (at line 134)\n" +
21689 		"	bar(l); // List<? super Object> - illegal [88]\n" +
21690 		"	^^^\n" +
21691 		"The method bar(List<? super Object>) in the type X is not applicable for the arguments (List<capture-of ?>)\n" +
21692 		"----------\n" +
21693 		"56. ERROR in X.java (at line 135)\n" +
21694 		"	bar2(l); // List<Object> - illegal [89]\n" +
21695 		"	^^^^\n" +
21696 		"The method bar2(List<Object>) in the type X is not applicable for the arguments (List<capture-of ?>)\n" +
21697 		"----------\n");
21698 }
21699 public void test0668() {
21700 	runConformTest(
21701 		// test directory preparation
21702 		new String[] { /* test files */
21703 			"X.java",
21704 			"import java.util.List;\n" +
21705 			" \n" +
21706 			"public class X {\n" +
21707 			"    void foo(List<? super Object[]> l) {\n" +
21708 			"        l.add(new Object[0]);\n" +
21709 			"    }\n" +
21710 			"}\n",
21711 		},
21712 		// javac options
21713 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
21714 }
21715 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=95289
21716 public void test0669() {
21717 	this.runConformTest(
21718 		new String[] {
21719 			"X.java",
21720 			"import java.util.*;\n" +
21721 			"\n" +
21722 			"public class X {\n" +
21723 			"private static<T> int indexOf(final T[] array,final T elem) {\n" +
21724 			"	return 0;\n" +
21725 			"}\n" +
21726 			"public static void meth(AContainer ac, AInfo[] aiArray) {\n" +
21727 			"  for(AInfo ai: aiArray) {\n" +
21728 			"	int index1 = indexOf(ac.getAs(),ai.a);\n" +
21729 			"	int index2 = indexOf(ac.getAs(),ai); // ai.class!=ai.a.class!!!\n" +
21730 			"  }\n" +
21731 			"}\n" +
21732 			"}\n" +
21733 			"\n" +
21734 			"class AContainer {\n" +
21735 			"   public A[] getAs(){ return null; }\n" +
21736 			"}\n" +
21737 			"\n" +
21738 			"class AInfo {\n" +
21739 			"   public A a;\n" +
21740 			"}\n" +
21741 			"\n" +
21742 			"class A {\n" +
21743 			"}\n",
21744 		},
21745 		"");
21746 }
21747 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=95021 (ensure not even a warning)
21748 public void test0670() {
21749 	runConformTest(
21750 		true,
21751 		new String[] {
21752 			"X.java",
21753 			"import java.util.Map;\n" +
21754 			"\n" +
21755 			"interface MethodProperty<ActualType extends MethodProperty<ActualType>> {\n" +
21756 			"	public void copyFrom(ActualType other);\n" +
21757 			"}\n" +
21758 			"\n" +
21759 			"class MethodPropertyDatabase<Property extends MethodProperty<Property>> {\n" +
21760 			"	Map<String, Property> propertyMap;\n" +
21761 			"	\n" +
21762 			"	void read(String fileName) {\n" +
21763 			"	}\n" +
21764 			"}\n" +
21765 			"\n" +
21766 			"class FooProperty implements MethodProperty<FooProperty> {\n" +
21767 			"	String value;\n" +
21768 			"\n" +
21769 			"	public void copyFrom(FooProperty other) {\n" +
21770 			"		this.value = other.value;\n" +
21771 			"	}\n" +
21772 			"}\n" +
21773 			"\n" +
21774 			"class FooPropertyDatabase extends MethodPropertyDatabase<FooProperty> {\n" +
21775 			"}\n" +
21776 			"\n" +
21777 			"public class X {\n" +
21778 			"	FooPropertyDatabase fooDatabase;\n" +
21779 			"	\n" +
21780 			"	public void readDatabase() {\n" +
21781 			"		FooPropertyDatabase database = new FooPropertyDatabase();\n" +
21782 			"		\n" +
21783 			"		fooDatabase = readDatabase(database, \"foodatabase.db\"); // Bug reported on this line\n" +
21784 			"	}\n" +
21785 			"	\n" +
21786 			"	private<\n" +
21787 			"		Property extends MethodProperty<Property>,\n" +
21788 			"		DatabaseType extends MethodPropertyDatabase<Property>\n" +
21789 			"		> DatabaseType readDatabase(DatabaseType database, String fileName) {\n" +
21790 			"			database.read(fileName);\n" +
21791 			"			return database;\n" +
21792 			"		}\n" +
21793 			"	\n" +
21794 			"}\n",
21795 		},
21796 		"",
21797 		null,
21798 		null,
21799 		JavacTestOptions.EclipseJustification.EclipseBug95021);
21800 }
21801 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=95021 - variation: ensure not even a warning
21802 public void test0671() {
21803 	this.runNegativeTest(
21804 		new String[] {
21805 			"X.java",
21806 			"import java.util.Map;\n" +
21807 			"\n" +
21808 			"interface MethodProperty<ActualType extends MethodProperty<ActualType>> {\n" +
21809 			"	public void copyFrom(ActualType other);\n" +
21810 			"}\n" +
21811 			"\n" +
21812 			"class MethodPropertyDatabase<Property extends MethodProperty<Property>> {\n" +
21813 			"	Map<String, Property> propertyMap;\n" +
21814 			"	\n" +
21815 			"	void read(String fileName) {\n" +
21816 			"	}\n" +
21817 			"}\n" +
21818 			"\n" +
21819 			"class FooProperty implements MethodProperty<FooProperty> {\n" +
21820 			"	String value;\n" +
21821 			"\n" +
21822 			"	public void copyFrom(FooProperty other) {\n" +
21823 			"		this.value = other.value;\n" +
21824 			"	}\n" +
21825 			"}\n" +
21826 			"\n" +
21827 			"class FooPropertyDatabase extends MethodPropertyDatabase<FooProperty> {\n" +
21828 			"}\n" +
21829 			"\n" +
21830 			"public class X {\n" +
21831 			"  Zork z;\n" +
21832 			"	FooPropertyDatabase fooDatabase;\n" +
21833 			"	\n" +
21834 			"	public void readDatabase() {\n" +
21835 			"		FooPropertyDatabase database = new FooPropertyDatabase();\n" +
21836 			"		\n" +
21837 			"		fooDatabase = readDatabase(database, \"foodatabase.db\"); // Bug reported on this line\n" +
21838 			"	}\n" +
21839 			"	\n" +
21840 			"	private<\n" +
21841 			"		Property extends MethodProperty<Property>,\n" +
21842 			"		DatabaseType extends MethodPropertyDatabase<Property>\n" +
21843 			"		> DatabaseType readDatabase(DatabaseType database, String fileName) {\n" +
21844 			"			database.read(fileName);\n" +
21845 			"			return database;\n" +
21846 			"		}\n" +
21847 			"	\n" +
21848 			"}\n",
21849 		},
21850 		"----------\n" +
21851 		"1. ERROR in X.java (at line 26)\n" +
21852 		"	Zork z;\n" +
21853 		"	^^^^\n" +
21854 		"Zork cannot be resolved to a type\n" +
21855 		"----------\n");
21856 }
21857 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=95021 - variation: ensure not even a warning
21858 // SHOULD FAIL AT 1.8 (18.2.3): The method read(D, String) in the type X is not applicable for the arguments (Bar<Foo>, String)
21859 public void test0672() {
21860 	this.runNegativeTest(
21861 		new String[] {
21862 			"X.java",
21863 			"interface Foo<T extends Foo<T>> {\n" +
21864 			"}\n" +
21865 			"\n" +
21866 			"class Bar<Q> {\n" +
21867 			"}\n" +
21868 			"\n" +
21869 			"\n" +
21870 			"public class X {\n" +
21871 			"	Zork z;\n" +
21872 			"	void readDatabase() {\n" +
21873 			"		Bar<Foo> bar = new Bar<Foo>();\n" +
21874 			"		read(bar, \"sadasd\");\n" +
21875 			"	}\n" +
21876 			"	\n" +
21877 			"	<P extends Foo<P>, D extends Bar<P>> \n" +
21878 			"	D read(D d, String s) {\n" +
21879 			"			return d;\n" +
21880 			"	}\n" +
21881 			"}\n",
21882 		},
21883 		"----------\n" +
21884 		"1. ERROR in X.java (at line 9)\n" +
21885 		"	Zork z;\n" +
21886 		"	^^^^\n" +
21887 		"Zork cannot be resolved to a type\n" +
21888 		"----------\n" +
21889 		"2. WARNING in X.java (at line 11)\n" +
21890 		"	Bar<Foo> bar = new Bar<Foo>();\n" +
21891 		"	    ^^^\n" +
21892 		"Foo is a raw type. References to generic type Foo<T> should be parameterized\n" +
21893 		"----------\n" +
21894 		"3. WARNING in X.java (at line 11)\n" +
21895 		"	Bar<Foo> bar = new Bar<Foo>();\n" +
21896 		"	                       ^^^\n" +
21897 		"Foo is a raw type. References to generic type Foo<T> should be parameterized\n" +
21898 		"----------\n" +
21899 		"4. WARNING in X.java (at line 12)\n" +
21900 		"	read(bar, \"sadasd\");\n" +
21901 		"	^^^^^^^^^^^^^^^^^^^\n" +
21902 		"Type safety: Unchecked invocation read(Bar<Foo>, String) of the generic method read(D, String) of type X\n" +
21903 		"----------\n");
21904 }
21905 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=95638
21906 public void test0673() {
21907 	this.runConformTest(
21908 		new String[] {
21909 			"X.java",
21910 			"import java.util.List;\n" +
21911 			"\n" +
21912 			"class Key<E, F extends Type<E, F>> {\n" +
21913 			"}\n" +
21914 			"\n" +
21915 			"class State<S extends State> {\n" +
21916 			"}\n" +
21917 			"\n" +
21918 			"class Type<T, U extends Type<T, U>> {\n" +
21919 			"}\n" +
21920 			"\n" +
21921 			"class Store<A, B extends Type<A, B>, C extends Key<A, B>, D extends State<D>> {\n" +
21922 			"}\n" +
21923 			"\n" +
21924 			"public class X<K> {\n" +
21925 			"	List<Store<K, ?, ? extends Key<K, ?>, ? extends State<?>>> stores;\n" +
21926 			"}\n",
21927 		},
21928 		"");
21929 }
21930 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=95638 - variation
21931 public void test0674() {
21932 	this.runConformTest(
21933 		new String[] {
21934 			"X.java",
21935 			"class Key<E extends Key<E>> {}\n" +
21936 			"class Store<F extends Key<F>> {}\n" +
21937 			"\n" +
21938 			"public class X<T extends Key<T>> {\n" +
21939 			"	Store<? extends Key<T>> store;\n" +
21940 			"}\n",
21941 		},
21942 		"");
21943 }
21944 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=95638 - variation
21945 public void test0675() {
21946 	runNegativeTest(
21947 		// test directory preparation
21948 		new String[] { /* test files */
21949 			"X.java",
21950 			"class Key<E extends Key<E>> {}\n" +
21951 			"class Store<F extends Key<F>> {}\n" +
21952 			"\n" +
21953 			"public class X<T> {\n" +
21954 			"	Store<? extends Key<T>> store1;\n" +
21955 			"	Store<? extends Key<? extends T>> store2;\n" +
21956 			"}\n",
21957 		},
21958 		// compiler results
21959 		"----------\n" + /* expected compiler log */
21960 		"1. ERROR in X.java (at line 5)\n" +
21961 		"	Store<? extends Key<T>> store1;\n" +
21962 		"	                    ^\n" +
21963 		"Bound mismatch: The type T is not a valid substitute for the bounded parameter <E extends Key<E>> of the type Key<E>\n" +
21964 		"----------\n" +
21965 		"2. ERROR in X.java (at line 6)\n" +
21966 		"	Store<? extends Key<? extends T>> store2;\n" +
21967 		"	                    ^^^^^^^^^^^\n" +
21968 		"Bound mismatch: The type ? extends T is not a valid substitute for the bounded parameter <E extends Key<E>> of the type Key<E>\n" +
21969 		"----------\n",
21970 		// javac options
21971 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
21972 }
21973 //check fault tolerance, in spite of bound mismatch, still pass param type for further resolving message send
21974 public void test0676() {
21975 	this.runNegativeTest(
21976 		new String[] {
21977 			"X.java",
21978 			"public class X<T extends Throwable> {\n" +
21979 			"	T get() { return null; }\n" +
21980 			"	\n" +
21981 			"	void foo(X<String> xs) {\n" +
21982 			"		xs.get().printStackTrace();\n" +
21983 			"	}\n" +
21984 			"}\n",
21985 		},
21986 		"----------\n" +
21987 		"1. ERROR in X.java (at line 4)\n" +
21988 		"	void foo(X<String> xs) {\n" +
21989 		"	           ^^^^^^\n" +
21990 		"Bound mismatch: The type String is not a valid substitute for the bounded parameter <T extends Throwable> of the type X<T>\n" +
21991 		"----------\n" +
21992 		"2. ERROR in X.java (at line 5)\n" +
21993 		"	xs.get().printStackTrace();\n" +
21994 		"	         ^^^^^^^^^^^^^^^\n" +
21995 		"The method printStackTrace() is undefined for the type String\n" +
21996 		"----------\n");
21997 }
21998 public void test0677() {
21999 	this.runNegativeTest(
22000 		new String[] {
22001 			"X.java",
22002 			"import java.util.*;\n" +
22003 			"public class X {\n" +
22004 			"	public static void main(String[] args) {\n" +
22005 			"		{\n" +
22006 			"			ArrayList<Number> arrayList = new ArrayList<Integer>(); // compile error\n" +
22007 			"			Number number = arrayList.get(0);\n" +
22008 			"		}\n" +
22009 			"		{\n" +
22010 			"			ArrayList<? extends Number> arrayList = new ArrayList<Integer>(); //correct\n" +
22011 			"			Number number = arrayList.get(0);\n" +
22012 			"		}\n" +
22013 			"		{\n" +
22014 			"			ArrayList<? super Integer> arrayList = new ArrayList<Number>();\n" +
22015 			"			Object number = arrayList.get(0); //returns java.lang.Object\n" +
22016 			"		}\n" +
22017 			"	}\n" +
22018 			"}\n",
22019 		},
22020 		"----------\n" +
22021 		"1. ERROR in X.java (at line 5)\n" +
22022 		"	ArrayList<Number> arrayList = new ArrayList<Integer>(); // compile error\n" +
22023 		"	                              ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
22024 		"Type mismatch: cannot convert from ArrayList<Integer> to ArrayList<Number>\n" +
22025 		"----------\n");
22026 }
22027 public void test0678() {
22028 	this.runNegativeTest(
22029 		new String[] {
22030 			"X.java",
22031 			"import java.io.Serializable;\n" +
22032 			"\n" +
22033 			"public class X<T, T2 extends T & Serializable > {\n" +
22034 			"	\n" +
22035 			"	X<Object, Serializable> right1;\n" +
22036 			"	X<String, Serializable> wrong1;\n" +
22037 			"	X<Y, Y> right2;\n" +
22038 			"	\n" +
22039 			"	static class Y implements Serializable {\n" +
22040 			"	}\n" +
22041 			"}\n",
22042 		},
22043 		"----------\n" +
22044 		"1. ERROR in X.java (at line 3)\n" +
22045 		"	public class X<T, T2 extends T & Serializable > {\n" +
22046 		"	                                 ^^^^^^^^^^^^\n" +
22047 		"Cannot specify any additional bound Serializable when first bound is a type parameter\n" +
22048 		"----------\n" +
22049 		"2. ERROR in X.java (at line 6)\n" +
22050 		"	X<String, Serializable> wrong1;\n" +
22051 		"	          ^^^^^^^^^^^^\n" +
22052 		"Bound mismatch: The type Serializable is not a valid substitute for the bounded parameter <T2 extends T & Serializable> of the type X<T,T2>\n" +
22053 		"----------\n" +
22054 		"3. WARNING in X.java (at line 9)\n" +
22055 		"	static class Y implements Serializable {\n" +
22056 		"	             ^\n" +
22057 		"The serializable class Y does not declare a static final serialVersionUID field of type long\n" +
22058 		"----------\n");
22059 }
22060 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=95638 - variation
22061 public void test0679() {
22062 	this.runConformTest(
22063 		new String[] {
22064 			"X.java",
22065 			"class Key<E, F extends Key<E, F>> {}\n" +
22066 			"class Store<A, B extends Key<A, B>> {}\n" +
22067 			"\n" +
22068 			"public class X<K extends Key<?, K>> {\n" +
22069 			"	Store<K, ? extends Key<K, ?>> store;\n" +
22070 			"}\n",
22071 		},
22072 		"");
22073 }
22074 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=95638 - variation
22075 public void test0680() {
22076 	this.runConformTest(
22077 		new String[] {
22078 			"X.java",
22079 			"import java.util.List;\n" +
22080 			"\n" +
22081 			"class Key<E, F extends Type<E, F, G, H>, G extends Key<E, F, G, H>, H extends State<H>> {}\n" +
22082 			"class State<S extends State> {}\n" +
22083 			"class Type<T, U extends Type<T, U, V, W>, V extends Key<T, U, V, W>, W extends State<W>> {}\n" +
22084 			"class Store<A, B extends Type<A, B, C, D>, C extends Key<A, B, C, D>, D extends State<D>> {}\n" +
22085 			"\n" +
22086 			"public class X<K extends Key<K, ?,?,?>> {\n" +
22087 			"	List<Store<K, ?, ? extends Key<K, ?, ?, ?>, ? extends State<?>>> stores;\n" +
22088 			"}\n",
22089 		},
22090 		"");
22091 }
22092 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=95638 - variation
22093 public void test0681() {
22094 	this.runConformTest(
22095 		new String[] {
22096 			"X.java",
22097 			"class Key<E, K extends Key<E, K>> {\n" +
22098 			"}\n" +
22099 			"class Store<E, K extends Key<E, K>> {\n" +
22100 			"}\n" +
22101 			"class X<E> {\n" +
22102 			"	Store<E, ?> store1;\n" +
22103 			"	Store<E, ? extends Key<E, ?>> store2;\n" +
22104 			"\n" +
22105 			"	class StoreHolder <F extends Key<E, F>> {\n" +
22106 			"		Store<E, F> store;\n" +
22107 			"	}\n" +
22108 			"}\n" +
22109 			"class Y<T, U extends Y<T, U>> {\n" +
22110 			"	Y<?, ?> y;\n" +
22111 			"}\n",
22112 		},
22113 		"");
22114 }
22115 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=95963
22116 public void test0682() {
22117 	this.runNegativeTest(
22118 		new String[] {
22119 			"X.java",
22120 			"class X extends A<X.M> {}\n" +
22121 			"class A<T> {}\n"
22122 		},
22123 		"----------\n" +
22124 		"1. ERROR in X.java (at line 1)\n" +
22125 		"	class X extends A<X.M> {}\n" +
22126 		"	                  ^^^\n" +
22127 		"X.M cannot be resolved to a type\n" +
22128 		"----------\n"
22129 	);
22130 }
22131 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=96085
22132 public void test0683() {
22133 	this.runConformTest(
22134 		new String[] {
22135 			"P.java",
22136 			"public interface P<V> {\n" +
22137 			"    interface A {}\n" +
22138 			"}\n",
22139 			"P2.java",
22140 			"public class P2 implements P.A {\n" +
22141 			"    P2(P.A problem) {}\n" +
22142 			"}\n",
22143 			"P3.java",
22144 			"public class P3 {\n" +
22145 			"    void test() {P.A o = new P2((P.A) null);}\n" +
22146 			"}\n",
22147 		},
22148 		"");
22149 	this.runConformTest(
22150 		new String[] {
22151 			"P3.java",
22152 			"class P3 {\n" +
22153 			"    void test() {P.A o = new P2((P.A) null);}\n" +
22154 			"}\n",
22155 		},
22156 		"",
22157 		null,
22158 		false,
22159 		null);
22160 }
22161 public void test0684() {
22162 	this.runNegativeTest(
22163 		new String[] {
22164 			"X.java",
22165 			"public class X<T> {\n" +
22166 			"	<U> U foo(U u1, U u2) {\n" +
22167 			"		return u1;\n" +
22168 			"	}\n" +
22169 			"	void bar(X<? extends Throwable> x1, X<? extends Runnable> x2) {\n" +
22170 			"		X<String> x = foo(x1, x2);\n" +
22171 			"	}\n" +
22172 			"}\n",
22173 		},
22174 		"----------\n" +
22175 		"1. ERROR in X.java (at line 6)\n" +
22176 		"	X<String> x = foo(x1, x2);\n" +
22177 		"	              ^^^^^^^^^^^\n" +
22178 		"Type mismatch: cannot convert from X<capture#3-of ? extends Object> to X<String>\n" +
22179 		"----------\n");
22180 }
22181 public void test0685() {
22182 	this.runNegativeTest(
22183 		new String[] {
22184 			"X.java",
22185 			"public class X<T> {\n" +
22186 			"	<U> U foo(U u1, U u2) {\n" +
22187 			"		return u1;\n" +
22188 			"	}\n" +
22189 			"	void bar(X<? extends Throwable> x1, X<? extends Runnable> x2) {\n" +
22190 			"		X<String> x = foo(x1, x2);\n" +
22191 			"	}\n" +
22192 			"}\n",
22193 		},
22194 		"----------\n" +
22195 		"1. ERROR in X.java (at line 6)\n" +
22196 		"	X<String> x = foo(x1, x2);\n" +
22197 		"	              ^^^^^^^^^^^\n" +
22198 		"Type mismatch: cannot convert from X<capture#3-of ? extends Object> to X<String>\n" +
22199 		"----------\n");
22200 }
22201 // check wildcard bounds wrt variable boundCheck
22202 public void test0686() {
22203 	this.runNegativeTest(
22204 		new String[] {
22205 			"X.java",
22206 			"import java.util.List;\n" +
22207 			"class Other<T extends List<? extends Runnable>> {\n" +
22208 			"}\n" +
22209 			"\n" +
22210 			"public class X {\n" +
22211 			"	Other<? extends List<? extends Throwable>> other1;\n" +
22212 			"	Other<? extends List<? super String>> other2;	\n" +
22213 			"	Other<? extends List<? extends String>> other3;		\n" +
22214 			"	Other<? extends List<? extends Runnable>> other7 = other1;\n" +
22215 			"}\n",
22216 		},
22217 		"----------\n" +
22218 		"1. ERROR in X.java (at line 7)\n" +
22219 		"	Other<? extends List<? super String>> other2;	\n" +
22220 		"	      ^^^^^^^^^^^^^^\n" +
22221 		"Bound mismatch: The type ? extends List<? super String> is not a valid substitute for the bounded parameter <T extends List<? extends Runnable>> of the type Other<T>\n" +
22222 		"----------\n" +
22223 		"2. ERROR in X.java (at line 8)\n" +
22224 		"	Other<? extends List<? extends String>> other3;		\n" +
22225 		"	      ^^^^^^^^^^^^^^\n" +
22226 		"Bound mismatch: The type ? extends List<? extends String> is not a valid substitute for the bounded parameter <T extends List<? extends Runnable>> of the type Other<T>\n" +
22227 		"----------\n");
22228 }
22229 // check wildcard bounds wrt variable boundCheck
22230 public void test0687() {
22231 	this.runNegativeTest(
22232 		new String[] {
22233 			"X.java",
22234 			"import java.util.List;\n" +
22235 			"class Other<T extends List<? extends Runnable>> {\n" +
22236 			"}\n" +
22237 			"\n" +
22238 			"public class X {\n" +
22239 			"	Other<? extends List<?>> other2;\n" +
22240 			"	Other<? extends List<? super Throwable>> other3;\n" +
22241 			"	Other<? super List<? extends Throwable>> other4;\n" +
22242 			"	Other<? super List<?>> other5;\n" +
22243 			"	Other<? super List<? super Throwable>> other6;\n" +
22244 			"}\n",
22245 		},
22246 		"----------\n" +
22247 		"1. ERROR in X.java (at line 7)\n" +
22248 		"	Other<? extends List<? super Throwable>> other3;\n" +
22249 		"	      ^^^^^^^^^^^^^^\n" +
22250 		"Bound mismatch: The type ? extends List<? super Throwable> is not a valid substitute for the bounded parameter <T extends List<? extends Runnable>> of the type Other<T>\n" +
22251 		"----------\n" +
22252 		"2. ERROR in X.java (at line 8)\n" +
22253 		"	Other<? super List<? extends Throwable>> other4;\n" +
22254 		"	      ^^^^^^^^^^^^\n" +
22255 		"Bound mismatch: The type ? super List<? extends Throwable> is not a valid substitute for the bounded parameter <T extends List<? extends Runnable>> of the type Other<T>\n" +
22256 		"----------\n" +
22257 		"3. ERROR in X.java (at line 9)\n" +
22258 		"	Other<? super List<?>> other5;\n" +
22259 		"	      ^^^^^^^^^^^^\n" +
22260 		"Bound mismatch: The type ? super List<?> is not a valid substitute for the bounded parameter <T extends List<? extends Runnable>> of the type Other<T>\n" +
22261 		"----------\n" +
22262 		"4. ERROR in X.java (at line 10)\n" +
22263 		"	Other<? super List<? super Throwable>> other6;\n" +
22264 		"	      ^^^^^^^^^^^^\n" +
22265 		"Bound mismatch: The type ? super List<? super Throwable> is not a valid substitute for the bounded parameter <T extends List<? extends Runnable>> of the type Other<T>\n" +
22266 		"----------\n");
22267 }
22268 // check wildcard bounds wrt variable boundCheck
22269 public void test0688() {
22270 	this.runConformTest(
22271 		new String[] {
22272 			"X.java",
22273 			"import java.util.List;\n" +
22274 			"class Other<T extends List<? extends Runnable>> {\n" +
22275 			"}\n" +
22276 			"\n" +
22277 			"public class X {\n" +
22278 			"	Other<? super List<? extends Runnable>> other5;\n" +
22279 			"}\n",
22280 		},
22281 		"");
22282 }
22283 // check wildcard bounds wrt variable boundCheck
22284 public void test0689() {
22285 	this.runNegativeTest(
22286 		new String[] {
22287 			"X.java",
22288 			"import java.util.List;\n" +
22289 			"class Other<T extends List<? extends Runnable>> {\n" +
22290 			"}\n" +
22291 			"\n" +
22292 			"public class X {\n" +
22293 			"	Other<? super List<? super Runnable>> other5;\n" +
22294 			"}\n",
22295 		},
22296 		"----------\n" +
22297 		"1. ERROR in X.java (at line 6)\n" +
22298 		"	Other<? super List<? super Runnable>> other5;\n" +
22299 		"	      ^^^^^^^^^^^^\n" +
22300 		"Bound mismatch: The type ? super List<? super Runnable> is not a valid substitute for the bounded parameter <T extends List<? extends Runnable>> of the type Other<T>\n" +
22301 		"----------\n");
22302 }
22303 // check assignment rules across param types with wildcards
22304 public void test0690() {
22305 	this.runNegativeTest(
22306 		new String[] {
22307 			"X.java",
22308 			"import java.util.List;\n" +
22309 			"public class X {\n" +
22310 			"	void foo(List<? extends Runnable> lr, List<?> la) {\n" +
22311 			"		lr = la;\n" +
22312 			"		la = lr;\n" +
22313 			"	}\n" +
22314 			"}         \n" +
22315 			"\n",
22316 		},
22317 		"----------\n" +
22318 		"1. ERROR in X.java (at line 4)\n" +
22319 		"	lr = la;\n" +
22320 		"	     ^^\n" +
22321 		"Type mismatch: cannot convert from List<capture#2-of ?> to List<? extends Runnable>\n" +
22322 		"----------\n");
22323 }
22324 // check that final class bound is more restrictive
22325 public void test0691() {
22326 	this.runNegativeTest(
22327 		new String[] {
22328 			"XX.java",
22329 			"public class XX<T extends Runnable> {\n" +
22330 			"	void foo(XX<?> lhs, XX<? extends String> rhs) {\n" +
22331 			"		lhs = rhs;\n" +
22332 			"	}\n" +
22333 			"}\n",
22334 		},
22335 		"----------\n" +
22336 		"1. ERROR in XX.java (at line 2)\n" +
22337 		"	void foo(XX<?> lhs, XX<? extends String> rhs) {\n" +
22338 		"	                       ^^^^^^^^^^^^^^^^\n" +
22339 		"Bound mismatch: The type ? extends String is not a valid substitute for the bounded parameter <T extends Runnable> of the type XX<T>\n" +
22340 		"----------\n");
22341 }
22342 // check wildcard bounds wrt variable boundCheck
22343 public void test0692() {
22344 	this.runNegativeTest(
22345 		new String[] {
22346 			"X.java",
22347 			"import java.util.List;\n" +
22348 			"\n" +
22349 			"public class X<T extends List<Object>> {\n" +
22350 			"	\n" +
22351 			"	void foo(X<? extends List<String>> x) {\n" +
22352 			"	}\n" +
22353 			"}\n",
22354 		},
22355 		"----------\n" +
22356 		"1. ERROR in X.java (at line 5)\n" +
22357 		"	void foo(X<? extends List<String>> x) {\n" +
22358 		"	           ^^^^^^^^^^^^^^\n" +
22359 		"Bound mismatch: The type ? extends List<String> is not a valid substitute for the bounded parameter <T extends List<Object>> of the type X<T>\n" +
22360 		"----------\n");
22361 }
22362 // bound checks
22363 public void test0693() {
22364 	this.runNegativeTest(
22365 		new String[] {
22366 			"X.java",
22367 			"public class X<T extends Runnable> {\n" +
22368 			"	X<X<String>> x1;\n" +
22369 			"	X<? extends String> x2;\n" +
22370 			"}\n",
22371 		},
22372 		"----------\n" +
22373 		"1. ERROR in X.java (at line 2)\n" +
22374 		"	X<X<String>> x1;\n" +
22375 		"	  ^\n" +
22376 		"Bound mismatch: The type X<String> is not a valid substitute for the bounded parameter <T extends Runnable> of the type X<T>\n" +
22377 		"----------\n" +
22378 		"2. ERROR in X.java (at line 2)\n" +
22379 		"	X<X<String>> x1;\n" +
22380 		"	    ^^^^^^\n" +
22381 		"Bound mismatch: The type String is not a valid substitute for the bounded parameter <T extends Runnable> of the type X<T>\n" +
22382 		"----------\n" +
22383 		"3. ERROR in X.java (at line 3)\n" +
22384 		"	X<? extends String> x2;\n" +
22385 		"	  ^^^^^^^^^^^^^^^^\n" +
22386 		"Bound mismatch: The type ? extends String is not a valid substitute for the bounded parameter <T extends Runnable> of the type X<T>\n" +
22387 		"----------\n");
22388 }
22389 // bound checks
22390 public void test0694() {
22391 	this.runNegativeTest(
22392 		new String[] {
22393 			"X.java",
22394 			"public class X<T extends X<T>> {\n" +
22395 			"	X<X<X<String>>> x1;\n" +
22396 			"	X<? extends X<? extends X<String>>> x2;\n" +
22397 			"}\n",
22398 		},
22399 		"----------\n" +
22400 		"1. ERROR in X.java (at line 2)\n" +
22401 		"	X<X<X<String>>> x1;\n" +
22402 		"	  ^\n" +
22403 		"Bound mismatch: The type X<X<String>> is not a valid substitute for the bounded parameter <T extends X<T>> of the type X<T>\n" +
22404 		"----------\n" +
22405 		"2. ERROR in X.java (at line 2)\n" +
22406 		"	X<X<X<String>>> x1;\n" +
22407 		"	    ^\n" +
22408 		"Bound mismatch: The type X<String> is not a valid substitute for the bounded parameter <T extends X<T>> of the type X<T>\n" +
22409 		"----------\n" +
22410 		"3. ERROR in X.java (at line 2)\n" +
22411 		"	X<X<X<String>>> x1;\n" +
22412 		"	      ^^^^^^\n" +
22413 		"Bound mismatch: The type String is not a valid substitute for the bounded parameter <T extends X<T>> of the type X<T>\n" +
22414 		"----------\n" +
22415 		"4. ERROR in X.java (at line 3)\n" +
22416 		"	X<? extends X<? extends X<String>>> x2;\n" +
22417 		"	  ^^^^^^^^^^^\n" +
22418 		"Bound mismatch: The type ? extends X<? extends X<String>> is not a valid substitute for the bounded parameter <T extends X<T>> of the type X<T>\n" +
22419 		"----------\n" +
22420 		"5. ERROR in X.java (at line 3)\n" +
22421 		"	X<? extends X<? extends X<String>>> x2;\n" +
22422 		"	              ^^^^^^^^^^^\n" +
22423 		"Bound mismatch: The type ? extends X<String> is not a valid substitute for the bounded parameter <T extends X<T>> of the type X<T>\n" +
22424 		"----------\n" +
22425 		"6. ERROR in X.java (at line 3)\n" +
22426 		"	X<? extends X<? extends X<String>>> x2;\n" +
22427 		"	                          ^^^^^^\n" +
22428 		"Bound mismatch: The type String is not a valid substitute for the bounded parameter <T extends X<T>> of the type X<T>\n" +
22429 		"----------\n");
22430 }
22431 // bound checks
22432 public void test0695() {
22433 	this.runConformTest(
22434 		new String[] {
22435 			"I.java",
22436 			"interface I<T extends I<? extends T>> {\n" +
22437 			"}\n",
22438 		},
22439 		"");
22440 }
22441 public void test0696() {
22442 	this.runNegativeTest(
22443 		new String[] {
22444 			"X.java",
22445 			"class Key<E extends Key<E>> {}\n" +
22446 			"class Store<F extends Key<F>> {}\n" +
22447 			"\n" +
22448 			"public class X<T> {\n" +
22449 			"	Store<? extends Key<T>> store = new Store<Key<T>>();\n" +
22450 			"}\n",
22451 		},
22452 		"----------\n" +
22453 		"1. ERROR in X.java (at line 5)\n" +
22454 		"	Store<? extends Key<T>> store = new Store<Key<T>>();\n" +
22455 		"	                    ^\n" +
22456 		"Bound mismatch: The type T is not a valid substitute for the bounded parameter <E extends Key<E>> of the type Key<E>\n" +
22457 		"----------\n" +
22458 		"2. ERROR in X.java (at line 5)\n" +
22459 		"	Store<? extends Key<T>> store = new Store<Key<T>>();\n" +
22460 		"	                                          ^^^\n" +
22461 		"Bound mismatch: The type Key<T> is not a valid substitute for the bounded parameter <F extends Key<F>> of the type Store<F>\n" +
22462 		"----------\n" +
22463 		"3. ERROR in X.java (at line 5)\n" +
22464 		"	Store<? extends Key<T>> store = new Store<Key<T>>();\n" +
22465 		"	                                              ^\n" +
22466 		"Bound mismatch: The type T is not a valid substitute for the bounded parameter <E extends Key<E>> of the type Key<E>\n" +
22467 		"----------\n");
22468 }
22469 public void test0697() {
22470 	this.runConformTest(
22471 		new String[] {
22472 			"X.java",
22473 			"import java.util.List;\n" +
22474 			"public class X<U, V extends List<U>> {\n" +
22475 			"	V v;\n" +
22476 			"	\n" +
22477 			"	void foo(X<String, ?> x1, X<Object, ?> x2) {\n" +
22478 			"		String s =x1.v.get(0);\n" +
22479 			"		Object o = x2.v.get(0);\n" +
22480 			"		\n" +
22481 			"	}\n" +
22482 			"}\n",
22483 		},
22484 		"");
22485 }
22486 public void test0698() {
22487 	this.runNegativeTest(
22488 		new String[] {
22489 			"X.java",
22490 			"import java.util.List;\n" +
22491 			"\n" +
22492 			"public class X<U extends List<Object>, V extends List<String>> {\n" +
22493 			"	\n" +
22494 			"	X<? super Exception, ? super Exception> x;\n" +
22495 			"}\n",
22496 		},
22497 		"----------\n" +
22498 		"1. ERROR in X.java (at line 5)\n" +
22499 		"	X<? super Exception, ? super Exception> x;\n" +
22500 		"	  ^^^^^^^^^^^^^^^^^\n" +
22501 		"Bound mismatch: The type ? super Exception is not a valid substitute for the bounded parameter <U extends List<Object>> of the type X<U,V>\n" +
22502 		"----------\n" +
22503 		"2. ERROR in X.java (at line 5)\n" +
22504 		"	X<? super Exception, ? super Exception> x;\n" +
22505 		"	                     ^^^^^^^^^^^^^^^^^\n" +
22506 		"Bound mismatch: The type ? super Exception is not a valid substitute for the bounded parameter <V extends List<String>> of the type X<U,V>\n" +
22507 		"----------\n");
22508 }
22509 public void test0699() {
22510 	this.runNegativeTest(
22511 		new String[] {
22512 			"X2.java",
22513 			"import java.util.List;\n" +
22514 			"class Other2<T extends List< Runnable>> {\n" +
22515 			"}\n" +
22516 			"\n" +
22517 			"class X2 {\n" +
22518 			"	Other2<? extends List<Throwable>> other1;\n" +
22519 			"	Other2<? extends List<? super String>> other2;	\n" +
22520 			"	Other2<? extends List<? extends String>> other3;		\n" +
22521 			"	Other2<? extends List<? extends Runnable>> other7 = other1;\n" +
22522 			"}\n",
22523 		},
22524 		"----------\n" +
22525 		"1. ERROR in X2.java (at line 6)\n" +
22526 		"	Other2<? extends List<Throwable>> other1;\n" +
22527 		"	       ^^^^^^^^^^^^^^\n" +
22528 		"Bound mismatch: The type ? extends List<Throwable> is not a valid substitute for the bounded parameter <T extends List<Runnable>> of the type Other2<T>\n" +
22529 		"----------\n" +
22530 		"2. ERROR in X2.java (at line 7)\n" +
22531 		"	Other2<? extends List<? super String>> other2;	\n" +
22532 		"	       ^^^^^^^^^^^^^^\n" +
22533 		"Bound mismatch: The type ? extends List<? super String> is not a valid substitute for the bounded parameter <T extends List<Runnable>> of the type Other2<T>\n" +
22534 		"----------\n" +
22535 		"3. ERROR in X2.java (at line 8)\n" +
22536 		"	Other2<? extends List<? extends String>> other3;		\n" +
22537 		"	       ^^^^^^^^^^^^^^\n" +
22538 		"Bound mismatch: The type ? extends List<? extends String> is not a valid substitute for the bounded parameter <T extends List<Runnable>> of the type Other2<T>\n" +
22539 		"----------\n");
22540 }
22541 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=96646
22542 public void test0700() {
22543 	this.runConformTest(
22544 		new String[] {
22545 			"X.java",
22546 			"abstract class BaseFactory<T> {\n" +
22547 			"	public T create() throws Exception {\n" +
22548 			"		return getType().newInstance();\n" +
22549 			"	}\n" +
22550 			"	public abstract Class<T> getType();\n" +
22551 			"}\n" +
22552 			"interface StringFactory {\n" +
22553 			"	public String create() throws Exception;\n" +
22554 			"}\n" +
22555 			"public class X extends BaseFactory<String> implements StringFactory {\n" +
22556 			"	@Override\n" +
22557 			"	public Class<String> getType() {\n" +
22558 			"		return String.class;\n" +
22559 			"	}\n" +
22560 			"	public static void main(String[] args) throws Exception {\n" +
22561 			"		String emptyString = new X().create();\n" +
22562 			"		System.out.printf(\"SUCCESS\");\n" +
22563 			"	}\n" +
22564 			"}\n",
22565 		},
22566 		"SUCCESS");
22567 }
22568 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=97303
22569 public void test0701() {
22570 	Map options = getCompilerOptions();
22571 	options.put(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION, JavaCore.IGNORE);
22572 	this.runNegativeTest(
22573 		new String[] {
22574 			"X.java",
22575 			"import java.util.Arrays;\n" +
22576 			"import java.util.List;\n" +
22577 			"\n" +
22578 			"class Deejay {\n" +
22579 			"	class Counter<T> {}\n" +
22580 			"\n" +
22581 			"	Counter<Song> songCounter = new Counter<Song>();\n" +
22582 			"	Counter<Genre> genreCounter = new Counter<Genre>();\n" +
22583 			"\n" +
22584 			"	List<Counter<?>> list1 = Arrays.asList(songCounter, genreCounter);\n" +
22585 			"	List<Counter<? extends Object>> list2 = Arrays.asList(songCounter, genreCounter);\n" +
22586 			"	List<Counter<?>> list3 = Arrays.<Counter<?>>asList(songCounter, genreCounter);\n" +
22587 			"	List<Counter<?>> list4 = Arrays.asList(new Counter<?>[] {songCounter, genreCounter});\n" +
22588 			"	List<Counter<? extends String>> list5 = Arrays.asList(songCounter, genreCounter);\n" +
22589 			"}\n" +
22590 			"class Genre {}\n" +
22591 			"class Song {}\n",
22592 		},
22593 		"----------\n" +
22594 		"1. ERROR in X.java (at line 14)\n" +
22595 		"	List<Counter<? extends String>> list5 = Arrays.asList(songCounter, genreCounter);\n" +
22596 		"	                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
22597 		"Type mismatch: cannot convert from List<Deejay.Counter<? extends Object>> to List<Deejay.Counter<? extends String>>\n" +
22598 		"----------\n",
22599 		null,
22600 		true,
22601 		options);
22602 }
22603 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=97303 - variation
22604 public void test0702() {
22605 	this.runNegativeTest(
22606 		new String[] {
22607 			"X.java",
22608 			"public class X<T extends Runnable> implements Runnable {\n" +
22609 			"	\n" +
22610 			"	void foo0(X<X<?>> lhs, X<X<? extends Runnable>> rhs) {\n" +
22611 			"		lhs = rhs; // 0\n" +
22612 			"	}\n" +
22613 			"	void foo1(X<X<?>> lhs, X<X<? extends Object>> rhs) {\n" +
22614 			"		lhs = rhs; // 1\n" + // TODO (philippe) should be ok using capture rules for equivalence
22615 			"	}\n" +
22616 			"	void foo2(X<X<? extends Cloneable>> lhs, X<X<? extends Object>> rhs) {\n" +
22617 			"		lhs = rhs; // 2\n" +
22618 			"	}\n" +
22619 			"	void foo3(X<X<? extends Runnable>> lhs, X<X<? extends Object>> rhs) {\n" +
22620 			"		lhs = rhs; // 3\n" +
22621 			"	}\n" +
22622 			"	void foo4(X<X<? extends Runnable>> lhs, X<X<?>> rhs) {\n" +
22623 			"		lhs = rhs; // 4\n" +
22624 			"	}\n" +
22625 			"	void foo5(X<X<?>> lhs, X<X<? extends Cloneable>> rhs) {\n" +
22626 			"		lhs = rhs; // 5\n" +
22627 			"	}\n" +
22628 			"	void foo6(X<X<X<X<X<?>>>>> lhs, X<X<X<X<X<? extends Runnable>>>>> rhs) {\n" +
22629 			"		lhs = rhs; // 6\n" +
22630 			"	}	\n" +
22631 			"	public void run() {\n" +
22632 			"	}\n" +
22633 			"}\n",
22634 		},
22635 		"----------\n" +
22636 		"1. ERROR in X.java (at line 7)\n" +
22637 		"	lhs = rhs; // 1\n" +
22638 		"	      ^^^\n" +
22639 		"Type mismatch: cannot convert from X<X<? extends Object>> to X<X<?>>\n" +
22640 		"----------\n" +
22641 		"2. ERROR in X.java (at line 10)\n" +
22642 		"	lhs = rhs; // 2\n" +
22643 		"	      ^^^\n" +
22644 		"Type mismatch: cannot convert from X<X<? extends Object>> to X<X<? extends Cloneable>>\n" +
22645 		"----------\n" +
22646 		"3. ERROR in X.java (at line 13)\n" +
22647 		"	lhs = rhs; // 3\n" +
22648 		"	      ^^^\n" +
22649 		"Type mismatch: cannot convert from X<X<? extends Object>> to X<X<? extends Runnable>>\n" +
22650 		"----------\n" +
22651 		"4. ERROR in X.java (at line 19)\n" +
22652 		"	lhs = rhs; // 5\n" +
22653 		"	      ^^^\n" +
22654 		"Type mismatch: cannot convert from X<X<? extends Cloneable>> to X<X<?>>\n" +
22655 		"----------\n");
22656 }
22657 public void test0703() {
22658 	this.runConformTest(
22659 		new String[] {
22660 			"X.java",
22661 			"public class X<T extends X<T>> {}\n" +
22662 			"class Y extends X<Y> {\n" +
22663 			"    X<?> p = (Y)null;\n" +
22664 			"}\n",
22665 		},
22666 		"");
22667 }
22668 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=97800
22669 public void test0704() {
22670 	this.runNegativeTest(
22671 		new String[] {
22672 			"X.java",
22673 			"import java.util.*;\n" +
22674 			"public class X {\n" +
22675 			"		 public static void main(String[] args) {\n" +
22676 			"		 		 List<String> l = (List<String>)Collections.emptyList();\n" +
22677 			"		 }	 \n" +
22678 			"}\n",
22679 		},
22680 		"----------\n" +
22681 		"1. ERROR in X.java (at line 4)\n" +
22682 		"	List<String> l = (List<String>)Collections.emptyList();\n" +
22683 		"	                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
22684 		"Cannot cast from List<Object> to List<String>\n" +
22685 		"----------\n");
22686 }
22687 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=97480
22688 public void test0705() {
22689 	this.runNegativeTest(
22690 		new String[] {
22691 			"X.java",
22692 			"import java.util.*;\n" +
22693 			"\n" +
22694 			"public class X {\n" +
22695 			"  void f(Object o){\n" +
22696 			"		 ((Map.Entry)o).setValue(\"bug\");\n" +
22697 			"		 		 \n" +
22698 			"		 Map.Entry me= (Map.Entry)o; \n" +
22699 			"		 me.setValue(\"ok\");\n" +
22700 			"		 		 \n" +
22701 			"		 ((Vector)o).add(\"ok\");\n" +
22702 			"  }\n" +
22703 			" Zork z;\n" +
22704 			"}\n",
22705 		},
22706 		"----------\n" +
22707 		"1. WARNING in X.java (at line 5)\n" +
22708 		"	((Map.Entry)o).setValue(\"bug\");\n" +
22709 		"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
22710 		"Type safety: The method setValue(Object) belongs to the raw type Map.Entry. References to generic type Map.Entry<K,V> should be parameterized\n" +
22711 		"----------\n" +
22712 		"2. WARNING in X.java (at line 5)\n" +
22713 		"	((Map.Entry)o).setValue(\"bug\");\n" +
22714 		"	  ^^^^^^^^^\n" +
22715 		"Map.Entry is a raw type. References to generic type Map.Entry<K,V> should be parameterized\n" +
22716 		"----------\n" +
22717 		"3. WARNING in X.java (at line 7)\n" +
22718 		"	Map.Entry me= (Map.Entry)o; \n" +
22719 		"	^^^^^^^^^\n" +
22720 		"Map.Entry is a raw type. References to generic type Map.Entry<K,V> should be parameterized\n" +
22721 		"----------\n" +
22722 		"4. WARNING in X.java (at line 7)\n" +
22723 		"	Map.Entry me= (Map.Entry)o; \n" +
22724 		"	               ^^^^^^^^^\n" +
22725 		"Map.Entry is a raw type. References to generic type Map.Entry<K,V> should be parameterized\n" +
22726 		"----------\n" +
22727 		"5. WARNING in X.java (at line 8)\n" +
22728 		"	me.setValue(\"ok\");\n" +
22729 		"	^^^^^^^^^^^^^^^^^\n" +
22730 		"Type safety: The method setValue(Object) belongs to the raw type Map.Entry. References to generic type Map.Entry<K,V> should be parameterized\n" +
22731 		"----------\n" +
22732 		"6. WARNING in X.java (at line 10)\n" +
22733 		"	((Vector)o).add(\"ok\");\n" +
22734 		"	^^^^^^^^^^^^^^^^^^^^^\n" +
22735 		"Type safety: The method add(Object) belongs to the raw type Vector. References to generic type Vector<E> should be parameterized\n" +
22736 		"----------\n" +
22737 		"7. WARNING in X.java (at line 10)\n" +
22738 		"	((Vector)o).add(\"ok\");\n" +
22739 		"	  ^^^^^^\n" +
22740 		"Vector is a raw type. References to generic type Vector<E> should be parameterized\n" +
22741 		"----------\n" +
22742 		"8. ERROR in X.java (at line 12)\n" +
22743 		"	Zork z;\n" +
22744 		"	^^^^\n" +
22745 		"Zork cannot be resolved to a type\n" +
22746 		"----------\n");
22747 }
22748 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=97219
22749 public void test0706() {
22750 	String outputExpectedBelow17 = (this.complianceLevel == ClassFileConstants.JDK1_6)?
22751 			"----------\n" +
22752 			"1. WARNING in X.java (at line 9)\n" +
22753 			"	class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
22754 			"	                                 ^^^^^^\n" +
22755 			"Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" +
22756 			"----------\n":
22757 				"----------\n" +
22758 				"1. ERROR in X.java (at line 9)\n" +
22759 				"	class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
22760 				"	                                 ^^^^^^\n" +
22761 				"Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" +
22762 				"----------\n";
22763 	this.runNegativeTest(
22764 		new String[] {
22765 			"X.java",
22766 			"public class X {\n" +
22767 			"	void foo() {\n" +
22768 			"		BB bb = new BB();\n" +
22769 			"		bb.<Object>test();\n" +
22770 			"		((AA<CC>) bb).test();\n" +
22771 			"	}\n" +
22772 			"}\n" +
22773 			"class AA<T> { AA<Object> test() {return null;} }\n" +
22774 			"class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
22775 			"class CC {}\n",
22776 		},
22777 		(this.complianceLevel < ClassFileConstants.JDK1_7)
22778 		? outputExpectedBelow17
22779 		: "----------\n" +
22780 		"1. ERROR in X.java (at line 4)\n" +
22781 		"	bb.<Object>test();\n" +
22782 		"	           ^^^^\n" +
22783 		"The method test() is ambiguous for the type BB\n" +
22784 		"----------\n" +
22785 		"2. ERROR in X.java (at line 9)\n" +
22786 		"	class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
22787 		"	                                 ^^^^^^\n" +
22788 		"Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" +
22789 		"----------\n"
22790 	);
22791 /*
22792 X.java:4: reference to test is ambiguous, both method test() in AA and method <U>test() in BB match
22793                 bb.<Object>test();
22794                   ^
22795   where U is a type-variable:
22796     U extends Object declared in method <U>test()
22797 X.java:9: name clash: <U>test() in BB and test() in AA have the same erasure, yet neither overrides the other
22798 class BB extends AA<CC> { <U> BB test() {return null;} }
22799                                  ^
22800   where U is a type-variable:
22801     U extends Object declared in method <U>test()
22802 2 errors
22803  */
22804 }
22805 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=97219
22806 public void test0706a() {
22807 	// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950
22808 	String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
22809 			"----------\n" +
22810 			"1. ERROR in X.java (at line 4)\n" +
22811 			"	AA<Object> res1 = bb.test();\n" +
22812 			"	                     ^^^^\n" +
22813 			"The method test() is ambiguous for the type BB\n" +
22814 			"----------\n" +
22815 			"2. WARNING in X.java (at line 5)\n" +
22816 			"	AA res3 = bb.test();\n" +
22817 			"	^^\n" +
22818 			"AA is a raw type. References to generic type AA<T> should be parameterized\n" +
22819 			"----------\n" +
22820 			"3. ERROR in X.java (at line 5)\n" +
22821 			"	AA res3 = bb.test();\n" +
22822 			"	             ^^^^\n" +
22823 			"The method test() is ambiguous for the type BB\n" +
22824 			"----------\n" +
22825 			"4. WARNING in X.java (at line 9)\n" +
22826 			"	class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
22827 			"	                                 ^^^^^^\n" +
22828 			"Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" +
22829 			"----------\n":
22830 				"----------\n" +
22831 				"1. ERROR in X.java (at line 4)\n" +
22832 				"	AA<Object> res1 = bb.test();\n" +
22833 				"	                     ^^^^\n" +
22834 				"The method test() is ambiguous for the type BB\n" +
22835 				"----------\n" +
22836 				"2. WARNING in X.java (at line 5)\n" +
22837 				"	AA res3 = bb.test();\n" +
22838 				"	^^\n" +
22839 				"AA is a raw type. References to generic type AA<T> should be parameterized\n" +
22840 				"----------\n" +
22841 				"3. ERROR in X.java (at line 5)\n" +
22842 				"	AA res3 = bb.test();\n" +
22843 				"	             ^^^^\n" +
22844 				"The method test() is ambiguous for the type BB\n" +
22845 				"----------\n" +
22846 				"4. ERROR in X.java (at line 9)\n" +
22847 				"	class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
22848 				"	                                 ^^^^^^\n" +
22849 				"Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" +
22850 				"----------\n";
22851 	this.runNegativeTest(
22852 		new String[] {
22853 			"X.java",
22854 			"public class X {\n" +
22855 			"	void foo() {\n" +
22856 			"		BB bb = new BB();\n" +
22857 			"		AA<Object> res1 = bb.test();\n" +
22858 			"		AA res3 = bb.test();\n" +
22859 			"	}\n" +
22860 			"}\n" +
22861 			"class AA<T> { AA<Object> test() {return null;} }\n" +
22862 			"class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
22863 			"class CC {}\n",
22864 		},
22865 		expectedCompilerLog
22866 	);
22867 /*
22868 X.java:4: reference to test is ambiguous, both method test() in AA and method <U>test() in BB match
22869                 AA<Object> res1 = bb.test();
22870                                     ^
22871   where U is a type-variable:
22872     U extends Object declared in method <U>test()
22873 X.java:5: reference to test is ambiguous, both method test() in AA and method <U>test() in BB match
22874                 AA res3 = bb.test();
22875                             ^
22876   where U is a type-variable:
22877     U extends Object declared in method <U>test()
22878 X.java:9: name clash: <U>test() in BB and test() in AA have the same erasure, yet neither overrides the other
22879 class BB extends AA<CC> { <U> BB test() {return null;} }
22880                                  ^
22881   where U is a type-variable:
22882     U extends Object declared in method <U>test()
22883 3 errors
22884  */
22885 }
22886 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=97219
22887 public void test0706b() {
22888 	// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950
22889 	String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
22890 			"----------\n" +
22891 			"1. ERROR in X.java (at line 4)\n" +
22892 			"	AA<CC> res = bb.test();\n" +
22893 			"	                ^^^^\n" +
22894 			"The method test() is ambiguous for the type BB\n" +
22895 			"----------\n" +
22896 			"2. ERROR in X.java (at line 5)\n" +
22897 			"	BB res2 = bb.test();\n" +
22898 			"	             ^^^^\n" +
22899 			"The method test() is ambiguous for the type BB\n" +
22900 			"----------\n" +
22901 			"3. WARNING in X.java (at line 9)\n" +
22902 			"	class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
22903 			"	                                 ^^^^^^\n" +
22904 			"Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" +
22905 			"----------\n":
22906 				"----------\n" +
22907 				"1. ERROR in X.java (at line 4)\n" +
22908 				"	AA<CC> res = bb.test();\n" +
22909 				"	                ^^^^\n" +
22910 				"The method test() is ambiguous for the type BB\n" +
22911 				"----------\n" +
22912 				"2. ERROR in X.java (at line 5)\n" +
22913 				"	BB res2 = bb.test();\n" +
22914 				"	             ^^^^\n" +
22915 				"The method test() is ambiguous for the type BB\n" +
22916 				"----------\n" +
22917 				"3. ERROR in X.java (at line 9)\n" +
22918 				"	class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
22919 				"	                                 ^^^^^^\n" +
22920 				"Name clash: The method test() of type BB has the same erasure as test() of type AA<T> but does not override it\n" +
22921 				"----------\n";
22922 	this.runNegativeTest(
22923 		new String[] {
22924 			"X.java",
22925 			"public class X {\n" +
22926 			"	void foo() {\n" +
22927 			"		BB bb = new BB();\n" +
22928 			"		AA<CC> res = bb.test();\n" +
22929 			"		BB res2 = bb.test();\n" +
22930 			"	}\n" +
22931 			"}\n" +
22932 			"class AA<T> { AA<Object> test() {return null;} }\n" +
22933 			"class BB extends AA<CC> { <U> BB test() {return null;} }\n" +
22934 			"class CC {}\n",
22935 		},
22936 		expectedCompilerLog
22937 	);
22938 /*
22939 X.java:4: reference to test is ambiguous, both method test() in AA and method <U>test() in BB match
22940                 AA<CC> res = bb.test();
22941                                ^
22942   where U is a type-variable:
22943     U extends Object declared in method <U>test()
22944 X.java:4: incompatible types
22945                 AA<CC> res = bb.test();
22946                                     ^
22947   required: AA<CC>
22948   found:    AA<Object>
22949 X.java:5: reference to test is ambiguous, both method test() in AA and method <U>test() in BB match
22950                 BB res2 = bb.test();
22951                             ^
22952   where U is a type-variable:
22953     U extends Object declared in method <U>test()
22954 X.java:5: incompatible types
22955                 BB res2 = bb.test();
22956                                  ^
22957   required: BB
22958   found:    AA<Object>
22959 X.java:9: name clash: <U>test() in BB and test() in AA have the same erasure, yet neither overrides the other
22960 class BB extends AA<CC> { <U> BB test() {return null;} }
22961                                  ^
22962   where U is a type-variable:
22963     U extends Object declared in method <U>test()
22964 5 errors
22965  */
22966 	this.runNegativeTest(
22967 		new String[] {
22968 			"X.java",
22969 			"public class X {\n" +
22970 			"	void foo() {\n" +
22971 			"		BB bb = new BB();\n" +
22972 			"		AA<CC> res = bb.test();\n" +
22973 			"		BB res2 = bb.test();\n" +
22974 			"	}\n" +
22975 			"}\n" +
22976 			"class AA<T> { AA<Object> test() {return null;} }\n" +
22977 			"class BB extends AA<CC> { }\n" +
22978 			"class CC {}\n",
22979 		},
22980 		"----------\n" +
22981 		"1. ERROR in X.java (at line 4)\n" +
22982 		"	AA<CC> res = bb.test();\n" +
22983 		"	             ^^^^^^^^^\n" +
22984 		"Type mismatch: cannot convert from AA<Object> to AA<CC>\n" +
22985 		"----------\n" +
22986 		"2. ERROR in X.java (at line 5)\n" +
22987 		"	BB res2 = bb.test();\n" +
22988 		"	          ^^^^^^^^^\n" +
22989 		"Type mismatch: cannot convert from AA<Object> to BB\n" +
22990 		"----------\n"
22991 	);
22992 /*
22993 X.java:4: incompatible types
22994                 AA<CC> res = bb.test();
22995                                     ^
22996   required: AA<CC>
22997   found:    AA<Object>
22998 X.java:5: incompatible types
22999                 BB res2 = bb.test();
23000                                  ^
23001   required: BB
23002   found:    AA<Object>
23003 2 errors
23004  */
23005 }
23006 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98079
23007 public void test0707() {
23008 	this.runConformTest(
23009 		new String[] {
23010 			"X.java",
23011 			"public class X<T> {\n" +
23012 			"\n" +
23013 			"    B<? extends T> b() {\n" +
23014 			"        return a();\n" +
23015 			"    }\n" +
23016 			"    \n" +
23017 			"    <U extends T> B<U> a() {\n" +
23018 			"        return null;\n" +
23019 			"    }\n" +
23020 			"    \n" +
23021 			"    static class B<V> { }\n" +
23022 			"}\n",
23023 		},
23024 		"");
23025 }
23026 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=95684
23027 public void test0708() {
23028 	this.runConformTest(
23029 		new String[] {
23030 			"UserClass.java",
23031 			"public class UserClass<K> {\n" +
23032 			"    protected class DataHolder {}\n" +
23033 			"    protected void loadHook(DataHolder data) {}\n" +
23034 			"}\n",
23035 		},
23036 		"");
23037 	this.runConformTest(
23038 		new String[] {
23039 			"ChildClass.java",
23040 			"public class ChildClass extends UserClass<Object> {\n" +
23041 			"    @Override protected void loadHook(DataHolder data) {}\n" +
23042 			"}\n",
23043 		},
23044 		"",
23045 		null,
23046 		false,
23047 		null);
23048 }
23049 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=95684 - variation
23050 public void test0709() {
23051 	this.runConformTest(
23052 		new String[] {
23053 			"UserClass.java",
23054 			"public class UserClass<K> {\n" +
23055 			"    protected class DataHolder {}\n" +
23056 			"    protected void loadHook(DataHolder[] data) {}\n" +
23057 			"}\n",
23058 		},
23059 		"");
23060 	this.runConformTest(
23061 		new String[] {
23062 			"ChildClass.java",
23063 			"public class ChildClass extends UserClass<Object> {\n" +
23064 			"    @Override protected void loadHook(DataHolder[] data) {}\n" +
23065 			"}\n",
23066 		},
23067 		"",
23068 		null,
23069 		false,
23070 		null);
23071 }
23072 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=96713
23073 public void test0710() {
23074 	this.runConformTest(
23075 		new String[] {
23076 			"X.java",
23077 			"public class X {\n" +
23078 			"	public static <V, P extends Persistent<V>> P createDataObject(V value) {\n" +
23079 			"		return null;\n" +
23080 			"	}\n" +
23081 			"	public static void testCreateDataObject(Object v) {\n" +
23082 			"		Persistent d = createDataObject(v);\n" +
23083 			"	}\n" +
23084 			"\n" +
23085 			"	private interface Persistent<V> {\n" +
23086 			"		public V getValueObject();\n" +
23087 			"	}\n" +
23088 			"}\n",
23089 		},
23090 		"");
23091 }
23092 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97108
23093 public void test0711(){
23094 	this.runConformTest(
23095 		new String[] {
23096 			"X.java",
23097 			"import java.util.ArrayList;\n" +
23098 			"import java.util.HashMap;\n" +
23099 			"import java.util.List;\n" +
23100 			"import java.util.Map;\n" +
23101 			"\n" +
23102 			"public class X<T> {\n" +
23103 			"	static private Map<String, XX> m1 = new HashMap<String, XX>();\n" +
23104 			"	private List<XX> m2 = new ArrayList<XX>();\n" +
23105 			"	static protected XX foo()\n" +
23106 			"	{\n" +
23107 			"		return null;\n" +
23108 			"	}\n" +
23109 			"	static public abstract class XX<TT>\n" +
23110 			"	{\n" +
23111 			"	}\n" +
23112 			"}\n",
23113 		},
23114 	    "");
23115 
23116 	this.runConformTest(
23117 		new String[] {
23118 			"Y.java",
23119 			"public class Y extends X<Object>  \n" +
23120 			"{        \n" +
23121 			"}\n"
23122 		},
23123 	    "",
23124 	    null,
23125 	    false,
23126 	    null);
23127 }
23128 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=97108
23129 // The case that works
23130 public void test0712(){
23131 	this.runConformTest(
23132 		new String[] {
23133 			"X.java",
23134 			"import java.util.ArrayList;\n" +
23135 			"import java.util.HashMap;\n" +
23136 			"import java.util.List;\n" +
23137 			"import java.util.Map;\n" +
23138 			"\n" +
23139 			"public class X<T> {\n" +
23140 			"	static private Map<String, XX> m1 = new HashMap<String, XX>();\n" +
23141 			"	private List<XX<T>> m2 = new ArrayList<XX<T>>();\n" +
23142 			"	static protected XX foo()\n" +
23143 			"	{\n" +
23144 			"		return null;\n" +
23145 			"	}\n" +
23146 			"	static public abstract class XX<TT>\n" +
23147 			"	{\n" +
23148 			"	}\n" +
23149 			"}\n",
23150 		},
23151         "");
23152 	this.runConformTest(
23153 		new String[] {
23154 			"Y.java",
23155 			"public class Y extends X<Object>  \n" +
23156 			"{        \n" +
23157 			"}\n"
23158 		},
23159         "",
23160         null,
23161         false,
23162         null);
23163 }
23164 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=96713
23165 public void test0713() {
23166 	this.runNegativeTest(
23167 		new String[] {
23168 			"X.java",
23169 			"public class X<T> {\n" +
23170 			"	int i = 0;\n" +
23171 			"	interface Y {\n" +
23172 			"		java.util.List<T> lt = null;\n" +
23173 			"		int j = i;\n" +
23174 			"		void m1(T t);		\n" +
23175 			"	}\n" +
23176 			"}\n",
23177 		},
23178 		"----------\n" +
23179 		"1. ERROR in X.java (at line 4)\n" +
23180 		"	java.util.List<T> lt = null;\n" +
23181 		"	               ^\n" +
23182 		"Cannot make a static reference to the non-static type T\n" +
23183 		"----------\n" +
23184 		"2. ERROR in X.java (at line 5)\n" +
23185 		"	int j = i;\n" +
23186 		"	        ^\n" +
23187 		"Cannot make a static reference to the non-static field i\n" +
23188 		"----------\n" +
23189 		"3. ERROR in X.java (at line 6)\n" +
23190 		"	void m1(T t);		\n" +
23191 		"	        ^\n" +
23192 		"Cannot make a static reference to the non-static type T\n" +
23193 		"----------\n");
23194 }
23195 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98232
23196 public void test0714() {
23197 	this.runConformTest(
23198 		new String[] {
23199 			"B.java",
23200 			"import java.util.Map;\n" +
23201 			"import java.util.Set;\n" +
23202 			"import java.util.SortedSet;\n" +
23203 			"\n" +
23204 			"public class B  {\n" +
23205 			"	static Set<Map.Entry> foo(SortedSet<Map.Entry> set) {\n" +
23206 			"		return null;\n" +
23207 			"	}\n" +
23208 			"}\n" +
23209 			"\n",
23210 		},
23211         "");
23212 	this.runConformTest(
23213 		new String[] {
23214 			"A.java",
23215 			"public class A {\n" +
23216 			"	A() {\n" +
23217 			"		B.foo(null);\n" +
23218 			"	}\n" +
23219 			"}\n"
23220 		},
23221         "",
23222         null,
23223         false,
23224         null);
23225 }
23226 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98393
23227 public void test0715() {
23228 	this.runNegativeTest(
23229 		new String[] {
23230 			"X.java",
23231 			"public class X {\n" +
23232 			"    void foo() {\n" +
23233 			"    	Comparable<String> c = (java.util.List)bar(5, 5.0);\n" +
23234 			"    }\n" +
23235 			"    \n" +
23236 			"    <T> T bar(T t1, T t2) { return t1; }\n" +
23237 			"}\n",
23238 		},
23239 		"----------\n" +
23240 		"1. ERROR in X.java (at line 3)\n" +
23241 		"	Comparable<String> c = (java.util.List)bar(5, 5.0);\n" +
23242 		"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
23243 		"Type mismatch: cannot convert from List to Comparable<String>\n" +
23244 		"----------\n" +
23245 		"2. WARNING in X.java (at line 3)\n" +
23246 		"	Comparable<String> c = (java.util.List)bar(5, 5.0);\n" +
23247 		"	                        ^^^^^^^^^^^^^^\n" +
23248 		"List is a raw type. References to generic type List<E> should be parameterized\n" +
23249 		"----------\n");
23250 }
23251 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98396
23252 // **
23253 public void test0716() {
23254 	this.runNegativeTest(
23255 		new String[] {
23256 			"X.java",
23257 			"public class X<T extends Number & Comparable<String>> {\n" +
23258 			"    void foo(T t) {\n" +
23259 			"    		 Comparable<Integer> ci = (Comparable<Integer>) t;  \n" +
23260 			"    }\n" +
23261 			"}\n",
23262 		},
23263 		"----------\n" +
23264 		"1. ERROR in X.java (at line 3)\n" +
23265 		"	Comparable<Integer> ci = (Comparable<Integer>) t;  \n" +
23266 		"	                         ^^^^^^^^^^^^^^^^^^^^^^^\n" +
23267 		"Cannot cast from T to Comparable<Integer>\n" +
23268 		"----------\n");
23269 }
23270 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=98396 - variation
23271 public void test0717() {
23272 	this.runNegativeTest(
23273 		new String[] {
23274 			"X.java",
23275 			"import java.util.List;\n" +
23276 			"public class X<T extends Comparable<String> & List<Integer>> {\n" +
23277 			"    void foo(T t) {\n" +
23278 			"    		 Comparable<Integer> ci = (Comparable<Integer>) t;  \n" +
23279 			"    }\n" +
23280 			"}\n",
23281 		},
23282 		"----------\n" +
23283 		"1. ERROR in X.java (at line 4)\n" +
23284 		"	Comparable<Integer> ci = (Comparable<Integer>) t;  \n" +
23285 		"	                         ^^^^^^^^^^^^^^^^^^^^^^^\n" +
23286 		"Cannot cast from T to Comparable<Integer>\n" +
23287 		"----------\n");
23288 }
23289 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98478
23290 // SHOULD FAIL AT 1.8 (18.2.3): The method max(Collection<? extends T>) in the type Collections is not applicable for the arguments (Set<X.ActionImpl>)
23291 public void test0718() {
23292 	this.runNegativeTest(
23293 		new String[] {
23294 			"X.java",
23295 			"import java.util.Collections;\n" +
23296 			"import java.util.Set;\n" +
23297 			"import java.util.TreeSet;\n" +
23298 			"\n" +
23299 			"public class X {\n" +
23300 			"    \n" +
23301 			"    public interface Base {\n" +
23302 			"    }\n" +
23303 			"    \n" +
23304 			"    abstract class Action<T extends Base> {\n" +
23305 			"    }\n" +
23306 			"\n" +
23307 			"    public class ActionImpl<T extends Base> extends Action<T> implements Comparable<ActionImpl> {\n" +
23308 			"        public int compareTo(ActionImpl o) {\n" +
23309 			"            return 0;\n" +
23310 			"        }\n" +
23311 			"    }\n" +
23312 			"\n" +
23313 			"    public void test() {\n" +
23314 			"        Set<ActionImpl> set = new TreeSet<ActionImpl>();\n" +
23315 			"        Collections.max(set);\n" +
23316 			"    }\n" +
23317 			"   Zork z;\n" +
23318 			"}\n",
23319 		},
23320 		"----------\n" +
23321 		"1. WARNING in X.java (at line 13)\n" +
23322 		"	public class ActionImpl<T extends Base> extends Action<T> implements Comparable<ActionImpl> {\n" +
23323 		"	                                                                                ^^^^^^^^^^\n" +
23324 		"X.ActionImpl is a raw type. References to generic type X.ActionImpl<T> should be parameterized\n" +
23325 		"----------\n" +
23326 		"2. WARNING in X.java (at line 14)\n" +
23327 		"	public int compareTo(ActionImpl o) {\n" +
23328 		"	                     ^^^^^^^^^^\n" +
23329 		"X.ActionImpl is a raw type. References to generic type X.ActionImpl<T> should be parameterized\n" +
23330 		"----------\n" +
23331 		"3. WARNING in X.java (at line 20)\n" +
23332 		"	Set<ActionImpl> set = new TreeSet<ActionImpl>();\n" +
23333 		"	    ^^^^^^^^^^\n" +
23334 		"X.ActionImpl is a raw type. References to generic type X.ActionImpl<T> should be parameterized\n" +
23335 		"----------\n" +
23336 		"4. WARNING in X.java (at line 20)\n" +
23337 		"	Set<ActionImpl> set = new TreeSet<ActionImpl>();\n" +
23338 		"	                                  ^^^^^^^^^^\n" +
23339 		"X.ActionImpl is a raw type. References to generic type X.ActionImpl<T> should be parameterized\n" +
23340 		"----------\n" +
23341 		"5. WARNING in X.java (at line 21)\n" +
23342 		"	Collections.max(set);\n" +
23343 		"	^^^^^^^^^^^^^^^^^^^^\n" +
23344 		"Type safety: Unchecked invocation max(Set<X.ActionImpl>) of the generic method max(Collection<? extends T>) of type Collections\n" +
23345 		"----------\n" +
23346 		"6. ERROR in X.java (at line 23)\n" +
23347 		"	Zork z;\n" +
23348 		"	^^^^\n" +
23349 		"Zork cannot be resolved to a type\n" +
23350 		"----------\n");
23351 }
23352 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98364
23353 public void test0719() {
23354 	this.runNegativeTest(
23355 		new String[] {
23356 			"X.java",
23357 			"import java.util.Iterator;\n" +
23358 			"import java.util.ListIterator;\n" +
23359 			"\n" +
23360 			"interface IntegerIterator extends Iterator {}\n" +
23361 			"interface IntegerListIterator extends ListIterator<Integer>, IntegerIterator {}\n" +
23362 			"\n",
23363 		},
23364 		"----------\n" +
23365 		"1. WARNING in X.java (at line 4)\n" +
23366 		"	interface IntegerIterator extends Iterator {}\n" +
23367 		"	                                  ^^^^^^^^\n" +
23368 		"Iterator is a raw type. References to generic type Iterator<E> should be parameterized\n" +
23369 		"----------\n" +
23370 		"2. ERROR in X.java (at line 5)\n" +
23371 		"	interface IntegerListIterator extends ListIterator<Integer>, IntegerIterator {}\n" +
23372 		"	          ^^^^^^^^^^^^^^^^^^^\n" +
23373 		"The interface Iterator cannot be implemented more than once with different arguments: Iterator and Iterator<Integer>\n" +
23374 		"----------\n");
23375 }
23376 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98364 - variation
23377 public void test0720() {
23378 	this.runNegativeTest(
23379 		new String[] {
23380 			"X.java",
23381 			"interface Foo<T> {}\n" +
23382 			"interface Bar extends Foo<Integer> {}\n" +
23383 			"interface Baz extends Bar, Foo {}\n" +
23384 			"\n" +
23385 			"class XSuper implements Foo {}\n" +
23386 			"class XSub extends XSuper implements Foo<Integer> {}\n" +
23387 			"\n" +
23388 			"public class X implements Bar, Foo {}\n",
23389 		},
23390 		"----------\n" +
23391 		"1. ERROR in X.java (at line 3)\n" +
23392 		"	interface Baz extends Bar, Foo {}\n" +
23393 		"	          ^^^\n" +
23394 		"The interface Foo cannot be implemented more than once with different arguments: Foo and Foo<Integer>\n" +
23395 		"----------\n" +
23396 		"2. WARNING in X.java (at line 3)\n" +
23397 		"	interface Baz extends Bar, Foo {}\n" +
23398 		"	                           ^^^\n" +
23399 		"Foo is a raw type. References to generic type Foo<T> should be parameterized\n" +
23400 		"----------\n" +
23401 		"3. WARNING in X.java (at line 5)\n" +
23402 		"	class XSuper implements Foo {}\n" +
23403 		"	                        ^^^\n" +
23404 		"Foo is a raw type. References to generic type Foo<T> should be parameterized\n" +
23405 		"----------\n" +
23406 		"4. ERROR in X.java (at line 6)\n" +
23407 		"	class XSub extends XSuper implements Foo<Integer> {}\n" +
23408 		"	      ^^^^\n" +
23409 		"The interface Foo cannot be implemented more than once with different arguments: Foo and Foo<Integer>\n" +
23410 		"----------\n" +
23411 		"5. ERROR in X.java (at line 8)\n" +
23412 		"	public class X implements Bar, Foo {}\n" +
23413 		"	             ^\n" +
23414 		"The interface Foo cannot be implemented more than once with different arguments: Foo and Foo<Integer>\n" +
23415 		"----------\n" +
23416 		"6. WARNING in X.java (at line 8)\n" +
23417 		"	public class X implements Bar, Foo {}\n" +
23418 		"	                               ^^^\n" +
23419 		"Foo is a raw type. References to generic type Foo<T> should be parameterized\n" +
23420 		"----------\n");
23421 }
23422 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98561
23423 public void test0721() {
23424 	this.runConformTest(
23425 			new String[] {
23426 				"Foo.java",
23427 				"public class Foo<T>\n" +
23428 				"{\n" +
23429 				"	protected abstract class InnerFoo\n" +
23430 				"	{\n" +
23431 				"		protected abstract void doSomething();\n" +
23432 				"	}\n" +
23433 				"	\n" +
23434 				"	protected void run( InnerFoo innerFoo )\n" +
23435 				"	{\n" +
23436 				"		innerFoo.doSomething();\n" +
23437 				"	}\n" +
23438 				"}",
23439 			},
23440 	        "");
23441 		this.runConformTest(
23442 			new String[] {
23443 				"Bar.java",
23444 				"public class Bar extends Foo<Integer>\n" +
23445 				"{\n" +
23446 				"	public void go()\n" +
23447 				"	{\n" +
23448 				"		InnerFoo inner = new InnerFoo()\n" +
23449 				"		{\n" +
23450 				"			protected void doSomething()\n" +
23451 				"			{\n" +
23452 				"				System.out.println( \"hello\" );\n" +
23453 				"			}\n" +
23454 				"		};\n" +
23455 				"		run( inner );\n" +
23456 				"	}\n" +
23457 				"}"
23458 			},
23459 	        "",
23460 	        null,
23461 	        false,
23462 	        null);
23463 }
23464 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98364 - variation
23465 public void test0722() {
23466 	this.runNegativeTest(
23467 		new String[] {
23468 			"X.java",
23469 			"interface I1<T1> {\n" +
23470 			"}\n" +
23471 			"\n" +
23472 			"interface I2<T2> extends I1<T2> {\n" +
23473 			"}\n" +
23474 			"\n" +
23475 			"public class X<U1> implements I1<U1>, I2<U1> {\n" +
23476 			"}\n",
23477 		},
23478 		"");
23479 }
23480 public void test0723() {
23481 	this.runConformTest(
23482 		new String[] {
23483 			"X.java",
23484 			"interface IA<E> {}\n" +
23485 			"interface IB<E> extends IA<E> {}\n" +
23486 			"class A<E> implements IA<E> {}\n" +
23487 			"class B<E> implements IB<E> {}\n" +
23488 			"\n" +
23489 			"public class X {\n" +
23490 			"\n" +
23491 			"	public static void main(String[] args) {\n" +
23492 			"		A<Integer> x = new A<Integer>();\n" +
23493 			"		B<Integer> y = new B<Integer>();\n" +
23494 			"		print(x);\n" +
23495 			"		print(y);\n" +
23496 			"	}\n" +
23497 			"	public static <T extends IA<?>> void print(T a) {\n" +
23498 			"		System.out.print(\"A\");\n" +
23499 			"	}\n" +
23500 			"	public static <T extends IB<?>> void print(T a) {\n" +
23501 			"		System.out.println(\"B\");\n" +
23502 			"	}\n" +
23503 			"}\n",
23504 		},
23505 		"AB");
23506 }
23507 public void test0724() {
23508 	this.runConformTest(
23509 		new String[] {
23510 			"X.java",
23511 			"import java.util.HashMap;\n" +
23512 			"\n" +
23513 			"public class X {\n" +
23514 			"\n" +
23515 			"	public static void main(String[] args) {\n" +
23516 			"		HashMap<Byte, Byte> subst = new HashMap<Byte, Byte>();\n" +
23517 			"		subst.put((byte)1, (byte)1);\n" +
23518 			"		if (1 + subst.get((byte)1) > 0.f) {\n" +
23519 			"			System.out.println(\"SUCCESS\");\n" +
23520 			"		}		\n" +
23521 			"	}\n" +
23522 			"}\n",
23523 		},
23524 		"SUCCESS");
23525 }
23526 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98500
23527 public void test0725() {
23528 	this.runNegativeTest(
23529 		new String[] {
23530 			"X.java",
23531 			"class AbsC {\n" +
23532 			"	public <T> T[] resize(T[] src, T[] dest) {\n" +
23533 			"		return dest;\n" +
23534 			"	}\n" +
23535 			"}\n" +
23536 			"\n" +
23537 			"class ConrC<T> extends AbsC {\n" +
23538 			"	T[][] data;\n" +
23539 			"	protected void allocateChunkSlots(int maxChunkNo) {\n" +
23540 			"		data = resize(data, new Object[maxChunkNo][]);\n" +
23541 			"	}\n" +
23542 			"}\n",
23543 		},
23544 		"----------\n" +
23545 		"1. ERROR in X.java (at line 10)\n" +
23546 		"	data = resize(data, new Object[maxChunkNo][]);\n" +
23547 		"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
23548 		"Type mismatch: cannot convert from Object[][] to T[][]\n" +
23549 		"----------\n");
23550 }
23551 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98500
23552 public void test0726() {
23553 	this.runConformTest(
23554 		new String[] {
23555 			"X.java",
23556 			"public class X {\n" +
23557 			"	\n" +
23558 			"	void foo() {\n" +
23559 			"		\n" +
23560 			"		Controller<?> ctrl = null;\n" +
23561 			"		foobar(ctrl.getView().getContent()); \n" +
23562 			"	} \n" +
23563 			"	\n" +
23564 			"	static void foobar(X x) {\n" +
23565 			"	}\n" +
23566 			"}\n" +
23567 			"interface Controller<T extends View<?>> {\n" +
23568 			"    public T getView() ;\n" +
23569 			"}\n" +
23570 			"interface View<U extends X> {\n" +
23571 			"	public U getContent();\n" +
23572 			"}\n"
23573 		},
23574 		"");
23575 }
23576 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98500 - variation
23577 public void test0727() {
23578 	this.runConformTest(
23579 		new String[] {
23580 			"X.java",
23581 			"public class X<E> {\n" +
23582 			"	\n" +
23583 			"	void foo() {\n" +
23584 			"		\n" +
23585 			"		Controller<?> ctrl = null;\n" +
23586 			"		foobar(ctrl.getView().getContent()); \n" +
23587 			"	} \n" +
23588 			"	\n" +
23589 			"	static void foobar(X<String> x) {\n" +
23590 			"	}\n" +
23591 			"}\n" +
23592 			"interface Controller<T extends View<?>> {\n" +
23593 			"    public T getView() ;\n" +
23594 			"}\n" +
23595 			"interface View<U extends X<String>> {\n" +
23596 			"	public U getContent();\n" +
23597 			"}\n"
23598 		},
23599 		"");
23600 }
23601 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98500 - variation
23602 public void test0728() {
23603 	this.runNegativeTest(
23604 		new String[] {
23605 			"X.java",
23606 			"public class X<E> {\n" +
23607 			"	\n" +
23608 			"	public static void main(String[] args) {\n" +
23609 			"		\n" +
23610 			"		Controller<?> ctrl = null;\n" +
23611 			"		foobar(ctrl.getView().getContent()); \n" +
23612 			"	} \n" +
23613 			"	\n" +
23614 			"	static void foobar(X<String> x) {\n" +
23615 			"	}\n" +
23616 			"}\n" +
23617 			"interface Controller<T extends View<?>> {\n" +
23618 			"    public T getView() ;\n" +
23619 			"}\n" +
23620 			"interface View<U extends X<U>> {\n" +
23621 			"	public U getContent();\n" +
23622 			"}\n"
23623 		},
23624 		"----------\n" +
23625 		"1. ERROR in X.java (at line 6)\n" +
23626 		"	foobar(ctrl.getView().getContent()); \n" +
23627 		"	^^^^^^\n" +
23628 		"The method foobar(X<String>) in the type X<E> is not applicable for the arguments (capture#2-of ?)\n" +
23629 		"----------\n");
23630 }
23631 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=96586
23632 public void test0729() {
23633 	this.runConformTest(
23634 		new String[] {
23635 			"X.java",
23636 			"public class X implements I<Y> {}\n" +
23637 			"interface I<T> {}\n" +
23638 			"class Y extends X implements I<Y> {}\n"
23639 		},
23640 		"");
23641 	this.runNegativeTest(
23642 		new String[] {
23643 			"X.java",
23644 			"public class X implements I<Y> {}\n" +
23645 			"interface I<T extends I<? super T>> {}\n" +
23646 			"class Y extends X implements I<X> {}\n"
23647 		},
23648 		"----------\n" +
23649 		"1. ERROR in X.java (at line 3)\n" +
23650 		"	class Y extends X implements I<X> {}\n" +
23651 		"	      ^\n" +
23652 		"The interface I cannot be implemented more than once with different arguments: I<Y> and I<X>\n" +
23653 		"----------\n" +
23654 		"2. ERROR in X.java (at line 3)\n" +
23655 		"	class Y extends X implements I<X> {}\n" +
23656 		"	                               ^\n" +
23657 		"Bound mismatch: The type X is not a valid substitute for the bounded parameter <T extends I<? super T>> of the type I<T>\n" +
23658 		"----------\n");
23659 }
23660 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=90437
23661 public void test0730() {
23662 	this.runNegativeTest(
23663 		new String[] {
23664 			"X.java",
23665 			"public class X {\n" +
23666 			"\n" +
23667 			"    Zork z;\n" +
23668 			"    public interface SuperInterface<A> {\n" +
23669 			"    }\n" +
23670 			"\n" +
23671 			"    public interface SubInterface extends SuperInterface<String> {\n" +
23672 			"        public String getString();\n" +
23673 			"    }\n" +
23674 			"\n" +
23675 			"    private SuperInterface< ? extends SuperInterface> x = null;\n" +
23676 			"\n" +
23677 			"    public void f() {\n" +
23678 			"        ((SubInterface) this.x).getString();\n" +
23679 			"    }\n" +
23680 			"}\n"
23681 		},
23682 		"----------\n" +
23683 		"1. ERROR in X.java (at line 3)\n" +
23684 		"	Zork z;\n" +
23685 		"	^^^^\n" +
23686 		"Zork cannot be resolved to a type\n" +
23687 		"----------\n" +
23688 		"2. WARNING in X.java (at line 11)\n" +
23689 		"	private SuperInterface< ? extends SuperInterface> x = null;\n" +
23690 		"	                                  ^^^^^^^^^^^^^^\n" +
23691 		"X.SuperInterface is a raw type. References to generic type X.SuperInterface<A> should be parameterized\n" +
23692 		"----------\n" +
23693 		"3. ERROR in X.java (at line 14)\n" +
23694 		"	((SubInterface) this.x).getString();\n" +
23695 		"	^^^^^^^^^^^^^^^^^^^^^^^\n" +
23696 		"Cannot cast from X.SuperInterface<capture#1-of ? extends X.SuperInterface> to X.SubInterface\n" +
23697 		"----------\n"	);
23698 }
23699 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=97440
23700 public void test0731() {
23701 	this.runConformTest(
23702 		new String[] {
23703 			"X.java",
23704 			"public class X<E> {\n" +
23705 			"	X<? super E> parent;\n" +
23706 			"	X<? super E> current;\n" +
23707 			"\n" +
23708 			"	X<? extends E> parent2;\n" +
23709 			"	X<? extends E> current2;\n" +
23710 			"\n" +
23711 			"	void foo() {\n" +
23712 			"		current = current.parent;\n" +
23713 			"	}\n" +
23714 			"\n" +
23715 			"	void bar() {\n" +
23716 			"		current2 = current2.parent2;\n" +
23717 			"	}\n" +
23718 			"}\n"
23719 		},
23720 		"");
23721 }
23722 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98331
23723 public void test0732() {
23724 	this.runNegativeTest(
23725 		new String[] {
23726 			"X.java",
23727 			"interface B<T> {}\n" +
23728 			"interface C extends B<String>{}\n" +
23729 			"interface D extends B<Integer>{}\n" +
23730 			"\n" +
23731 			"public class X {\n" +
23732 			"             public static void main(String[] args) {\n" +
23733 			"                         D d = null;\n" +
23734 			"                         C c = (C)d; // illegal\n" +
23735 			"             }\n" +
23736 			"}\n"
23737 		},
23738 		"----------\n" +
23739 		"1. ERROR in X.java (at line 8)\n" +
23740 		"	C c = (C)d; // illegal\n" +
23741 		"	      ^^^^\n" +
23742 		"Cannot cast from D to C\n" +
23743 		"----------\n");
23744 }
23745 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98331 - variation
23746 public void test0733() {
23747 	this.runConformTest(
23748 		new String[] {
23749 			"X.java",
23750 			"interface B<T> {}\n" +
23751 			"interface C extends B<String>{}\n" +
23752 			"interface D<E> extends B<E>{}\n" +
23753 			"\n" +
23754 			"\n" +
23755 			"public class X {\n" +
23756 			"			Object foo(C c) {\n" +
23757 			"					return (D<? extends String>) c;\n" +
23758 			"             }\n" +
23759 			"}\n"
23760 		},
23761 		"");
23762 }
23763 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98331 - variation
23764 public void test0734() {
23765 	this.runConformTest(
23766 		new String[] {
23767 			"X.java",
23768 			"interface B<T> {}\n" +
23769 			"interface C extends B<String>{}\n" +
23770 			"interface D<E> extends B<E>{}\n" +
23771 			"\n" +
23772 			"\n" +
23773 			"public class X {\n" +
23774 			"			Object foo(C c, D<? extends String> d) {\n" +
23775 			"					return c != null ? c : d; \n" +
23776 			"             }\n" +
23777 			"}\n"
23778 		},
23779 		"");
23780 }
23781 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98331 - variation
23782 public void test0735() {
23783 	this.runConformTest(
23784 		new String[] {
23785 			"X.java",
23786 			"interface B<T> {}\n" +
23787 			"interface C extends B<String>{}\n" +
23788 			"interface D<E> extends B<E>{}\n" +
23789 			"\n" +
23790 			"\n" +
23791 			"public class X {\n" +
23792 			"			Object foo(C c, D<? extends Exception> d) {\n" +
23793 			"					return c != null ? c : d; \n" +
23794 			"             }\n" +
23795 			"}\n"
23796 		},
23797 		"");
23798 }
23799 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98331 - variation
23800 public void test0736() {
23801 	this.runNegativeTest(
23802 		new String[] {
23803 			"X.java",
23804 			"interface B<T> {}\n" +
23805 			"interface C extends B<String>{}\n" +
23806 			"interface D<E> extends B<E>{}\n" +
23807 			"\n" +
23808 			"\n" +
23809 			"public class X {\n" +
23810 			"			void bar(C c) {\n" +
23811 			"					D<? extends Exception> d = (D<? extends Exception>) c;\n" +
23812 			"					foo(d, c);\n" +
23813 			"             }\n" +
23814 			"			<U> void foo(U u1, U u2) {\n" +
23815 			"			}\n" +
23816 			"}\n"
23817 		},
23818 		"----------\n" +
23819 		"1. ERROR in X.java (at line 8)\n" +
23820 		"	D<? extends Exception> d = (D<? extends Exception>) c;\n" +
23821 		"	                           ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
23822 		"Cannot cast from C to D<? extends Exception>\n" +
23823 		"----------\n");
23824 }
23825 public void test0737() {
23826 	runConformTest(
23827 		// test directory preparation
23828 		new String[] { /* test files */
23829 			"X.java",
23830 			"class Sup {\n" +
23831 			"}\n" +
23832 			"\n" +
23833 			"class Sub1 extends Sup {\n" +
23834 			"}\n" +
23835 			"\n" +
23836 			"class Sub2 extends Sup {\n" +
23837 			"\n" +
23838 			"}\n" +
23839 			"abstract class X {\n" +
23840 			"	abstract <S, A extends S, B extends S> S method(A la, B lb);\n" +
23841 			"\n" +
23842 			"	void m2() {\n" +
23843 			"		Sup Sup = method(new Sub1(), new Sub2());// <-- compiles?? ( A=Sub1, B=Sub2, S=Sup)\n" +
23844 			"		Object obj = method(1, \"32\");// <--doesn\'t compile?? ( A=Integer, B=String, S=Object)\n" +
23845 			"	}\n" +
23846 			"}\n",
23847 		},
23848 		// javac options
23849 		JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
23850 }
23851 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98331 - variation
23852 public void test0738() {
23853 	this.runNegativeTest(
23854 		new String[] {
23855 			"X.java",
23856 			"interface B<T> {}\n" +
23857 			"class C implements B<String>{}\n" +
23858 			"interface D extends B<Integer>{}\n" +
23859 			"\n" +
23860 			"public class X {\n" +
23861 			"             public static void main(String[] args) {\n" +
23862 			"                         D d = null;\n" +
23863 			"                         C c = (C)d; // illegal\n" +
23864 			"             }\n" +
23865 			"}\n"
23866 		},
23867 		"----------\n" +
23868 		"1. ERROR in X.java (at line 8)\n" +
23869 		"	C c = (C)d; // illegal\n" +
23870 		"	      ^^^^\n" +
23871 		"Cannot cast from D to C\n" +
23872 		"----------\n");
23873 }
23874 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98331 - variation
23875 public void test0739() {
23876 	this.runNegativeTest(
23877 		new String[] {
23878 			"X.java",
23879 			"interface B<T> {}\n" +
23880 			"interface C extends B<String>{}\n" +
23881 			"class D implements B<Integer>{}\n" +
23882 			"\n" +
23883 			"public class X {\n" +
23884 			"             public static void main(String[] args) {\n" +
23885 			"                         D d = null;\n" +
23886 			"                         C c = (C)d; // illegal\n" +
23887 			"             }\n" +
23888 			"}\n"
23889 		},
23890 		"----------\n" +
23891 		"1. ERROR in X.java (at line 8)\n" +
23892 		"	C c = (C)d; // illegal\n" +
23893 		"	      ^^^^\n" +
23894 		"Cannot cast from D to C\n" +
23895 		"----------\n");
23896 }
23897 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98331 - variation
23898 public void test0740() {
23899 	this.runNegativeTest(
23900 		new String[] {
23901 			"X.java",
23902 			"interface B<T> {}\n" +
23903 			"final class C implements B<String>{}\n" +
23904 			"\n" +
23905 			"public class X {\n" +
23906 			"             public static void main(String[] args) {\n" +
23907 			"                         B<Integer> d = null;\n" +
23908 			"                         C c = (C)d; // illegal\n" +
23909 			"             }\n" +
23910 			"}\n"
23911 		},
23912 		"----------\n" +
23913 		"1. ERROR in X.java (at line 7)\n" +
23914 		"	C c = (C)d; // illegal\n" +
23915 		"	      ^^^^\n" +
23916 		"Cannot cast from B<Integer> to C\n" +
23917 		"----------\n");
23918 }
23919 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98331 - variation
23920 public void test0741() {
23921 	this.runNegativeTest(
23922 		new String[] {
23923 			"X.java",
23924 			"interface B<T> {}\n" +
23925 			"final class D implements B<Integer>{}\n" +
23926 			"\n" +
23927 			"public class X {\n" +
23928 			"             public static void main(String[] args) {\n" +
23929 			"                         D d = null;\n" +
23930 			"                         B<String> c = (B<String>)d; // illegal\n" +
23931 			"             }\n" +
23932 			"}\n"
23933 		},
23934 		"----------\n" +
23935 		"1. ERROR in X.java (at line 7)\n" +
23936 		"	B<String> c = (B<String>)d; // illegal\n" +
23937 		"	              ^^^^^^^^^^^^\n" +
23938 		"Cannot cast from D to B<String>\n" +
23939 		"----------\n");
23940 }
23941 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=98538
23942 // **
23943 // FAIL ERRMSG
23944 public void test0742() {
23945 	if (this.complianceLevel >= ClassFileConstants.JDK1_8)
23946 		return;
23947 	this.runNegativeTest(
23948 		new String[] {
23949 			"X.java",
23950 			"import java.util.*;\n" +
23951 			"\n" +
23952 			" public class X {\n" +
23953 			" \n" +
23954 			"	static abstract class SelfType<T extends SelfType<T>>{\n" +
23955 			"	}\n" +
23956 			" \n" +
23957 			"	static class SuperType extends SelfType<SuperType>{\n" +
23958 			"	}\n" +
23959 			" \n" +
23960 			"	static class SubType extends SuperType{}\n" +
23961 			" \n" +
23962 			"	static <T extends SelfType<T>> List<T> makeSingletonList(T t){\n" +
23963 			"		return Collections.singletonList(t);\n" +
23964 			"	}\n" +
23965 			" \n" +
23966 			"	static <T extends SelfType<T>,S extends T> List<T> makeSingletonList2(S s){\n" +
23967 			"		return Collections.singletonList((T)s); // #0\n" +
23968 			"	}\n" +
23969 			" \n" +
23970 			"	public static void main(String[] args){\n" +
23971 			"		makeSingletonList(new SuperType()); // #1 - OK\n" +
23972 			"		List<SuperType> lsup = makeSingletonList(new SuperType()); // #2 - OK\n" +
23973 			"		List<SubType> lsub = makeSingletonList(new SubType()); // #3 - ERROR\n" +
23974 			"		makeSingletonList(new SubType()); // #4 - ERROR\n" +
23975 			" 		makeSingletonList2(new SubType()); // #5 - ERROR\n" +
23976 			"		lsup = makeSingletonList2(new SubType()); // #6 - OK\n" +
23977 			"		lsub = makeSingletonList2(new SubType()); // #7 - ERROR\n" +
23978 			"		makeSingletonList2(new SuperType()); // #8 - OK\n" +
23979 			"		lsup = makeSingletonList2(new SuperType()); // #9 - OK\n" +
23980 			"	}\n" +
23981 			"}\n"
23982 		},
23983 		(this.complianceLevel < ClassFileConstants.JDK1_8 ?
23984 		"----------\n" +
23985 		"1. ERROR in X.java (at line 24)\n" +
23986 		"	List<SubType> lsub = makeSingletonList(new SubType()); // #3 - ERROR\n" +
23987 		"	                     ^^^^^^^^^^^^^^^^^\n" +
23988 		"Bound mismatch: The generic method makeSingletonList(T) of type X is not applicable for the arguments (X.SubType). The inferred type X.SubType is not a valid substitute for the bounded parameter <T extends X.SelfType<T>>\n" +
23989 		"----------\n" +
23990 		"2. ERROR in X.java (at line 25)\n" +
23991 		"	makeSingletonList(new SubType()); // #4 - ERROR\n" +
23992 		"	^^^^^^^^^^^^^^^^^\n" +
23993 		"Bound mismatch: The generic method makeSingletonList(T) of type X is not applicable for the arguments (X.SubType). The inferred type X.SubType is not a valid substitute for the bounded parameter <T extends X.SelfType<T>>\n" +
23994 		"----------\n" +
23995 		"3. ERROR in X.java (at line 26)\n" +
23996 		"	makeSingletonList2(new SubType()); // #5 - ERROR\n" +
23997 		"	^^^^^^^^^^^^^^^^^^\n" +
23998 		"Bound mismatch: The generic method makeSingletonList2(S) of type X is not applicable for the arguments (X.SubType). The inferred type X.SubType is not a valid substitute for the bounded parameter <T extends X.SelfType<T>>\n" +
23999 		"----------\n" +
24000 		"4. ERROR in X.java (at line 28)\n" +
24001 		"	lsub = makeSingletonList2(new SubType()); // #7 - ERROR\n" +
24002 		"	       ^^^^^^^^^^^^^^^^^^\n" +
24003 		"Bound mismatch: The generic method makeSingletonList2(S) of type X is not applicable for the arguments (X.SubType). The inferred type X.SubType is not a valid substitute for the bounded parameter <T extends X.SelfType<T>>\n" +
24004 		"----------\n"
24005 		: // ----- JDK1_8 + -----: #4 & #5 infer as argument type: SuperType.
24006 		"----------\n" +
24007 		"1. ERROR in X.java (at line 24)\n" +
24008 		"	List<SubType> lsub = makeSingletonList(new SubType()); // #3 - ERROR\n" +
24009 		"	                     ^^^^^^^^^^^^^^^^^\n" +
24010 		"Bound mismatch: The generic method makeSingletonList(T) of type X is not applicable for the arguments (X.SubType). The inferred type X.SubType is not a valid substitute for the bounded parameter <T extends X.SelfType<T>>\n" +
24011 		"----------\n" +
24012 		"2. ERROR in X.java (at line 28)\n" +
24013 		"	lsub = makeSingletonList2(new SubType()); // #7 - ERROR\n" +
24014 		"	       ^^^^^^^^^^^^^^^^^^\n" +
24015 		"Bound mismatch: The generic method makeSingletonList2(S) of type X is not applicable for the arguments (X.SubType). The inferred type X.SubType is not a valid substitute for the bounded parameter <T extends X.SelfType<T>>\n" +
24016 		"----------\n"));
24017 }
24018 
24019 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=99553
24020 public void test0743() {
24021 	this.runNegativeTest(
24022 		new String[] {
24023 			"X.java",
24024 			"interface TestGeneric2<A> {\n" +
24025 			"	Nested<A> getNested2(); // super\n" +
24026 			"\n" +
24027 			"	class Nested<B> implements TestGeneric2<B> {\n" +
24028 			"		public Nested<B> getNested2() { // sub\n" +
24029 			"			return this;//2\n" +
24030 			"		}\n" +
24031 			"	}\n" +
24032 			"}\n" +
24033 			" \n" +
24034 			"class TestGeneric3<A> {\n" +
24035 			"	Nested<A> getNested3() { return null; } // super\n" +
24036 			"\n" +
24037 			"	class Nested<B> extends TestGeneric3<B> {\n" +
24038 			"		@Override public Nested<B> getNested3() { // sub\n" +
24039 			"			return this;//3\n" +
24040 			"		}\n" +
24041 			"	}\n" +
24042 			"}\n"
24043 		},
24044 		"----------\n" +
24045 		"1. ERROR in X.java (at line 16)\n" +
24046 		"	return this;//3\n" +
24047 		"	       ^^^^\n" +
24048 		"Type mismatch: cannot convert from TestGeneric3<A>.Nested<B> to TestGeneric3<B>.Nested<B>\n" +
24049 		"----------\n");
24050 }
24051 public void test0744() {
24052 	this.runNegativeTest(
24053 		new String[] {
24054 			"java/util/X.java",
24055 			"package java.util;\n" +
24056 			"\n" +
24057 			"import java.io.*;\n" +
24058 			"\n" +
24059 			"class Super<U, V> {\n" +
24060 			"	static class Entry<U,V> {\n" +
24061 			"		Entry(int i, U u, V v, Entry<U,V> entry) {}\n" +
24062 			"		void recordAccess(Super<U,V> s) {\n" +
24063 			"		}\n" +
24064 			"	}\n" +
24065 			"}\n"+
24066 			"public abstract class X<K1, V1> extends Super<K1, V1> {\n" +
24067 			"\n" +
24068 			"	Entry<K1, V1> h;\n" +
24069 			"\n" +
24070 			"	private static class Entry<K2, V2> extends Super.Entry<K2, V2> {\n" +
24071 			"\n" +
24072 			"		Entry() {\n" +
24073 			"			super(0, null, null, null);\n" +
24074 			"		}\n" +
24075 			"\n" +
24076 			"		void ab(Entry<K2, V2> e) {\n" +
24077 			"		}\n" +
24078 			"\n" +
24079 			"		@Override void recordAccess(Super<K2, V2> m) {\n" +
24080 			"			X<K2, V2> x = (X<K2, V2>) m;\n" +
24081 			"			ab(x.h);\n" +
24082 			"		}\n" +
24083 			"	}\n" +
24084 			"  Zork z;\n" +
24085 			"}\n"
24086 		},
24087 		"----------\n" +
24088 		"1. ERROR in java\\util\\X.java (at line 30)\n" +
24089 		"	Zork z;\n" +
24090 		"	^^^^\n" +
24091 		"Zork cannot be resolved to a type\n" +
24092 		"----------\n");
24093 }
24094 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=99922
24095 public void test0745() {
24096 	this.runConformTest(
24097 		new String[] {
24098 			"X.java",
24099 			"public class X {\n" +
24100 			"	void test() {\n" +
24101 			"		java.util.Arrays.asList(3, 3.1);\n" +
24102 			"	}\n" +
24103 			"}\n"
24104 		},
24105 		"");
24106 }
24107 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=99922 - variation
24108 public void test0746() {
24109 	Map options = getCompilerOptions();
24110 	options.put(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION, JavaCore.IGNORE);
24111 	this.runNegativeTest(
24112 		new String[] {
24113 			"X.java",
24114 			"public class X {\n" +
24115 			"	void test() {\n" +
24116 			"		String s = java.util.Arrays.asList(3, 3.1);\n" +
24117 			"	}\n" +
24118 			"}\n"
24119 		},
24120 		"----------\n" +
24121 		"1. ERROR in X.java (at line 3)\n" +
24122 		"	String s = java.util.Arrays.asList(3, 3.1);\n" +
24123 		"	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
24124 		"Type mismatch: cannot convert from List<"+intersection("Number","Comparable<?>")+"> to String\n" +
24125 		"----------\n",
24126 		null,
24127 		true,
24128 		options);
24129 }
24130 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=99983
24131 public void test0747() {
24132 	this.runNegativeTest(
24133 		new String[] {
24134 			"X.java",
24135 			"public class X<T> {\n" +
24136 			"  interface I {}\n" +
24137 			"  class Y<U extends T & I> {\n" +
24138 			"  }\n" +
24139 			"}",
24140 		},
24141 		"----------\n" +
24142 		"1. ERROR in X.java (at line 3)\n" +
24143 		"	class Y<U extends T & I> {\n" +
24144 		"	                      ^\n" +
24145 		"Cannot specify any additional bound X.I when first bound is a type parameter\n" +
24146 		"----------\n");
24147 }
24148 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=100007
24149 public void test0748() {
24150 	// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950
24151 	String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
24152 			"----------\n" +
24153 			"1. WARNING in X.java (at line 5)\n" +
24154 			"	public byte[] create(Class<byte[]> cl) { return null; }\n" +
24155 			"	              ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
24156 			"Name clash: The method create(Class<byte[]>) of type X has the same erasure as create(Class<U>) of type Factory<T> but does not override it\n" +
24157 			"----------\n":
24158 				"----------\n" +
24159 				"1. ERROR in X.java (at line 5)\n" +
24160 				"	public byte[] create(Class<byte[]> cl) { return null; }\n" +
24161 				"	              ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
24162 				"Name clash: The method create(Class<byte[]>) of type X has the same erasure as create(Class<U>) of type Factory<T> but does not override it\n" +
24163 				"----------\n";
24164 	this.runNegativeTest(
24165 		new String[] {
24166 			"X.java",
24167 			"interface Factory<T> {\n" +
24168 			"	<U extends T> U create(Class<U> cl);\n" +
24169 			"}\n" +
24170 			"abstract class X implements Factory<byte[]> {\n" +
24171 			"	public byte[] create(Class<byte[]> cl) { return null; }\n" +
24172 			"}\n",
24173 		},
24174 		expectedCompilerLog
24175 	);
24176 // javac 7 reports the name clash when X subclasses another class or is a concrete type
24177 }
24178 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=100149
24179 public void test0749() {
24180 	this.runNegativeTest(
24181 		new String[] {
24182 			"X.java",
24183 			"import java.util.List;\n" +
24184 			"\n" +
24185 			"public class X<T extends X<?>> {\n" +
24186 			"	T get() { return null; }\n" +
24187 			"	void foo(X x) {\n" +
24188 			"		String s = x.get();\n" +
24189 			"	}\n" +
24190 			"}\n",
24191 		},
24192 		"----------\n" +
24193 		"1. WARNING in X.java (at line 5)\n" +
24194 		"	void foo(X x) {\n" +
24195 		"	         ^\n" +
24196 		"X is a raw type. References to generic type X<T> should be parameterized\n" +
24197 		"----------\n" +
24198 		"2. ERROR in X.java (at line 6)\n" +
24199 		"	String s = x.get();\n" +
24200 		"	           ^^^^^^^\n" +
24201 		"Type mismatch: cannot convert from X to String\n" +
24202 		"----------\n");
24203 }
24204 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=100149 - variation
24205 public void test0750() {
24206 	this.runNegativeTest(
24207 		new String[] {
24208 			"X.java",
24209 			"import java.util.List;\n" +
24210 			"\n" +
24211 			"public class X<T extends List<String>> {\n" +
24212 			"	T get() { return null; }\n" +
24213 			"	void foo(X x) {\n" +
24214 			"		List<Object> l = x.get();\n" +
24215 			"	}\n" +
24216 			"  Zork z ;\n" +
24217 			"}\n",
24218 		},
24219 		"----------\n" +
24220 		"1. WARNING in X.java (at line 5)\n" +
24221 		"	void foo(X x) {\n" +
24222 		"	         ^\n" +
24223 		"X is a raw type. References to generic type X<T> should be parameterized\n" +
24224 		"----------\n" +
24225 		"2. WARNING in X.java (at line 6)\n" +
24226 		"	List<Object> l = x.get();\n" +
24227 		"	                 ^^^^^^^\n" +
24228 		"Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
24229 		"----------\n" +
24230 		"3. ERROR in X.java (at line 8)\n" +
24231 		"	Zork z ;\n" +
24232 		"	^^^^\n" +
24233 		"Zork cannot be resolved to a type\n" +
24234 		"----------\n");
24235 }
24236 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=100153
24237 public void test0751() {
24238 	this.runNegativeTest(
24239 		new String[] {
24240 			"X.java",
24241 			"public class X<T extends X<T>> {\n" +
24242 			"	\n" +
24243 			"	void foo(X<? extends T> x) {\n" +
24244 			"		X<T> x2 = x;\n" +
24245 			"	}\n" +
24246 			"}\n",
24247 		},
24248 		"----------\n" +
24249 		"1. ERROR in X.java (at line 4)\n" +
24250 		"	X<T> x2 = x;\n" +
24251 		"	          ^\n" +
24252 		"Type mismatch: cannot convert from X<capture#1-of ? extends T> to X<T>\n" +
24253 		"----------\n");
24254 }
24255 public void test0752() {
24256 	this.runNegativeTest(
24257 		new String[] {
24258 			"X.java",
24259 			"import java.io.Serializable;\n" +
24260 			"\n" +
24261 			"public class X<E extends Serializable> {\n" +
24262 			"	X<? extends I<E>> parent;\n" +
24263 			"	X<? extends I<E>> current;\n" +
24264 			"	void foo() {\n" +
24265 			"		current = current.parent;\n" +
24266 			"	}\n" +
24267 			"}\n" +
24268 			"\n" +
24269 			"interface I<T> {\n" +
24270 			"}\n",
24271 		},
24272 		"----------\n" +
24273 		"1. ERROR in X.java (at line 7)\n" +
24274 		"	current = current.parent;\n" +
24275 		"	          ^^^^^^^^^^^^^^\n" +
24276 		"Type mismatch: cannot convert from X<capture#3-of ? extends I<capture#2-of ? extends I<E>>> to X<? extends I<E>>\n" +
24277 		"----------\n");
24278 }
24279 public void test0753() {
24280 	this.runNegativeTest(
24281 		new String[] {
24282 			"X.java",
24283 			"import java.io.Serializable;\n" +
24284 			"\n" +
24285 			"public class X<E extends Serializable> {\n" +
24286 			"	X<? super I<E>> parent;\n" +
24287 			"	X<? super I<E>> current;\n" +
24288 			"	void foo() {\n" +
24289 			"		current = current.parent;\n" +
24290 			"	}\n" +
24291 			"}\n" +
24292 			"\n" +
24293 			"interface I<T> {\n" +
24294 			"}\n",
24295 		},
24296 		"----------\n" +
24297 		"1. ERROR in X.java (at line 4)\n" +
24298 		"	X<? super I<E>> parent;\n" +
24299 		"	  ^^^^^^^^^\n" +
24300 		"Bound mismatch: The type ? super I<E> is not a valid substitute for the bounded parameter <E extends Serializable> of the type X<E>\n" +
24301 		"----------\n" +
24302 		"2. ERROR in X.java (at line 5)\n" +
24303 		"	X<? super I<E>> current;\n" +
24304 		"	  ^^^^^^^^^\n" +
24305 		"Bound mismatch: The type ? super I<E> is not a valid substitute for the bounded parameter <E extends Serializable> of the type X<E>\n" +
24306 		"----------\n" +
24307 		"3. ERROR in X.java (at line 7)\n" +
24308 		"	current = current.parent;\n" +
24309 		"	          ^^^^^^^^^^^^^^\n" +
24310 		"Type mismatch: cannot convert from X<capture#3-of ? super I<capture#2-of ? super I<E>>> to X<? super I<E>>\n" +
24311 		"----------\n");
24312 }
24313 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=99578
24314 public void test0754() {
24315 	this.runNegativeTest(
24316 		new String[] {
24317 			"X.java",
24318 			"class bugSuper<T extends Object> {\n" +
24319 			"	public T getData(){\n" +
24320 			"		return null;\n" +
24321 			"	}\n" +
24322 			"}\n" +
24323 			"\n" +
24324 			"class bugElement {\n" +
24325 			"}\n" +
24326 			"\n" +
24327 			"class bugClass<T extends bugElement> extends bugSuper<T>{\n" +
24328 			"}\n" +
24329 			"\n" +
24330 			"public class X{\n" +
24331 			"	public void method(bugClass bc){\n" +
24332 			"		bugElement be = bc.getData();   //<< here\n" +
24333 			"	}\n" +
24334 			"}\n",
24335 		},
24336 		"----------\n" +
24337 		"1. WARNING in X.java (at line 14)\n" +
24338 		"	public void method(bugClass bc){\n" +
24339 		"	                   ^^^^^^^^\n" +
24340 		"bugClass is a raw type. References to generic type bugClass<T> should be parameterized\n" +
24341 		"----------\n" +
24342 		"2. ERROR in X.java (at line 15)\n" +
24343 		"	bugElement be = bc.getData();   //<< here\n" +
24344 		"	                ^^^^^^^^^^^^\n" +
24345 		"Type mismatch: cannot convert from Object to bugElement\n" +
24346 		"----------\n");
24347 }
24348 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=99999
24349 public void test0755() {
24350 	this.runNegativeTest(
24351 		new String[] {
24352 			"X.java",
24353 			"public class X<T> {\n" +
24354 			"  public static class B {}\n" +
24355 			"  public static void main (String... args) {\n" +
24356 			"    X<?>.B[] b = new X<?>.B[1];\n" +
24357 			"  }\n" +
24358 			"}",
24359 		},
24360 		"----------\n" +
24361 		"1. ERROR in X.java (at line 4)\n" +
24362 		"	X<?>.B[] b = new X<?>.B[1];\n" +
24363 		"	^^^^^^\n" +
24364 		"The member type X.B cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type X<?>\n" +
24365 		"----------\n" +
24366 		"2. ERROR in X.java (at line 4)\n" +
24367 		"	X<?>.B[] b = new X<?>.B[1];\n" +
24368 		"	                 ^^^^^^\n" +
24369 		"The member type X.B cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type X<?>\n" +
24370 		"----------\n");
24371 }
24372 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=99999 - variation
24373 public void test0756() {
24374 	runConformTest(
24375 		// test directory preparation
24376 		new String[] { /* test files */
24377 			"X.java",
24378 			"public class X<T> {\n" +
24379 			"  public class B {}\n" +
24380 			"  public static void main (String... args) {\n" +
24381 			"    X<?>.B[] b = new X<?>.B[1];\n" +
24382 			"  }\n" +
24383 			"}",
24384 		},
24385 		// javac options
24386 		JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
24387 }
24388 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=100147
24389 public void test0757() {
24390 	this.runNegativeTest(
24391 		new String[] {
24392 			"X.java",
24393 			"public class X<K, V> {\n" +
24394 			"	static class EntryMap<K, V> {\n" +
24395 			"		class Entry {\n" +
24396 			"		}\n" +
24397 			"	}\n" +
24398 			"\n" +
24399 			"	EntryMap.Entry internalGet(Object key) {\n" +
24400 			"		return null;\n" +
24401 			"	}\n" +
24402 			"	\n" +
24403 			"	void foo(Object key) {\n" +
24404 			"		EntryMap<K,V>.Entry entry = internalGet(key);\n" +
24405 			"	}\n" +
24406 			"  Zork z;\n" +
24407 			"}\n",
24408 		},
24409 		"----------\n" +
24410 		"1. WARNING in X.java (at line 7)\n" +
24411 		"	EntryMap.Entry internalGet(Object key) {\n" +
24412 		"	^^^^^^^^^^^^^^\n" +
24413 		"X.EntryMap.Entry is a raw type. References to generic type X.EntryMap<K,V>.Entry should be parameterized\n" +
24414 		"----------\n" +
24415 		"2. WARNING in X.java (at line 12)\n" +
24416 		"	EntryMap<K,V>.Entry entry = internalGet(key);\n" +
24417 		"	                            ^^^^^^^^^^^^^^^^\n" +
24418 		"Type safety: The expression of type X.EntryMap.Entry needs unchecked conversion to conform to X.EntryMap<K,V>.Entry\n" +
24419 		"----------\n" +
24420 		"3. ERROR in X.java (at line 14)\n" +
24421 		"	Zork z;\n" +
24422 		"	^^^^\n" +
24423 		"Zork cannot be resolved to a type\n" +
24424 		"----------\n");
24425 }
24426 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=100147 - variation
24427 public void test0758() {
24428 	this.runNegativeTest(
24429 		new String[] {
24430 			"X.java",
24431 			"public class X<K, V> {\n" +
24432 			"	static class EntryMap<K, V> {\n" +
24433 			"		class Entry {\n" +
24434 			"		}\n" +
24435 			"	}\n" +
24436 			"\n" +
24437 			"	EntryMap.Entry internalGet(Object key) {\n" +
24438 			"		return null;\n" +
24439 			"	}\n" +
24440 			"	\n" +
24441 			"	void foo(Object key) {\n" +
24442 			"		EntryMap<K,V>.Entry entry = (EntryMap.Entry) internalGet(key);\n" +
24443 			"	}\n" +
24444 			"  Zork z;\n" +
24445 			"}\n",
24446 		},
24447 		"----------\n" +
24448 		"1. WARNING in X.java (at line 7)\n" +
24449 		"	EntryMap.Entry internalGet(Object key) {\n" +
24450 		"	^^^^^^^^^^^^^^\n" +
24451 		"X.EntryMap.Entry is a raw type. References to generic type X.EntryMap<K,V>.Entry should be parameterized\n" +
24452 		"----------\n" +
24453 		"2. WARNING in X.java (at line 12)\n" +
24454 		"	EntryMap<K,V>.Entry entry = (EntryMap.Entry) internalGet(key);\n" +
24455 		"	                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
24456 		"Unnecessary cast from X.EntryMap.Entry to X.EntryMap.Entry\n" +
24457 		"----------\n" +
24458 		"3. WARNING in X.java (at line 12)\n" +
24459 		"	EntryMap<K,V>.Entry entry = (EntryMap.Entry) internalGet(key);\n" +
24460 		"	                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
24461 		"Type safety: The expression of type X.EntryMap.Entry needs unchecked conversion to conform to X.EntryMap<K,V>.Entry\n" +
24462 		"----------\n" +
24463 		"4. WARNING in X.java (at line 12)\n" +
24464 		"	EntryMap<K,V>.Entry entry = (EntryMap.Entry) internalGet(key);\n" +
24465 		"	                             ^^^^^^^^^^^^^^\n" +
24466 		"X.EntryMap.Entry is a raw type. References to generic type X.EntryMap<K,V>.Entry should be parameterized\n" +
24467 		"----------\n" +
24468 		"5. ERROR in X.java (at line 14)\n" +
24469 		"	Zork z;\n" +
24470 		"	^^^^\n" +
24471 		"Zork cannot be resolved to a type\n" +
24472 		"----------\n");
24473 }
24474 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=100128
24475 public void test0759() {
24476 	this.runConformTest(
24477 		new String[] {
24478 			"X.java",
24479 			"public class X<E>\n" +
24480 			"{\n" +
24481 			"  E[] m;\n" +
24482 			"  public X()\n" +
24483 			"  {\n" +
24484 			"	X<? extends E> x = null;\n" +
24485 			"	System.out.println(x.m.length);\n" +
24486 			"  }\n" +
24487 			"}\n",
24488 		},
24489 		"");
24490 }
24491 public void test0760() {
24492 	this.runNegativeTest(
24493 		new String[] {
24494 			"X.java",
24495 			"import java.util.*;\n" +
24496 			"\n" +
24497 			"public class X<U> {\n" +
24498 			"	public static <T> X<T> make() {\n" +
24499 			"		return null;\n" +
24500 			"	}\n" +
24501 			"	public static <T> T itself(T t) {\n" +
24502 			"		return t;\n" +
24503 			"	}\n" +
24504 			"\n" +
24505 			"	void foo() {\n" +
24506 			"		X<Integer> x1 = make();\n" +
24507 			"		X<Integer> x2 = itself(x1);\n" +
24508 			"	}\n" +
24509 			"	void bar() {\n" +
24510 			"		X<Integer> x2 = itself(make());\n" +
24511 			"	}\n" +
24512 			"	void baz() {\n" +
24513 			"		X<Integer> x2 = itself((X<Integer>)make());\n" +
24514 			"	}	\n" +
24515 			"} \n",
24516 		},
24517 		(this.complianceLevel < ClassFileConstants.JDK1_8 ?
24518 		"----------\n" +
24519 		"1. ERROR in X.java (at line 16)\n" +
24520 		"	X<Integer> x2 = itself(make());\n" +
24521 		"	                ^^^^^^^^^^^^^^\n" +
24522 		"Type mismatch: cannot convert from X<Object> to X<Integer>\n" +
24523 		"----------\n" +
24524 		"2. ERROR in X.java (at line 19)\n" +
24525 		"	X<Integer> x2 = itself((X<Integer>)make());\n" +
24526 		"	                       ^^^^^^^^^^^^^^^^^^\n" +
24527 		"Cannot cast from X<Object> to X<Integer>\n" +
24528 		"----------\n"
24529 		:
24530 		"----------\n" +
24531 		"1. ERROR in X.java (at line 19)\n" +
24532 		"	X<Integer> x2 = itself((X<Integer>)make());\n" +
24533 		"	                       ^^^^^^^^^^^^^^^^^^\n" +
24534 		"Cannot cast from X<Object> to X<Integer>\n" +
24535 		"----------\n"
24536 		));
24537 }
24538 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=100421
24539 public void test0761() {
24540 	this.runConformTest(
24541 		new String[] {
24542 			"X.java",
24543 			"public class X {\n" +
24544 			"\n" +
24545 			"  public abstract class ClassA<A, B> {\n" +
24546 			"    public abstract B method(A param);\n" +
24547 			"  }\n" +
24548 			"\n" +
24549 			"  public class ClassB<C, D extends C> {\n" +
24550 			"    // the following field declaration causes an error\n" +
24551 			"    ClassA<? super C, ? extends D> classA;\n" +
24552 			"\n" +
24553 			"    public D method(D d) {\n" +
24554 			"      return classA.method(d);\n" +
24555 			"    }\n" +
24556 			"  }\n" +
24557 			"}\n",
24558 		},
24559 		"");
24560 }
24561 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=100421 - variation
24562 public void test0762() {
24563 	this.runConformTest(
24564 		new String[] {
24565 			"X.java",
24566 			"public class X {\n" +
24567 			"\n" +
24568 			"  public abstract class ClassA<A, B extends Number> {\n" +
24569 			"    public abstract B method(A param);\n" +
24570 			"  }\n" +
24571 			"\n" +
24572 			"  public class ClassB<C extends Number, D extends C> {\n" +
24573 			"    // the following field declaration causes an error\n" +
24574 			"    ClassA<? super C, ? extends D> classA;\n" +
24575 			"\n" +
24576 			"    public D method(D d) {\n" +
24577 			"      return classA.method(d);\n" +
24578 			"    }\n" +
24579 			"  }\n" +
24580 			"}\n",
24581 		},
24582 		"");
24583 }
24584 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=100519
24585 public void test0763() {
24586 	this.runConformTest(
24587 		new String[] {
24588 			"X.java",
24589 			"public class X<E> {\n" +
24590 			"	public static class InnerClass {\n" +
24591 			"		public InnerClass() {\n" +
24592 			"			System.out.println(\"class : \" + InnerClass.this);\n" +
24593 			"		}\n" +
24594 			"	}\n" +
24595 			"}\n",
24596 		},
24597 		"");
24598 }
24599 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=100527
24600 public void test0764() {
24601 	this.runNegativeTest(
24602 		new String[] {
24603 			"X.java",
24604 			"import java.util.*;\n" +
24605 			" \n" +
24606 			"interface IIfClosure {}\n" +
24607 			" \n" +
24608 			"public class X {\n" +
24609 			"    public X(String label, HashMap<String,Object> bindings) {\n" +
24610 			"        this(label, bindings, (List<IIfClosure>)Collections.emptyList());\n" +
24611 			"    }\n" +
24612 			"    \n" +
24613 			"    public X(String label, HashMap<String,Object> bindings, Collection<IIfClosure> coll) {\n" +
24614 			"    }\n" +
24615 			"}\n",
24616 		},
24617 		"----------\n" +
24618 		"1. ERROR in X.java (at line 7)\n" +
24619 		"	this(label, bindings, (List<IIfClosure>)Collections.emptyList());\n" +
24620 		"	                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
24621 		"Cannot cast from List<Object> to List<IIfClosure>\n" +
24622 		"----------\n");
24623 }
24624 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98379
24625 public void test0765() {
24626 	this.runConformTest(
24627 		// test directory preparation
24628 		new String[] { /* test files */
24629 			"X.java",
24630 			"public class X {\n" +
24631 			"    static <T extends X> T f1() throws Exception{\n" +
24632 			"    	return null;\n" +
24633 			"    }\n" +
24634 			"    static <U extends X> U f2() throws Exception {\n" +
24635 			"        return f1();\n" +
24636 			"    }\n" +
24637 			"}\n",
24638 		},
24639 		// javac options
24640 		JavacTestOptions.JavacHasABug.JavacBug6302954 /* javac test options */);
24641 }
24642 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=99453
24643 public void test0766() {
24644 	this.runNegativeTest(
24645 		new String[] {
24646 			"X.java",
24647 			"import java.util.*;\n" +
24648 			"\n" +
24649 			"interface Cloneable<T extends Cloneable<T>> {\n" +
24650 			"	public T clone();\n" +
24651 			"}\n" +
24652 			"\n" +
24653 			"interface CloneableMap<K, V extends Cloneable<V>> extends Map<K, V>, Cloneable<CloneableMap<K, V>> {\n" +
24654 			"}\n" +
24655 			"\n" +
24656 			"interface C<T extends C<T>> extends Cloneable<T> {\n" +
24657 			"}\n" +
24658 			"public class X {\n" +
24659 			"	void foo() {\n" +
24660 			"		CloneableMap<String, C<?>> map = null;\n" +
24661 			"	}\n" +
24662 			"}\n",
24663 		},
24664 		"----------\n" +
24665 		"1. ERROR in X.java (at line 14)\n" +
24666 		"	CloneableMap<String, C<?>> map = null;\n" +
24667 		"	                     ^\n" +
24668 		"Bound mismatch: The type C<?> is not a valid substitute for the bounded parameter <V extends Cloneable<V>> of the type CloneableMap<K,V>\n" +
24669 		"----------\n");
24670 }
24671 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=99453 - variation
24672 public void test0767() {
24673 	this.runConformTest(
24674 		new String[] {
24675 			"X.java",
24676 			"import java.util.*;\n" +
24677 			"\n" +
24678 			"interface Cloneable<T extends Cloneable<T>> {\n" +
24679 			"	public T clone();\n" +
24680 			"}\n" +
24681 			"\n" +
24682 			"interface CloneableMap<K, V extends Cloneable<V>> extends Map<K, V>, Cloneable<CloneableMap<K, V>> {\n" +
24683 			"}\n" +
24684 			"\n" +
24685 			"interface C extends Cloneable<C> {\n" +
24686 			"}\n" +
24687 			"public class X {\n" +
24688 			"	void foo() {\n" +
24689 			"		CloneableMap<String, C> map = null;\n" +
24690 			"	}\n" +
24691 			"}\n",
24692 		},
24693 		"");
24694 }
24695 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=100619
24696 public void test0768() {
24697 	this.runNegativeTest(
24698 		new String[] {
24699 			"X.java",
24700 			"public class X {\n" +
24701 			"	<T extends Runnable, U extends Runnable & T>  T foo1() { return null; }\n" +
24702 			"	<T extends Y<Object>, U extends Z & T>  T foo2() { return null; }\n" +
24703 			"	<T extends Y<Object>, U extends T & Z>  T foo3() { return null; }\n" +
24704 			"	<T extends Y<Object>, U extends W & Z>  T foo4() { return null; }\n" +
24705 			"}\n" +
24706 			"\n" +
24707 			"interface Y<T> {\n" +
24708 			"}\n" +
24709 			"\n" +
24710 			"interface Z extends Y<String> {}\n" +
24711 			"interface W extends Y<Object> {}\n",
24712 		},
24713 		"----------\n" +
24714 		"1. ERROR in X.java (at line 2)\n" +
24715 		"	<T extends Runnable, U extends Runnable & T>  T foo1() { return null; }\n" +
24716 		"	                                          ^\n" +
24717 		"The type T is not an interface; it cannot be specified as a bounded parameter\n" +
24718 		"----------\n" +
24719 		"2. ERROR in X.java (at line 3)\n" +
24720 		"	<T extends Y<Object>, U extends Z & T>  T foo2() { return null; }\n" +
24721 		"	                                    ^\n" +
24722 		"The type T is not an interface; it cannot be specified as a bounded parameter\n" +
24723 		"----------\n" +
24724 		"3. ERROR in X.java (at line 4)\n" +
24725 		"	<T extends Y<Object>, U extends T & Z>  T foo3() { return null; }\n" +
24726 		"	                                    ^\n" +
24727 		"Cannot specify any additional bound Z when first bound is a type parameter\n" +
24728 		"----------\n" +
24729 		"4. ERROR in X.java (at line 4)\n" +
24730 		"	<T extends Y<Object>, U extends T & Z>  T foo3() { return null; }\n" +
24731 		"	                                    ^\n" +
24732 		"The interface Y cannot be implemented more than once with different arguments: Y<String> and Y<Object>\n" +
24733 		"----------\n" +
24734 		"5. ERROR in X.java (at line 5)\n" +
24735 		"	<T extends Y<Object>, U extends W & Z>  T foo4() { return null; }\n" +
24736 		"	                                    ^\n" +
24737 		"The interface Y cannot be implemented more than once with different arguments: Y<String> and Y<Object>\n" +
24738 		"----------\n");
24739 }
24740 public void test0769() {
24741 	this.runConformTest(
24742 		new String[] {
24743 			"X.java",
24744 			"class XSuper<T> {\n" +
24745 			"	T value;\n" +
24746 			"}\n" +
24747 			"public class X extends XSuper<String>{\n" +
24748 			"	public void a() {\n" +
24749 			"		value += 1;\n" +
24750 			"		value = value + 1;\n" +
24751 			"		System.out.println(value);\n" +
24752 			"	}\n" +
24753 			"\n" +
24754 			"	public static void main(final String[] args) {\n" +
24755 			"		X x = new X();\n" +
24756 			"		x.value = \"[\";\n" +
24757 			"		x.a();\n" +
24758 			"	}\n" +
24759 			"}\n",
24760 		},
24761 		"[11");
24762 }
24763 public void test0770() {
24764 	this.runConformTest(
24765 		new String[] {
24766 			"X.java",
24767 			"class XSuper<T> {\n" +
24768 			"	T value;\n" +
24769 			"}\n" +
24770 			"public class X extends XSuper<String>{\n" +
24771 			"	public void a() {\n" +
24772 			"		this.value += 1;\n" +
24773 			"		this.value = this.value + 1;\n" +
24774 			"		System.out.println(this.value);\n" +
24775 			"	}\n" +
24776 			"\n" +
24777 			"	public static void main(final String[] args) {\n" +
24778 			"		X x = new X();\n" +
24779 			"		x.value = \"[\";\n" +
24780 			"		x.a();\n" +
24781 			"	}\n" +
24782 			"}\n",
24783 		},
24784 		"[11");
24785 }
24786 public void test0771() {
24787 	this.runConformTest(
24788 		new String[] {
24789 			"X.java",
24790 			"class XSuper<T> {\n" +
24791 			"	T value;\n" +
24792 			"}\n" +
24793 			"public class X extends XSuper<String>{\n" +
24794 			"	public static void a(X x) {\n" +
24795 			"		x.value += 1;\n" +
24796 			"		x.value = x.value + 1;\n" +
24797 			"		System.out.println(x.value);\n" +
24798 			"	}\n" +
24799 			"\n" +
24800 			"	public static void main(final String[] args) {\n" +
24801 			"		X x = new X();\n" +
24802 			"		x.value = \"[\";\n" +
24803 			"		a(x);\n" +
24804 			"	}\n" +
24805 			"}\n",
24806 		},
24807 		"[11");
24808 }
24809 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=101794
24810 public void test0772() throws Exception {
24811 	this.runConformTest(
24812 		new String[] {
24813 			"X.java",
24814 			"interface Foo<T> {\n" +
24815 			"  public T getIt();\n" +
24816 			"}\n" +
24817 			"\n" +
24818 			"class FooImpl implements Foo {\n" +
24819 			"  public String getIt() {\n" +
24820 			"    return null;\n" +
24821 			"  }\n" +
24822 			"}\n" +
24823 			"public class X {\n" +
24824 			"  public void doIt() {\n" +
24825 			"    Object s = new FooImpl().getIt();\n" +
24826 			"  }\n" +
24827 			"}\n",
24828 		},
24829 		"");
24830 	this.runConformTest(
24831 		new String[] {
24832 			"X.java",
24833 			"public class X {\n" +
24834 			"  public void doIt() {\n" +
24835 			"    Object s = new FooImpl().getIt();\n" +
24836 			"  }\n" +
24837 			"}\n",
24838 		},
24839 		"",
24840 		null,
24841 		false,
24842 		null);
24843 		String expectedOutput =
24844 			"  // Method descriptor #18 ()Ljava/lang/Object;\n" +
24845 			"  // Stack: 1, Locals: 1\n" +
24846 			"  public bridge synthetic java.lang.Object getIt();\n" +
24847 			"    0  aload_0 [this]\n" +
24848 			"    1  invokevirtual FooImpl.getIt() : java.lang.String [19]\n" +
24849 			"    4  areturn\n" +
24850 			"      Line numbers:\n" +
24851 			"        [pc: 0, line: 1]\n";
24852 
24853 		File f = new File(OUTPUT_DIR + File.separator + "FooImpl.class");
24854 		byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
24855 		ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
24856 		String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
24857 		int index = result.indexOf(expectedOutput);
24858 		if (index == -1 || expectedOutput.length() == 0) {
24859 			System.out.println(Util.displayString(result, 3));
24860 		}
24861 		if (index == -1) {
24862 			assertEquals("Wrong contents", expectedOutput, result);
24863 		}
24864 }
24865 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=101794 - variation
24866 public void test0773() throws Exception {
24867 	this.runConformTest(
24868 		new String[] {
24869 			"X.java",
24870 			"interface Foo<T extends Exception> {\n" +
24871 			"  public T getIt() throws T;\n" +
24872 			"}\n" +
24873 			"\n" +
24874 			"class FooImpl implements Foo {\n" +
24875 			"  public NullPointerException getIt() {\n" +
24876 			"    return null;\n" +
24877 			"  }\n" +
24878 			"}\n" +
24879 			"public class X {\n" +
24880 			"  public void doIt() {\n" +
24881 			"    Object s = new FooImpl().getIt();\n" +
24882 			"  }\n" +
24883 			"}\n",
24884 		},
24885 		"");
24886 	this.runConformTest(
24887 		new String[] {
24888 			"X.java",
24889 			"public class X {\n" +
24890 			"  public void doIt() {\n" +
24891 			"    Object s = new FooImpl().getIt();\n" +
24892 			"  }\n" +
24893 			"}\n",
24894 		},
24895 		"",
24896 		null,
24897 		false,
24898 		null);
24899 		String expectedOutput =
24900 			"  // Method descriptor #18 ()Ljava/lang/Exception;\n" +
24901 			"  // Stack: 1, Locals: 1\n" +
24902 			"  public bridge synthetic java.lang.Exception getIt() throws java.lang.Exception;\n" +
24903 			"    0  aload_0 [this]\n" +
24904 			"    1  invokevirtual FooImpl.getIt() : java.lang.NullPointerException [22]\n" +
24905 			"    4  areturn\n" +
24906 			"      Line numbers:\n" +
24907 			"        [pc: 0, line: 1]\n";
24908 
24909 		File f = new File(OUTPUT_DIR + File.separator + "FooImpl.class");
24910 		byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
24911 		ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
24912 		String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
24913 		int index = result.indexOf(expectedOutput);
24914 		if (index == -1 || expectedOutput.length() == 0) {
24915 			System.out.println(Util.displayString(result, 3));
24916 		}
24917 		if (index == -1) {
24918 			assertEquals("Wrong contents", expectedOutput, result);
24919 		}
24920 }
24921 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=98532
24922 public void test0774() {
24923 	this.runNegativeTest(
24924 		new String[] {
24925 			"X.java",
24926 			"public class X<T> {\n" +
24927 			"	static class StaticInnerNoParam {\n" +
24928 			"		T x;\n" +
24929 			"	}\n" +
24930 			"	class NonStaticInnerParam<T> {}	\n" +
24931 			"	static class StaticInnerParam<T> {	}\n" +
24932 			"	<T> void foo(T t) {}\n" +
24933 			"	static <T> void bar(T t) {}\n" +
24934 			"	<T> X(T t) {}\n" +
24935 			"	\n" +
24936 			"	class U {}\n" +
24937 			"	<U> void foo2(U t) {}\n" +
24938 			"	static <U> void bar2(U t) {}\n" +
24939 			"	class NonStaticInnerParam2<U> {}	\n" +
24940 			"	static class StaticInnerParam2<U> {}	\n" +
24941 			"}\n",
24942 		},
24943 		"----------\n" +
24944 		"1. ERROR in X.java (at line 3)\n" +
24945 		"	T x;\n" +
24946 		"	^\n" +
24947 		"Cannot make a static reference to the non-static type T\n" +
24948 		"----------\n" +
24949 		"2. WARNING in X.java (at line 5)\n" +
24950 		"	class NonStaticInnerParam<T> {}	\n" +
24951 		"	                          ^\n" +
24952 		"The type parameter T is hiding the type T\n" +
24953 		"----------\n" +
24954 		"3. WARNING in X.java (at line 7)\n" +
24955 		"	<T> void foo(T t) {}\n" +
24956 		"	 ^\n" +
24957 		"The type parameter T is hiding the type T\n" +
24958 		"----------\n" +
24959 		"4. WARNING in X.java (at line 9)\n" +
24960 		"	<T> X(T t) {}\n" +
24961 		"	 ^\n" +
24962 		"The type parameter T is hiding the type T\n" +
24963 		"----------\n" +
24964 		"5. WARNING in X.java (at line 12)\n" +
24965 		"	<U> void foo2(U t) {}\n" +
24966 		"	 ^\n" +
24967 		"The type parameter U is hiding the type X<T>.U\n" +
24968 		"----------\n" +
24969 		"6. WARNING in X.java (at line 13)\n" +
24970 		"	static <U> void bar2(U t) {}\n" +
24971 		"	        ^\n" +
24972 		"The type parameter U is hiding the type X<T>.U\n" +
24973 		"----------\n" +
24974 		"7. WARNING in X.java (at line 14)\n" +
24975 		"	class NonStaticInnerParam2<U> {}	\n" +
24976 		"	                           ^\n" +
24977 		"The type parameter U is hiding the type X<T>.U\n" +
24978 		"----------\n" +
24979 		"8. WARNING in X.java (at line 15)\n" +
24980 		"	static class StaticInnerParam2<U> {}	\n" +
24981 		"	                               ^\n" +
24982 		"The type parameter U is hiding the type X<T>.U\n" +
24983 		"----------\n");
24984 }
24985 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=100153
24986 public void test0775() {
24987 	this.runConformTest(
24988 		new String[] {
24989 			"X.java",
24990 			"public class X<T extends X<T>> {\n" +
24991 			"	void foo1(X<? extends T> x) {}\n" +
24992 			"	void foo2(X<? super T> x) {}\n" +
24993 			"}\n",
24994 		},
24995 		"");
24996 }
24997 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=103023
24998 public void test0776() {
24999 	runConformTest(
25000 		// test directory preparation
25001 		true /* flush output directory */,
25002 		new String[] { /* test files */
25003 			"X.java",
25004 			"import java.util.*;\n" +
25005 			"\n" +
25006 			"public class X<T extends Comparable<? super T>> {\n" +
25007 			"\n" +
25008 			"    abstract class Foo<E> implements I<Foo<? extends E>> {}\n" +
25009 			"\n" +
25010 			"    abstract class Bar<E> implements I<Bar<? extends E>> {}\n" +
25011 			"\n" +
25012 			"    public void bar(List<Foo<T>> f, List<Bar<T>> b) {\n" +
25013 			"	foo(f, b);\n" +
25014 			"    }\n" +
25015 			"\n" +
25016 			"    <C> void foo(List<? extends C> f, List<? extends C> b) {\n" +
25017 			"	System.out.println(\"SUCCESS\");\n" +
25018 			"    }\n" +
25019 			"    public static void main(String... args) {\n" +
25020 			"	new X().bar(null, null);\n" +
25021 			"    }\n" +
25022 			"}\n" +
25023 			"interface I<U> {}\n",
25024 		},
25025 		// compiler results
25026 		null /* do not check compiler log */,
25027 		// runtime results
25028 		"SUCCESS" /* expected output string */,
25029 		null /* do not check error string */,
25030 		// javac options
25031 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
25032 }
25033 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=103472
25034 public void test0777() {
25035 	this.runNegativeTest(
25036 		new String[] {
25037 			"X.java",
25038 			"public class X {\n" +
25039 			"	public interface B<T> {\n" +
25040 			"		public T a();\n" +
25041 			"	}\n" +
25042 			"\n" +
25043 			"	public interface C extends B {\n" +
25044 			"	}\n" +
25045 			"\n" +
25046 			"	public class D implements B<Integer> {\n" +
25047 			"		public Integer a() {\n" +
25048 			"			return 0;\n" +
25049 			"		}\n" +
25050 			"	}\n" +
25051 			"\n" +
25052 			"	// Illegal\n" +
25053 			"	public class E implements B<Integer>, C {\n" +
25054 			"		public Integer a() {\n" +
25055 			"			return 0;\n" +
25056 			"		}\n" +
25057 			"	}\n" +
25058 			"\n" +
25059 			"	// why is this allowed?\n" +
25060 			"	public class F extends D implements C {\n" +
25061 			"		public Integer a() {\n" +
25062 			"			return 0;\n" +
25063 			"		}\n" +
25064 			"	}\n" +
25065 			"\n" +
25066 			"	public interface G<T> {\n" +
25067 			"		public void a(T pArg);\n" +
25068 			"	}\n" +
25069 			"\n" +
25070 			"	public interface H extends G {\n" +
25071 			"		public Object b();\n" +
25072 			"	}\n" +
25073 			"\n" +
25074 			"	public class I implements G<Integer> {\n" +
25075 			"		public void a(Integer pInt) {\n" +
25076 			"		}\n" +
25077 			"	}\n" +
25078 			"\n" +
25079 			"	// Illegal. Huh?\n" +
25080 			"	public class J extends I implements G {\n" +
25081 			"		public Integer a() {\n" +
25082 			"			return 0;\n" +
25083 			"		}\n" +
25084 			"	}\n" +
25085 			"}\n",
25086 		},
25087 		"----------\n" +
25088 		"1. WARNING in X.java (at line 6)\n" +
25089 		"	public interface C extends B {\n" +
25090 		"	                           ^\n" +
25091 		"X.B is a raw type. References to generic type X.B<T> should be parameterized\n" +
25092 		"----------\n" +
25093 		"2. ERROR in X.java (at line 16)\n" +
25094 		"	public class E implements B<Integer>, C {\n" +
25095 		"	             ^\n" +
25096 		"The interface B cannot be implemented more than once with different arguments: X.B and X.B<Integer>\n" +
25097 		"----------\n" +
25098 		"3. ERROR in X.java (at line 23)\n" +
25099 		"	public class F extends D implements C {\n" +
25100 		"	             ^\n" +
25101 		"The interface B cannot be implemented more than once with different arguments: X.B<Integer> and X.B\n" +
25102 		"----------\n" +
25103 		"4. WARNING in X.java (at line 24)\n" +
25104 		"	public Integer a() {\n" +
25105 		"	               ^^^\n" +
25106 		"The method a() of type X.F should be tagged with @Override since it actually overrides a superclass method\n" +
25107 		"----------\n" +
25108 		"5. WARNING in X.java (at line 33)\n" +
25109 		"	public interface H extends G {\n" +
25110 		"	                           ^\n" +
25111 		"X.G is a raw type. References to generic type X.G<T> should be parameterized\n" +
25112 		"----------\n" +
25113 		"6. ERROR in X.java (at line 43)\n" +
25114 		"	public class J extends I implements G {\n" +
25115 		"	             ^\n" +
25116 		"The interface G cannot be implemented more than once with different arguments: X.G<Integer> and X.G\n" +
25117 		"----------\n" +
25118 		"7. WARNING in X.java (at line 43)\n" +
25119 		"	public class J extends I implements G {\n" +
25120 		"	                                    ^\n" +
25121 		"X.G is a raw type. References to generic type X.G<T> should be parameterized\n" +
25122 		"----------\n");
25123 }
25124 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=103472 - variation
25125 public void test0778() {
25126 	this.runNegativeTest(
25127 		new String[] {
25128 			"X.java",
25129 			"public class X {\n" +
25130 			"	interface B<T> {}\n" +
25131 			"\n" +
25132 			"	interface C extends B {}\n" +
25133 			"\n" +
25134 			"	class D implements B<Integer> {}\n" +
25135 			"\n" +
25136 			"	class F extends D implements C {}\n" +
25137 			"	\n" +
25138 			"	class V<U extends D & C> {}\n" +
25139 			"}\n",
25140 		},
25141 		"----------\n" +
25142 		"1. WARNING in X.java (at line 4)\n" +
25143 		"	interface C extends B {}\n" +
25144 		"	                    ^\n" +
25145 		"X.B is a raw type. References to generic type X.B<T> should be parameterized\n" +
25146 		"----------\n" +
25147 		"2. ERROR in X.java (at line 8)\n" +
25148 		"	class F extends D implements C {}\n" +
25149 		"	      ^\n" +
25150 		"The interface B cannot be implemented more than once with different arguments: X.B<Integer> and X.B\n" +
25151 		"----------\n" +
25152 		"3. ERROR in X.java (at line 10)\n" +
25153 		"	class V<U extends D & C> {}\n" +
25154 		"	                      ^\n" +
25155 		"The interface B cannot be implemented more than once with different arguments: X.B and X.B<Integer>\n" +
25156 		"----------\n");
25157 }
25158 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=103227
25159 public void test0779() throws Exception {
25160 	this.runConformTest(
25161 		new String[] {
25162 			"X.java",
25163 			"import java.util.AbstractList;\n" +
25164 			"import java.util.List;\n" +
25165 			"\n" +
25166 			"public class X {\n" +
25167 			"	private static class Entry {\n" +
25168 			"		public void doIt(final List<? extends String> args) {\n" +
25169 			"			List<String> list = new AbstractList<String>() {\n" +
25170 			"				@Override public int size() { return 0; }\n" +
25171 			"				@Override public String get(int i) { return args.get(i); }\n" +
25172 			"			};\n" +
25173 			"		}\n" +
25174 			"	}\n" +
25175 			"	public static void main(String[] args) {\n" +
25176 			"		new Entry().doIt(null);\n" +
25177 			"		System.out.println(\"SUCCESS\");\n" +
25178 			"	}\n" +
25179 			"}\n",
25180 		},
25181 		"SUCCESS");
25182 
25183 	String expectedOutput =
25184 		"  // Method descriptor #31 (I)Ljava/lang/Object;\n" +
25185 		"  // Stack: 2, Locals: 2\n" +
25186 		"  public bridge synthetic java.lang.Object get(int arg0);\n" +
25187 		"    0  aload_0 [this]\n" +
25188 		"    1  iload_1 [arg0]\n" +
25189 		"    2  invokevirtual X$Entry$1.get(int) : java.lang.String [36]\n" +
25190 		"    5  areturn\n" +
25191 		"      Line numbers:\n" +
25192 		"        [pc: 0, line: 1]\n";
25193 
25194 	// check no unnecessary checkcast on bridge method for X$1
25195 	File f = new File(OUTPUT_DIR + File.separator + "X$Entry$1.class");
25196 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
25197 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
25198 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
25199 	int index = result.indexOf(expectedOutput);
25200 	if (index == -1 || expectedOutput.length() == 0) {
25201 		System.out.println(Util.displayString(result, 3));
25202 	}
25203 	if (index == -1) {
25204 		assertEquals("Wrong contents", expectedOutput, result);
25205 	}
25206 }
25207 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=103227 - variation
25208 public void test0780() {
25209 	this.runConformTest(
25210 		new String[] {
25211 			"X.java",
25212 			"import java.util.*;\n" +
25213 			"\n" +
25214 			"public class X {\n" +
25215 			"	long foo(List<? extends Long> list) {\n" +
25216 			"		return list.get(0);\n" +
25217 			"	}\n" +
25218 			"	public static void main(String[] args) {\n" +
25219 			"		List<Long> list = new ArrayList<Long>();\n" +
25220 			"		list.add(123L);\n" +
25221 			"		System.out.println(new X().foo(list));\n" +
25222 			"	}\n" +
25223 			"}\n",
25224 		},
25225 		"123");
25226 }
25227 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=104109
25228 public void test0781() {
25229 	this.runNegativeTest(
25230 		new String[] {
25231 			"X.java",
25232 			"public class X {\n" +
25233 			"\n" +
25234 			"    public static <E, T extends E & Comparable<? super T>> Foo<E> doIt(T t) {\n" +
25235 			"        return null;\n" +
25236 			"    }\n" +
25237 			"    \n" +
25238 			"    interface Foo<E> {\n" +
25239 			"        boolean ok(E e);\n" +
25240 			"    }\n" +
25241 			"}\n",
25242 		},
25243 		"----------\n" +
25244 		"1. ERROR in X.java (at line 3)\n" +
25245 		"	public static <E, T extends E & Comparable<? super T>> Foo<E> doIt(T t) {\n" +
25246 		"	                                ^^^^^^^^^^\n" +
25247 		"Cannot specify any additional bound Comparable<? super T> when first bound is a type parameter\n" +
25248 		"----------\n");
25249 }
25250 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=104082
25251 public void test0782() {
25252 	this.runConformTest(
25253 		new String[] {
25254 			"X.java",
25255 			"import java.lang.reflect.*;\n" +
25256 			"import java.util.*;\n" +
25257 			"\n" +
25258 			"interface StoredObject {\n" +
25259 			"	String getUid();\n" +
25260 			"	String getName();\n" +
25261 			"	String getDescription();\n" +
25262 			"}\n" +
25263 			"\n" +
25264 			"interface GraphDiagramNode // extends Comparable\n" +
25265 			"{\n" +
25266 			"}\n" +
25267 			"\n" +
25268 			"public class X<ObjectType extends StoredObject, ParentType extends StoredObject> implements GraphDiagramNode {\n" +
25269 			"	private final JccsGraphDiagramModel model;\n" +
25270 			"	private final X<? extends ParentType, ?> parent;\n" +
25271 			"	private final ObjectType object;\n" +
25272 			"\n" +
25273 			"	public class JccsGraphDiagramModel {\n" +
25274 			"	}\n" +
25275 			"\n" +
25276 			"	public interface GraphDiagramModel {\n" +
25277 			"	}\n" +
25278 			"\n" +
25279 			"	public class Dependency {\n" +
25280 			"\n" +
25281 			"	}\n" +
25282 			"\n" +
25283 			"	public X(JccsGraphDiagramModel argModel, X<? extends ParentType, ?> argParent, ObjectType argObject) {\n" +
25284 			"		model = argModel;\n" +
25285 			"		parent = argParent;\n" +
25286 			"		object = argObject;\n" +
25287 			"	}\n" +
25288 			"\n" +
25289 			"	protected <ChildType extends StoredObject> Collection<? extends X<ChildType, ? super ObjectType>> createChildren(\n" +
25290 			"			Iterator<ChildType> argData, Class<? extends X<ChildType, ? super ObjectType>> argChildNodeClass,\n" +
25291 			"			Class<? extends StoredObject> argInterface) {\n" +
25292 			"		Collection<X<ChildType, ? super ObjectType>> output = new LinkedList<X<ChildType, ? super ObjectType>>();\n" +
25293 			"\n" +
25294 			"		try {\n" +
25295 			"			while (argData.hasNext()) {\n" +
25296 			"				ChildType next = argData.next();\n" +
25297 			"				Constructor<? extends X<ChildType, ? super ObjectType>> constructor = argChildNodeClass.getConstructor(\n" +
25298 			"						JccsGraphDiagramModel.class, getClass(), argInterface);\n" +
25299 			"\n" +
25300 			"				output.add(constructor.newInstance(model, this, next));\n" +
25301 			"			}\n" +
25302 			"		} catch (Exception x) {\n" +
25303 			"			x.printStackTrace();\n" +
25304 			"		}\n" +
25305 			"\n" +
25306 			"		return output;\n" +
25307 			"	}\n" +
25308 			"}\n",
25309 		},
25310 		"");
25311 }
25312 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=104167
25313 public void test0783() {
25314 	this.runNegativeTest(
25315 		new String[] {
25316 			"X.java",
25317 			"public class X<T> {\n" +
25318 			"  private static class B{\n" +
25319 			"    private int foo; //incorrectly identified as unused\n" +
25320 			"  }\n" +
25321 			"  void bar(B b){\n" +
25322 			"    if (b.foo == 0)\n" +
25323 			"      return;\n" +
25324 			"  }\n" +
25325 			"  Zork z;\n" +
25326 			"}\n",
25327 		},
25328 		"----------\n" +
25329 		"1. ERROR in X.java (at line 9)\n" +
25330 		"	Zork z;\n" +
25331 		"	^^^^\n" +
25332 		"Zork cannot be resolved to a type\n" +
25333 		"----------\n");
25334 }
25335 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=104082 - variation
25336 public void test0784() {
25337 	this.runNegativeTest(
25338 		new String[] {
25339 			"X.java",
25340 			"public class X<T, U> {\n" +
25341 			"	X<? extends U, ?> parent;\n" +
25342 			"\n" +
25343 			"	public X(X<? extends U, ?> parent) {\n" +
25344 			"		this.parent = parent;\n" +
25345 			"	}\n" +
25346 			"}\n",
25347 		},
25348 		"");
25349 }
25350 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=103528
25351 public void test0785() {
25352 	this.runNegativeTest(
25353 		new String[] {
25354 			"X.java",
25355 			"import java.util.*;\n" +
25356 			"public class X {\n" +
25357 			"    <T extends Collection<? extends Number>> T getLonger(T t1, T t2) {\n" +
25358 			"        return t1.size() > t2.size() ? t1 : t2;\n" +
25359 			"    }\n" +
25360 			"    \n" +
25361 			"    void m(HashSet<?> list, ArrayList<?> set) {\n" +
25362 			"        getLonger(list, set);\n" +
25363 			"    }\n" +
25364 			"}\n",
25365 		},
25366 		this.complianceLevel < ClassFileConstants.JDK1_8 ?
25367 		"----------\n" +
25368 		"1. ERROR in X.java (at line 8)\n" +
25369 		"	getLonger(list, set);\n" +
25370 		"	^^^^^^^^^\n" +
25371 		"Bound mismatch: The generic method getLonger(T, T) of type X is not applicable for the arguments (HashSet<capture#3-of ?>, ArrayList<capture#4-of ?>). The inferred type AbstractCollection<? extends Object>&Cloneable&Serializable is not a valid substitute for the bounded parameter <T extends Collection<? extends Number>>\n" +
25372 		"----------\n" :
25373 			"----------\n" +
25374 			"1. ERROR in X.java (at line 8)\n" +
25375 			"	getLonger(list, set);\n" +
25376 			"	^^^^^^^^^\n" +
25377 			"The method getLonger(T, T) in the type X is not applicable for the arguments (HashSet<capture#3-of ?>, ArrayList<capture#4-of ?>)\n" +
25378 			"----------\n");
25379 }
25380 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=103528 - variation
25381 public void test0786() {
25382 	this.runConformTest(
25383 		new String[] {
25384 			"X.java",
25385 			"import java.util.*;\n" +
25386 			"public class X {\n" +
25387 			"    <T extends Collection<? extends Object>> T getLonger(T t1, T t2) {\n" +
25388 			"        return t1.size() > t2.size() ? t1 : t2;\n" +
25389 			"    }\n" +
25390 			"    \n" +
25391 			"    void m(HashSet<?> list, ArrayList<?> set) {\n" +
25392 			"        getLonger(list, set);\n" +
25393 			"    }\n" +
25394 			"}\n",
25395 		},
25396 		"");
25397 }
25398 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=103528 - variation
25399 public void test0787() {
25400 	this.runNegativeTest(
25401 		new String[] {
25402 			"X.java",
25403 			"import java.util.*;\n" +
25404 			"public class X<U> {\n" +
25405 			"    <T extends Collection<? extends U>> T getLonger(T t1, T t2) {\n" +
25406 			"        return t1.size() > t2.size() ? t1 : t2;\n" +
25407 			"    }\n" +
25408 			"    \n" +
25409 			"    void m(HashSet<?> list, ArrayList<?> set) {\n" +
25410 			"        getLonger(list, set);\n" +
25411 			"    }\n" +
25412 			"}\n",
25413 		},
25414 		this.complianceLevel < ClassFileConstants.JDK1_8 ?
25415 		"----------\n" +
25416 		"1. ERROR in X.java (at line 8)\n" +
25417 		"	getLonger(list, set);\n" +
25418 		"	^^^^^^^^^\n" +
25419 		"Bound mismatch: The generic method getLonger(T, T) of type X<U> is not applicable for the arguments (HashSet<capture#3-of ?>, ArrayList<capture#4-of ?>). The inferred type AbstractCollection<? extends Object>&Cloneable&Serializable is not a valid substitute for the bounded parameter <T extends Collection<? extends U>>\n" +
25420 		"----------\n" :
25421 			"----------\n" +
25422 			"1. ERROR in X.java (at line 8)\n" +
25423 			"	getLonger(list, set);\n" +
25424 			"	^^^^^^^^^\n" +
25425 			"The method getLonger(T, T) in the type X<U> is not applicable for the arguments (HashSet<capture#3-of ?>, ArrayList<capture#4-of ?>)\n" +
25426 			"----------\n");
25427 }
25428 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=103994
25429 public void test0788() {
25430 	this.runConformTest(
25431 		new String[] {
25432 			"test/A.java",
25433 			"package test;\n" +
25434 			"\n" +
25435 			"public class A<C extends java.nio.channels.Channel>\n" +
25436 			"{\n" +
25437 			"	class B\n" +
25438 			"		extends A<java.nio.channels.SocketChannel>\n" +
25439 			"	{\n" +
25440 			"	}\n" +
25441 			"}\n",
25442 			"java/nio/channels/spi/AbstractSelectableChannel.java",
25443 			"package java.nio.channels.spi;\n" +
25444 			"\n" +
25445 			"public abstract class AbstractSelectableChannel\n" +
25446 			"	extends java.nio.channels.SelectableChannel\n" +
25447 			"{\n" +
25448 			"}\n",
25449 		},
25450 		"");
25451 }
25452 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=103994 - variation (change ordering of files should have no effect)
25453 public void test0789() {
25454 	this.runConformTest(
25455 		new String[] {
25456 			"java/nio/channels/spi/AbstractSelectableChannel.java",
25457 			"package java.nio.channels.spi;\n" +
25458 			"\n" +
25459 			"public abstract class AbstractSelectableChannel\n" +
25460 			"	extends java.nio.channels.SelectableChannel\n" +
25461 			"{\n" +
25462 			"}\n",
25463 			"test/A.java",
25464 			"package test;\n" +
25465 			"\n" +
25466 			"public class A<C extends java.nio.channels.Channel>\n" +
25467 			"{\n" +
25468 			"	class B\n" +
25469 			"		extends A<java.nio.channels.SocketChannel>\n" +
25470 			"	{\n" +
25471 			"	}\n" +
25472 			"}\n",
25473 		},
25474 		"");
25475 }
25476 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=103485
25477 public void test0790() {
25478 	this.runNegativeTest(
25479 		new String[] {
25480 			"X.java",
25481 			"public class X {\n" +
25482 			"	<T extends Comparable<T>> boolean isGreater(T t1, T t2) {\n" +
25483 			"		return t1.compareTo(t2) > 0 ? true : false; \n" +
25484 			"	}\n" +
25485 			"\n" +
25486 			"	void method1(Integer i, Double d) {\n" +
25487 			"		if (isGreater(i, d)) \n" +
25488 			"			System.out.println(\"GREATER\");\n" +
25489 			"		else\n" +
25490 			"			System.out.println(\"LOWER\");\n" +
25491 			"	}\n" +
25492 			"	void method2(Integer i, Double d) {\n" +
25493 			"		Comparable<? extends Number> c1= i;\n" +
25494 			"		Comparable<? extends Number> c2= d;\n" +
25495 			"		isGreater(c1, c2);\n" +
25496 			"	}	\n" +
25497 			"	void method3(Integer i, Double d) {\n" +
25498 			"		Comparable c1= i;\n" +
25499 			"		Comparable c2= d;\n" +
25500 			"		isGreater(c1, c2);\n" +
25501 			"	}	\n" +
25502 			"	public static void main(String[] args) {\n" +
25503 			"		Integer i = 1;\n" +
25504 			"		Double d = 2.0;\n" +
25505 			"		new X().method1(i, d);\n" +
25506 			"		new X().method2(i, d);\n" +
25507 			"		new X().method3(i, d);\n" +
25508 			"	}\n" +
25509 			"}\n",
25510 		},
25511 		this.complianceLevel < ClassFileConstants.JDK1_8 ?
25512 		"----------\n" +
25513 		"1. ERROR in X.java (at line 7)\n" +
25514 		"	if (isGreater(i, d)) \n" +
25515 		"	    ^^^^^^^^^\n" +
25516 		"Bound mismatch: The generic method isGreater(T, T) of type X is not applicable for the arguments (Integer, Double). The inferred type "+ intersection("Number", "Comparable<?>") +" is not a valid substitute for the bounded parameter <T extends Comparable<T>>\n" +
25517 		"----------\n" +
25518 		"2. ERROR in X.java (at line 15)\n" +
25519 		"	isGreater(c1, c2);\n" +
25520 		"	^^^^^^^^^\n" +
25521 		"Bound mismatch: The generic method isGreater(T, T) of type X is not applicable for the arguments (Comparable<capture#1-of ? extends Number>, Comparable<capture#2-of ? extends Number>). The inferred type Comparable<? extends Number> is not a valid substitute for the bounded parameter <T extends Comparable<T>>\n" +
25522 		"----------\n" +
25523 		"3. WARNING in X.java (at line 18)\n" +
25524 		"	Comparable c1= i;\n" +
25525 		"	^^^^^^^^^^\n" +
25526 		"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
25527 		"----------\n" +
25528 		"4. WARNING in X.java (at line 19)\n" +
25529 		"	Comparable c2= d;\n" +
25530 		"	^^^^^^^^^^\n" +
25531 		"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
25532 		"----------\n" +
25533 		"5. WARNING in X.java (at line 20)\n" +
25534 		"	isGreater(c1, c2);\n" +
25535 		"	^^^^^^^^^^^^^^^^^\n" +
25536 		"Type safety: Unchecked invocation isGreater(Comparable, Comparable) of the generic method isGreater(T, T) of type X\n" +
25537 		"----------\n" :
25538 			"----------\n" +
25539 			"1. ERROR in X.java (at line 7)\n" +
25540 			"	if (isGreater(i, d)) \n" +
25541 			"	    ^^^^^^^^^\n" +
25542 			"The method isGreater(T, T) in the type X is not applicable for the arguments (Integer, Double)\n" +
25543 			"----------\n" +
25544 			"2. ERROR in X.java (at line 15)\n" +
25545 			"	isGreater(c1, c2);\n" +
25546 			"	^^^^^^^^^\n" +
25547 			"The method isGreater(T, T) in the type X is not applicable for the arguments (Comparable<capture#1-of ? extends Number>, Comparable<capture#2-of ? extends Number>)\n" +
25548 			"----------\n" +
25549 			"3. WARNING in X.java (at line 18)\n" +
25550 			"	Comparable c1= i;\n" +
25551 			"	^^^^^^^^^^\n" +
25552 			"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
25553 			"----------\n" +
25554 			"4. WARNING in X.java (at line 19)\n" +
25555 			"	Comparable c2= d;\n" +
25556 			"	^^^^^^^^^^\n" +
25557 			"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
25558 			"----------\n" +
25559 			"5. WARNING in X.java (at line 20)\n" +
25560 			"	isGreater(c1, c2);\n" +
25561 			"	^^^^^^^^^^^^^^^^^\n" +
25562 			"Type safety: Unchecked invocation isGreater(Comparable, Comparable) of the generic method isGreater(T, T) of type X\n" +
25563 			"----------\n");
25564 }
25565 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=104655
25566 public void test0791() {
25567 	runConformTest(
25568 		// test directory preparation
25569 		true /* flush output directory */,
25570 		new String[] { /* test files */
25571 			"X.java",
25572 			"public class X {\n" +
25573 			"  <Sup, E1 extends Sup, E2 extends Sup> Sup method1(boolean b, E1 e1, E2 e2) {\n" +
25574 			"    if (b)\n" +
25575 			"      return e1;\n" +
25576 			"    else\n" +
25577 			"      return e2;\n" +
25578 			"  }\n" +
25579 			"\n" +
25580 			"  <Sup, E1 extends Sup, E2 extends Sup> Sup method2(boolean b, E1 e1, E2 e2) {\n" +
25581 			"    return b ? e1 : e2;\n" +
25582 			"  }\n" +
25583 			"}\n",
25584 		},
25585 		// compiler results
25586 		null /* do not check compiler log */,
25587 		// runtime results
25588 		"" /* expected output string */,
25589 		null /* do not check error string */,
25590 		// javac options
25591 		JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
25592 }
25593 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=104649
25594 public void test0792() {
25595 	runConformTest(
25596 		// test directory preparation
25597 		new String[] { /* test files */
25598 			"X.java",
25599 			"public class X<E> {\n" +
25600 			"	void shouldcompile() {\n" +
25601 			"		java.util.Collections.max(null);\n" +
25602 			"	}\n" +
25603 			"}\n",
25604 		},
25605 		// javac options
25606 		JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
25607 }
25608 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=105635
25609 public void test0793() {
25610 	this.runNegativeTest(
25611 		new String[] {
25612 			"X.java",
25613 			"class X { \n" +
25614 			"	public java.util.List<Integer> i,j[],k;\n" +
25615 			"	void m() {\n" +
25616 			"		  i[0] = null;\n" +
25617 			"		  j[0] = null;\n" +
25618 			"		  k[0] = null;\n" +
25619 			"	}\n" +
25620 			"}",
25621 		},
25622 		"----------\n" +
25623 		"1. ERROR in X.java (at line 4)\n" +
25624 		"	i[0] = null;\n" +
25625 		"	^^^^\n" +
25626 		"The type of the expression must be an array type but it resolved to List<Integer>\n" +
25627 		"----------\n" +
25628 		"2. ERROR in X.java (at line 6)\n" +
25629 		"	k[0] = null;\n" +
25630 		"	^^^^\n" +
25631 		"The type of the expression must be an array type but it resolved to List<Integer>\n" +
25632 		"----------\n");
25633 }
25634 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=105635
25635 public void test0794() {
25636 	this.runNegativeTest(
25637 		new String[] {
25638 			"X.java",
25639 			"import java.util.List;\n" +
25640 			"class X { \n" +
25641 			"	public List<Integer> i,j[],k;\n" +
25642 			"	void m() {\n" +
25643 			"		  i[0] = null;\n" +
25644 			"		  j[0] = null;\n" +
25645 			"		  k[0] = null;\n" +
25646 			"	}\n" +
25647 			"}",
25648 		},
25649 		"----------\n" +
25650 		"1. ERROR in X.java (at line 5)\n" +
25651 		"	i[0] = null;\n" +
25652 		"	^^^^\n" +
25653 		"The type of the expression must be an array type but it resolved to List<Integer>\n" +
25654 		"----------\n" +
25655 		"2. ERROR in X.java (at line 7)\n" +
25656 		"	k[0] = null;\n" +
25657 		"	^^^^\n" +
25658 		"The type of the expression must be an array type but it resolved to List<Integer>\n" +
25659 		"----------\n");
25660 }
25661 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=106297
25662 public void test0795() {
25663 	this.runConformTest(
25664 		new String[] {
25665 			"X.java",
25666 			"public class X<T> { \n" +
25667 			"		 class B {\n" +
25668 			"			 B() {\n" +
25669 			"				 System.out.println(\"SUCCESS\");\n" +
25670 			"			 }\n" +
25671 			"		 }\n" +
25672 			"		 static { \n" +
25673 			"		 		 new X<String>().new B() {};\n" +
25674 			"		 }\n" +
25675 			"		 public static void main(String[] args) {\n" +
25676 			"			\n" +
25677 			"		}\n" +
25678 			"}\n",
25679 		},
25680 		"SUCCESS");
25681 }
25682 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=106297 - variation
25683 public void test0796() {
25684 	this.runNegativeTest(
25685 		new String[] {
25686 			"X.java",
25687 			"public class X<T> { \n" +
25688 			"		 class B {\n" +
25689 			"			 B(T t) {\n" +
25690 			"				 System.out.println(\"SUCCESS\");\n" +
25691 			"			 }\n" +
25692 			"		 }\n" +
25693 			"		 static { \n" +
25694 			"		 		 new X<String>().new B(12) {};\n" +
25695 			"		 }\n" +
25696 			"		 public static void main(String[] args) {\n" +
25697 			"			\n" +
25698 			"		}\n" +
25699 			"}\n",
25700 		},
25701 		"----------\n" +
25702 		"1. ERROR in X.java (at line 8)\n" +
25703 		"	new X<String>().new B(12) {};\n" +
25704 		"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
25705 		"The constructor X<String>.B(int) is undefined\n" +
25706 		"----------\n");
25707 }
25708 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=106297 - variation
25709 public void test0797() {
25710 	this.runConformTest(
25711 		new String[] {
25712 			"X.java",
25713 			"public class X<T> { \n" +
25714 			"		 class B {\n" +
25715 			"			 B() {\n" +
25716 			"				 System.out.println(\"SUCCESS\");\n" +
25717 			"			 }\n" +
25718 			"		 }\n" +
25719 			"		 static { \n" +
25720 			"		 		 new X<String>().new B();\n" +
25721 			"		 }\n" +
25722 			"		 public static void main(String[] args) {\n" +
25723 			"			\n" +
25724 			"		}\n" +
25725 			"}\n",
25726 		},
25727 		"SUCCESS");
25728 }
25729 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=106284
25730 public void test0798() {
25731 	this.runNegativeTest(
25732 		new String[] {
25733 			"X.java",
25734 			"import java.math.BigDecimal;\n" +
25735 			"\n" +
25736 			"public class X\n" +
25737 			"{\n" +
25738 			"    private static <T extends Comparable<? super T>> T max(T... elems)\n" +
25739 			"    {\n" +
25740 			"        T max=null;\n" +
25741 			"        for (T elem : elems)\n" +
25742 			"            if (max == null || max.compareTo(elem) < 0)\n" +
25743 			"                max=elem;\n" +
25744 			"        return max;\n" +
25745 			"    }\n" +
25746 			"\n" +
25747 			"    public static void main(String[] args)\n" +
25748 			"    {\n" +
25749 			"        System.out.println(max(1, 2.0, new BigDecimal(Math.PI)));\n" +
25750 			"    }\n" +
25751 			"}\n",
25752 		},
25753 		this.complianceLevel < ClassFileConstants.JDK1_7 ?
25754 		"----------\n" +
25755 		"1. ERROR in X.java (at line 16)\n" +
25756 		"	System.out.println(max(1, 2.0, new BigDecimal(Math.PI)));\n" +
25757 		"	                   ^^^\n" +
25758 		"Bound mismatch: The generic method max(T...) of type X is not applicable for the arguments (Integer, Double, BigDecimal). The inferred type Number&Comparable<?> is not a valid substitute for the bounded parameter <T extends Comparable<? super T>>\n" +
25759 		"----------\n" :
25760 			this.complianceLevel < ClassFileConstants.JDK1_8 ?
25761 			"----------\n" +
25762 			"1. WARNING in X.java (at line 5)\n" +
25763 			"	private static <T extends Comparable<? super T>> T max(T... elems)\n" +
25764 			"	                                                            ^^^^^\n" +
25765 			"Type safety: Potential heap pollution via varargs parameter elems\n" +
25766 			"----------\n" +
25767 			"2. ERROR in X.java (at line 16)\n" +
25768 			"	System.out.println(max(1, 2.0, new BigDecimal(Math.PI)));\n" +
25769 			"	                   ^^^\n" +
25770 			"Bound mismatch: The generic method max(T...) of type X is not applicable for the arguments (Integer, Double, BigDecimal). The inferred type Number&Comparable<?> is not a valid substitute for the bounded parameter <T extends Comparable<? super T>>\n" +
25771 			"----------\n" :
25772 				"----------\n" +
25773 				"1. WARNING in X.java (at line 5)\n" +
25774 				"	private static <T extends Comparable<? super T>> T max(T... elems)\n" +
25775 				"	                                                            ^^^^^\n" +
25776 				"Type safety: Potential heap pollution via varargs parameter elems\n" +
25777 				"----------\n" +
25778 				"2. ERROR in X.java (at line 16)\n" +
25779 				"	System.out.println(max(1, 2.0, new BigDecimal(Math.PI)));\n" +
25780 				"	                   ^^^\n" +
25781 				"The method max(T...) in the type X is not applicable for the arguments (int, double, BigDecimal)\n" +
25782 				"----------\n");
25783 }
25784 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=105531
25785 public void test0799() {
25786 	this.runNegativeTest(
25787 		new String[] {
25788 			"X.java",
25789 			"public class X<T> {\n" +
25790 			"	Y first;\n" +
25791 			"	Y first2;\n" +
25792 			"\n" +
25793 			"	<U> U foo(U u1, U u2) {\n" +
25794 			"		return u1;\n" +
25795 			"	}\n" +
25796 			"	void bar2(Y<? extends T> ref) {\n" +
25797 			"		String s = foo(ref, first);\n" +
25798 			"	}\n" +
25799 			"	\n" +
25800 			"	void foo(Y<? extends T> ref) {\n" +
25801 			"		ref.next = first == null ? ref : first;\n" +
25802 			"		String s = first == null ? ref : first;\n" +
25803 			"		ref.next = first2 == null ? ref : first2;\n" +
25804 			"	}\n" +
25805 			"	Y<? extends T> bar(Y<? extends T> ref) {\n" +
25806 			"		return first == null ? ref : first;\n" +
25807 			"	}\n" +
25808 			"}\n" +
25809 			"\n" +
25810 			"class Y<E> {\n" +
25811 			"	Y<E> next;\n" +
25812 			"}\n",
25813 		},
25814 		this.complianceLevel < ClassFileConstants.JDK1_8 ?
25815 			"----------\n" +
25816 			"1. WARNING in X.java (at line 2)\n" +
25817 			"	Y first;\n" +
25818 			"	^\n" +
25819 			"Y is a raw type. References to generic type Y<E> should be parameterized\n" +
25820 			"----------\n" +
25821 			"2. WARNING in X.java (at line 3)\n" +
25822 			"	Y first2;\n" +
25823 			"	^\n" +
25824 			"Y is a raw type. References to generic type Y<E> should be parameterized\n" +
25825 			"----------\n" +
25826 			"3. ERROR in X.java (at line 9)\n" +
25827 			"	String s = foo(ref, first);\n" +
25828 			"	           ^^^^^^^^^^^^^^^\n" +
25829 			"Type mismatch: cannot convert from Y to String\n" +
25830 			"----------\n" +
25831 			"4. WARNING in X.java (at line 13)\n" +
25832 			"	ref.next = first == null ? ref : first;\n" +
25833 			"	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
25834 			"Type safety: The expression of type Y needs unchecked conversion to conform to Y<capture#2-of ? extends T>\n" +
25835 			"----------\n" +
25836 			"5. ERROR in X.java (at line 14)\n" +
25837 			"	String s = first == null ? ref : first;\n" +
25838 			"	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
25839 			"Type mismatch: cannot convert from Y to String\n" +
25840 			"----------\n" +
25841 			"6. WARNING in X.java (at line 15)\n" +
25842 			"	ref.next = first2 == null ? ref : first2;\n" +
25843 			"	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
25844 			"Type safety: The expression of type Y needs unchecked conversion to conform to Y<capture#5-of ? extends T>\n" +
25845 			"----------\n" +
25846 			"7. WARNING in X.java (at line 18)\n" +
25847 			"	return first == null ? ref : first;\n" +
25848 			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
25849 			"Type safety: The expression of type Y needs unchecked conversion to conform to Y<? extends T>\n" +
25850 			"----------\n" :
25851 				"----------\n" +
25852 				"1. WARNING in X.java (at line 2)\n" +
25853 				"	Y first;\n" +
25854 				"	^\n" +
25855 				"Y is a raw type. References to generic type Y<E> should be parameterized\n" +
25856 				"----------\n" +
25857 				"2. WARNING in X.java (at line 3)\n" +
25858 				"	Y first2;\n" +
25859 				"	^\n" +
25860 				"Y is a raw type. References to generic type Y<E> should be parameterized\n" +
25861 				"----------\n" +
25862 				"3. ERROR in X.java (at line 9)\n" +
25863 				"	String s = foo(ref, first);\n" +
25864 				"	           ^^^^^^^^^^^^^^^\n" +
25865 				"Type mismatch: cannot convert from Y to String\n" +
25866 				"----------\n" +
25867 				"4. ERROR in X.java (at line 13)\n" +
25868 				"	ref.next = first == null ? ref : first;\n" +
25869 				"	                           ^^^\n" +
25870 				"Type mismatch: cannot convert from Y<capture#3-of ? extends T> to Y<capture#2-of ? extends T>\n" +
25871 				"----------\n" +
25872 				"5. WARNING in X.java (at line 13)\n" +
25873 				"	ref.next = first == null ? ref : first;\n" +
25874 				"	                                 ^^^^^\n" +
25875 				"Type safety: The expression of type Y needs unchecked conversion to conform to Y<capture#2-of ? extends T>\n" +
25876 				"----------\n" +
25877 				"6. ERROR in X.java (at line 14)\n" +
25878 				"	String s = first == null ? ref : first;\n" +
25879 				"	                           ^^^\n" +
25880 				"Type mismatch: cannot convert from Y<capture#4-of ? extends T> to String\n" +
25881 				"----------\n" +
25882 				"7. ERROR in X.java (at line 14)\n" +
25883 				"	String s = first == null ? ref : first;\n" +
25884 				"	                                 ^^^^^\n" +
25885 				"Type mismatch: cannot convert from Y to String\n" +
25886 				"----------\n" +
25887 				"8. ERROR in X.java (at line 15)\n" +
25888 				"	ref.next = first2 == null ? ref : first2;\n" +
25889 				"	                            ^^^\n" +
25890 				"Type mismatch: cannot convert from Y<capture#6-of ? extends T> to Y<capture#5-of ? extends T>\n" +
25891 				"----------\n" +
25892 				"9. WARNING in X.java (at line 15)\n" +
25893 				"	ref.next = first2 == null ? ref : first2;\n" +
25894 				"	                                  ^^^^^^\n" +
25895 				"Type safety: The expression of type Y needs unchecked conversion to conform to Y<capture#5-of ? extends T>\n" +
25896 				"----------\n" +
25897 				"10. WARNING in X.java (at line 18)\n" +
25898 				"	return first == null ? ref : first;\n" +
25899 				"	                             ^^^^^\n" +
25900 				"Type safety: The expression of type Y needs unchecked conversion to conform to Y<? extends T>\n" +
25901 				"----------\n");
25902 }
25903 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=106744
25904 public void test0800() {
25905 	runNegativeTest(
25906 		// test directory preparation
25907 		new String[] { /* test files */
25908 			"X.java",
25909 			"import java.lang.reflect.Constructor;\n" +
25910 			"\n" +
25911 			"public class X {\n" +
25912 			"	public static void main(String[] args) {\n" +
25913 			"        final Class<Ann> AnnClass = Ann.class;\n" +
25914 			"	    Constructor[] constrs = X.class.getConstructors();\n" +
25915 			"        for (Constructor constructor  : constrs) {\n" +
25916 			"            final String message = constructor.getAnnotation(AnnClass).message();\n" +
25917 			"            System.out.println(message);\n" +
25918 			"        }\n" +
25919 			"	}\n" +
25920 			"}\n" +
25921 			"\n" +
25922 			"@interface Ann {\n" +
25923 			"	String message();\n" +
25924 			"}\n",
25925 		},
25926 		// compiler results
25927 		"----------\n" + /* expected compiler log */
25928 		"1. WARNING in X.java (at line 6)\n" +
25929 		"	Constructor[] constrs = X.class.getConstructors();\n" +
25930 		"	^^^^^^^^^^^\n" +
25931 		"Constructor is a raw type. References to generic type Constructor<T> should be parameterized\n" +
25932 		"----------\n" +
25933 		"2. WARNING in X.java (at line 7)\n" +
25934 		"	for (Constructor constructor  : constrs) {\n" +
25935 		"	     ^^^^^^^^^^^\n" +
25936 		"Constructor is a raw type. References to generic type Constructor<T> should be parameterized\n" +
25937 		"----------\n" +
25938 		"3. WARNING in X.java (at line 8)\n" +
25939 		"	final String message = constructor.getAnnotation(AnnClass).message();\n" +
25940 		"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
25941 		"Type safety: The method getAnnotation(Class) belongs to the raw type Constructor. References to generic type Constructor<T> should be parameterized\n" +
25942 		"----------\n" +
25943 		"4. ERROR in X.java (at line 8)\n" +
25944 		"	final String message = constructor.getAnnotation(AnnClass).message();\n" +
25945 		"	                                                           ^^^^^^^\n" +
25946 		"The method message() is undefined for the type Annotation\n" +
25947 		"----------\n",
25948 		// javac options
25949 		JavacTestOptions.JavacHasABug.JavacBug6400189 /* javac test options */);
25950 }
25951 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=106744 - variation
25952 public void test0801() {
25953 	this.runConformTest(
25954 		new String[] {
25955 			"X.java",
25956 			"public class X {\n" +
25957 			"	public static void main(String[] args) {\n" +
25958 			"		try {\n" +
25959 			"		    X.class.getConstructor(new Class[0]).getAnnotation(Ann.class).message();\n" +
25960 			"		} catch(Exception e) {\n" +
25961 			"		}\n" +
25962 			"	}\n" +
25963 			"}\n" +
25964 			"\n" +
25965 			"@interface Ann {\n" +
25966 			"	String message();\n" +
25967 			"}\n",
25968 		},
25969 		"");
25970 }
25971 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=106744 - variation
25972 public void test0802() {
25973 	this.runNegativeTest(
25974 		new String[] {
25975 			"X.java",
25976 			"public class X<U> {\n" +
25977 			"    void bar(Y y, X<ZZ> x) {\n" +
25978 			"    	y.foo(x).zz();\n" +
25979 			"    }\n" +
25980 			"}\n" +
25981 			"class Y<V> {\n" +
25982 			"    <T extends Z> T foo(X<T> x) { return null; }\n" +
25983 			"}\n" +
25984 			"\n" +
25985 			"class Z {\n" +
25986 			"}\n" +
25987 			"class ZZ extends Z {\n" +
25988 			"	void zz() {}\n" +
25989 			"}\n",
25990 		},
25991 		"----------\n" +
25992 		"1. WARNING in X.java (at line 2)\n" +
25993 		"	void bar(Y y, X<ZZ> x) {\n" +
25994 		"	         ^\n" +
25995 		"Y is a raw type. References to generic type Y<V> should be parameterized\n" +
25996 		"----------\n" +
25997 		"2. WARNING in X.java (at line 3)\n" +
25998 		"	y.foo(x).zz();\n" +
25999 		"	^^^^^^^^\n" +
26000 		"Type safety: The method foo(X) belongs to the raw type Y. References to generic type Y<V> should be parameterized\n" +
26001 		"----------\n" +
26002 		"3. ERROR in X.java (at line 3)\n" +
26003 		"	y.foo(x).zz();\n" +
26004 		"	         ^^\n" +
26005 		"The method zz() is undefined for the type Z\n" +
26006 		"----------\n");
26007 }
26008 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=101831
26009 public void test0803() {
26010 	this.runNegativeTest(
26011 		false /* skipJavac */,
26012 		this.complianceLevel < ClassFileConstants.JDK1_8 ? null : JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings,
26013 		new String[] {
26014 			"X.java",
26015 			"import java.util.*;\n" +
26016 			"\n" +
26017 			"public class X<A> {\n" +
26018 			"  ArrayList<A> list = new ArrayList<A>();\n" +
26019 			"  ArrayList<? super A> superList = new ArrayList<A>();\n" +
26020 			"  ArrayList<? extends A> extendsList = new ArrayList<A>();\n" +
26021 			"\n" +
26022 			"  ArrayList<A> getList() {\n" +
26023 			"    return true ? list : list;\n" +
26024 			"  }\n" +
26025 			"\n" +
26026 			"  ArrayList<? super A> getSuperList() {\n" +
26027 			"    return true ? superList : superList;\n" +
26028 			"  }\n" +
26029 			"\n" +
26030 			"  ArrayList<? extends A> getExtendsList() {\n" +
26031 			"    return true ? extendsList : extendsList;\n" +
26032 			"  }\n" +
26033 			"}\n",
26034 		},
26035 		this.complianceLevel < ClassFileConstants.JDK1_8 ?
26036 			"----------\n" +
26037 			"1. WARNING in X.java (at line 9)\n" +
26038 			"	return true ? list : list;\n" +
26039 			"	                     ^^^^\n" +
26040 			"Dead code\n" +
26041 			"----------\n" +
26042 			"2. ERROR in X.java (at line 13)\n" +
26043 			"	return true ? superList : superList;\n" +
26044 			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
26045 			"Type mismatch: cannot convert from ArrayList<capture#3-of ? extends Object> to ArrayList<? super A>\n" +
26046 			"----------\n" +
26047 			"3. WARNING in X.java (at line 17)\n" +
26048 			"	return true ? extendsList : extendsList;\n" +
26049 			"	                            ^^^^^^^^^^^\n" +
26050 			"Dead code\n" +
26051 			"----------\n" :
26052 				"----------\n" +
26053 				"1. WARNING in X.java (at line 9)\n" +
26054 				"	return true ? list : list;\n" +
26055 				"	                     ^^^^\n" +
26056 				"Dead code\n" +
26057 				"----------\n" +
26058 				"2. WARNING in X.java (at line 13)\n" +
26059 				"	return true ? superList : superList;\n" +
26060 				"	                          ^^^^^^^^^\n" +
26061 				"Dead code\n" +
26062 				"----------\n" +
26063 				"3. WARNING in X.java (at line 17)\n" +
26064 				"	return true ? extendsList : extendsList;\n" +
26065 				"	                            ^^^^^^^^^^^\n" +
26066 				"Dead code\n" +
26067 				"----------\n"
26068 			);
26069 }
26070 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=106865
26071 public void test0804() {
26072 	this.runNegativeTest(
26073 		new String[] {
26074 			"X.java",
26075 			"class Y<E> {\n" +
26076 			"	void foo(E e) {\n" +
26077 			"	}\n" +
26078 			"}\n" +
26079 			"public class X {\n" +
26080 			"    void method1(Y<? super Object[]> y, Object[] os) {\n" +
26081 			"        y.foo(os);\n" +
26082 			"    }\n" +
26083 			"    void method2(Y<? super Cloneable> y, Cloneable c) {\n" +
26084 			"        y.foo(c);\n" +
26085 			"    }    \n" +
26086 			"    void method3(Y<? extends Object[]> y, Object[] os) {\n" +
26087 			"        y.foo(os);\n" +
26088 			"    }\n" +
26089 			"    void method4(Y<? extends Cloneable> y, Cloneable c) {\n" +
26090 			"        y.foo(c);\n" +
26091 			"    }    \n" +
26092 			"    \n" +
26093 			"    void bar(Y<Object> y) {\n" +
26094 			"    	method2(y, null);\n" +
26095 			"    }\n" +
26096 			"}\n",
26097 		},
26098 		"----------\n" +
26099 		"1. ERROR in X.java (at line 13)\n" +
26100 		"	y.foo(os);\n" +
26101 		"	  ^^^\n" +
26102 		"The method foo(capture#3-of ? extends Object[]) in the type Y<capture#3-of ? extends Object[]> is not applicable for the arguments (Object[])\n" +
26103 		"----------\n" +
26104 		"2. ERROR in X.java (at line 16)\n" +
26105 		"	y.foo(c);\n" +
26106 		"	  ^^^\n" +
26107 		"The method foo(capture#4-of ? extends Cloneable) in the type Y<capture#4-of ? extends Cloneable> is not applicable for the arguments (Cloneable)\n" +
26108 		"----------\n");
26109 }
26110 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=106936
26111 public void test0805() {
26112 	this.runNegativeTest(
26113 		new String[] {
26114 			"X.java",
26115 			"public class X {\n" +
26116 			" 	static <T> T foo(T t1, T t2) { return t1; }\n" +
26117 			" 	public static void main(String[] args) {\n" +
26118 			"		Number[] numbers = {}, numbers2, numbers3;\n" +
26119 			"		Float[] floats = {};\n" +
26120 			"		Integer[] integers = {};\n" +
26121 			"\n" +
26122 			"		numbers2 = foo(numbers, floats);\n" +
26123 			" 		numbers3 = numbers != null ? numbers : floats;\n" +
26124 			" 		String s = foo(numbers, floats); 		\n" +
26125 			"\n" +
26126 			" 		numbers2 = foo(integers, floats);\n" +
26127 			" 		numbers3 = integers != null ? integers : floats;\n" +
26128 			" 		String s2 = foo(integers, floats);\n" +
26129 			" 	}\n" +
26130 			"}\n",
26131 		},
26132 		"----------\n" +
26133 		"1. ERROR in X.java (at line 10)\n" +
26134 		"	String s = foo(numbers, floats); 		\n" +
26135 		"	           ^^^^^^^^^^^^^^^^^^^^\n" +
26136 		"Type mismatch: cannot convert from Number[] to String\n" +
26137 		"----------\n" +
26138 		"2. ERROR in X.java (at line 14)\n" +
26139 		"	String s2 = foo(integers, floats);\n" +
26140 		"	            ^^^^^^^^^^^^^^^^^^^^^\n" +
26141 		"Type mismatch: cannot convert from "+intersection("Number",
26142 				intersection("Comparable<? extends "+intersection("Number","Comparable<?>")+">")
26143 				)+"[] to String\n" +
26144 		"----------\n");
26145 }
26146 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=107079
26147 public void test0806() {
26148 	this.runNegativeTest(
26149 		new String[] {
26150 			"X.java",
26151 			"import java.util.ArrayList;\n" +
26152 			"import java.util.List;\n" +
26153 			"\n" +
26154 			"/**\n" +
26155 			" * This class demonstrates a generic program that Eclipse must not compile as it\n" +
26156 			" * can lead to a ClassCastException despite having no explicit type casts.\n" +
26157 			" */\n" +
26158 			"public class X {\n" +
26159 			"	private static class ValueHolder<T> {\n" +
26160 			"		public T value;\n" +
26161 			"	}\n" +
26162 			"\n" +
26163 			"	public static void main(final String[] args) {\n" +
26164 			"		List<ValueHolder<?>> multiList = new ArrayList<ValueHolder<?>>();\n" +
26165 			"\n" +
26166 			"		ValueHolder<Integer> intHolder = new ValueHolder<Integer>();\n" +
26167 			"		intHolder.value = 1;\n" +
26168 			"\n" +
26169 			"		ValueHolder<Double> doubleHolder = new ValueHolder<Double>();\n" +
26170 			"		doubleHolder.value = 1.5;\n" +
26171 			"\n" +
26172 			"		multiList.add(intHolder);\n" +
26173 			"		multiList.add(doubleHolder);\n" +
26174 			"\n" +
26175 			"		// I believe this line is being erroneously treated as a capture\n" +
26176 			"        // conversion under 3.1 JDT.\n" +
26177 			"		// I believe the problem is that ? cannot be captured except in a first\n" +
26178 			"        // level wildcard.\n" +
26179 			"		swapFirstTwoValues(multiList);\n" +
26180 			"\n" +
26181 			"		// this line causes a ClassCastException when checked.\n" +
26182 			"		Integer value = intHolder.value;\n" +
26183 			"		System.out.println(value);\n" +
26184 			"	}\n" +
26185 			"\n" +
26186 			"	private static <T> void swapFirstTwoValues(List<ValueHolder<T>> multiList) {\n" +
26187 			"		ValueHolder<T> intHolder = multiList.get(0);\n" +
26188 			"		ValueHolder<T> doubleHolder = multiList.get(1);\n" +
26189 			"\n" +
26190 			"		intHolder.value = doubleHolder.value;\n" +
26191 			"	}\n" +
26192 			"}\n",
26193 		},
26194 		"----------\n" +
26195 		"1. ERROR in X.java (at line 29)\n" +
26196 		"	swapFirstTwoValues(multiList);\n" +
26197 		"	^^^^^^^^^^^^^^^^^^\n" +
26198 		"The method swapFirstTwoValues(List<X.ValueHolder<T>>) in the type X is not applicable for the arguments (List<X.ValueHolder<?>>)\n" +
26199 		"----------\n");
26200 }
26201 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=107756
26202 public void test0807() {
26203 	this.runConformTest(
26204 		new String[] {
26205 			"X.java",
26206 			"interface Prop<BeanT> {\n" +
26207 			"	Unmarshaller.Handler createHandler();\n" +
26208 			"}\n" +
26209 			"\n" +
26210 			"abstract class Unmarshaller {\n" +
26211 			"	public static abstract class Handler {}\n" +
26212 			"}\n" +
26213 			"\n" +
26214 			"public class X {\n" +
26215 			"	void foo(Prop p) {\n" +
26216 			"		Unmarshaller.Handler h = p.createHandler(); \n" +
26217 			"	}\n" +
26218 			"}\n",
26219 		},
26220 		"");
26221 }
26222 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=107756 - variation
26223 public void test0808() {
26224 	this.runConformTest(
26225 		new String[] {
26226 			"X.java",
26227 			"public class X<T> {\n" +
26228 			"    \n" +
26229 			"    public static void main(String[] args) {\n" +
26230 			"        X x = new X();\n" +
26231 			"        x.ax = new AX<String>();\n" +
26232 			"    }\n" +
26233 			"    \n" +
26234 			"    AX<T> ax;\n" +
26235 			"}\n" +
26236 			"\n" +
26237 			"class AX <P> {\n" +
26238 			"    AX<P> p;\n" +
26239 			"}\n",
26240 		},
26241 		"");
26242 }
26243 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=106946
26244 public void test0809() {
26245 	this.runNegativeTest(
26246 		new String[] {
26247 			"X.java",
26248 			"import java.util.Iterator;\n" +
26249 			"\n" +
26250 			"class Node {}\n" +
26251 			"interface Set1<N extends Node> extends Iterable<N> {}\n" +
26252 			"interface Set2 extends Iterable<Node> {}\n" +
26253 			"\n" +
26254 			"class SetIterator<N extends Node> implements Iterator<N> {\n" +
26255 			"	public N next() {\n" +
26256 			"		return null;\n" +
26257 			"	}\n" +
26258 			"	public boolean hasNext() {\n" +
26259 			"		return true;\n" +
26260 			"	}\n" +
26261 			"	public void remove() {\n" +
26262 			"	}\n" +
26263 			"}\n" +
26264 			"interface Set3<N extends Node> extends Iterable<N> {\n" +
26265 			"	SetIterator<N> iterator();\n" +
26266 			"}\n" +
26267 			"public class X {\n" +
26268 			"	void f1(Set1 s) {\n" +
26269 			"		Node n_ = s.iterator().next();\n" +
26270 			"		// ^Type mismatch: cannot convert from Object to Node\n" +
26271 			"		// this was unexpected (s can only contain types derivered from Node)\n" +
26272 			"		for (Node n : s) {\n" +
26273 			"			// ^Type mismatch: cannot convert from Object to Node\n" +
26274 			"			// this was unexpected\n" +
26275 			"		}\n" +
26276 			"	}\n" +
26277 			"	void f2(Set2 s) {\n" +
26278 			"		Node n_ = s.iterator().next();\n" +
26279 			"		for (Node n : s) {\n" +
26280 			"		}\n" +
26281 			"	}\n" +
26282 			"	void f3(Set3 s) {\n" +
26283 			"		Node n_ = s.iterator().next();\n" +
26284 			"		// (^ no error here)\n" +
26285 			"		for (Node n : s) {\n" +
26286 			"			// ^Type mismatch: cannot convert from Object to Node\n" +
26287 			"			// this is even stranger as we already know that s.iterator().next()\n" +
26288 			"            // have the right type\n" +
26289 			"		}\n" +
26290 			"	}\n" +
26291 			"}\n",
26292 		},
26293 		"----------\n" +
26294 		"1. WARNING in X.java (at line 21)\n" +
26295 		"	void f1(Set1 s) {\n" +
26296 		"	        ^^^^\n" +
26297 		"Set1 is a raw type. References to generic type Set1<N> should be parameterized\n" +
26298 		"----------\n" +
26299 		"2. ERROR in X.java (at line 22)\n" +
26300 		"	Node n_ = s.iterator().next();\n" +
26301 		"	          ^^^^^^^^^^^^^^^^^^^\n" +
26302 		"Type mismatch: cannot convert from Object to Node\n" +
26303 		"----------\n" +
26304 		"3. ERROR in X.java (at line 25)\n" +
26305 		"	for (Node n : s) {\n" +
26306 		"	              ^\n" +
26307 		"Type mismatch: cannot convert from element type Object to Node\n" +
26308 		"----------\n" +
26309 		"4. WARNING in X.java (at line 35)\n" +
26310 		"	void f3(Set3 s) {\n" +
26311 		"	        ^^^^\n" +
26312 		"Set3 is a raw type. References to generic type Set3<N> should be parameterized\n" +
26313 		"----------\n" +
26314 		"5. ERROR in X.java (at line 38)\n" +
26315 		"	for (Node n : s) {\n" +
26316 		"	              ^\n" +
26317 		"Type mismatch: cannot convert from element type Object to Node\n" +
26318 		"----------\n");
26319 }
26320 public void test0810() {
26321 	runConformTest(
26322 		// test directory preparation
26323 		true /* flush output directory */,
26324 		new String[] { /* test files */
26325 			"X.java",
26326 			"class A<T, U> {\n" +
26327 			"	public String toString() {\n" +
26328 			"		return \"SUCCESS\";\n" +
26329 			"	}\n" +
26330 			"}\n" +
26331 			"public class X {\n" +
26332 			"\n" +
26333 			"	public <K> A<K,K> foo(K type) {\n" +
26334 			"		return new A<K,K>();\n" +
26335 			"	}\n" +
26336 			"\n" +
26337 			"	public static void main(String args[]) {\n" +
26338 			"		X x = new X();\n" +
26339 			"		A<?,?> a = x.foo(null);\n" +
26340 			"		System.out.println(a);\n" +
26341 			"	}\n" +
26342 			"}",
26343 		},
26344 		// compiler results
26345 		null /* do not check compiler log */,
26346 		// runtime results
26347 		"SUCCESS" /* expected output string */,
26348 		"" /* expected error string */,
26349 		// javac options
26350 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
26351 }
26352 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=108372
26353 public void test0811() {
26354 	this.runConformTest(
26355 		new String[] {
26356 			"X.java",
26357 			"public class X<T> {\n" +
26358 			"    private T t;\n" +
26359 			"    private X.Inner inner;\n" +
26360 			"    private X.Inner[] inners;\n" +
26361 			"    public X(T t,  X.Inner in, X.Inner[] ins) {\n" +
26362 			"        this.t = t;\n" +
26363 			"        this.inner = in;\n" +
26364 			"        this.inner = new X(null, null, null).new Inner();\n" +
26365 			"        this.inners = ins;\n" +
26366 			"        this.inners = new X.Inner[10];\n" +
26367 			"        //Type mismatch: cannot convert from X.Inner[] to X<T>.Inner[]\n" +
26368 			"    }\n" +
26369 			"    private class Inner {\n" +
26370 			"    }\n" +
26371 			"}\n",
26372 		},
26373 		"");
26374 }
26375 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=108372 - variation
26376 public void test0812() {
26377 	this.runNegativeTest(
26378 		new String[] {
26379 			"X.java",
26380 			"public class X<T> {\n" +
26381 			"    private T t;\n" +
26382 			"    private X<?>.Inner inner;\n" +
26383 			"    private X<?>.Inner[] inners;\n" +
26384 			"    public X(T t) {\n" +
26385 			"        this.t = t;\n" +
26386 			"        this.inner = new X.Inner();\n" +
26387 			"        this.inners = new X.Inner[10];\n" +
26388 			"        Zork z;\n" +
26389 			"    }\n" +
26390 			"    private class Inner {\n" +
26391 			"    }\n" +
26392 			"}\n",
26393 		},
26394 		"----------\n" +
26395 		"1. WARNING in X.java (at line 7)\n" +
26396 		"	this.inner = new X.Inner();\n" +
26397 		"	                 ^^^^^^^\n" +
26398 		"X.Inner is a raw type. References to generic type X<T>.Inner should be parameterized\n" +
26399 		"----------\n" +
26400 		"2. ERROR in X.java (at line 9)\n" +
26401 		"	Zork z;\n" +
26402 		"	^^^^\n" +
26403 		"Zork cannot be resolved to a type\n" +
26404 		"----------\n");
26405 }
26406 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=108372 - variation
26407 public void test0813() {
26408 	runConformTest(
26409 		// test directory preparation
26410 		true /* flush output directory */,
26411 		new String[] { /* test files */
26412 			"X.java",
26413 			"public class X<T> {\n" +
26414 			"    private T t;\n" +
26415 			"    private X<?>.Inner[] inners;\n" +
26416 			"    public X(T t) {\n" +
26417 			"        this.t = t;\n" +
26418 			"        this.inners = new X<?>.Inner[10];\n" +
26419 			"    }\n" +
26420 			"    private class Inner {\n" +
26421 			"    }\n" +
26422 			"}\n",
26423 		},
26424 		// compiler results
26425 		null /* do not check compiler log */,
26426 		// runtime results
26427 		"" /* expected output string */,
26428 		"" /* expected error string */,
26429 		// javac options
26430 		JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
26431 }
26432 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=104695
26433 public void test0814() {
26434 	this.runNegativeTest(
26435 		new String[] {
26436 			"X.java",
26437 			"import java.util.*;\n" +
26438 			"public class X<E> {\n" +
26439 			"    void method(Object o) {\n" +
26440 			"        if (o instanceof E[]) { //incorrect: cannot test non-reifiable type\n" +
26441 			"            E[] es = (E[]) o;\n" +
26442 			"        }\n" +
26443 			"        if (o instanceof List<E>[]) { //incorrect too\n" +
26444 			"            List<E>[] es = (List<E>[]) o; \n" +
26445 			"        }\n" +
26446 			"        if (o instanceof List<?>[]) { // unbound is ok\n" +
26447 			"            List<?>[] es = (List<?>[]) o;\n" +
26448 			"        }\n" +
26449 			"    }\n" +
26450 			"    void method(ArrayList<E>[] al) {\n" +
26451 			"        if (al instanceof List<E>[]) { //incorrect too\n" +
26452 			"            List<E>[] es = (List<E>[]) al; \n" +
26453 			"        }        \n" +
26454 			"    }\n" +
26455 			"}\n",
26456 		},
26457 		"----------\n" +
26458 		"1. ERROR in X.java (at line 4)\n" +
26459 		"	if (o instanceof E[]) { //incorrect: cannot test non-reifiable type\n" +
26460 		"	    ^^^^^^^^^^^^^^^^\n" +
26461 		"Cannot perform instanceof check against type parameter E[]. Use its erasure Object[] instead since further generic type information will be erased at runtime\n" +
26462 		"----------\n" +
26463 		"2. WARNING in X.java (at line 5)\n" +
26464 		"	E[] es = (E[]) o;\n" +
26465 		"	         ^^^^^^^\n" +
26466 		"Type safety: Unchecked cast from Object to E[]\n" +
26467 		"----------\n" +
26468 		"3. ERROR in X.java (at line 7)\n" +
26469 		"	if (o instanceof List<E>[]) { //incorrect too\n" +
26470 		"	    ^^^^^^^^^^^^^^^^^^^^^^\n" +
26471 		"Cannot perform instanceof check against parameterized type List<E>[]. Use the form List<?>[] instead since further generic type information will be erased at runtime\n" +
26472 		"----------\n" +
26473 		"4. WARNING in X.java (at line 8)\n" +
26474 		"	List<E>[] es = (List<E>[]) o; \n" +
26475 		"	               ^^^^^^^^^^^^^\n" +
26476 		"Type safety: Unchecked cast from Object to List<E>[]\n" +
26477 		"----------\n" +
26478 		"5. ERROR in X.java (at line 15)\n" +
26479 		"	if (al instanceof List<E>[]) { //incorrect too\n" +
26480 		"	    ^^^^^^^^^^^^^^^^^^^^^^^\n" +
26481 		"Cannot perform instanceof check against parameterized type List<E>[]. Use the form List<?>[] instead since further generic type information will be erased at runtime\n" +
26482 		"----------\n" +
26483 		"6. WARNING in X.java (at line 16)\n" +
26484 		"	List<E>[] es = (List<E>[]) al; \n" +
26485 		"	               ^^^^^^^^^^^^^^\n" +
26486 		"Unnecessary cast from ArrayList<E>[] to List<E>[]\n" +
26487 		"----------\n");
26488 }
26489 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=104695 - variation
26490 public void test0815() {
26491 	this.runNegativeTest(
26492 		new String[] {
26493 			"X.java",
26494 			"public class X<E> {\n" +
26495 			"	void foo(Object[][] e) {\n" +
26496 			"		E[] o = (E[]) e;\n" +
26497 			"		Zork z;\n" +
26498 			"	}\n" +
26499 			"}\n",
26500 		},
26501 		"----------\n" +
26502 		"1. WARNING in X.java (at line 3)\n" +
26503 		"	E[] o = (E[]) e;\n" +
26504 		"	        ^^^^^^^\n" +
26505 		"Type safety: Unchecked cast from Object[][] to E[]\n" +
26506 		"----------\n" +
26507 		"2. ERROR in X.java (at line 4)\n" +
26508 		"	Zork z;\n" +
26509 		"	^^^^\n" +
26510 		"Zork cannot be resolved to a type\n" +
26511 		"----------\n");
26512 }
26513 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=104695 - variation
26514 public void test0816() {
26515 	this.runNegativeTest(
26516 		new String[] {
26517 			"X.java",
26518 			"import java.util.*;\n" +
26519 			"public class X<E> {\n" +
26520 			"    void method(Object[] o) {\n" +
26521 			"        if (o instanceof List<E>[][]) { //incorrect too\n" +
26522 			"            List<E>[][] es = (List<E>[][]) o; \n" +
26523 			"        }\n" +
26524 			"    }\n" +
26525 			"}\n",
26526 		},
26527 		"----------\n" +
26528 		"1. ERROR in X.java (at line 4)\n" +
26529 		"	if (o instanceof List<E>[][]) { //incorrect too\n" +
26530 		"	    ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
26531 		"Cannot perform instanceof check against parameterized type List<E>[][]. Use the form List<?>[][] instead since further generic type information will be erased at runtime\n" +
26532 		"----------\n" +
26533 		"2. WARNING in X.java (at line 5)\n" +
26534 		"	List<E>[][] es = (List<E>[][]) o; \n" +
26535 		"	                 ^^^^^^^^^^^^^^^\n" +
26536 		"Type safety: Unchecked cast from Object[] to List<E>[][]\n" +
26537 		"----------\n");
26538 }
26539 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=104695 - variation
26540 public void test0817() {
26541 	this.runNegativeTest(
26542 			new String[] {
26543 				"X.java",
26544 				"import java.util.List;\n" +
26545 				"\n" +
26546 				"public class X<T> {\n" +
26547 				"    private T t;\n" +
26548 				"    private X<?>.Inner inner;\n" +
26549 				"    private X<?>.Inner[] inners;\n" +
26550 				"    public X(T t) {\n" +
26551 				"        this.t = t;\n" +
26552 				"        if (this.inner instanceof X<?>.Inner) {}\n" +
26553 				"        if (this.inners instanceof X<?>.Inner[]) {}\n" +
26554 				"    }\n" +
26555 				"    private class Inner {\n" +
26556 				"    }\n" +
26557 				"    void foo(List l) {\n" +
26558 				"    	if (l instanceof List<?>) {}\n" +
26559 				"    	if (l instanceof List<? extends String>) {}\n" +
26560 				"    }\n" +
26561 				"    void foo(List[] ls) {\n" +
26562 				"    	if (ls instanceof List<?>[]) {}\n" +
26563 				"    	if (ls instanceof List<? extends String>[]) {}\n" +
26564 				"    }\n" +
26565 				"}\n",
26566 			},
26567 			"----------\n" +
26568 			"1. WARNING in X.java (at line 9)\n" +
26569 			"	if (this.inner instanceof X<?>.Inner) {}\n" +
26570 			"	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
26571 			"The expression of type X<?>.Inner is already an instance of type X<?>.Inner\n" +
26572 			"----------\n" +
26573 			"2. WARNING in X.java (at line 10)\n" +
26574 			"	if (this.inners instanceof X<?>.Inner[]) {}\n" +
26575 			"	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
26576 			"The expression of type X<?>.Inner[] is already an instance of type X<?>.Inner[]\n" +
26577 			"----------\n" +
26578 			"3. WARNING in X.java (at line 14)\n" +
26579 			"	void foo(List l) {\n" +
26580 			"	         ^^^^\n" +
26581 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
26582 			"----------\n" +
26583 			"4. WARNING in X.java (at line 15)\n" +
26584 			"	if (l instanceof List<?>) {}\n" +
26585 			"	    ^^^^^^^^^^^^^^^^^\n" +
26586 			"The expression of type List is already an instance of type List<?>\n" +
26587 			"----------\n" +
26588 			"5. ERROR in X.java (at line 16)\n" +
26589 			"	if (l instanceof List<? extends String>) {}\n" +
26590 			"	    ^^^^^^^^^^^^^^^^^\n" +
26591 			"Cannot perform instanceof check against parameterized type List<? extends String>. Use the form List<?> instead since further generic type information will be erased at runtime\n" +
26592 			"----------\n" +
26593 			"6. WARNING in X.java (at line 18)\n" +
26594 			"	void foo(List[] ls) {\n" +
26595 			"	         ^^^^\n" +
26596 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
26597 			"----------\n" +
26598 			"7. WARNING in X.java (at line 19)\n" +
26599 			"	if (ls instanceof List<?>[]) {}\n" +
26600 			"	    ^^^^^^^^^^^^^^^^^^^^^^^\n" +
26601 			"The expression of type List[] is already an instance of type List<?>\n" +
26602 			"----------\n" +
26603 			"8. ERROR in X.java (at line 20)\n" +
26604 			"	if (ls instanceof List<? extends String>[]) {}\n" +
26605 			"	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
26606 			"Cannot perform instanceof check against parameterized type List<? extends String>[]. Use the form List<?>[] instead since further generic type information will be erased at runtime\n" +
26607 			"----------\n");
26608 }
26609 public void test0818() {
26610 	this.runConformTest(
26611 		new String[] {
26612 			"X.java",
26613 			"public class X<T> {\n" +
26614 			"    boolean b = this instanceof Y;\n" +
26615 			"    static class Y extends X<Object> {\n" +
26616 			"    }\n" +
26617 			"}\n",
26618 		},
26619 		"");
26620 }
26621 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=101380
26622 public void test0819() {
26623 	this.runConformTest(
26624 			new String[] {
26625 				"X.java",
26626 				"public class X implements MyInterface {\n" +
26627 				"	public void myMethod(myEnum value) {\n" +
26628 				"		System.out.println(\"value is \"+value);\n" +
26629 				"	}\n" +
26630 				"	public static void main(String[] args){\n" +
26631 				"		new X().myMethod(myEnum.one);		\n" +
26632 				"	}\n" +
26633 				"}\n" +
26634 				"\n" +
26635 				"interface MyInterface<T> {\n" +
26636 				"	enum myEnum {one,two};\n" +
26637 				"	public void myMethod(myEnum value); \n" +
26638 				"}\n",
26639 			},
26640 			"value is one");
26641 }
26642 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=101380 - variation
26643 public void test0820() {
26644 	this.runConformTest(
26645 		new String[] {
26646 			"X.java",
26647 			"public class X implements I {\n" +
26648 			"  public void x(M value) {}\n" +
26649 			"}\n" +
26650 			"interface I<T> {\n" +
26651 			"  class M {}\n" +
26652 			"  void x(M value); \n" +
26653 			"}\n",
26654 		},
26655 		"");
26656 }
26657 public void test0821() throws Exception {
26658 	this.runConformTest(
26659 		new String[] {
26660 			"X.java",
26661 			"import java.io.Serializable;\n" +
26662 			"\n" +
26663 			"public class X<T extends Serializable & Runnable> {\n" +
26664 			"	T t;\n" +
26665 			"	X(T t) {\n" +
26666 			"		this.t = t;\n" +
26667 			"	}\n" +
26668 			"	void foo() {\n" +
26669 			"		t.run();\n" +
26670 			"	}\n" +
26671 			"	public static void main(String[] args) {\n" +
26672 			"		new X<A>(new A()).foo();\n" +
26673 			"	}\n" +
26674 			"}\n" +
26675 			"class A implements Serializable, Runnable {\n" +
26676 			"	public void run() {\n" +
26677 			"		System.out.println(\"AA\");\n" +
26678 			"	}\n" +
26679 			"}\n",
26680 		},
26681 		"AA");
26682 	// 	ensure proper declaring class for #run() invocation
26683 	String expectedOutput =
26684 		"  // Method descriptor #15 ()V\n" +
26685 		"  // Stack: 1, Locals: 1\n" +
26686 		"  void foo();\n" +
26687 		"     0  aload_0 [this]\n" +
26688 		"     1  getfield X.t : java.io.Serializable [16]\n" +
26689 		"     4  checkcast java.lang.Runnable [25]\n" +
26690 		"     7  invokeinterface java.lang.Runnable.run() : void [27] [nargs: 1]\n" +
26691 		"    12  return\n" +
26692 		"      Line numbers:\n" +
26693 		"        [pc: 0, line: 9]\n" +
26694 		"        [pc: 12, line: 10]\n" +
26695 		"      Local variable table:\n" +
26696 		"        [pc: 0, pc: 13] local: this index: 0 type: X\n" +
26697 		"      Local variable type table:\n" +
26698 		"        [pc: 0, pc: 13] local: this index: 0 type: X<T>\n";
26699 
26700 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
26701 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
26702 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
26703 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
26704 	int index = result.indexOf(expectedOutput);
26705 	if (index == -1 || expectedOutput.length() == 0) {
26706 		System.out.println(Util.displayString(result, 3));
26707 	}
26708 	if (index == -1) {
26709 		assertEquals("Wrong contents", expectedOutput, result);
26710 		}
26711 }
26712 public void test0822() throws Exception {
26713 	this.runConformTest(
26714 		new String[] {
26715 			"X.java",
26716 			"import java.io.Serializable;\n" +
26717 			"\n" +
26718 			"public class X<T extends Serializable & Runnable> {\n" +
26719 			"	void foo(T t) {\n" +
26720 			"		t.run();\n" +
26721 			"	}\n" +
26722 			"	public static void main(String[] args) {\n" +
26723 			"		new X<A>().foo(new A());\n" +
26724 			"	}\n" +
26725 			"}\n" +
26726 			"class A implements Serializable, Runnable {\n" +
26727 			"	public void run() {\n" +
26728 			"		System.out.println(\"AA\");\n" +
26729 			"	}\n" +
26730 			"}\n",
26731 		},
26732 		"AA");
26733 	// 	ensure proper declaring class for #run() invocation
26734 	String expectedOutput =
26735 		"  // Method descriptor #17 (Ljava/io/Serializable;)V\n" +
26736 		"  // Signature: (TT;)V\n" +
26737 		"  // Stack: 1, Locals: 2\n" +
26738 		"  void foo(java.io.Serializable t);\n" +
26739 		"     0  aload_1 [t]\n" +
26740 		"     1  checkcast java.lang.Runnable [20]\n" +
26741 		"     4  invokeinterface java.lang.Runnable.run() : void [22] [nargs: 1]\n" +
26742 		"     9  return\n" +
26743 		"      Line numbers:\n" +
26744 		"        [pc: 0, line: 5]\n" +
26745 		"        [pc: 9, line: 6]\n" +
26746 		"      Local variable table:\n" +
26747 		"        [pc: 0, pc: 10] local: this index: 0 type: X\n" +
26748 		"        [pc: 0, pc: 10] local: t index: 1 type: java.io.Serializable\n" +
26749 		"      Local variable type table:\n" +
26750 		"        [pc: 0, pc: 10] local: this index: 0 type: X<T>\n" +
26751 		"        [pc: 0, pc: 10] local: t index: 1 type: T\n";
26752 
26753 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
26754 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
26755 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
26756 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
26757 	int index = result.indexOf(expectedOutput);
26758 	if (index == -1 || expectedOutput.length() == 0) {
26759 		System.out.println(Util.displayString(result, 3));
26760 	}
26761 	if (index == -1) {
26762 		assertEquals("Wrong contents", expectedOutput, result);
26763 	}
26764 }
26765 public void test0823() throws Exception {
26766 	runConformTest(
26767 		true,
26768 		new String[] {
26769 			"X.java",
26770 			"import java.io.Serializable;\n" +
26771 			"\n" +
26772 			"public class X<T extends Serializable & Runnable, V extends T> {\n" +
26773 			"	T t;\n" +
26774 			"	X(T t) {\n" +
26775 			"		this.t = t;\n" +
26776 			"	}\n" +
26777 			"	void foo() {\n" +
26778 			"		(this == null ? t : t).run();\n" +
26779 			"		((V) t).run();\n" +
26780 			"	}\n" +
26781 			"	public static void main(String[] args) {\n" +
26782 			"		new X<A, A>(new A()).foo();\n" +
26783 			"	}\n" +
26784 			"}\n" +
26785 			"class A implements Serializable, Runnable {\n" +
26786 			"	public void run() {\n" +
26787 			"		System.out.print(\"AA\");\n" +
26788 			"	}\n" +
26789 			"}\n",
26790 		},
26791 		null,
26792 		"AAAA",
26793 		null,
26794 		JavacTestOptions.JavacHasABug.JavacBug6531075);
26795 	// 	ensure proper declaring class for #run() invocation
26796 	String expectedOutput =
26797 		"  // Method descriptor #15 ()V\n" +
26798 		"  // Stack: 1, Locals: 1\n" +
26799 		"  void foo();\n" +
26800 		"     0  aload_0 [this]\n" +
26801 		"     1  ifnonnull 11\n" +
26802 		"     4  aload_0 [this]\n" +
26803 		"     5  getfield X.t : java.io.Serializable [16]\n" +
26804 		"     8  goto 15\n" +
26805 		"    11  aload_0 [this]\n" +
26806 		"    12  getfield X.t : java.io.Serializable [16]\n" +
26807 		"    15  checkcast java.lang.Runnable [25]\n" +
26808 		"    18  invokeinterface java.lang.Runnable.run() : void [27] [nargs: 1]\n" +
26809 		"    23  aload_0 [this]\n" +
26810 		"    24  getfield X.t : java.io.Serializable [16]\n" +
26811 		"    27  checkcast java.lang.Runnable [25]\n" +
26812 		"    30  invokeinterface java.lang.Runnable.run() : void [27] [nargs: 1]\n" +
26813 		"    35  return\n" +
26814 		"      Line numbers:\n" +
26815 		"        [pc: 0, line: 9]\n" +
26816 		"        [pc: 23, line: 10]\n" +
26817 		"        [pc: 35, line: 11]\n" +
26818 		"      Local variable table:\n" +
26819 		"        [pc: 0, pc: 36] local: this index: 0 type: X\n" +
26820 		"      Local variable type table:\n" +
26821 		"        [pc: 0, pc: 36] local: this index: 0 type: X<T,V>\n";
26822 
26823 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
26824 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
26825 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
26826 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
26827 	int index = result.indexOf(expectedOutput);
26828 	if (index == -1 || expectedOutput.length() == 0) {
26829 		System.out.println(Util.displayString(result, 3));
26830 	}
26831 	if (index == -1) {
26832 		assertEquals("Wrong contents", expectedOutput, result);
26833 	}
26834 }
26835 public void test0824() throws Exception {
26836 	runConformTest(
26837 		true,
26838 		new String[] {
26839 			"X.java",
26840 			"import java.io.Serializable;\n" +
26841 			"\n" +
26842 			"public class X<T extends Serializable & Runnable, V extends T> {\n" +
26843 			"	void foo(T t) {\n" +
26844 			"		(this == null ? t : t).run();\n" +
26845 			"		((V) t).run();\n" +
26846 			"	}\n" +
26847 			"	public static void main(String[] args) {\n" +
26848 			"		new X<A, A>().foo(new A());\n" +
26849 			"	}\n" +
26850 			"}\n" +
26851 			"class A implements Serializable, Runnable {\n" +
26852 			"	public void run() {\n" +
26853 			"		System.out.print(\"AA\");\n" +
26854 			"	}\n" +
26855 			"}\n",
26856 		},
26857 		null,
26858 		"AAAA",
26859 		null,
26860 		JavacTestOptions.JavacHasABug.JavacBug6531075);
26861 	// 	ensure proper declaring class for #run() invocation
26862 	String expectedOutput =
26863 		"  // Method descriptor #17 (Ljava/io/Serializable;)V\n" +
26864 		"  // Signature: (TT;)V\n" +
26865 		"  // Stack: 1, Locals: 2\n" +
26866 		"  void foo(java.io.Serializable t);\n" +
26867 		"     0  aload_0 [this]\n" +
26868 		"     1  ifnonnull 8\n" +
26869 		"     4  aload_1 [t]\n" +
26870 		"     5  goto 9\n" +
26871 		"     8  aload_1 [t]\n" +
26872 		"     9  checkcast java.lang.Runnable [20]\n" +
26873 		"    12  invokeinterface java.lang.Runnable.run() : void [22] [nargs: 1]\n" +
26874 		"    17  aload_1 [t]\n" +
26875 		"    18  checkcast java.lang.Runnable [20]\n" +
26876 		"    21  invokeinterface java.lang.Runnable.run() : void [22] [nargs: 1]\n" +
26877 		"    26  return\n" +
26878 		"      Line numbers:\n" +
26879 		"        [pc: 0, line: 5]\n" +
26880 		"        [pc: 17, line: 6]\n" +
26881 		"        [pc: 26, line: 7]\n" +
26882 		"      Local variable table:\n" +
26883 		"        [pc: 0, pc: 27] local: this index: 0 type: X\n" +
26884 		"        [pc: 0, pc: 27] local: t index: 1 type: java.io.Serializable\n" +
26885 		"      Local variable type table:\n" +
26886 		"        [pc: 0, pc: 27] local: this index: 0 type: X<T,V>\n" +
26887 		"        [pc: 0, pc: 27] local: t index: 1 type: T\n";
26888 
26889 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
26890 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
26891 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
26892 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
26893 	int index = result.indexOf(expectedOutput);
26894 	if (index == -1 || expectedOutput.length() == 0) {
26895 		System.out.println(Util.displayString(result, 3));
26896 	}
26897 	if (index == -1) {
26898 		assertEquals("Wrong contents", expectedOutput, result);
26899 	}
26900 }
26901 public void test0825() throws Exception {
26902 	if (this.complianceLevel >= ClassFileConstants.JDK1_8)
26903 		return;
26904 	this.runConformTest(
26905 		new String[] {
26906 			"X.java",
26907 			"import java.io.Serializable;\n" +
26908 			"\n" +
26909 			"public class X<T extends Serializable & Runnable, V extends T> {\n" +
26910 			"	void foo(T t) {\n" +
26911 			"		Runnable r1 = t;\n" +
26912 			"		Runnable r2 = (this == null ? t : t);\n" +
26913 			"		Runnable r3 = ((V) t);\n" +
26914 			"		\n" +
26915 			"		bar(t);\n" +
26916 			"		bar(this == null ? t : t);\n" +
26917 			"		bar((V)t);\n" +
26918 			"	}\n" +
26919 			"	void bar(Runnable r) {}	\n" +
26920 			"	public static void main(String[] args) {\n" +
26921 			"		new X<A, A>().foo(new A());\n" +
26922 			"	}\n" +
26923 			"}\n" +
26924 			"class A implements Serializable, Runnable {\n" +
26925 			"	public void run() {\n" +
26926 			"		System.out.println(\"AA\");\n" +
26927 			"	}\n" +
26928 			"}\n",
26929 		},
26930 		"");
26931 	// 	ensure proper declaring class for #run() invocation
26932 	String expectedOutput = this.complianceLevel < ClassFileConstants.JDK1_8 ?
26933 		"  // Method descriptor #17 (Ljava/io/Serializable;)V\n" +
26934 		"  // Signature: (TT;)V\n" +
26935 		"  // Stack: 2, Locals: 5\n" +
26936 		"  void foo(java.io.Serializable t);\n" +
26937 		"     0  aload_1 [t]\n" +
26938 		"     1  checkcast java.lang.Runnable [20]\n" +
26939 		"     4  astore_2 [r1]\n" +
26940 		"     5  aload_0 [this]\n" +
26941 		"     6  ifnonnull 13\n" +
26942 		"     9  aload_1 [t]\n" +
26943 		"    10  goto 14\n" +
26944 		"    13  aload_1 [t]\n" +
26945 		"    14  astore_3 [r2]\n" +
26946 		"    15  aload_1 [t]\n" +
26947 		"    16  astore 4 [r3]\n" +
26948 		"    18  aload_0 [this]\n" +
26949 		"    19  aload_1 [t]\n" +
26950 		"    20  checkcast java.lang.Runnable [20]\n" +
26951 		"    23  invokevirtual X.bar(java.lang.Runnable) : void [22]\n" +
26952 		"    26  aload_0 [this]\n" +
26953 		"    27  aload_0 [this]\n" +
26954 		"    28  ifnonnull 35\n" +
26955 		"    31  aload_1 [t]\n" +
26956 		"    32  goto 36\n" +
26957 		"    35  aload_1 [t]\n" +
26958 		"    36  invokevirtual X.bar(java.lang.Runnable) : void [22]\n" +
26959 		"    39  aload_0 [this]\n" +
26960 		"    40  aload_1 [t]\n" +
26961 		"    41  invokevirtual X.bar(java.lang.Runnable) : void [22]\n" +
26962 		"    44  return\n" +
26963 		"      Line numbers:\n" +
26964 		"        [pc: 0, line: 5]\n" +
26965 		"        [pc: 5, line: 6]\n" +
26966 		"        [pc: 15, line: 7]\n" +
26967 		"        [pc: 18, line: 9]\n" +
26968 		"        [pc: 26, line: 10]\n" +
26969 		"        [pc: 39, line: 11]\n" +
26970 		"        [pc: 44, line: 12]\n" +
26971 		"      Local variable table:\n" +
26972 		"        [pc: 0, pc: 45] local: this index: 0 type: X\n" +
26973 		"        [pc: 0, pc: 45] local: t index: 1 type: java.io.Serializable\n" +
26974 		"        [pc: 5, pc: 45] local: r1 index: 2 type: java.lang.Runnable\n" +
26975 		"        [pc: 15, pc: 45] local: r2 index: 3 type: java.lang.Runnable\n" +
26976 		"        [pc: 18, pc: 45] local: r3 index: 4 type: java.lang.Runnable\n" +
26977 		"      Local variable type table:\n" +
26978 		"        [pc: 0, pc: 45] local: this index: 0 type: X<T,V>\n" +
26979 		"        [pc: 0, pc: 45] local: t index: 1 type: T\n" :
26980 
26981 			"  // Method descriptor #17 (Ljava/io/Serializable;)V\n" +
26982 			"  // Signature: (TT;)V\n" +
26983 			"  // Stack: 2, Locals: 5\n" +
26984 			"  void foo(java.io.Serializable t);\n" +
26985 			"     0  aload_1 [t]\n" +
26986 			"     1  checkcast java.lang.Runnable [20]\n" +
26987 			"     4  astore_2 [r1]\n" +
26988 			"     5  aload_0 [this]\n" +
26989 			"     6  ifnonnull 16\n" +
26990 			"     9  aload_1 [t]\n" +
26991 			"    10  checkcast java.lang.Runnable [20]\n" +
26992 			"    13  goto 20\n" +
26993 			"    16  aload_1 [t]\n" +
26994 			"    17  checkcast java.lang.Runnable [20]\n" +
26995 			"    20  astore_3 [r2]\n" +
26996 			"    21  aload_1 [t]\n" +
26997 			"    22  astore 4 [r3]\n" +
26998 			"    24  aload_0 [this]\n" +
26999 			"    25  aload_1 [t]\n" +
27000 			"    26  checkcast java.lang.Runnable [20]\n" +
27001 			"    29  invokevirtual X.bar(java.lang.Runnable) : void [22]\n" +
27002 			"    32  aload_0 [this]\n" +
27003 			"    33  aload_0 [this]\n" +
27004 			"    34  ifnonnull 44\n" +
27005 			"    37  aload_1 [t]\n" +
27006 			"    38  checkcast java.lang.Runnable [20]\n" +
27007 			"    41  goto 48\n" +
27008 			"    44  aload_1 [t]\n" +
27009 			"    45  checkcast java.lang.Runnable [20]\n" +
27010 			"    48  invokevirtual X.bar(java.lang.Runnable) : void [22]\n" +
27011 			"    51  aload_0 [this]\n" +
27012 			"    52  aload_1 [t]\n" +
27013 			"    53  invokevirtual X.bar(java.lang.Runnable) : void [22]\n" +
27014 			"    56  return\n" +
27015 			"      Line numbers:\n" +
27016 			"        [pc: 0, line: 5]\n" +
27017 			"        [pc: 5, line: 6]\n" +
27018 			"        [pc: 21, line: 7]\n" +
27019 			"        [pc: 24, line: 9]\n" +
27020 			"        [pc: 32, line: 10]\n" +
27021 			"        [pc: 51, line: 11]\n" +
27022 			"        [pc: 56, line: 12]\n" +
27023 			"      Local variable table:\n" +
27024 			"        [pc: 0, pc: 57] local: this index: 0 type: X\n" +
27025 			"        [pc: 0, pc: 57] local: t index: 1 type: java.io.Serializable\n" +
27026 			"        [pc: 5, pc: 57] local: r1 index: 2 type: java.lang.Runnable\n" +
27027 			"        [pc: 21, pc: 57] local: r2 index: 3 type: java.lang.Runnable\n" +
27028 			"        [pc: 24, pc: 57] local: r3 index: 4 type: java.lang.Runnable\n" +
27029 			"      Local variable type table:\n" +
27030 			"        [pc: 0, pc: 57] local: this index: 0 type: X<T,V>\n" +
27031 			"        [pc: 0, pc: 57] local: t index: 1 type: T\n";
27032 
27033 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
27034 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
27035 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
27036 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
27037 	int index = result.indexOf(expectedOutput);
27038 	if (index == -1 || expectedOutput.length() == 0) {
27039 		System.out.println(Util.displayString(result, 3));
27040 	}
27041 	if (index == -1) {
27042 		assertEquals("Wrong contents", expectedOutput, result);
27043 	}
27044 }
27045 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=110570
27046 public void test0826() {
27047 	this.runNegativeTest(
27048 		new String[] {
27049 			"X.java",
27050 			"public class X<T> {\n" +
27051 			"\n" +
27052 			"  public <V1, V2 extends V1> void test(V1 p1, V2 p2) {}\n" +
27053 			"	\n" +
27054 			"  public static void main(String[] args) {\n" +
27055 			"    XA a = new XA(){};\n" +
27056 			"    XB b = new XB(){};\n" +
27057 			"\n" +
27058 			"    X t1 = new X();\n" +
27059 			"    t1.test(a, b); //this gives an error but should be OK\n" +
27060 			"    \n" +
27061 			"    X<Object> t2 = new X<Object>();\n" +
27062 			"    t2.test(a, b); //this compiles OK\n" +
27063 			"    Zork z;\n" +
27064 			"  }\n" +
27065 			"}\n" +
27066 			"\n" +
27067 			"interface XA {}\n" +
27068 			"interface XB extends XA {}\n",
27069 		},
27070 		"----------\n" +
27071 		"1. WARNING in X.java (at line 9)\n" +
27072 		"	X t1 = new X();\n" +
27073 		"	^\n" +
27074 		"X is a raw type. References to generic type X<T> should be parameterized\n" +
27075 		"----------\n" +
27076 		"2. WARNING in X.java (at line 9)\n" +
27077 		"	X t1 = new X();\n" +
27078 		"	           ^\n" +
27079 		"X is a raw type. References to generic type X<T> should be parameterized\n" +
27080 		"----------\n" +
27081 		"3. WARNING in X.java (at line 10)\n" +
27082 		"	t1.test(a, b); //this gives an error but should be OK\n" +
27083 		"	^^^^^^^^^^^^^\n" +
27084 		"Type safety: The method test(Object, Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
27085 		"----------\n" +
27086 		"4. ERROR in X.java (at line 14)\n" +
27087 		"	Zork z;\n" +
27088 		"	^^^^\n" +
27089 		"Zork cannot be resolved to a type\n" +
27090 		"----------\n");
27091 }
27092 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=110570 - variation
27093 // ensure variable V2 is substituted with upper bound erasure (List) and not just upperbound List<String>
27094 // for raw generic method invocation
27095 public void test0827() {
27096 	this.runNegativeTest(
27097 		new String[] {
27098 			"X.java",
27099 			"import java.util.List;\n" +
27100 			"public class X<T> {\n" +
27101 			"  public <V1, V2 extends List<String>> void test(V1 p1, V2 p2) {}\n" +
27102 			"  public static void main(String[] args) {\n" +
27103 			"    XA a = new XA(){};\n" +
27104 			"    List<Object> b = null;\n" +
27105 			"    X t1 = new X();\n" +
27106 			"    t1.test(a, b); //this gives an error but should be OK\n" +
27107 			"    X<Object> t2 = new X<Object>();\n" +
27108 			"    t2.test(a, b); //this compiles OK\n" +
27109 			"  }\n" +
27110 			"}\n" +
27111 			"interface XA {}\n" +
27112 			"\n",
27113 		},
27114 		this.complianceLevel < ClassFileConstants.JDK1_8 ?
27115 		"----------\n" +
27116 		"1. WARNING in X.java (at line 7)\n" +
27117 		"	X t1 = new X();\n" +
27118 		"	^\n" +
27119 		"X is a raw type. References to generic type X<T> should be parameterized\n" +
27120 		"----------\n" +
27121 		"2. WARNING in X.java (at line 7)\n" +
27122 		"	X t1 = new X();\n" +
27123 		"	           ^\n" +
27124 		"X is a raw type. References to generic type X<T> should be parameterized\n" +
27125 		"----------\n" +
27126 		"3. WARNING in X.java (at line 8)\n" +
27127 		"	t1.test(a, b); //this gives an error but should be OK\n" +
27128 		"	^^^^^^^^^^^^^\n" +
27129 		"Type safety: The method test(Object, List) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
27130 		"----------\n" +
27131 		"4. ERROR in X.java (at line 10)\n" +
27132 		"	t2.test(a, b); //this compiles OK\n" +
27133 		"	   ^^^^\n" +
27134 		"Bound mismatch: The generic method test(V1, V2) of type X<T> is not applicable for the arguments (XA, List<Object>). The inferred type List<Object> is not a valid substitute for the bounded parameter <V2 extends List<String>>\n" +
27135 		"----------\n" :
27136 			"----------\n" +
27137 			"1. WARNING in X.java (at line 7)\n" +
27138 			"	X t1 = new X();\n" +
27139 			"	^\n" +
27140 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
27141 			"----------\n" +
27142 			"2. WARNING in X.java (at line 7)\n" +
27143 			"	X t1 = new X();\n" +
27144 			"	           ^\n" +
27145 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
27146 			"----------\n" +
27147 			"3. WARNING in X.java (at line 8)\n" +
27148 			"	t1.test(a, b); //this gives an error but should be OK\n" +
27149 			"	^^^^^^^^^^^^^\n" +
27150 			"Type safety: The method test(Object, List) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
27151 			"----------\n" +
27152 			"4. ERROR in X.java (at line 10)\n" +
27153 			"	t2.test(a, b); //this compiles OK\n" +
27154 			"	   ^^^^\n" +
27155 			"The method test(V1, V2) in the type X<Object> is not applicable for the arguments (XA, List<Object>)\n" +
27156 			"----------\n");
27157 }
27158 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=109249
27159 public void test0828() {
27160 	this.runNegativeTest(
27161 		new String[] {
27162 			"X.java",
27163 			"interface Transformable<T extends Transformable>\n" +
27164 			"{\n" +
27165 			"	public T transform();\n" +
27166 			"}\n" +
27167 			"interface Volume<V extends Volume> extends Transformable<V>\n" +
27168 			"{\n" +
27169 			"//	public V transform();\n" +
27170 			"}\n" +
27171 			"@SuppressWarnings(\"null\")\n" +
27172 			"public class X {\n" +
27173 			"	void foo(){\n" +
27174 			"		Volume v1 = null;\n" +
27175 			"		Volume v2 = v1.transform();\n" +
27176 			"	}\n" +
27177 			"	void bar(){\n" +
27178 			"		Volume<Volume> v1 = null;\n" +
27179 			"		Volume v2 = v1.transform();\n" +
27180 			"	}\n" +
27181 			"}\n",
27182 		},
27183 		"----------\n" +
27184 		"1. WARNING in X.java (at line 1)\n" +
27185 		"	interface Transformable<T extends Transformable>\n" +
27186 		"	                                  ^^^^^^^^^^^^^\n" +
27187 		"Transformable is a raw type. References to generic type Transformable<T> should be parameterized\n" +
27188 		"----------\n" +
27189 		"2. WARNING in X.java (at line 5)\n" +
27190 		"	interface Volume<V extends Volume> extends Transformable<V>\n" +
27191 		"	                           ^^^^^^\n" +
27192 		"Volume is a raw type. References to generic type Volume<V> should be parameterized\n" +
27193 		"----------\n" +
27194 		"3. WARNING in X.java (at line 12)\n" +
27195 		"	Volume v1 = null;\n" +
27196 		"	^^^^^^\n" +
27197 		"Volume is a raw type. References to generic type Volume<V> should be parameterized\n" +
27198 		"----------\n" +
27199 		"4. WARNING in X.java (at line 13)\n" +
27200 		"	Volume v2 = v1.transform();\n" +
27201 		"	^^^^^^\n" +
27202 		"Volume is a raw type. References to generic type Volume<V> should be parameterized\n" +
27203 		"----------\n" +
27204 		"5. ERROR in X.java (at line 13)\n" +
27205 		"	Volume v2 = v1.transform();\n" +
27206 		"	            ^^^^^^^^^^^^^^\n" +
27207 		"Type mismatch: cannot convert from Transformable to Volume\n" +
27208 		"----------\n" +
27209 		"6. WARNING in X.java (at line 16)\n" +
27210 		"	Volume<Volume> v1 = null;\n" +
27211 		"	       ^^^^^^\n" +
27212 		"Volume is a raw type. References to generic type Volume<V> should be parameterized\n" +
27213 		"----------\n" +
27214 		"7. WARNING in X.java (at line 17)\n" +
27215 		"	Volume v2 = v1.transform();\n" +
27216 		"	^^^^^^\n" +
27217 		"Volume is a raw type. References to generic type Volume<V> should be parameterized\n" +
27218 		"----------\n");
27219 }
27220 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=109249 - variation
27221 public void test0829() {
27222 	this.runConformTest(
27223 		new String[] {
27224 			"X.java",
27225 			"interface Transformable<T extends Transformable>\n" +
27226 			"{\n" +
27227 			"	public T transform();\n" +
27228 			"}\n" +
27229 			"interface Volume<V extends Volume> extends Transformable<V>\n" +
27230 			"{\n" +
27231 			"	public V transform();\n" +
27232 			"}\n" +
27233 			"public class X {\n" +
27234 			"	void foo(){\n" +
27235 			"		Volume v1 = null;\n" +
27236 			"		Volume v2 = v1.transform();\n" +
27237 			"	}\n" +
27238 			"	void bar(){\n" +
27239 			"		Volume<Volume> v1 = null;\n" +
27240 			"		Volume v2 = v1.transform();\n" +
27241 			"	}\n" +
27242 			"}\n",
27243 		},
27244 		"");
27245 }
27246 
27247 public void test0830() {
27248 	this.runNegativeTest(
27249 		new String[] {
27250 			"X.java",
27251 			"import java.util.*;\n" +
27252 			"public class X<T> {\n" +
27253 			"	void foo(Object o) {\n" +
27254 			"		boolean b = o instanceof X;\n" +
27255 			"		X x = (X) o;\n" +
27256 			"		X<String> xs = (X<String>)o;\n" +
27257 			"		Zork z;\n" +
27258 			"	}\n" +
27259 			"	void bar(ArrayList<String> al) {\n" +
27260 			"		List l = (List) al;\n" +
27261 			"	}\n" +
27262 			"}\n",
27263 		},
27264 		"----------\n" +
27265 		"1. WARNING in X.java (at line 5)\n" +
27266 		"	X x = (X) o;\n" +
27267 		"	^\n" +
27268 		"X is a raw type. References to generic type X<T> should be parameterized\n" +
27269 		"----------\n" +
27270 		"2. WARNING in X.java (at line 5)\n" +
27271 		"	X x = (X) o;\n" +
27272 		"	       ^\n" +
27273 		"X is a raw type. References to generic type X<T> should be parameterized\n" +
27274 		"----------\n" +
27275 		"3. WARNING in X.java (at line 6)\n" +
27276 		"	X<String> xs = (X<String>)o;\n" +
27277 		"	               ^^^^^^^^^^^^\n" +
27278 		"Type safety: Unchecked cast from Object to X<String>\n" +
27279 		"----------\n" +
27280 		"4. ERROR in X.java (at line 7)\n" +
27281 		"	Zork z;\n" +
27282 		"	^^^^\n" +
27283 		"Zork cannot be resolved to a type\n" +
27284 		"----------\n" +
27285 		"5. WARNING in X.java (at line 10)\n" +
27286 		"	List l = (List) al;\n" +
27287 		"	^^^^\n" +
27288 		"List is a raw type. References to generic type List<E> should be parameterized\n" +
27289 		"----------\n" +
27290 		"6. WARNING in X.java (at line 10)\n" +
27291 		"	List l = (List) al;\n" +
27292 		"	         ^^^^^^^^^\n" +
27293 		"Unnecessary cast from ArrayList<String> to List\n" +
27294 		"----------\n" +
27295 		"7. WARNING in X.java (at line 10)\n" +
27296 		"	List l = (List) al;\n" +
27297 		"	          ^^^^\n" +
27298 		"List is a raw type. References to generic type List<E> should be parameterized\n" +
27299 		"----------\n");
27300 }
27301 //unnecessary cast may be combined with unchecked cast warning
27302 public void test0831() {
27303 	this.runNegativeTest(
27304 		new String[] {
27305 			"X.java",
27306 			"import java.util.*;\n" +
27307 			"public class X {\n" +
27308 			"	void foo(Object o1) {\n" +
27309 			"		Object o2 = (List<String>) o1;\n" +
27310 			"		\n" +
27311 			"		foo((List<String>)o2);\n" +
27312 			"	}\n" +
27313 			"	Zork z;\n" +
27314 			"}\n",
27315 		},
27316 		"----------\n" +
27317 		"1. WARNING in X.java (at line 4)\n" +
27318 		"	Object o2 = (List<String>) o1;\n" +
27319 		"	            ^^^^^^^^^^^^^^^^^\n" +
27320 		"Type safety: Unchecked cast from Object to List<String>\n" +
27321 		"----------\n" +
27322 		"2. WARNING in X.java (at line 4)\n" +
27323 		"	Object o2 = (List<String>) o1;\n" +
27324 		"	            ^^^^^^^^^^^^^^^^^\n" +
27325 		"Unnecessary cast from Object to List<String>\n" +
27326 		"----------\n" +
27327 		"3. WARNING in X.java (at line 6)\n" +
27328 		"	foo((List<String>)o2);\n" +
27329 		"	    ^^^^^^^^^^^^^^^^\n" +
27330 		"Type safety: Unchecked cast from Object to List<String>\n" +
27331 		"----------\n" +
27332 		"4. WARNING in X.java (at line 6)\n" +
27333 		"	foo((List<String>)o2);\n" +
27334 		"	    ^^^^^^^^^^^^^^^^\n" +
27335 		"Unnecessary cast from Object to List<String>\n" +
27336 		"----------\n" +
27337 		"5. ERROR in X.java (at line 8)\n" +
27338 		"	Zork z;\n" +
27339 		"	^^^^\n" +
27340 		"Zork cannot be resolved to a type\n" +
27341 		"----------\n");
27342 }
27343 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=106010
27344 public void test0832() {
27345 	this.runNegativeTest(
27346 		new String[] {
27347 			"X.java",
27348 			"class C1<T> {\n" +
27349 			"	class C11 {	}\n" +
27350 			"	class C12 {\n" +
27351 			"		T t;\n" +
27352 			"		C1<T>.C11[] m() {\n" +
27353 			"			C1<T>.C11[] ts = (C1<T>.C11[]) new C1<?>.C11[5];\n" +
27354 			"			return ts;\n" +
27355 			"		}\n" +
27356 			"	}\n" +
27357 			"	Zork z;\n" +
27358 			"}\n",
27359 		},
27360 		"----------\n" +
27361 		"1. WARNING in X.java (at line 6)\n" +
27362 		"	C1<T>.C11[] ts = (C1<T>.C11[]) new C1<?>.C11[5];\n" +
27363 		"	                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
27364 		"Type safety: Unchecked cast from C1<?>.C11[] to C1<T>.C11[]\n" +
27365 		"----------\n" +
27366 		"2. ERROR in X.java (at line 10)\n" +
27367 		"	Zork z;\n" +
27368 		"	^^^^\n" +
27369 		"Zork cannot be resolved to a type\n" +
27370 		"----------\n");
27371 }
27372 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=111014
27373 public void test0833() {
27374 	this.runConformTest(
27375 		new String[] {
27376 			"A.java",
27377 			"class A<T1> {}\n",
27378 			"B.java",
27379 			"class B<T2> extends A<B<T2>.Inner> { class Inner {} }\n",
27380 			"C.java",
27381 			"class C { B<Integer> b; }\n",
27382 		},
27383 		"");
27384 	this.runConformTest(
27385 		new String[] {
27386 			"C.java",
27387 			"class C { B<Integer> b; }\n",
27388 		},
27389 		"",
27390 		null,
27391 		false,
27392 		null);
27393 }
27394 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=100809
27395 public void test0834() {
27396 	this.runNegativeTest(
27397 		new String[] {
27398 			"X.java",
27399 			"import java.util.*;\n" +
27400 			"public class X {\n" +
27401 			"    public static void main(String[] args) {\n" +
27402 			"        Set<Integer> set = new HashSet<Integer>();\n" +
27403 			"        set.add(42);\n" +
27404 			"        Collection<Number> collection;\n" +
27405 			"        collection = (Collection) set;\n" +
27406 			"        System.out.println(collection.iterator().next());\n" +
27407 			"        Zork z;\n" +
27408 			"    }\n" +
27409 			"}\n",
27410 		},
27411 		"----------\n" +
27412 		"1. WARNING in X.java (at line 7)\n" +
27413 		"	collection = (Collection) set;\n" +
27414 		"	             ^^^^^^^^^^^^^^^^\n" +
27415 		"Type safety: The expression of type Collection needs unchecked conversion to conform to Collection<Number>\n" +
27416 		"----------\n" +
27417 		"2. WARNING in X.java (at line 7)\n" +
27418 		"	collection = (Collection) set;\n" +
27419 		"	              ^^^^^^^^^^\n" +
27420 		"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
27421 		"----------\n" +
27422 		"3. ERROR in X.java (at line 9)\n" +
27423 		"	Zork z;\n" +
27424 		"	^^^^\n" +
27425 		"Zork cannot be resolved to a type\n" +
27426 		"----------\n");
27427 }
27428 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=100809 - variation
27429 public void test0835() {
27430 	this.runNegativeTest(
27431 		new String[] {
27432 			"X.java",
27433 			"import java.util.*;\n" +
27434 			"public class X {\n" +
27435 			"	void foo(List<String> ls) {\n" +
27436 			"		ArrayList<?> als = (ArrayList) ls;\n" +
27437 			"	}\n" +
27438 			"	Zork z;\n" +
27439 			"}\n",
27440 		},
27441 		"----------\n" +
27442 		"1. WARNING in X.java (at line 4)\n" +
27443 		"	ArrayList<?> als = (ArrayList) ls;\n" +
27444 		"	                    ^^^^^^^^^\n" +
27445 		"ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
27446 		"----------\n" +
27447 		"2. ERROR in X.java (at line 6)\n" +
27448 		"	Zork z;\n" +
27449 		"	^^^^\n" +
27450 		"Zork cannot be resolved to a type\n" +
27451 		"----------\n");
27452 }
27453 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=111208
27454 public void test0836() {
27455 	this.runConformTest(
27456 		new String[] {
27457 			"X.java",
27458 			" import java.util.Iterator;\n" +
27459 			" import java.util.List;\n" +
27460 			"\n" +
27461 			" public class X<A> {\n" +
27462 			"\n" +
27463 			" interface Factory<T> {\n" +
27464 			" T invoke();\n" +
27465 			"	}\n" +
27466 			"\n" +
27467 			"	public static <E> Iterator<E> iterate(Iterable<E> iterable) {\n" +
27468 			"		return iterable.iterator();\n" +
27469 			"	}\n" +
27470 			"\n" +
27471 			"	public Factory<Iterator<? extends A>> factory(final Factory<? extends List<? extends A>> factory) {\n" +
27472 			"		return new Factory<Iterator<? extends A>>() {\n" +
27473 			"			public Iterator<? extends A> invoke() {\n" +
27474 			"				//String s = iterate(factory.invoke());\n" +
27475 			"				return iterate(factory.invoke());\n" +
27476 			"			}\n" +
27477 			"		};\n" +
27478 			"	}\n" +
27479 			"}\n",
27480 		},
27481 		"");
27482 }
27483 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=111208 - variation
27484 public void test0837() {
27485 	this.runNegativeTest(
27486 		new String[] {
27487 			"X.java",
27488 			"import java.util.*;\n" +
27489 			"\n" +
27490 			"public class X {\n" +
27491 			"	public void foo(List<? extends List<? extends Number>> l) {\n" +
27492 			"		bar(l.get(0));\n" +
27493 			"		swap(l.get(0));\n" +
27494 			"	}\n" +
27495 			"	void bar(String s) {}\n" +
27496 			"	private static <T> void swap(List<T> l) {\n" +
27497 			"	}\n" +
27498 			"}\n",
27499 		},
27500 		"----------\n" +
27501 		"1. ERROR in X.java (at line 5)\n" +
27502 		"	bar(l.get(0));\n" +
27503 		"	^^^\n" +
27504 		"The method bar(String) in the type X is not applicable for the arguments (capture#1-of ? extends List<? extends Number>)\n" +
27505 		"----------\n");
27506 }
27507 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=111689
27508 public void test0838() {
27509 	this.runConformTest(
27510 		new String[] {
27511 			"X.java",
27512 			"public class X {\n" +
27513 			"	public class CClass<T extends AClass.BClass<T>> {\n" +
27514 			"	}\n" +
27515 			"}\n",
27516 			"AClass.java",
27517 			"public interface AClass<X extends AClass> {\n" +
27518 			"	public interface BClass<T extends BClass> extends AClass<T> {\n" +
27519 			"	}\n" +
27520 			"}\n",
27521 		},
27522 		"");
27523 }
27524 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=109118
27525 public void test0839() {
27526 	this.runConformTest(
27527 		new String[] {
27528 			"com/test/Tester.java",
27529 			"package com.test;\n" +
27530 			"\n" +
27531 			"import com.test.TestClass.MyException;\n" +
27532 			"\n" +
27533 			"public class Tester {\n" +
27534 			"\n" +
27535 			"	public static void main(String[] args) {\n" +
27536 			"		try {\n" +
27537 			"			TestClass<String> test = new TestClass<String>();\n" +
27538 			"		} catch (MyException e) {\n" +
27539 			"			System.out.println(\"SUCCESS\");\n" +
27540 			"		}\n" +
27541 			"	}\n" +
27542 			"}",
27543 			"com/test/TestClass.java",
27544 			"package com.test;\n" +
27545 			"\n" +
27546 			"public class TestClass<T> {\n" +
27547 			"	\n" +
27548 			"	public TestClass() throws MyException {\n" +
27549 			"		throw new MyException();\n" +
27550 			"	}\n" +
27551 			"\n" +
27552 			"	public static class MyException extends Exception {\n" +
27553 			"		\n" +
27554 			"		public MyException() {\n" +
27555 			"			super();\n" +
27556 			"		}\n" +
27557 			"	}\n" +
27558 			"}"
27559 		},
27560 		"SUCCESS");
27561 }
27562 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=109118
27563 public void test0840() {
27564 	this.runNegativeTest(
27565 		new String[] {
27566 			"generics/NodeList.java",
27567 			"package generics;\n" +
27568 			"public class NodeList<E> {\n" +
27569 			"    public class Cursor { }\n" +
27570 			"}",
27571 			"generics/user/User.java",
27572 			"package generics.user;\n" +
27573 			"import generics.NodeList;\n" +
27574 			"import generics.NodeList.Cursor;\n" +
27575 			"public class User {\n" +
27576 			"    Cursor raw;\n" +
27577 			"    NodeList.Cursor rawQualified;\n" +
27578 			"    NodeList<String>.Cursor parameterized;\n" +
27579 			"\n" +
27580 			"    void foo() {\n" +
27581 			"        parameterized= rawQualified; //unchecked warning (OK)\n" +
27582 			"        rawQualified= parameterized;\n" +
27583 			"\n" +
27584 			"        parameterized= raw; //should just give unchecked warning, but errors\n" +
27585 			"        raw= parameterized; //should not error\n" +
27586 			"\n" +
27587 			"        raw= rawQualified; //should not error\n" +
27588 			"        rawQualified= raw;\n" +
27589 			"    }\n" +
27590 			"    Zork z;\n" +
27591 			"}",
27592 		},
27593 		"----------\n" +
27594 		"1. WARNING in generics\\user\\User.java (at line 5)\n" +
27595 		"	Cursor raw;\n" +
27596 		"	^^^^^^\n" +
27597 		"NodeList.Cursor is a raw type. References to generic type NodeList<E>.Cursor should be parameterized\n" +
27598 		"----------\n" +
27599 		"2. WARNING in generics\\user\\User.java (at line 6)\n" +
27600 		"	NodeList.Cursor rawQualified;\n" +
27601 		"	^^^^^^^^^^^^^^^\n" +
27602 		"NodeList.Cursor is a raw type. References to generic type NodeList<E>.Cursor should be parameterized\n" +
27603 		"----------\n" +
27604 		"3. WARNING in generics\\user\\User.java (at line 10)\n" +
27605 		"	parameterized= rawQualified; //unchecked warning (OK)\n" +
27606 		"	               ^^^^^^^^^^^^\n" +
27607 		"Type safety: The expression of type NodeList.Cursor needs unchecked conversion to conform to NodeList<String>.Cursor\n" +
27608 		"----------\n" +
27609 		"4. WARNING in generics\\user\\User.java (at line 13)\n" +
27610 		"	parameterized= raw; //should just give unchecked warning, but errors\n" +
27611 		"	               ^^^\n" +
27612 		"Type safety: The expression of type NodeList.Cursor needs unchecked conversion to conform to NodeList<String>.Cursor\n" +
27613 		"----------\n" +
27614 		"5. ERROR in generics\\user\\User.java (at line 19)\n" +
27615 		"	Zork z;\n" +
27616 		"	^^^^\n" +
27617 		"Zork cannot be resolved to a type\n" +
27618 		"----------\n");
27619 }
27620 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=112268
27621 public void test0841() {
27622 	this.runConformTest(
27623 		new String[] {
27624 			"X.java", // =================
27625 			"import java.util.*;\n" +
27626 			"\n" +
27627 			"public class X {\n" +
27628 			"  List<? extends Comparator> bar() {\n" +
27629 			"	  List<? extends Comparator> l = foo();\n" +
27630 			"	  return foo();\n" +
27631 			"  }\n" +
27632 			"  <T> List<T> foo() {\n" +
27633 			"	  return null;\n" +
27634 			"  }\n" +
27635 			"}\n",
27636 		},
27637 		"");
27638 }
27639 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=112500
27640 public void test0842() {
27641 	String expectedError = isJRE11Plus ? intersection("Object","Serializable","Comparable<?>", "CharSequence") :
27642 		intersection("Object","Serializable","CharSequence");
27643 	this.runNegativeTest(
27644 		new String[] {
27645 			"X.java", // =================
27646 			"import java.util.List;\n" +
27647 			"\n" +
27648 			"public class X {\n" +
27649 			"	static <T> List<T> merge(List<? extends T> a, List<? extends T> b) {\n" +
27650 			"		return null;\n" +
27651 			"	}\n" +
27652 			"\n" +
27653 			"	public static void main(String[] args) {\n" +
27654 			"		List<String> list1 = null;\n" +
27655 			"		List<StringBuilder> list2 = null;\n" +
27656 			"		List<? extends CharSequence> result = merge(list1, list2);\n" +
27657 			"		List<? extends String> result2 = merge(list1, list2);\n" +
27658 			"	}\n" +
27659 			"}\n",
27660 		},
27661 		"----------\n" +
27662 		"1. ERROR in X.java (at line 12)\n" +
27663 		"	List<? extends String> result2 = merge(list1, list2);\n" +
27664 		"	                                 ^^^^^^^^^^^^^^^^^^^\n" +
27665 		"Type mismatch: cannot convert from List<" + expectedError + "> to List<? extends String>\n" +
27666 		"----------\n");
27667 }
27668 public void test0843() {
27669 	String expectedError = isJRE11Plus ? intersection("Object","Serializable","Comparable<?>", "CharSequence") :
27670 		intersection("Object","Serializable","CharSequence");
27671 	this.runNegativeTest(
27672 		new String[] {
27673 			"X.java", // =================
27674 			"import java.util.List;\n" +
27675 			"\n" +
27676 			"public class X {\n" +
27677 			"	static <T> List<T> merge(List<? extends T> a, List<? extends T> b) {\n" +
27678 			"		return null;\n" +
27679 			"	}\n" +
27680 			"\n" +
27681 			"	public static void main(String[] args) {\n" +
27682 			"		List<String> list1 = null;\n" +
27683 			"		List<StringBuilder> list2 = null;\n" +
27684 			"		Object result3 = (List<? extends CharSequence>)merge(list1, list2);\n" +
27685 			"		Object result4 = (List<? extends String>)merge(list1, list2);\n" +
27686 			"	}\n" +
27687 			"}\n",
27688 		},
27689 		"----------\n" +
27690 		"1. WARNING in X.java (at line 11)\n" +
27691 		"	Object result3 = (List<? extends CharSequence>)merge(list1, list2);\n" +
27692 		"	                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
27693 		"Unnecessary cast from List<" + expectedError + "> to List<? extends CharSequence>\n" +
27694 		"----------\n" +
27695 		"2. ERROR in X.java (at line 12)\n" +
27696 		"	Object result4 = (List<? extends String>)merge(list1, list2);\n" +
27697 		"	                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
27698 		"Cannot cast from List<" + expectedError + "> to List<? extends String>\n" +
27699 		"----------\n" +
27700 		"3. WARNING in X.java (at line 12)\n" +
27701 		"	Object result4 = (List<? extends String>)merge(list1, list2);\n" +
27702 		"	                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
27703 		"Unnecessary cast from List<" + expectedError + "> to List<? extends String>\n" +
27704 		"----------\n");
27705 }
27706 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=112595
27707 public void test0844() {
27708 	this.runConformTest(
27709 		new String[] {
27710 			"X.java", // =================
27711 			"import java.util.*;\n" +
27712 			"public class X {\n" +
27713 			"    public Set< ? extends X> getModifiers()\n" +
27714 			"    {\n" +
27715 			"        return Collections.emptySet();\n" +
27716 			"    }\n" +
27717 			"}\n",
27718 		},
27719 		"");
27720 }
27721 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=112595
27722 public void test0845() {
27723 	this.runConformTest(
27724 		new String[] {
27725 			"Generic.java", // =================
27726 			"public class Generic<T> {\n" +
27727 			"	public int size() {\n" +
27728 			"		return 0;\n" +
27729 			"	}\n" +
27730 			"	public static void main(String[] args) {\n" +
27731 			"		System.out.println(\"SUCCESS\");\n" +
27732 			"	}\n" +
27733 			"}", // =================
27734 		},
27735 		"SUCCESS");
27736 	this.runNegativeTest(
27737 			new String[] {
27738 				"X.java", // =================
27739 				"import java.util.ArrayList;\n" +
27740 				"\n" +
27741 				"public class X {\n" +
27742 				"	public void testList(ArrayList aList) {\n" +
27743 				"		aList.size();\n" +
27744 				"	}\n" +
27745 				"	public void testGeneric(Generic aGeneric) {\n" +
27746 				"		aGeneric.size();\n" +
27747 				"	}\n" +
27748 				"	Zork z;\n" +
27749 				"}\n", // =================
27750 			},
27751 			"----------\n" +
27752 			"1. WARNING in X.java (at line 4)\n" +
27753 			"	public void testList(ArrayList aList) {\n" +
27754 			"	                     ^^^^^^^^^\n" +
27755 			"ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
27756 			"----------\n" +
27757 			"2. ERROR in X.java (at line 7)\n" +
27758 			"	public void testGeneric(Generic aGeneric) {\n" +
27759 			"	                        ^^^^^^^\n" +
27760 			"Generic cannot be resolved to a type\n" +
27761 			"----------\n" +
27762 			"3. ERROR in X.java (at line 10)\n" +
27763 			"	Zork z;\n" +
27764 			"	^^^^\n" +
27765 			"Zork cannot be resolved to a type\n" +
27766 			"----------\n");
27767 	}
27768 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=112666
27769 public void test0846() {
27770 	this.runConformTest(
27771 		new String[] {
27772 			"X.java", // =================
27773 			"import java.util.Collection;\n" +
27774 			"public class X {\n" +
27775 			"	void m() {\n" +
27776 			"		Collection<? super Collection<? super Number>> col = null;\n" +
27777 			"		java.util.List<java.lang.Number> n = null;\n" +
27778 			"		col.add(n);\n" +
27779 			"	}\n" +
27780 			"}\n", // =================
27781 		},
27782 		"");
27783 }
27784 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=112666
27785 public void test0847() {
27786 	this.runNegativeTest(
27787 		new String[] {
27788 			"X.java", // =================
27789 			"import java.util.Collection;\n" +
27790 			"\n" +
27791 			"public class X {\n" +
27792 			"	void m() {\n" +
27793 			"		Collection<? extends Collection<? super Number>> col = null;\n" +
27794 			"		java.util.List<java.lang.Number> n = null;\n" +
27795 			"		col.add(n);\n" +
27796 			"	}\n" +
27797 			"}\n", // =================
27798 		},
27799 		"----------\n" +
27800 		"1. ERROR in X.java (at line 7)\n" +
27801 		"	col.add(n);\n" +
27802 		"	    ^^^\n" +
27803 		"The method add(capture#1-of ? extends Collection<? super Number>) in the type Collection<capture#1-of ? extends Collection<? super Number>> is not applicable for the arguments (List<Number>)\n" +
27804 		"----------\n");
27805 }
27806 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=106451
27807 public void test0848() throws Exception {
27808 	this.runNegativeTest(
27809 			new String[] {
27810 				"X.java", // =================
27811 				"import java.util.*;\n" +
27812 				"\n" +
27813 				"public class X<E> {\n" +
27814 				"	public static <T> List<T> asList(T a) { return null; }\n" +
27815 				"	Collection<? extends Number> asList= asList(1);\n" +
27816 				"	List<Number> nums= (List<Number>) asList; // correct warning\n" +
27817 				"	List<Number> numz= (LinkedList<Number>) asList; // type safety warning missing\n" +
27818 				"	Zork z;\n" +
27819 				"}\n", // =================
27820 			},
27821 			"----------\n" +
27822 			"1. WARNING in X.java (at line 6)\n" +
27823 			"	List<Number> nums= (List<Number>) asList; // correct warning\n" +
27824 			"	                   ^^^^^^^^^^^^^^^^^^^^^\n" +
27825 			"Type safety: Unchecked cast from Collection<capture#1-of ? extends Number> to List<Number>\n" +
27826 			"----------\n" +
27827 			"2. WARNING in X.java (at line 7)\n" +
27828 			"	List<Number> numz= (LinkedList<Number>) asList; // type safety warning missing\n" +
27829 			"	                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
27830 			"Type safety: Unchecked cast from Collection<capture#2-of ? extends Number> to LinkedList<Number>\n" +
27831 			"----------\n" +
27832 			"3. ERROR in X.java (at line 8)\n" +
27833 			"	Zork z;\n" +
27834 			"	^^^^\n" +
27835 			"Zork cannot be resolved to a type\n" +
27836 			"----------\n");
27837 
27838 		this.runConformTest(
27839 				new String[] {
27840 					"X.java", // =================
27841 					"import java.util.*;\n" +
27842 					"\n" +
27843 					"public class X<E> {\n" +
27844 					"	Collection<? extends Number> asList= Arrays.asList(1, 2.2);\n" +
27845 					"	List<Number> nums= (List<Number>) asList; // correct warning\n" +
27846 					"	List<Number> numz= (LinkedList<Number>) asList; // type safety warning missing\n" +
27847 					"}\n", // =================
27848 				},
27849 				"");
27850 		// 	ensure presence of: "checkcast java.util.LinkedList" before putfield X.numz
27851 		String expectedOutput =
27852 		"  // Method descriptor #14 ()V\n" +
27853 		"  // Stack: 6, Locals: 1\n" +
27854 		"  public X();\n" +
27855 		"     0  aload_0 [this]\n" +
27856 		"     1  invokespecial java.lang.Object() [16]\n" +
27857 		"     4  aload_0 [this]\n" +
27858 		"     5  iconst_2\n" +
27859 		"     6  anewarray java.lang.Number [18]\n" +
27860 		"     9  dup\n" +
27861 		"    10  iconst_0\n" +
27862 		"    11  iconst_1\n" +
27863 		"    12  invokestatic java.lang.Integer.valueOf(int) : java.lang.Integer [20]\n" +
27864 		"    15  aastore\n" +
27865 		"    16  dup\n" +
27866 		"    17  iconst_1\n" +
27867 		"    18  ldc2_w <Double 2.2> [26]\n" +
27868 		"    21  invokestatic java.lang.Double.valueOf(double) : java.lang.Double [28]\n" +
27869 		"    24  aastore\n" +
27870 		"    25  invokestatic java.util.Arrays.asList(java.lang.Object[]) : java.util.List [33]\n" +
27871 		"    28  putfield X.asList : java.util.Collection [38]\n" +
27872 		"    31  aload_0 [this]\n" +
27873 		"    32  aload_0 [this]\n" +
27874 		"    33  getfield X.asList : java.util.Collection [38]\n" +
27875 		"    36  checkcast java.util.List [40]\n" +
27876 		"    39  putfield X.nums : java.util.List [42]\n" +
27877 		"    42  aload_0 [this]\n" +
27878 		"    43  aload_0 [this]\n" +
27879 		"    44  getfield X.asList : java.util.Collection [38]\n" +
27880 		"    47  checkcast java.util.LinkedList [44]\n" +
27881 		"    50  putfield X.numz : java.util.List [46]\n" +
27882 		"    53  return\n";
27883 
27884 		File f = new File(OUTPUT_DIR + File.separator + "X.class");
27885 		byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
27886 		ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
27887 		String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
27888 		int index = result.indexOf(expectedOutput);
27889 		if (index == -1 || expectedOutput.length() == 0) {
27890 			System.out.println(Util.displayString(result, 3));
27891 		}
27892 		if (index == -1) {
27893 			assertEquals("Wrong contents", expectedOutput, result);
27894 		}
27895 }
27896 //ensure no unsafe cast is diagnosed
27897 public void test0849() {
27898 	this.runNegativeTest(
27899 		new String[] {
27900 			"X.java", // =================
27901 			"public class X {\n" +
27902 			"    static <T, U extends T> T[] cast(U[] a) { return (T[]) a; }\n" +
27903 			"    Zork z;\n" +
27904 			"}\n", // =================
27905 		},
27906 		"----------\n" +
27907 		"1. WARNING in X.java (at line 2)\n" +
27908 		"	static <T, U extends T> T[] cast(U[] a) { return (T[]) a; }\n" +
27909 		"	                                                 ^^^^^^^\n" +
27910 		"Unnecessary cast from U[] to T[]\n" +
27911 		"----------\n" +
27912 		"2. ERROR in X.java (at line 3)\n" +
27913 		"	Zork z;\n" +
27914 		"	^^^^\n" +
27915 		"Zork cannot be resolved to a type\n" +
27916 		"----------\n");
27917 }
27918 public void test0850() {
27919 	this.runNegativeTest(
27920 		new String[] {
27921 			"X.java", // =================
27922 			"public class X {\n" +
27923 			"    <T> T f(Object o) {\n" +
27924 			"	return (T) o; // OK\n" +
27925 			"    }\n" +
27926 			"\n" +
27927 			"    <U, T extends U> T g(Object o) {\n" +
27928 			"	return (T) o; // bug???\n" +
27929 			"    }\n" +
27930 			"\n" +
27931 			"    <U, T extends U> T h(Object o) {\n" +
27932 			"	return X.<T>castTo(o); // workaround\n" +
27933 			"    }\n" +
27934 			"\n" +
27935 			"    private static <T> T castTo(Object o) {\n" +
27936 			"	return (T) o;\n" +
27937 			"    }\n" +
27938 			"    Zork z;\n" +
27939 			"}\n", // =================
27940 		},
27941 		"----------\n" +
27942 		"1. WARNING in X.java (at line 3)\n" +
27943 		"	return (T) o; // OK\n" +
27944 		"	       ^^^^^\n" +
27945 		"Type safety: Unchecked cast from Object to T\n" +
27946 		"----------\n" +
27947 		"2. WARNING in X.java (at line 7)\n" +
27948 		"	return (T) o; // bug???\n" +
27949 		"	       ^^^^^\n" +
27950 		"Type safety: Unchecked cast from Object to T\n" +
27951 		"----------\n" +
27952 		"3. WARNING in X.java (at line 15)\n" +
27953 		"	return (T) o;\n" +
27954 		"	       ^^^^^\n" +
27955 		"Type safety: Unchecked cast from Object to T\n" +
27956 		"----------\n" +
27957 		"4. ERROR in X.java (at line 17)\n" +
27958 		"	Zork z;\n" +
27959 		"	^^^^\n" +
27960 		"Zork cannot be resolved to a type\n" +
27961 		"----------\n");
27962 }
27963 public void test0851() {
27964 	this.runNegativeTest(
27965 		new String[] {
27966 			"X.java", // =================
27967 			"interface Foo {}\n" +
27968 			"interface Bar<T> {}\n" +
27969 			"public class X {\n" +
27970 			"    Object m(Foo f) {\n" +
27971 			"        return (Bar<Object>)f;\n" +
27972 			"    }\n" +
27973 			"    Zork z;\n" +
27974 			"}\n", // =================
27975 		},
27976 		"----------\n" +
27977 		"1. WARNING in X.java (at line 5)\n" +
27978 		"	return (Bar<Object>)f;\n" +
27979 		"	       ^^^^^^^^^^^^^^\n" +
27980 		"Type safety: Unchecked cast from Foo to Bar<Object>\n" +
27981 		"----------\n" +
27982 		"2. WARNING in X.java (at line 5)\n" +
27983 		"	return (Bar<Object>)f;\n" +
27984 		"	       ^^^^^^^^^^^^^^\n" +
27985 		"Unnecessary cast from Foo to Bar<Object>\n" +
27986 		"----------\n" +
27987 		"3. ERROR in X.java (at line 7)\n" +
27988 		"	Zork z;\n" +
27989 		"	^^^^\n" +
27990 		"Zork cannot be resolved to a type\n" +
27991 		"----------\n");
27992 }
27993 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=106466
27994 public void test0852() {
27995 	this.runNegativeTest(
27996 		new String[] {
27997 			"X.java", // =================
27998 			"public class X {\n" +
27999 			"	<T extends Runnable, U extends T & Runnable>  T foo() { return null; }\n" +
28000 			"}\n", // =================
28001 		},
28002 		"----------\n" +
28003 		"1. ERROR in X.java (at line 2)\n" +
28004 		"	<T extends Runnable, U extends T & Runnable>  T foo() { return null; }\n" +
28005 		"	                                   ^^^^^^^^\n" +
28006 		"Cannot specify any additional bound Runnable when first bound is a type parameter\n" +
28007 		"----------\n");
28008 }
28009 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=112109
28010 public void test0853() {
28011 	this.runConformTest(
28012 		new String[] {
28013 			"X.java",
28014 			"public class X<C extends I> {\n" +
28015 			"	void test(java.util.List<C> list) { list.get(0).notify(null); }\n" +
28016 			"}\n" +
28017 			"interface I { Object notify(Object o); }",
28018 		},
28019 		"");
28020 }
28021 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=113236
28022 public void test0854() {
28023 	runConformTest(
28024 		// test directory preparation
28025 		true /* flush output directory */,
28026 		new String[] { /* test files */
28027 			"X.java",
28028 			"public class X {\n" +
28029 			"	public static void main(String[] args) {\n" +
28030 			"		Field field = new Field();\n" +
28031 			"		Form form = new Form(field);\n" +
28032 			"		String result = form.getField().toString();\n" +
28033 			"		System.out.print(result);\n" +
28034 			"	}\n" +
28035 			"}",
28036 			"Form.java",
28037 			"public class Form {\n" +
28038 			"	private final Field field;\n" +
28039 			"	public Form(Field field) {\n" +
28040 			"		this.field = field;\n" +
28041 			"	}\n" +
28042 			"	public <T extends Field> T getField() {\n" +
28043 			"		return (T) field;\n" +
28044 			"	}\n" +
28045 			"}",
28046 			"Field.java",
28047 			"public class Field {\n" +
28048 			"	@Override\n" +
28049 			"	public String toString() {\n" +
28050 			"		return \"SUCCESS\";\n" +
28051 			"	}\n" +
28052 			"}",
28053 		},
28054 		// compiler results
28055 		null /* do not check compiler log */,
28056 		// runtime results
28057 		"SUCCESS" /* expected output string */,
28058 		"" /* expected error string */,
28059 		// javac options
28060 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
28061 }
28062 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=113218
28063 public void test0855() {
28064 	runConformTest(
28065 		// test directory preparation
28066 		true /* flush output directory */,
28067 		new String[] { /* test files */
28068 			"X.java",
28069 			"public class X {\n" +
28070 			"	public static void main(String[] args) {\n" +
28071 			"		FieldManager manager = new FieldManagerImpl();\n" +
28072 			"		FieldMeta<FieldImpl> meta = new FieldMeta<FieldImpl>(manager);\n" +
28073 			"		Field<? extends Field> field = new FieldImpl(meta);\n" +
28074 			"		FieldMeta<? extends Field> meta2 = field.getFieldMeta();\n" +
28075 			"		System.out.print(meta2.getFieldManager() instanceof ExtFieldManager);\n" +
28076 			"	}\n" +
28077 			"}",
28078 			"FieldMeta.java",
28079 			"public class FieldMeta<F extends Field> {\n" +
28080 			"	private final FieldManager<F> fieldManager;\n" +
28081 			"	public FieldMeta(FieldManager<F> fieldManager) {\n" +
28082 			"		this.fieldManager = fieldManager;\n" +
28083 			"	}\n" +
28084 			"	public <FB extends FieldManager<F>> FB getFieldManager() {\n" +
28085 			"		return (FB) fieldManager;\n" +
28086 			"	}\n" +
28087 			"}",
28088 			"FieldManagerImpl.java",
28089 			"public class FieldManagerImpl extends FieldManager<FieldImpl> implements\n" +
28090 			"	ExtFieldManager<FieldImpl> {\n" +
28091 			"}",
28092 			"FieldManager.java",
28093 			"public abstract class FieldManager<F extends Field> {}",
28094 			"FieldImpl.java",
28095 			"public class FieldImpl extends Field<FieldImpl> {\n" +
28096 			"	public FieldImpl(FieldMeta<FieldImpl> fieldMeta) {\n" +
28097 			"		super(fieldMeta);\n" +
28098 			"	}\n" +
28099 			"}",
28100 			"Field.java",
28101 			"public class Field<F extends Field> {\n" +
28102 			"	private final FieldManager<F> fieldManager;\n" +
28103 			"	private final FieldMeta<F> fieldMeta;\n" +
28104 			"	public FieldMeta<F> getFieldMeta() {\n" +
28105 			"		return fieldMeta;\n" +
28106 			"	}\n" +
28107 			"	public Field(FieldMeta<F> fieldMeta) {\n" +
28108 			"		this.fieldMeta = fieldMeta;\n" +
28109 			"		this.fieldManager = fieldMeta.getFieldManager();\n" +
28110 			"	}\n" +
28111 			"	public FieldManager<F> getFieldManager() {\n" +
28112 			"		return fieldManager;\n" +
28113 			"	}\n" +
28114 			"}",
28115 			"ExtFieldManager.java",
28116 			"public interface ExtFieldManager<F extends Field> {}"
28117 		},
28118 		// compiler results
28119 		null /* do not check compiler log */,
28120 		// runtime results
28121 		"true" /* expected output string */,
28122 		"" /* expected error string */,
28123 		// javac options
28124 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
28125 }
28126 public void test0856() {
28127 	runConformTest(
28128 		// test directory preparation
28129 		true /* flush output directory */,
28130 		new String[] { /* test files */
28131 			"X.java",
28132 			"public class X {\n" +
28133 			"	static class MX<T> {\n" +
28134 			"		T t = null;\n" +
28135 			"	}\n" +
28136 			"	static <T> T getT() {\n" +
28137 			"		return (new MX<T>()).t;\n" +
28138 			"	}\n" +
28139 			"	public static void test() {\n" +
28140 			"		getT().getClass(); // error: java.lang.Object cannot be dereferenced\n" +
28141 			"	}\n" +
28142 			"\n" +
28143 			"	public static void main(String[] args) {\n" +
28144 			"		System.out.println(\"SUCCESS\");\n" +
28145 			"	}\n" +
28146 			"}\n",
28147 		},
28148 		// compiler results
28149 		"" /* expected compiler log */,
28150 		// runtime results
28151 		"SUCCESS" /* expected output string */,
28152 		"" /* expected error string */,
28153 		// javac options
28154 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
28155 }
28156 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=113070
28157 public void test0857() {
28158 	this.runNegativeTest(
28159 		new String[] {
28160 			"X.java",
28161 			"public class X {\n" +
28162 			"	public <U, T extends U & Cloneable & Runnable> void m(T t) {\n" +
28163 			"	}\n" +
28164 			"}\n",
28165 		},
28166 		"----------\n" +
28167 		"1. ERROR in X.java (at line 2)\n" +
28168 		"	public <U, T extends U & Cloneable & Runnable> void m(T t) {\n" +
28169 		"	                         ^^^^^^^^^\n" +
28170 		"Cannot specify any additional bound Cloneable when first bound is a type parameter\n" +
28171 		"----------\n");
28172 }
28173 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=113560
28174 public void test0858() {
28175 	this.runConformTest(
28176 		new String[] {
28177 			"X.java",
28178 			"interface ExtCloneable extends Cloneable {\n" +
28179 			"	public ExtCloneable clone( String arg) throws CloneNotSupportedException;\n" +
28180 			"}\n" +
28181 			"public class X {\n" +
28182 			"	public static <V extends ExtCloneable> ExtCloneable cloneItem1( V value) throws CloneNotSupportedException {\n" +
28183 			"		return value.clone( \"\");\n" +
28184 			"	}\n" +
28185 			"	public static <V extends ExtCloneable> ExtCloneable cloneItem2( ExtCloneable value) throws CloneNotSupportedException {\n" +
28186 			"		return value.clone( \"\");\n" +
28187 			"	}\n" +
28188 			"	public static <V extends ExtCloneable> ExtCloneable cloneItem3( V value) throws CloneNotSupportedException {\n" +
28189 			"		return ((ExtCloneable)value).clone( \"\");\n" +
28190 			"	}\n" +
28191 			"}",
28192 		},
28193 		"");
28194 }
28195 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=113710
28196 public void test0859() {
28197 	this.runConformTest(
28198 		new String[] {
28199 			"X.java",
28200 			"import java.awt.Graphics2D;\n" +
28201 			"import java.awt.Shape;\n" +
28202 			"public class X<V extends DrawObject> {\n" +
28203 			"   /** Base object for wrapping */\n" +
28204 			"   protected V draw;\n" +
28205 			"   /**\n" +
28206 			"    * Draw the object with its attached text\n" +
28207 			"    * \n" +
28208 			"    * @param graphics the graphics object to draw into\n" +
28209 			"    */\n" +
28210 			"   public void draw( Graphics2D graphics ) {\n" +
28211 			"      draw.draw(graphics);\n" +
28212 			"   }\n" +
28213 			"}\n" +
28214 			"abstract class DrawObject implements Drawable {\n" +
28215 			"   protected void draw( Graphics2D graphics, Shape shape ) {\n" +
28216 			"   }\n" +
28217 			"}\n" +
28218 			"interface Drawable {\n" +
28219 			"   void draw( Graphics2D graphics );\n" +
28220 			"}",
28221 		},
28222 		"");
28223 }
28224 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=114304
28225 public void test0860() {
28226 	this.runConformTest(
28227 		new String[] {
28228 			"A.java",
28229 			"interface A {\n" +
28230 			"    A.I foo();\n" +
28231 			"    interface I { }\n" +
28232 			"}\n" +
28233 			"\n" +
28234 			"interface B<T> extends A { }\n" +
28235 			"\n" +
28236 			"interface C extends B<Object> {\n" +
28237 			"    C.J foo();\n" +
28238 			"    interface J extends B.I { }\n" +
28239 			"}\n",
28240 		},
28241 		"");
28242 }
28243 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=114304 - variation
28244 public void test0861() {
28245 	this.runConformTest(
28246 		new String[] {
28247 			"A.java",
28248 			"interface A {\n" +
28249 			"    A.I foo();\n" +
28250 			"    interface I { }\n" +
28251 			"}\n" +
28252 			"\n" +
28253 			"interface B<T> extends A { }\n" +
28254 			"\n" +
28255 			"interface C extends B<Object> {\n" +
28256 			"    C.J foo();\n" +
28257 			"    interface J extends A.I { }\n" +
28258 			"}\n",
28259 		},
28260 		"");
28261 }
28262 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=114304 - variation
28263 public void test0862() {
28264 	this.runConformTest(
28265 		new String[] {
28266 			"A.java",
28267 			"interface A {\n" +
28268 			"    interface I { }\n" +
28269 			"\n" +
28270 			"    A.I foo();\n" +
28271 			"}\n" +
28272 			"\n" +
28273 			"interface B<T> extends A { \n" +
28274 			"    interface J extends B.I { }\n" +
28275 			"}\n" +
28276 			"\n" +
28277 			"interface C extends B<Object> {\n" +
28278 			"    C.J foo();\n" +
28279 			"}\n",
28280 		},
28281 		"");
28282 }
28283 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=114304 - variation
28284 public void test0863() {
28285 	this.runConformTest(
28286 		new String[] {
28287 			"A.java",
28288 			"interface A {\n" +
28289 			"    interface I { }\n" +
28290 			"\n" +
28291 			"    A.I foo();\n" +
28292 			"}\n" +
28293 			"\n" +
28294 			"interface B<T> extends A { \n" +
28295 			"    interface J extends B.I { }\n" +
28296 			"}\n" +
28297 			"\n" +
28298 			"interface C extends B<Object> {\n" +
28299 			"    B.J foo();\n" +
28300 			"}\n",
28301 		},
28302 		"");
28303 }
28304 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=114304 - variation
28305 public void test0864() {
28306 	this.runNegativeTest(
28307 		new String[] {
28308 			"A.java",
28309 			"interface A {\n" +
28310 			"    interface I<T> { }\n" +
28311 			"\n" +
28312 			"    A.I<Object> foo();\n" +
28313 			"}\n" +
28314 			"\n" +
28315 			"interface B<T> extends A { \n" +
28316 			"    interface J<E> extends B.I<E> { }\n" +
28317 			"}\n" +
28318 			"\n" +
28319 			"interface C extends B<Object> {\n" +
28320 			"    C.J<Object> foo();\n" +
28321 			"    B<Object>.J<Object> bar();\n" +
28322 			"}\n",
28323 		},
28324 		"----------\n" +
28325 		"1. ERROR in A.java (at line 13)\n" +
28326 		"	B<Object>.J<Object> bar();\n" +
28327 		"	^^^^^^^^^^^\n" +
28328 		"The member type B.J<E> cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type B<Object>\n" +
28329 		"----------\n");
28330 }
28331 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=114304 - variation
28332 public void test0865() {
28333 	this.runConformTest(
28334 		new String[] {
28335 			"A.java",
28336 			"class A {\n" +
28337 			"    interface I { }\n" +
28338 			"\n" +
28339 			"    A.I foo() { return null; }\n" +
28340 			"}\n" +
28341 			"\n" +
28342 			"class B<T> extends A { \n" +
28343 			"    interface J extends B.I { }\n" +
28344 			"}\n" +
28345 			"\n" +
28346 			"class C extends B<Object> {\n" +
28347 			"	@Override\n" +
28348 			"    C.J foo() { return (B.J)super.foo(); }\n" +
28349 			"}\n",
28350 		},
28351 		"");
28352 }
28353 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=114997
28354 public void test0866() {
28355 	this.runConformTest(
28356 		new String[] {
28357 			"X.java",
28358 			"import java.util.Collections;\n" +
28359 			"import java.util.List;\n" +
28360 			"\n" +
28361 			"public class X {\n" +
28362 			"  public interface Interface {\n" +
28363 			"	  // nothing\n" +
28364 			"  }\n" +
28365 			"  public List<? extends Interface> field = Collections.emptyList();\n" +
28366 			"}\n",
28367 		},
28368 		"");
28369 }
28370 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=114087
28371 // SHOULD FAIL AT 1.8 (RET): Type mismatch: cannot convert from List<Runnable> to List
28372 public void test0867() {
28373 	this.runNegativeTest(
28374 		new String[] {
28375 			"X.java",
28376 			"import java.util.List;\n" +
28377 			"\n" +
28378 			"class Foo {\n" +
28379 			"\n" +
28380 			"	static <T extends Runnable> List<List<T>> foo1() {\n" +
28381 			"		return null;\n" +
28382 			"	}\n" +
28383 			"	static <T extends Runnable> void bar1(List<List<T>> l) {\n" +
28384 			"	}\n" +
28385 			"	static <T extends Runnable> List<T> foo2() {\n" +
28386 			"		return null;\n" +
28387 			"	}\n" +
28388 			"	static <T extends Runnable> void bar2(List<T> l) {\n" +
28389 			"	}\n" +
28390 			"}\n" +
28391 			"\n" +
28392 			"public class X {\n" +
28393 			"\n" +
28394 			"	{\n" +
28395 			"		List<List> o = Foo.foo1();\n" +
28396 			"		Foo.bar1(o);\n" +
28397 			"	}\n" +
28398 			"	{\n" +
28399 			"		List o = Foo.foo2();\n" +
28400 			"		Foo.bar2(o);\n" +
28401 			"	}\n" +
28402 			"\n" +
28403 			"}\n",
28404 		},
28405 		"----------\n" +
28406 		"1. WARNING in X.java (at line 20)\n" +
28407 		"	List<List> o = Foo.foo1();\n" +
28408 		"	     ^^^^\n" +
28409 		"List is a raw type. References to generic type List<E> should be parameterized\n" +
28410 		"----------\n" +
28411 		"2. ERROR in X.java (at line 20)\n" +
28412 		(this.complianceLevel < ClassFileConstants.JDK1_8 ?
28413 		"	List<List> o = Foo.foo1();\n" +
28414 		"	                   ^^^^\n" +
28415 		"The method foo1() in the type Foo is not applicable for the arguments ()\n"
28416 		:
28417 		"	List<List> o = Foo.foo1();\n" +
28418 		"	               ^^^^^^^^^^\n" +
28419 		"Type mismatch: cannot convert from List<List<Runnable>> to List<List>\n" // TODO(stephan) more specific error message
28420 		)+
28421 		"----------\n" +
28422 		"3. ERROR in X.java (at line 21)\n" +
28423 		"	Foo.bar1(o);\n" +
28424 		"	    ^^^^\n" +
28425 		"The method bar1(List<List<T>>) in the type Foo is not applicable for the arguments (List<List>)\n" +
28426 		"----------\n" +
28427 		"4. WARNING in X.java (at line 24)\n" +
28428 		"	List o = Foo.foo2();\n" +
28429 		"	^^^^\n" +
28430 		"List is a raw type. References to generic type List<E> should be parameterized\n" +
28431 		"----------\n" +
28432 		"5. WARNING in X.java (at line 25)\n" +
28433 		"	Foo.bar2(o);\n" +
28434 		"	^^^^^^^^^^^\n" +
28435 		"Type safety: Unchecked invocation bar2(List) of the generic method bar2(List<T>) of type Foo\n" +
28436 		"----------\n" +
28437 		"6. WARNING in X.java (at line 25)\n" +
28438 		"	Foo.bar2(o);\n" +
28439 		"	         ^\n" +
28440 		"Type safety: The expression of type List needs unchecked conversion to conform to List<Runnable>\n" +
28441 		"----------\n");
28442 }
28443 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=114365
28444 public void test0868() {
28445 	Map options = getCompilerOptions();
28446 	options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
28447 	this.runConformTest(
28448 		new String[] {
28449 			"X.java",
28450 			"import java.util.Collection;\n" +
28451 			"import java.util.Iterator;\n" +
28452 			"import java.io.Serializable;\n" +
28453 			"import java.lang.Cloneable;\n" +
28454 			"public class X<A extends Collection & Serializable > implements Collection {\n" +
28455 			"	public int size() {\n" +
28456 			"		// TODO Auto-generated method stub\n" +
28457 			"		return 0;\n" +
28458 			"	}\n" +
28459 			"	public boolean isEmpty() {\n" +
28460 			"		// TODO Auto-generated method stub\n" +
28461 			"		return false;\n" +
28462 			"	}\n" +
28463 			"	public boolean contains(Object arg0) {\n" +
28464 			"		// TODO Auto-generated method stub\n" +
28465 			"		return false;\n" +
28466 			"	}\n" +
28467 			"	public Iterator iterator() {\n" +
28468 			"		// TODO Auto-generated method stub\n" +
28469 			"		return null;\n" +
28470 			"	}\n" +
28471 			"	public Object[] toArray() {\n" +
28472 			"		// TODO Auto-generated method stub\n" +
28473 			"		return null;\n" +
28474 			"	}\n" +
28475 			"	public Object[] toArray(Object[] arg0) {\n" +
28476 			"		// TODO Auto-generated method stub\n" +
28477 			"		return null;\n" +
28478 			"	}\n" +
28479 			"	public boolean add(Object arg0) {\n" +
28480 			"		// TODO Auto-generated method stub\n" +
28481 			"		return false;\n" +
28482 			"	}\n" +
28483 			"	public boolean remove(Object arg0) {\n" +
28484 			"		// TODO Auto-generated method stub\n" +
28485 			"		return false;\n" +
28486 			"	}\n" +
28487 			"	public boolean containsAll(Collection arg0) {\n" +
28488 			"		// TODO Auto-generated method stub\n" +
28489 			"		return false;\n" +
28490 			"	}\n" +
28491 			"	public boolean addAll(Collection arg0) {\n" +
28492 			"		// TODO Auto-generated method stub\n" +
28493 			"		return false;\n" +
28494 			"	}\n" +
28495 			"	public boolean removeAll(Collection arg0) {\n" +
28496 			"		// TODO Auto-generated method stub\n" +
28497 			"		return false;\n" +
28498 			"	}\n" +
28499 			"	public boolean retainAll(Collection arg0) {\n" +
28500 			"		// TODO Auto-generated method stub\n" +
28501 			"		return false;\n" +
28502 			"	}\n" +
28503 			"	public void clear() {\n" +
28504 			"		// TODO Auto-generated method stub\n" +
28505 			"		\n" +
28506 			"	}" +
28507 			"}",
28508 		},
28509 		"",
28510 		null,
28511 		true,
28512 		null,
28513 		options,
28514 		null);
28515 }
28516 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=115181
28517 public void test0869() {
28518 	this.runNegativeTest(
28519 		new String[] {
28520 			"X.java",
28521 			"import java.util.Comparator;\n" +
28522 			"\n" +
28523 			"public class X {\n" +
28524 			"	public static void main(String[] args) {\n" +
28525 			"		Class<?> c = Comparator.class;\n" +
28526 			"		Zork z;\n" +
28527 			"	}\n" +
28528 			"}\n",
28529 		},
28530 		"----------\n" +
28531 		"1. ERROR in X.java (at line 6)\n" +
28532 		"	Zork z;\n" +
28533 		"	^^^^\n" +
28534 		"Zork cannot be resolved to a type\n" +
28535 		"----------\n");
28536 }
28537 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=113950
28538 public void test0870() {
28539 	this.runConformTest(
28540 		new String[] {
28541 			"X.java",
28542 			"import java.util.List;\n" +
28543 			"\n" +
28544 			"public class X {\n" +
28545 			"	public interface I<T> {\n" +
28546 			"	        public <S extends T> void foo(List<S> ls);\n" +
28547 			"	}\n" +
28548 			"\n" +
28549 			"	public abstract class A<T> implements I<T> {\n" +
28550 			"	        public <S extends T> void foo(List<S> ls) { }\n" +
28551 			"	}\n" +
28552 			"\n" +
28553 			"	public class C<T> extends A<List<T>> { }\n" +
28554 			"}\n",
28555 		},
28556 		"");
28557 }
28558 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=107788
28559 public void test0871() {
28560 	this.runConformTest(
28561 		new String[] {
28562 			"Lister.java",
28563 			"interface Lister<BeanT, PropT, PackT> {\n" +
28564 			"	void endPacking(PackT p, BeanT b, Accessor<BeanT, PropT> acc);\n" +
28565 			"\n" +
28566 			"	static class IDRefs<BeanT, PropT> implements\n" +
28567 			"			Lister<BeanT, PropT, IDRefs<BeanT, PropT>.Pack> {\n" +
28568 			"		public void endPacking(Pack p, BeanT b, Accessor<BeanT, PropT> acc) {\n" +
28569 			"		}\n" +
28570 			"\n" +
28571 			"		private class Pack {\n" +
28572 			"		}\n" +
28573 			"	}\n" +
28574 			"}\n" +
28575 			"\n" +
28576 			"class Accessor<BeanT, PropT> {\n" +
28577 			"}\n",
28578 		},
28579 		"");
28580 }
28581 public void test0872() {
28582 	this.runNegativeTest(
28583 		new String[] {
28584 			"X.java", // =================
28585 			"import java.io.PrintStream;\n" +
28586 			"\n" +
28587 			"public class X {\n" +
28588 			"	public void foo1(){\n" +
28589 			"		M1<X> m = new M1<X>();\n" +
28590 			"		M1<X>.N1<X> n = m.new N1<X>();\n" +
28591 			"	}\n" +
28592 			"	static class M1<T> {\n" +
28593 			"		class N1<U> {\n" +
28594 			"		}\n" +
28595 			"	}\n" +
28596 			"	public void foo2(){\n" +
28597 			"		M2<X> m = new M2<X>();\n" +
28598 			"		M2<X>.N2<X> n = m.new N2<X>();\n" +
28599 			"	}\n" +
28600 			"	class M2<T> {\n" +
28601 			"		class N2<U> {\n" +
28602 			"		}\n" +
28603 			"	}\n" +
28604 			"	public void foo3(){\n" +
28605 			"		M3<X> m = new M3<X>();\n" +
28606 			"		M3<X>.N3<X> n = m.new N3<X>();\n" +
28607 			"	}\n" +
28608 			"	class M3<T> {\n" +
28609 			"		static class N3<U> {\n" +
28610 			"		}\n" +
28611 			"	}\n" +
28612 			"	public void foo4(){\n" +
28613 			"		M4<X> m = new M4<X>();\n" +
28614 			"		M4<X>.N4<X> n = m.new N4<X>();\n" +
28615 			"	}\n" +
28616 			"	static class M4<T> {\n" +
28617 			"		static class N4<U> {\n" +
28618 			"		}\n" +
28619 			"	}\n" +
28620 			"}\n",
28621 		},
28622 		"----------\n" +
28623 		"1. ERROR in X.java (at line 22)\n" +
28624 		"	M3<X>.N3<X> n = m.new N3<X>();\n" +
28625 		"	^^^^^^^^\n" +
28626 		"The member type X.M3.N3<U> cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type X.M3<X>\n" +
28627 		"----------\n" +
28628 		"2. ERROR in X.java (at line 25)\n" +
28629 		"	static class N3<U> {\n" +
28630 		"	             ^^\n" +
28631 		"The member type N3 cannot be declared static; static types can only be declared in static or top level types\n" +
28632 		"----------\n" +
28633 		"3. ERROR in X.java (at line 30)\n" +
28634 		"	M4<X>.N4<X> n = m.new N4<X>();\n" +
28635 		"	^^^^^^^^\n" +
28636 		"The member type X.M4.N4<U> cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type X.M4<X>\n" +
28637 		"----------\n");
28638 }
28639 public void test0873() {
28640 	this.runConformTest(
28641 		new String[] {
28642 			"X.java", // =================
28643 			"public class X<T> {\n" +
28644 			"    static class XMap {\n" +
28645 			"        XEntry[] table;\n" +
28646 			"        static class XEntry {}    \n" +
28647 			"        void foo() {\n" +
28648 			"            XEntry e = table[0];\n" +
28649 			"        }	\n" +
28650 			"    }        \n" +
28651 			"}\n",
28652 		},
28653 		"");
28654 }
28655 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=115693
28656 public void test0874() throws Exception {
28657 	this.runConformTest(
28658 		new String[] {
28659 			"X.java", // =================
28660 			"class A {}\n" +
28661 			"abstract class B<T> {\n" +
28662 			"    public B<T> label(String s) { return this; }\n" +
28663 			"}\n" +
28664 			"final class C extends B<A> {\n" +
28665 			"    public static C instance(String s) { return new C(); }\n" +
28666 			"    @Override public String toString() {\n" +
28667 			"    	return \"SUCCESS\";\n" +
28668 			"    }\n" +
28669 			"}\n" +
28670 			"public class X {\n" +
28671 			"    public static void main(String[] args) {\n" +
28672 			"        C c = (C)C.instance(\"X\").label(\"Y\");\n" +
28673 			"        System.out.println(c.toString());\n" +
28674 			"    }\n" +
28675 			"}\n",
28676 		},
28677 		"SUCCESS");
28678 	// 	ensure only one checkcast C
28679 	String expectedOutput =
28680 		"  // Method descriptor #15 ([Ljava/lang/String;)V\n" +
28681 		"  // Stack: 2, Locals: 2\n" +
28682 		"  public static void main(java.lang.String[] args);\n" +
28683 		"     0  ldc <String \"X\"> [16]\n" +
28684 		"     2  invokestatic C.instance(java.lang.String) : C [17]\n" +
28685 		"     5  ldc <String \"Y\"> [23]\n" +
28686 		"     7  invokevirtual C.label(java.lang.String) : B [25]\n" +
28687 		"    10  checkcast C [18]\n" +
28688 		"    13  astore_1 [c]\n" +
28689 		"    14  getstatic java.lang.System.out : java.io.PrintStream [29]\n" +
28690 		"    17  aload_1 [c]\n" +
28691 		"    18  invokevirtual C.toString() : java.lang.String [35]\n" +
28692 		"    21  invokevirtual java.io.PrintStream.println(java.lang.String) : void [39]\n" +
28693 		"    24  return\n" +
28694 		"      Line numbers:\n" +
28695 		"        [pc: 0, line: 13]\n" +
28696 		"        [pc: 14, line: 14]\n" +
28697 		"        [pc: 24, line: 15]\n" +
28698 		"      Local variable table:\n" +
28699 		"        [pc: 0, pc: 25] local: args index: 0 type: java.lang.String[]\n" +
28700 		"        [pc: 14, pc: 25] local: c index: 1 type: C\n";
28701 
28702 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
28703 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
28704 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
28705 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
28706 	int index = result.indexOf(expectedOutput);
28707 	if (index == -1 || expectedOutput.length() == 0) {
28708 		System.out.println(Util.displayString(result, 3));
28709 	}
28710 	if (index == -1) {
28711 		assertEquals("Wrong contents", expectedOutput, result);
28712 	}
28713 }
28714 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=119395
28715 public void test0875() {
28716 	this.runNegativeTest(
28717 		new String[] {
28718 			"X.java", // =================
28719 			"import java.util.*;\n" +
28720 			"public class X {\n" +
28721 			"\n" +
28722 			"	public static class DatabaseObject {}\n" +
28723 			"	public static class ObjectFormUI<T extends DatabaseObject> {}\n" +
28724 			"	private static final Map<Class<? extends DatabaseObject>, Class<? extends ObjectFormUI>> uiMap = new HashMap<Class<? extends DatabaseObject>, Class<? extends ObjectFormUI>>();\n" +
28725 			"\n" +
28726 			"	public static <T extends DatabaseObject> Class<? extends ObjectFormUI<T>> getUI(\n" +
28727 			"			Class<T> persistentClass) {\n" +
28728 			"		return null != null \n" +
28729 			"			? uiMap.get(persistentClass)\n" +
28730 			"			: (Class<? extends ObjectFormUI<T>>) uiMap.get(persistentClass);\n" +
28731 			"	}\n" +
28732 			"}\n",
28733 		},
28734 		this.complianceLevel < ClassFileConstants.JDK1_8 ?
28735 			"----------\n" +
28736 			"1. WARNING in X.java (at line 6)\n" +
28737 			"	private static final Map<Class<? extends DatabaseObject>, Class<? extends ObjectFormUI>> uiMap = new HashMap<Class<? extends DatabaseObject>, Class<? extends ObjectFormUI>>();\n" +
28738 			"	                                                                          ^^^^^^^^^^^^\n" +
28739 			"X.ObjectFormUI is a raw type. References to generic type X.ObjectFormUI<T> should be parameterized\n" +
28740 			"----------\n" +
28741 			"2. WARNING in X.java (at line 6)\n" +
28742 			"	private static final Map<Class<? extends DatabaseObject>, Class<? extends ObjectFormUI>> uiMap = new HashMap<Class<? extends DatabaseObject>, Class<? extends ObjectFormUI>>();\n" +
28743 			"	                                                                                                                                                              ^^^^^^^^^^^^\n" +
28744 			"X.ObjectFormUI is a raw type. References to generic type X.ObjectFormUI<T> should be parameterized\n" +
28745 			"----------\n" +
28746 			"3. ERROR in X.java (at line 10)\n" +
28747 			"	return null != null \n" +
28748 			"			? uiMap.get(persistentClass)\n" +
28749 			"			: (Class<? extends ObjectFormUI<T>>) uiMap.get(persistentClass);\n" +
28750 			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
28751 			"Type mismatch: cannot convert from Class<capture#4-of ? extends X.ObjectFormUI> to Class<? extends X.ObjectFormUI<T>>\n" +
28752 			"----------\n" +
28753 			"4. WARNING in X.java (at line 12)\n" +
28754 			"	: (Class<? extends ObjectFormUI<T>>) uiMap.get(persistentClass);\n" +
28755 			"	  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
28756 			"Type safety: Unchecked cast from Class<capture#2-of ? extends X.ObjectFormUI> to Class<? extends X.ObjectFormUI<T>>\n" +
28757 			"----------\n" :
28758 				"----------\n" +
28759 				"1. WARNING in X.java (at line 6)\n" +
28760 				"	private static final Map<Class<? extends DatabaseObject>, Class<? extends ObjectFormUI>> uiMap = new HashMap<Class<? extends DatabaseObject>, Class<? extends ObjectFormUI>>();\n" +
28761 				"	                                                                          ^^^^^^^^^^^^\n" +
28762 				"X.ObjectFormUI is a raw type. References to generic type X.ObjectFormUI<T> should be parameterized\n" +
28763 				"----------\n" +
28764 				"2. WARNING in X.java (at line 6)\n" +
28765 				"	private static final Map<Class<? extends DatabaseObject>, Class<? extends ObjectFormUI>> uiMap = new HashMap<Class<? extends DatabaseObject>, Class<? extends ObjectFormUI>>();\n" +
28766 				"	                                                                                                                                                              ^^^^^^^^^^^^\n" +
28767 				"X.ObjectFormUI is a raw type. References to generic type X.ObjectFormUI<T> should be parameterized\n" +
28768 				"----------\n" +
28769 				"3. ERROR in X.java (at line 11)\n" +
28770 				"	? uiMap.get(persistentClass)\n" +
28771 				"	  ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
28772 				"Type mismatch: cannot convert from Class<capture#1-of ? extends X.ObjectFormUI> to Class<? extends X.ObjectFormUI<T>>\n" +
28773 				"----------\n" +
28774 				"4. WARNING in X.java (at line 12)\n" +
28775 				"	: (Class<? extends ObjectFormUI<T>>) uiMap.get(persistentClass);\n" +
28776 				"	  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
28777 				"Type safety: Unchecked cast from Class<capture#2-of ? extends X.ObjectFormUI> to Class<? extends X.ObjectFormUI<T>>\n" +
28778 				"----------\n");
28779 }
28780 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=119395 - variation
28781 public void test0876() {
28782 	this.runNegativeTest(
28783 		new String[] {
28784 			"X.java", // =================
28785 			"import java.util.*;\n" +
28786 			"public class X {\n" +
28787 			"	void foo(){\n" +
28788 			"		Class<Class<Object>> cco = null;\n" +
28789 			"		Class<Class> cc = cco; // ko\n" +
28790 			"		Class<Class<Object>> cco2 = cc; // ko\n" +
28791 			"		\n" +
28792 			"		Class<? extends Class<Object>> ceco = null;\n" +
28793 			"		Class<? extends Class> cec = ceco; // ok\n" +
28794 			"		Class<? extends Class<Object>> ceco2 = cec; // ko\n" +
28795 			"	}\n" +
28796 			"}\n",
28797 		},
28798 		"----------\n" +
28799 		"1. WARNING in X.java (at line 5)\n" +
28800 		"	Class<Class> cc = cco; // ko\n" +
28801 		"	      ^^^^^\n" +
28802 		"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
28803 		"----------\n" +
28804 		"2. ERROR in X.java (at line 5)\n" +
28805 		"	Class<Class> cc = cco; // ko\n" +
28806 		"	                  ^^^\n" +
28807 		"Type mismatch: cannot convert from Class<Class<Object>> to Class<Class>\n" +
28808 		"----------\n" +
28809 		"3. ERROR in X.java (at line 6)\n" +
28810 		"	Class<Class<Object>> cco2 = cc; // ko\n" +
28811 		"	                            ^^\n" +
28812 		"Type mismatch: cannot convert from Class<Class> to Class<Class<Object>>\n" +
28813 		"----------\n" +
28814 		"4. WARNING in X.java (at line 9)\n" +
28815 		"	Class<? extends Class> cec = ceco; // ok\n" +
28816 		"	                ^^^^^\n" +
28817 		"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
28818 		"----------\n" +
28819 		"5. ERROR in X.java (at line 10)\n" +
28820 		"	Class<? extends Class<Object>> ceco2 = cec; // ko\n" +
28821 		"	                                       ^^^\n" +
28822 		"Type mismatch: cannot convert from Class<capture#2-of ? extends Class> to Class<? extends Class<Object>>\n" +
28823 		"----------\n");
28824 }
28825 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=119395 - variation
28826 public void test0877() {
28827 	this.runNegativeTest(
28828 		new String[] {
28829 			"X.java", // =================
28830 			"import java.util.*;\n" +
28831 			"public class X {\n" +
28832 			"	<T extends Class> void bar(T t) {\n" +
28833 			"		Class<Object> c = t; // ok - unchecked\n" +
28834 			"	}\n" +
28835 			"	<T extends Class> void bar2(List<? extends T> let) {\n" +
28836 			"		Class<Object> c = let.get(0); // ok - unchecked\n" +
28837 			"	}\n" +
28838 			"	void bar3(List<? extends Class> lec) {\n" +
28839 			"		Class<Object> c = lec.get(0); // ok - unchecked\n" +
28840 			"	}\n" +
28841 			"	Zork z;\n" +
28842 			"}\n",
28843 		},
28844 		"----------\n" +
28845 		"1. WARNING in X.java (at line 3)\n" +
28846 		"	<T extends Class> void bar(T t) {\n" +
28847 		"	           ^^^^^\n" +
28848 		"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
28849 		"----------\n" +
28850 		"2. WARNING in X.java (at line 3)\n" +
28851 		"	<T extends Class> void bar(T t) {\n" +
28852 		"	           ^^^^^\n" +
28853 		"The type parameter T should not be bounded by the final type Class. Final types cannot be further extended\n" +
28854 		"----------\n" +
28855 		"3. WARNING in X.java (at line 4)\n" +
28856 		"	Class<Object> c = t; // ok - unchecked\n" +
28857 		"	                  ^\n" +
28858 		"Type safety: The expression of type T needs unchecked conversion to conform to Class<Object>\n" +
28859 		"----------\n" +
28860 		"4. WARNING in X.java (at line 6)\n" +
28861 		"	<T extends Class> void bar2(List<? extends T> let) {\n" +
28862 		"	           ^^^^^\n" +
28863 		"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
28864 		"----------\n" +
28865 		"5. WARNING in X.java (at line 6)\n" +
28866 		"	<T extends Class> void bar2(List<? extends T> let) {\n" +
28867 		"	           ^^^^^\n" +
28868 		"The type parameter T should not be bounded by the final type Class. Final types cannot be further extended\n" +
28869 		"----------\n" +
28870 		"6. WARNING in X.java (at line 7)\n" +
28871 		"	Class<Object> c = let.get(0); // ok - unchecked\n" +
28872 		"	                  ^^^^^^^^^^\n" +
28873 		"Type safety: The expression of type capture#1-of ? extends T needs unchecked conversion to conform to Class<Object>\n" +
28874 		"----------\n" +
28875 		"7. WARNING in X.java (at line 9)\n" +
28876 		"	void bar3(List<? extends Class> lec) {\n" +
28877 		"	                         ^^^^^\n" +
28878 		"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
28879 		"----------\n" +
28880 		"8. WARNING in X.java (at line 10)\n" +
28881 		"	Class<Object> c = lec.get(0); // ok - unchecked\n" +
28882 		"	                  ^^^^^^^^^^\n" +
28883 		"Type safety: The expression of type capture#2-of ? extends Class needs unchecked conversion to conform to Class<Object>\n" +
28884 		"----------\n" +
28885 		"9. ERROR in X.java (at line 12)\n" +
28886 		"	Zork z;\n" +
28887 		"	^^^^\n" +
28888 		"Zork cannot be resolved to a type\n" +
28889 		"----------\n");
28890 }
28891 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=115693 - variation
28892 public void test0878() throws Exception {
28893 	this.runConformTest(
28894 		new String[] {
28895 			"X.java", // =================
28896 			"class A {}\n" +
28897 			"class D extends A {}\n" +
28898 			"abstract class B<T> {\n" +
28899 			"    public T label(String s) { return null; }\n" +
28900 			"}\n" +
28901 			"final class C extends B<A> {\n" +
28902 			"    public static C instance(String s) { return new C(); }\n" +
28903 			"    @Override public String toString() {\n" +
28904 			"    	return \"SUCCESS\"; \n" +
28905 			"    }\n" +
28906 			"}\n" +
28907 			"public class X {\n" +
28908 			"    public static void main(String[] args) {\n" +
28909 			"        D d = (D)C.instance(\"X\").label(\"Y\");\n" +
28910 			"        System.out.println(d);\n" +
28911 			"    }\n" +
28912 			"}\n",
28913 		},
28914 		"null");
28915 	// 	ensure only one checkcast D
28916 	String expectedOutput =
28917 		"  // Method descriptor #15 ([Ljava/lang/String;)V\n" +
28918 		"  // Stack: 2, Locals: 2\n" +
28919 		"  public static void main(java.lang.String[] args);\n" +
28920 		"     0  ldc <String \"X\"> [16]\n" +
28921 		"     2  invokestatic C.instance(java.lang.String) : C [17]\n" +
28922 		"     5  ldc <String \"Y\"> [23]\n" +
28923 		"     7  invokevirtual C.label(java.lang.String) : java.lang.Object [25]\n" +
28924 		"    10  checkcast D [29]\n" +
28925 		"    13  astore_1 [d]\n" +
28926 		"    14  getstatic java.lang.System.out : java.io.PrintStream [31]\n" +
28927 		"    17  aload_1 [d]\n" +
28928 		"    18  invokevirtual java.io.PrintStream.println(java.lang.Object) : void [37]\n" +
28929 		"    21  return\n" +
28930 		"      Line numbers:\n" +
28931 		"        [pc: 0, line: 14]\n" +
28932 		"        [pc: 14, line: 15]\n" +
28933 		"        [pc: 21, line: 16]\n" +
28934 		"      Local variable table:\n" +
28935 		"        [pc: 0, pc: 22] local: args index: 0 type: java.lang.String[]\n" +
28936 		"        [pc: 14, pc: 22] local: d index: 1 type: D\n";
28937 
28938 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
28939 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
28940 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
28941 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
28942 	int index = result.indexOf(expectedOutput);
28943 	if (index == -1 || expectedOutput.length() == 0) {
28944 		System.out.println(Util.displayString(result, 3));
28945 	}
28946 	if (index == -1) {
28947 		assertEquals("Wrong contents", expectedOutput, result);
28948 	}
28949 }
28950 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=122610
28951 public void test0879() {
28952 	this.runConformTest(
28953 		new String[] {
28954 			"X.java", // =================
28955 			"public class X<V, R> {\n" +
28956 			"\n" +
28957 			"    private class InnerClass1 {\n" +
28958 			"            void foo() {\n" +
28959 			"                    X<V, R> c = X.this;\n" +
28960 			"            }\n" +
28961 			"    }\n" +
28962 			"}\n",
28963 		},
28964 		"");
28965 }
28966 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=121369
28967 public void test0880() {
28968 	this.runNegativeTest(
28969 		new String[] {
28970 			"X.java", // =================
28971 			"class Foo {\n" +
28972 			"	static <T, U extends java.util.List<T>> U foo() {\n" +
28973 			"		return null;\n" +
28974 			"	}\n" +
28975 			"}\n" +
28976 			"\n" +
28977 			"public class X {\n" +
28978 			"	{\n" +
28979 			"		String s = (String) Foo.foo();\n" +
28980 			"	}\n" +
28981 			"}\n",
28982 		},
28983 		"----------\n" +
28984 		"1. ERROR in X.java (at line 9)\n" +
28985 		"	String s = (String) Foo.foo();\n" +
28986 		"	           ^^^^^^^^^^^^^^^^^^\n" +
28987 		"Cannot cast from List<Object> to String\n" +
28988 		"----------\n");
28989 }
28990 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=121369 - variation
28991 public void test0881() {
28992 	this.runNegativeTest(
28993 		new String[] {
28994 			"X.java", // =================
28995 			"class Foo {\n" +
28996 			"	static <T, U extends java.util.List<U>> U foo() {\n" +
28997 			"		return null;\n" +
28998 			"	}\n" +
28999 			"}\n" +
29000 			"\n" +
29001 			"public class X {\n" +
29002 			"	{\n" +
29003 			"		String s = (String) Foo.foo();\n" +
29004 			"	}\n" +
29005 			"}\n",
29006 		},
29007 		"----------\n" +
29008 		"1. ERROR in X.java (at line 9)\n" +
29009 		"	String s = (String) Foo.foo();\n" +
29010 		"	           ^^^^^^^^^^^^^^^^^^\n" +
29011 		"Cannot cast from List<List<U>> to String\n" +
29012 		"----------\n");
29013 }
29014 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=121369 - variation
29015 public void test0882() {
29016 	this.runNegativeTest(
29017 		new String[] {
29018 			"X.java", // =================
29019 			"import java.util.List;\n" +
29020 			"\n" +
29021 			"public class X {\n" +
29022 			"	static <U extends List<U>> U foo(U u) {\n" +
29023 			"		String s = (String) foo(u);\n" +
29024 			"		return u;\n" +
29025 			"	}\n" +
29026 			"}\n",
29027 		},
29028 		"----------\n" +
29029 		"1. ERROR in X.java (at line 5)\n" +
29030 		"	String s = (String) foo(u);\n" +
29031 		"	           ^^^^^^^^^^^^^^^\n" +
29032 		"Cannot cast from U to String\n" +
29033 		"----------\n");
29034 }
29035 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=121369 - variation
29036 public void test0883() {
29037 	this.runNegativeTest(
29038 		new String[] {
29039 			"X.java", // =================
29040 			"import java.util.List;\n" +
29041 			"\n" +
29042 			"public class X {\n" +
29043 			"	static <U extends List<U>> U foo(U u) {\n" +
29044 			"		List<U> listu = null;\n" +
29045 			"		String s = (String)foo(listu);\n" +
29046 			"		return u;\n" +
29047 			"	}\n" +
29048 			"	static <V extends List<V>> V bar(V v) {\n" +
29049 			"		List<V> listv = null;\n" +
29050 			"		String s = (String)foo(listv);\n" +
29051 			"		return v;\n" +
29052 			"	}\n" +
29053 			"}\n",
29054 		},
29055 		(this.complianceLevel < ClassFileConstants.JDK1_8 ?
29056 		"----------\n" +
29057 		"1. ERROR in X.java (at line 6)\n" +
29058 		"	String s = (String)foo(listu);\n" +
29059 		"	           ^^^^^^^^^^^^^^^^^^\n" +
29060 		"Cannot cast from List<U> to String\n" +
29061 		"----------\n" +
29062 		"2. ERROR in X.java (at line 6)\n" +
29063 		"	String s = (String)foo(listu);\n" +
29064 		"	                   ^^^\n" +
29065 		"Bound mismatch: The generic method foo(U) of type X is not applicable for the arguments (List<U>). The inferred type List<U> is not a valid substitute for the bounded parameter <U extends List<U>>\n" +
29066 		"----------\n" +
29067 		"3. ERROR in X.java (at line 11)\n" +
29068 		"	String s = (String)foo(listv);\n" +
29069 		"	           ^^^^^^^^^^^^^^^^^^\n" +
29070 		"Cannot cast from List<V> to String\n" +
29071 		"----------\n" +
29072 		"4. ERROR in X.java (at line 11)\n" +
29073 		"	String s = (String)foo(listv);\n" +
29074 		"	                   ^^^\n" +
29075 		"Bound mismatch: The generic method foo(U) of type X is not applicable for the arguments (List<V>). The inferred type List<V> is not a valid substitute for the bounded parameter <U extends List<U>>\n" +
29076 		"----------\n"
29077 		:
29078 			"----------\n" +
29079 			"1. ERROR in X.java (at line 6)\n" +
29080 			"	String s = (String)foo(listu);\n" +
29081 			"	                   ^^^\n" +
29082 			"The method foo(U) in the type X is not applicable for the arguments (List<U>)\n" +
29083 			"----------\n" +
29084 			"2. ERROR in X.java (at line 11)\n" +
29085 			"	String s = (String)foo(listv);\n" +
29086 			"	                   ^^^\n" +
29087 			"The method foo(U) in the type X is not applicable for the arguments (List<V>)\n" +
29088 			"----------\n" ));
29089 }
29090 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=123078
29091 // SHOULD FAIL AT 1.8 (18.2.3): The method getDefault(Class<T>) in the type X<C> is not applicable for the arguments (Class<capture#2-of ? extends X>)
29092 public void test0884() {
29093 	this.runNegativeTest(
29094 		new String[] {
29095 			"X.java", // =================
29096 			"public abstract class X<C extends X<C>> {\n" +
29097 			"	public static <T extends X<T>> T getDefault(Class<T> clz) {\n" +
29098 			"		return null;\n" +
29099 			"	}\n" +
29100 			"\n" +
29101 			"	public Object getDefault() {\n" +
29102 			"		String s = getClass();\n" +
29103 			"		return (String) getDefault(getClass());\n" +
29104 			"	}\n" +
29105 			"}\n" ,
29106 		},
29107 		"----------\n" +
29108 		"1. ERROR in X.java (at line 7)\n" +
29109 		"	String s = getClass();\n" +
29110 		"	           ^^^^^^^^^^\n" +
29111 		"Type mismatch: cannot convert from Class<capture#1-of ? extends X> to String\n" +
29112 		"----------\n" +
29113 		"2. ERROR in X.java (at line 8)\n" +
29114 		"	return (String) getDefault(getClass());\n" +
29115 		"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
29116 		"Cannot cast from X to String\n" +
29117 		"----------\n" +
29118 		"3. WARNING in X.java (at line 8)\n" +
29119 		"	return (String) getDefault(getClass());\n" +
29120 		"	                ^^^^^^^^^^^^^^^^^^^^^^\n" +
29121 		"Type safety: Unchecked invocation getDefault(Class<capture#2-of ? extends X>) of the generic method getDefault(Class<T>) of type X<C>\n" +
29122 		"----------\n");
29123 }
29124 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=125445
29125 public void test0885() {
29126 	this.runNegativeTest(
29127 		new String[] {
29128 			"X.java", // =================
29129 			"public class X {\n" +
29130 			"	public static <C extends Number, A extends C & Comparable<C>> int m(\n" +
29131 			"			A comparableNumberObj) {\n" +
29132 			"		return comparableNumberObj.compareTo(comparableNumberObj);\n" +
29133 			"	}\n" +
29134 			"}\n" ,
29135 		},
29136 		"----------\n" +
29137 		"1. ERROR in X.java (at line 2)\n" +
29138 		"	public static <C extends Number, A extends C & Comparable<C>> int m(\n" +
29139 		"	                                               ^^^^^^^^^^\n" +
29140 		"Cannot specify any additional bound Comparable<C> when first bound is a type parameter\n" +
29141 		"----------\n");
29142 }
29143 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=124943
29144 public void test0886() {
29145 	Map customOptions= getCompilerOptions();
29146 	customOptions.put(CompilerOptions.OPTION_Source, CompilerOptions.VERSION_1_4);
29147 	runConformTest(
29148 		// test directory preparation
29149 		true /* flush output directory */,
29150 		new String[] { /* test files */
29151 			"X.java", // =================
29152 			"public class X {\n" +
29153 			"	void test() {\n" +
29154 			"		\"Hello\".compareTo((Object) \"Hello\");\n" +
29155 			"	}\n" +
29156 			"}\n" ,
29157 		},
29158 		// compiler options
29159 		null /* no class libraries */,
29160 		customOptions /* custom options */,
29161 		// compiler results
29162 		"" /* expected compiler log */,
29163 		// runtime results
29164 		"" /* expected output string */,
29165 		null /* do not check error string */,
29166 		// javac options
29167 		new JavacTestOptions("-source 1.4 -Xlint:-options") /* javac test options */);
29168 }
29169 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=122775
29170 public void test0887() {
29171 	this.runNegativeTest(
29172 		new String[] {
29173 			"Bar.java", // =================
29174 			"class Foo<T> {}\n" +
29175 			"public class Bar<X extends Foo<Foo<? super X>>>{\n" +
29176 			"    Bar(X x){\n" +
29177 			"        Foo<? super X> f = x;\n" +
29178 			"    }\n" +
29179 			"}\n",
29180 		},
29181 		"----------\n" +
29182 		"1. ERROR in Bar.java (at line 4)\n" +
29183 		"	Foo<? super X> f = x;\n" +
29184 		"	                   ^\n" +
29185 		"Type mismatch: cannot convert from X to Foo<? super X>\n" +
29186 		"----------\n");
29187 }
29188 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=122775 - variation
29189 public void test0888() {
29190 	this.runNegativeTest(
29191 		new String[] {
29192 			"Bar.java", // =================
29193 			"class Foo<T> {}\n" +
29194 			"public class Bar<X extends Foo<Foo<? super X>>>{\n" +
29195 			"    Bar(X x){\n" +
29196 			"        Foo<? extends X> f = x;\n" +
29197 			"    }\n" +
29198 			"}\n",
29199 		},
29200 		"----------\n" +
29201 		"1. ERROR in Bar.java (at line 4)\n" +
29202 		"	Foo<? extends X> f = x;\n" +
29203 		"	                     ^\n" +
29204 		"Type mismatch: cannot convert from X to Foo<? extends X>\n" +
29205 		"----------\n");
29206 }
29207 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=122775 - variation
29208 public void test0889() {
29209 	this.runConformTest(
29210 		// test directory preparation
29211 		true /* flush output directory */,
29212 		new String[] { /* test files */
29213 			"Test.java", // =================
29214 			"import java.util.*;\n" +
29215 			"\n" +
29216 			"class Group<E extends Comparable<? super E>> extends ArrayList<E> implements\n" +
29217 			"		Comparable<Group<? extends E>> {\n" +
29218 			"	public int compareTo(Group<? extends E> o) {\n" +
29219 			"		return 0;\n" +
29220 			"	}\n" +
29221 			"}\n" +
29222 			"\n" +
29223 			"class Sequence<E extends Comparable<? super E>> extends TreeSet<E> implements\n" +
29224 			"		Comparable<Sequence<? extends E>> {\n" +
29225 			"	public int compareTo(Sequence<? extends E> o) {\n" +
29226 			"		return 0;\n" +
29227 			"	}\n" +
29228 			"}\n" +
29229 			"\n" +
29230 			"class Test<T extends Comparable<? super T>> {\n" +
29231 			"	<C extends Collection<T>> void foo(SortedSet<? extends C> setToCheck,\n" +
29232 			"			SortedSet<? extends C> validSet) {\n" +
29233 			"	}\n" +
29234 			"\n" +
29235 			"	public void containsCombination(SortedSet<Group<T>> groups,\n" +
29236 			"			SortedSet<Sequence<T>> sequences) {\n" +
29237 			"		foo(groups, sequences);\n" +
29238 			"	}\n" +
29239 			"}\n",
29240 		},
29241 		// compiler results
29242 		null /* do not check compiler log */,
29243 		// runtime results
29244 		"" /* expected output string */,
29245 		"" /* expected error string */,
29246 		// javac options
29247 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
29248 }
29249 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=122775 - variation
29250 public void test0890() {
29251 	runConformTest(
29252 		// test directory preparation
29253 		new String[] { /* test files */
29254 			"Simple.java", // =================
29255 			"class A<T extends A<T>> {}\n" +
29256 			"class B extends A<B> {}\n" +
29257 			"class C extends B {}\n" +
29258 			"class D<T> {}\n" +
29259 			"\n" +
29260 			"public class Simple {\n" +
29261 			"	<T extends A<T>, S extends T> D<T> m(S s) {\n" +
29262 			"		C c = null;\n" +
29263 			"		D<B> d = m(c);\n" +
29264 			"		return null;\n" +
29265 			"	}\n" +
29266 			"}\n",
29267 		},
29268 		// javac options
29269 		JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
29270 }
29271 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=122775 - variation
29272 public void test0891() {
29273 	String xSource =
29274 			"interface Function<A, B> {\n" +
29275 			"	B apply(A x);\n" +
29276 			"}\n" +
29277 			"class Id<A> implements Function<A, A> {\n" +
29278 			"	public A apply(A x) {\n" +
29279 			"		return x;\n" +
29280 			"	}\n" +
29281 			"}\n" +
29282 			"class Test {\n" +
29283 			"	<A> Id<A> identity() {\n" +
29284 			"		return new Id<A>();\n" +
29285 			"	}\n" +
29286 			"\n" +
29287 			"	<B> B applyToString(Function<String, B> f) {\n" +
29288 			"		return f.apply(\"abc\");\n" +
29289 			"	}\n" +
29290 			"	void test() {\n" +
29291 			"		String s = applyToString(identity());\n" +
29292 			"	}\n" +
29293 			"}\n";
29294 	if (this.complianceLevel < ClassFileConstants.JDK1_8) {
29295 		this.runNegativeTest(
29296 			new String[] {
29297 				"Test.java",
29298 				xSource
29299 			},
29300 			"----------\n" +
29301 			"1. ERROR in Test.java (at line 18)\n" +
29302 			"	String s = applyToString(identity());\n" +
29303 			"	           ^^^^^^^^^^^^^\n" +
29304 			"The method applyToString(Function<String,B>) in the type Test is not applicable for the arguments (Id<Object>)\n" +
29305 			"----------\n");
29306 	} else {
29307 		runConformTest(
29308 			new String[] {
29309 				"Test.java",
29310 				xSource
29311 			});
29312 	}
29313 }
29314 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=126180
29315 public void test0892() {
29316 	this.runNegativeTest(
29317 		new String[] {
29318 			"X.java", // =================
29319 			"public class X {\n" +
29320 			"	public static void main(String[] args) {\n" +
29321 			"		C2 c2 = null;\n" +
29322 			"		C3 c3 = null;\n" +
29323 			"		Object oc1 = m1(c2, c3).new C1Member();\n" +
29324 			"	}\n" +
29325 			"\n" +
29326 			"	public static <T> T m1(T t1, T t2) {\n" +
29327 			"		return null;\n" +
29328 			"	}\n" +
29329 			"\n" +
29330 			"	class C1 {}\n" +
29331 			"	interface I1 {}\n" +
29332 			"	class C2 extends C1 implements I1 {}\n" +
29333 			"	class C3 extends C1 implements I1 {\n" +
29334 			"	}\n" +
29335 			"}\n",
29336 		},
29337 		"----------\n" +
29338 		"1. ERROR in X.java (at line 5)\n" +
29339 		"	Object oc1 = m1(c2, c3).new C1Member();\n" +
29340 		"	                            ^^^^^^^^\n" +
29341 		intersection("X.C1","X.I1.C1Member")+" cannot be resolved to a type\n" +
29342 		"----------\n");
29343 }
29344 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=126177
29345 public void test0893() {
29346 	this.runNegativeTest(
29347 		new String[] {
29348 			"X.java", // =================
29349 			"public class X {\n" +
29350 			"	static String foo;\n" +
29351 			"\n" +
29352 			"	public static void main(String[] args) {\n" +
29353 			"		C2 c2 = null;\n" +
29354 			"		C3 c3 = null;\n" +
29355 			"		// method access\n" +
29356 			"		m1(c2, c3).c1m1();\n" +
29357 			"		m1(c2, c3).i1m1();\n" +
29358 			"		m1(c2, c3).i2m1();\n" +
29359 			"\n" +
29360 			"		// field access\n" +
29361 			"		int ic1 = m1(c2, c3).c1f1;\n" +
29362 			"		int ii1 = m1(c2, c3).i1f1;\n" +
29363 			"		int ii2 = m1(c2, c3).i2f1;\n" +
29364 			"	\n" +
29365 			"		// member type access\n" +
29366 			"		Object oc1 = m1(c2, c3).new C1Member();\n" +
29367 			"		Object oi1 = m1(c2, c3).new I1Member(); \n" +
29368 			"		Object oi2 = m1(c2, c3).new I2Member();\n" +
29369 			"	}\n" +
29370 			"\n" +
29371 			"	public static <T> T m1(T t1, T t2) {\n" +
29372 			"		return null;\n" +
29373 			"	}\n" +
29374 			"\n" +
29375 			"	class C1 {\n" +
29376 			"		void c1m1() {}\n" +
29377 			"		int c1f1 = 0;\n" +
29378 			"		class C1Member {}\n" +
29379 			"	}\n" +
29380 			"\n" +
29381 			"	interface I1 {\n" +
29382 			"		void i1m1();\n" +
29383 			"		int i1f1 = 1;\n" +
29384 			"		class I1Member {}\n" +
29385 			"	}\n" +
29386 			"\n" +
29387 			"	interface I2 {\n" +
29388 			"		void i2m1();\n" +
29389 			"		int i2f1 = 2;\n" +
29390 			"		class I2Member {}\n" +
29391 			"	}\n" +
29392 			"\n" +
29393 			"	class C2 extends C1 implements I1, I2 {\n" +
29394 			"		public void i1m1() {\n" +
29395 			"		}\n" +
29396 			"		public void i2m1() {\n" +
29397 			"		}\n" +
29398 			"	}\n" +
29399 			"\n" +
29400 			"	class C3 extends C1 implements I1, I2 {\n" +
29401 			"		public void i1m1() {\n" +
29402 			"		}\n" +
29403 			"		public void i2m1() {\n" +
29404 			"		}\n" +
29405 			"	}\n" +
29406 			"}\n",
29407 		},
29408 		"----------\n" +
29409 		"1. WARNING in X.java (at line 14)\n" +
29410 		"	int ii1 = m1(c2, c3).i1f1;\n" +
29411 		"	                     ^^^^\n" +
29412 		"The static field X.I1.i1f1 should be accessed in a static way\n" +
29413 		"----------\n" +
29414 		"2. WARNING in X.java (at line 15)\n" +
29415 		"	int ii2 = m1(c2, c3).i2f1;\n" +
29416 		"	                     ^^^^\n" +
29417 		"The static field X.I2.i2f1 should be accessed in a static way\n" +
29418 		"----------\n" +
29419 		"3. ERROR in X.java (at line 19)\n" +
29420 		"	Object oi1 = m1(c2, c3).new I1Member(); \n" +
29421 		"	             ^^^^^^^^^^\n" +
29422 		"Illegal enclosing instance specification for type X.I1.I1Member\n" +
29423 		"----------\n" +
29424 		"4. ERROR in X.java (at line 20)\n" +
29425 		"	Object oi2 = m1(c2, c3).new I2Member();\n" +
29426 		"	             ^^^^^^^^^^\n" +
29427 		"Illegal enclosing instance specification for type X.I2.I2Member\n" +
29428 		"----------\n");
29429 }
29430 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=126177 - variation
29431 public void test0894() {
29432 	runConformTest(
29433 		// test directory preparation
29434 		true /* flush output directory */,
29435 		new String[] { /* test files */
29436 			"X.java", // =================
29437 			"public class X {\n" +
29438 			"        static class C1 {\n" +
29439 			"                void c1m1() {\n" +
29440 			"                        System.out.print(\"[c1m1]\");\n" +
29441 			"                }\n" +
29442 			"        }\n" +
29443 			"        static interface I {}\n" +
29444 			"        static class C2 extends C1 implements I {}\n" +
29445 			"        static class C3 extends C1 implements I {}\n" +
29446 			"\n" +
29447 			"        public <T> T m1(T t1, T t2) {\n" +
29448 			"                return t1;\n" +
29449 			"        }\n" +
29450 			"\n" +
29451 			"        public <T extends C1 & I> void test(C2 c2, C3 c3, T t) {\n" +
29452 			"                m1(c2, c3).c1m1(); // 1\n" +
29453 			"                t.c1m1(); // 2\n" +
29454 			"                (t != null ? c2 : c3).c1m1(); // 3\n" +
29455 			"        }\n" +
29456 			"\n" +
29457 			"        public static void main(String... args) {\n" +
29458 			"                X x = new X();\n" +
29459 			"                x.test(new C2(), new C3(), new C2()); // 4\n" +
29460 			"                System.out.println();\n" +
29461 			"        }\n" +
29462 			"}\n",
29463 		},
29464 		// compiler results
29465 		"" /* expected compiler log */,
29466 		// runtime results
29467 		"[c1m1][c1m1][c1m1]" /* expected output string */,
29468 		"" /* expected error string */,
29469 		// javac options
29470 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
29471 }
29472 public void test0895() {
29473 	if (this.complianceLevel < ClassFileConstants.JDK1_7) {
29474 		this.runNegativeTest(
29475 			new String[] {
29476 				"X.java", // =================
29477 				"interface I {}\n" +
29478 				"public class X {\n" +
29479 				"    Object o = new <Object> I() {};\n" +
29480 				"}\n" ,
29481 			},
29482 			"----------\n" +
29483 			"1. ERROR in X.java (at line 3)\n" +
29484 			"	Object o = new <Object> I() {};\n" +
29485 			"	           ^^^^^^^^^^^^^^^^^^^\n" +
29486 			"The constructor Object() of type Object is not generic; it cannot be parameterized with arguments <Object>\n" +
29487 			"----------\n");
29488 		return;
29489 	}
29490 	this.runNegativeTest(
29491 			new String[] {
29492 				"X.java", // =================
29493 				"interface I {}\n" +
29494 				"public class X {\n" +
29495 				"    Object o = new <Object> I() {};\n" +
29496 				"}\n" ,
29497 				"Y.java",
29498 				"class Y extends Zork {}\n",
29499 			},
29500 			"----------\n" +
29501 			"1. WARNING in X.java (at line 3)\n" +
29502 			"	Object o = new <Object> I() {};\n" +
29503 			"	                ^^^^^^\n" +
29504 			"Unused type arguments for the non generic constructor Object() of type Object; it should not be parameterized with arguments <Object>\n" +
29505 			"----------\n" +
29506 			"----------\n" +
29507 			"1. ERROR in Y.java (at line 1)\n" +
29508 			"	class Y extends Zork {}\n" +
29509 			"	                ^^^^\n" +
29510 			"Zork cannot be resolved to a type\n" +
29511 			"----------\n");
29512 }
29513 public void test0896() {
29514 	runConformTest(
29515 		// test directory preparation
29516 		true /* flush output directory */,
29517 		new String[] { /* test files */
29518 			"X.java", // =================
29519 			"public class X {\n" +
29520 			"	interface I {		void f(); 	}\n" +
29521 			"	interface J {		void g(); }\n" +
29522 			"\n" +
29523 			"	static class A implements I, J {\n" +
29524 			"		public void f() {	System.out.print(\"[A#f()]\");}\n" +
29525 			"		public void g() {	System.out.print(\"[A#g()]\");}\n" +
29526 			"	}\n" +
29527 			"\n" +
29528 			"	static class B implements J, I {\n" +
29529 			"		public void f() {	System.out.print(\"[B#f()]\");}\n" +
29530 			"		public void g() {	System.out.print(\"[B#g()]\");}\n" +
29531 			"	}\n" +
29532 			"\n" +
29533 			"	public static void main(String[] args) {\n" +
29534 			"		f(true, new A(), new B());\n" +
29535 			"		f(false, new A(), new B());\n" +
29536 			"		System.out.println();\n" +
29537 			"	}\n" +
29538 			"\n" +
29539 			"	static void f(boolean cond, A a, B b) {\n" +
29540 			"		(cond ? a : b).f();\n" +
29541 			"		(cond ? a : b).g();\n" +
29542 			"	}\n" +
29543 			"}\n",
29544 		},
29545 		// compiler results
29546 		"" /* expected compiler log */,
29547 		// runtime results
29548 		"[A#f()][A#g()][B#f()][B#g()]" /* expected output string */,
29549 		"" /* expected error string */,
29550 		// javac options
29551 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
29552 }
29553 public void test0897() {
29554 	runConformTest(
29555 		// test directory preparation
29556 		new String[] { /* test files */
29557 			"Test.java", // =================
29558 			"interface I { }\n" +
29559 			"class X { }\n" +
29560 			"class A extends X implements I { }\n" +
29561 			"class B extends X implements I { }\n" +
29562 			"public class Test {\n" +
29563 			"    void test(A a, B b) {\n" +
29564 			"	X x = (a.hashCode() == b.hashCode()) ? a : b;\n" +
29565 			"    }\n" +
29566 			"}\n" +
29567 			"\n",
29568 		},
29569 		// javac options
29570 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
29571 }
29572 public void test0898() {
29573 	runConformTest(
29574 		// test directory preparation
29575 		new String[] { /* test files */
29576 			"X.java", // =================
29577 			"interface I1 {\n" +
29578 			"	void i1();\n" +
29579 			"}\n" +
29580 			"class G1<T extends I1> {\n" +
29581 			"	T get() {\n" +
29582 			"		return null;\n" +
29583 			"	}\n" +
29584 			"}\n" +
29585 			"interface I2 {\n" +
29586 			"	void i2();\n" +
29587 			"}\n" +
29588 			"public class X {\n" +
29589 			"	void f1(G1<?> g1) {\n" +
29590 			"		g1.get().i1();\n" +
29591 			"	}\n" +
29592 			"	void f2(G1<? extends I2> g1) {\n" +
29593 			"		g1.get().i1();\n" +
29594 			"		g1.get().i2();\n" +
29595 			"	}\n" +
29596 			"}\n",
29597 		},
29598 		// javac options
29599 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
29600 }
29601 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=122331
29602 public void test0899() {
29603 	this.runConformTest(
29604 		new String[] {
29605 			"A.java", // =================
29606 			"public class A<T extends A<T>> extends SomeArbitraryClass<T> {\n" +
29607 			"  public static class B {\n" +
29608 			"    private C c;\n" +
29609 			"    protected void set(C val) {\n" +
29610 			"      c = val;\n" +
29611 			"    }\n" +
29612 			"    protected class C {\n" +
29613 			"    }\n" +
29614 			"  }\n" +
29615 			"}",
29616 			"C.java",
29617 			"public class C {\n" +
29618 			"  \n" +
29619 			"  public C() {\n" +
29620 			"    //do nothing\n" +
29621 			"  }\n" +
29622 			"  \n" +
29623 			"}",
29624 			"ObjThatExtendsB.java",
29625 			"public class ObjThatExtendsB extends A.B {\n" +
29626 			"  protected void doSomeSetting() {\n" +
29627 			"    super.set(new ObjThatExtendsC());\n" +
29628 			"  }\n" +
29629 			"  protected class ObjThatExtendsC extends C {\n" +
29630 			"  }\n" +
29631 			"}",
29632 			"ObjThatExtendsC.java",
29633 			"public class ObjThatExtendsC extends C {\n" +
29634 			"  public ObjThatExtendsC() {\n" +
29635 			"    //do nothing\n" +
29636 			"  }\n" +
29637 			"}",
29638 			"SomeArbitraryClass.java",
29639 			"public class SomeArbitraryClass<T extends SomeArbitraryClass<T>> {\n" +
29640 			"  public SomeArbitraryClass() {\n" +
29641 			"    //do nothing\n" +
29642 			"  }\n" +
29643 			"}"
29644 		},
29645 		"");
29646 }
29647 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=97693
29648 public void test0900() {
29649 	this.runNegativeTest(
29650 		new String[] {
29651 			"X.java", // =================
29652 			"public class X<R> {\n" +
29653 			"	static interface Interface extends Comparable<String> {}\n" +
29654 			"\n" +
29655 			"	static final class Implements implements Interface {\n" +
29656 			"		public int compareTo(String o) {\n" +
29657 			"			return 0;\n" +
29658 			"		}\n" +
29659 			"	}\n" +
29660 			"\n" +
29661 			"	void method() {\n" +
29662 			"		((Comparable<R>) new Implements()).toString();\n" +
29663 			"		((Comparable) new Implements()).toString();\n" +
29664 			"		((Comparable<?>) new Implements()).toString();\n" +
29665 			"		((Comparable<? extends String>) new Implements()).toString();\n" +
29666 			"		((Comparable<? super String>) new Implements()).toString();\n" +
29667 			"		Zork z;\n" +
29668 			"	}\n" +
29669 			"}\n",
29670 		},
29671 		"----------\n" +
29672 		"1. WARNING in X.java (at line 11)\n" +
29673 		"	((Comparable<R>) new Implements()).toString();\n" +
29674 		"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
29675 		"Type safety: Unchecked cast from X.Implements to Comparable<R>\n" +
29676 		"----------\n" +
29677 		"2. WARNING in X.java (at line 12)\n" +
29678 		"	((Comparable) new Implements()).toString();\n" +
29679 		"	  ^^^^^^^^^^\n" +
29680 		"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
29681 		"----------\n" +
29682 		"3. ERROR in X.java (at line 16)\n" +
29683 		"	Zork z;\n" +
29684 		"	^^^^\n" +
29685 		"Zork cannot be resolved to a type\n" +
29686 		"----------\n");
29687 }
29688 // Object array vs Object into generic method
29689 public void test0901() {
29690 	runNegativeTest(
29691 		// test directory preparation
29692 		new String[] { /* test files */
29693 			"X.java",
29694 			"public class X {\n" +
29695 			"    static <T> T foo(T p1, T p2) {\n" +
29696 			"        return p1;\n" +
29697 			"    }\n" +
29698 			"    static Object[] bar(int[] i, float[] f) {\n" +
29699 			"        return foo(i, f);\n" +
29700 			"    }\n" +
29701 			"}"},
29702 		"----------\n" +
29703 		"1. ERROR in X.java (at line 6)\n" +
29704 		"	return foo(i, f);\n" +
29705 		"	       ^^^^^^^^^\n" +
29706 		"Type mismatch: cannot convert from "+intersection("Object","Serializable","Cloneable")+" to Object[]\n" +
29707 		"----------\n",
29708 		// javac options
29709 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
29710 }
29711 
29712 // circular references amongst generic interfaces with co-implementing classes
29713 public void test0902() {
29714 	runConformTest(
29715 		// test directory preparation
29716 		new String[] { /* test files */
29717 			"I.java",
29718 			"public interface I<U extends J<? extends I<U>>> {\n" +
29719 			"}",
29720 			"J.java",
29721 			"public interface J<T extends I<? extends J<T>>> {\n" +
29722 			"}",
29723 			"CI.java",
29724 			"class CI<U extends CJ<T, U> & J<T>,\n" +
29725 			"			T extends CI<U, T> & I<U>>\n" +
29726 			"	implements I<U> {\n" +
29727 			"}",
29728 			"CJ.java",
29729 			"class CJ<T extends CI<U, T> & I<U>,\n" +
29730 			"			U extends CJ<T, U> & J<T>>\n" +
29731 			"	implements J<T> {\n" +
29732 			"}"},
29733 		// javac options
29734 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
29735 }
29736 
29737 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=126914
29738 public void test0903() {
29739 	this.runConformTest(
29740 		new String[] {
29741 			"X.java",
29742 			"interface I<T extends J<T,U>, U extends I<T,U>> {\n" +
29743 			"    // empty\n" +
29744 			"}\n" +
29745 			"interface J<T extends J<T,U>, U extends I<T,U>> {\n" +
29746 			"    // empty\n" +
29747 			"}\n" +
29748 			"final class Y<T, U> extends X<T, U> implements I<X<T, U>, Y<T, U>> {\n" +
29749 			"    // empty\n" +
29750 			"}\n" +
29751 			"abstract class X<T, U> implements J<X<T, U>, Y<T, U>> {\n" +
29752 			"    // empty\n" +
29753 			"}\n"
29754 			},
29755 		"");
29756 }
29757 
29758 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=126914
29759 public void test0904() {
29760 	runConformTest(
29761 		// test directory preparation
29762 		new String[] { /* test files */
29763 			"X.java",
29764 			"interface I<T extends J<T,U>, U extends I<T,U>> {\n" +
29765 			"    // empty\n" +
29766 			"}\n" +
29767 			"interface J<T extends J<T,U>, U extends I<T,U>> {\n" +
29768 			"    // empty\n" +
29769 			"}\n" +
29770 			"abstract class X<T, U> implements J<X<T, U>, Y<T, U>> {\n" +
29771 			"    // empty\n" +
29772 			"}\n" +
29773 			"final class Y<T, U> extends X<T, U> implements I<X<T, U>, Y<T, U>> {\n" +
29774 			"    // empty\n" +
29775 			"}\n"
29776 			},
29777 		// javac options
29778 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
29779 }
29780 
29781 // array in super bound
29782 public void test0905() {
29783 	runConformTest(
29784 		// test directory preparation
29785 		new String[] { /* test files */
29786 			"X.java",
29787 			"import java.util.List;\n" +
29788 			" \n" +
29789 			"class X {\n" +
29790 			"    void foo(List<? super Object[]> p) {\n" +
29791 			"        p.add(new Object[0]);\n" +
29792 			"    }\n" +
29793 			"}"},
29794 		// javac options
29795 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
29796 }
29797 
29798 // raw types in casts
29799 public void test0906() {
29800 	this.runNegativeTest(
29801 		new String[] {
29802 			"X.java",
29803 			"interface I<V> {\n" +
29804 			"    // empty\n" +
29805 			"}         \n" +
29806 			"public class X implements I {\n" +
29807 			"    I<Integer> x1 = (I<Integer>) (X) null;\n" +
29808 			"    I<Integer> x2 = (I<Integer>) new X();\n" +
29809 			"    I<Integer> x3 = (I<Integer>) null;\n" +
29810 			"    X x4 = (X) (I<Integer>) null;\n" +
29811 			"}"},
29812 			"----------\n" +
29813 			"1. WARNING in X.java (at line 4)\n" +
29814 			"	public class X implements I {\n" +
29815 			"	                          ^\n" +
29816 			"I is a raw type. References to generic type I<V> should be parameterized\n" +
29817 			"----------\n" +
29818 			"2. WARNING in X.java (at line 5)\n" +
29819 			"	I<Integer> x1 = (I<Integer>) (X) null;\n" +
29820 			"	                ^^^^^^^^^^^^^^^^^^^^^\n" +
29821 			"Type safety: Unchecked cast from X to I<Integer>\n" +
29822 			"----------\n" +
29823 			"3. WARNING in X.java (at line 5)\n" +
29824 			"	I<Integer> x1 = (I<Integer>) (X) null;\n" +
29825 			"	                ^^^^^^^^^^^^^^^^^^^^^\n" +
29826 			"Unnecessary cast from X to I<Integer>\n" +
29827 			"----------\n" +
29828 			"4. WARNING in X.java (at line 5)\n" +
29829 			"	I<Integer> x1 = (I<Integer>) (X) null;\n" +
29830 			"	                             ^^^^^^^^\n" +
29831 			"Unnecessary cast from null to X\n" +
29832 			"----------\n" +
29833 			"5. WARNING in X.java (at line 6)\n" +
29834 			"	I<Integer> x2 = (I<Integer>) new X();\n" +
29835 			"	                ^^^^^^^^^^^^^^^^^^^^\n" +
29836 			"Type safety: Unchecked cast from X to I<Integer>\n" +
29837 			"----------\n" +
29838 			"6. WARNING in X.java (at line 6)\n" +
29839 			"	I<Integer> x2 = (I<Integer>) new X();\n" +
29840 			"	                ^^^^^^^^^^^^^^^^^^^^\n" +
29841 			"Unnecessary cast from X to I<Integer>\n" +
29842 			"----------\n" +
29843 			"7. WARNING in X.java (at line 7)\n" +
29844 			"	I<Integer> x3 = (I<Integer>) null;\n" +
29845 			"	                ^^^^^^^^^^^^^^^^^\n" +
29846 			"Unnecessary cast from null to I<Integer>\n" +
29847 			"----------\n" +
29848 			"8. WARNING in X.java (at line 8)\n" +
29849 			"	X x4 = (X) (I<Integer>) null;\n" +
29850 			"	           ^^^^^^^^^^^^^^^^^\n" +
29851 			"Unnecessary cast from null to I<Integer>\n" +
29852 			"----------\n");
29853 }
29854 
29855 // parametrized method with array extends Object upper bound verification
29856 public void test0907() {
29857 	this.runConformTest(
29858 		new String[] {
29859 			"X.java",
29860 			"import java.util.Collection;\n" +
29861 			"import java.util.Collections;\n" +
29862 			"public class X<T extends X<T, V>, V> {\n" +
29863 			"    public void foo() {\n" +
29864 			"        Y o = (new Z<Object>()).<Y, double[]> bar(Collections\n" +
29865 			"                .singleton(new Y()));\n" +
29866 			"        o.toString();\n" +
29867 			"    }\n" +
29868 			"}\n" +
29869 			"class Y extends X<Y, double[]> {\n" +
29870 			"    // empty\n" +
29871 			"}\n" +
29872 			"class Z<V> {\n" +
29873 			"    public <U extends X<U, W>, W extends V> U bar(Collection<U> c) {\n" +
29874 			"        return null;\n" +
29875 			"    }\n" +
29876 			"}\n"},
29877 		"");
29878 }
29879 
29880 // check capture for conditional operator - variant
29881 public void test0908() {
29882 	runConformTest(
29883 		// test directory preparation
29884 		new String[] { /* test files */
29885 			"X.java",
29886 			"public abstract class X {\n" +
29887 			"    protected <T> void foo(Class<? extends T> clazz) {\n" +
29888 			"        Class<? extends T> l = clazz.isInterface() ? bar(clazz) : clazz;\n" +
29889 			"    }\n" +
29890 			"    abstract public <T> Class<? extends T> bar(Class<T> p);\n" +
29891 			"}"},
29892 		// javac options
29893 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
29894 }
29895 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=126105
29896 public void test0909() {
29897 	this.runNegativeTest(
29898 		new String[] {
29899 			"X.java",
29900 			"public class X {\n" +
29901 			"	private static class B<T> {\n" +
29902 			"		private Object x;\n" +
29903 			"\n" +
29904 			"		public B(T x) {\n" +
29905 			"			this.x = x;\n" +
29906 			"		}\n" +
29907 			"	}\n" +
29908 			"\n" +
29909 			"	private static class C {\n" +
29910 			"		private Object x;\n" +
29911 			"\n" +
29912 			"		public C(Object x) {\n" +
29913 			"			this.x = x;\n" +
29914 			"		}\n" +
29915 			"	}\n" +
29916 			"\n" +
29917 			"	public static void main(String[] args) throws Throwable {\n" +
29918 			"		B<String> b = new B<String>(\"foo\");\n" +
29919 			"		System.out.println(b.x);\n" +
29920 			"\n" +
29921 			"		C c = new C(\"foo\");\n" +
29922 			"		System.out.println(c.x);\n" +
29923 			"		Zork z;\n" +
29924 			"	}\n" +
29925 			"}\n",
29926 		},
29927 		"----------\n" +
29928 		"1. ERROR in X.java (at line 24)\n" +
29929 		"	Zork z;\n" +
29930 		"	^^^^\n" +
29931 		"Zork cannot be resolved to a type\n" +
29932 		"----------\n");
29933 }
29934 
29935 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=127583
29936 public void test0910() {
29937 	int[] capIds = this.complianceLevel < ClassFileConstants.JDK1_8
29938 			? new int[]{ 1, 3, 4, 6, 13}
29939 			: new int[]{ 1, 2, 3, 4, 8};
29940 	this.runNegativeTest(
29941 		new String[] {
29942 			"X.java",
29943 			"import java.util.ArrayList;\n" +
29944 			"import java.util.Collection;\n" +
29945 			"import java.util.List;\n" +
29946 			"\n" +
29947 			"public class X {\n" +
29948 			"\n" +
29949 			"	void bar() {\n" +
29950 			"		List<Collection> lc1 = null;\n" +
29951 			"		List<Collection<?>> lc2 = null;\n" +
29952 			"		List<? extends Collection<?>> lc3 = null;\n" +
29953 			"		List<? extends Collection> lc4 = null;\n" +
29954 			"		lc1 = lc2; //1 ko\n" +
29955 			"		lc1 = lc3; //2 ko\n" +
29956 			"		lc1 = lc4; //3 ko\n" +
29957 			"		lc2 = lc1; //4 ko\n" +
29958 			"		lc2 = lc3; //5 ko\n" +
29959 			"		lc2 = lc4; //6 ko\n" +
29960 			"		lc3 = lc1; //7 ko\n" +
29961 			"		lc3 = lc2; //8 ok\n" +
29962 			"		lc3 = lc4; //9 ko\n" +
29963 			"		lc4 = lc1; //10 ok\n" +
29964 			"		lc4 = lc2; //11 ok\n" +
29965 			"		lc4 = lc3; //12 ok\n" +
29966 			"	}\n" +
29967 			"	private final List<Collection> aList = new ArrayList<Collection>();\n" +
29968 			"	public void foo() {\n" +
29969 			"		final List<Collection<?>> listCopy = new ArrayList<Collection<?>>(this.aList); // ko\n" +
29970 			"	}\n" +
29971 			"}\n",
29972 		},
29973 		"----------\n" +
29974 		"1. WARNING in X.java (at line 8)\n" +
29975 		"	List<Collection> lc1 = null;\n" +
29976 		"	     ^^^^^^^^^^\n" +
29977 		"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
29978 		"----------\n" +
29979 		"2. WARNING in X.java (at line 11)\n" +
29980 		"	List<? extends Collection> lc4 = null;\n" +
29981 		"	               ^^^^^^^^^^\n" +
29982 		"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
29983 		"----------\n" +
29984 		"3. ERROR in X.java (at line 12)\n" +
29985 		"	lc1 = lc2; //1 ko\n" +
29986 		"	      ^^^\n" +
29987 		"Type mismatch: cannot convert from List<Collection<?>> to List<Collection>\n" +
29988 		"----------\n" +
29989 		"4. ERROR in X.java (at line 13)\n" +
29990 		"	lc1 = lc3; //2 ko\n" +
29991 		"	      ^^^\n" +
29992 		"Type mismatch: cannot convert from List<capture#"+capIds[0]+"-of ? extends Collection<?>> to List<Collection>\n" +
29993 		"----------\n" +
29994 		"5. ERROR in X.java (at line 14)\n" +
29995 		"	lc1 = lc4; //3 ko\n" +
29996 		"	      ^^^\n" +
29997 		"Type mismatch: cannot convert from List<capture#"+capIds[1]+"-of ? extends Collection> to List<Collection>\n" +
29998 		"----------\n" +
29999 		"6. ERROR in X.java (at line 15)\n" +
30000 		"	lc2 = lc1; //4 ko\n" +
30001 		"	      ^^^\n" +
30002 		"Type mismatch: cannot convert from List<Collection> to List<Collection<?>>\n" +
30003 		"----------\n" +
30004 		"7. ERROR in X.java (at line 16)\n" +
30005 		"	lc2 = lc3; //5 ko\n" +
30006 		"	      ^^^\n" +
30007 		"Type mismatch: cannot convert from List<capture#"+capIds[2]+"-of ? extends Collection<?>> to List<Collection<?>>\n" +
30008 		"----------\n" +
30009 		"8. ERROR in X.java (at line 17)\n" +
30010 		"	lc2 = lc4; //6 ko\n" +
30011 		"	      ^^^\n" +
30012 		"Type mismatch: cannot convert from List<capture#"+capIds[3]+"-of ? extends Collection> to List<Collection<?>>\n" +
30013 		"----------\n" +
30014 		"9. ERROR in X.java (at line 18)\n" +
30015 		"	lc3 = lc1; //7 ko\n" +
30016 		"	      ^^^\n" +
30017 		"Type mismatch: cannot convert from List<Collection> to List<? extends Collection<?>>\n" +
30018 		"----------\n" +
30019 		"10. ERROR in X.java (at line 20)\n" +
30020 		"	lc3 = lc4; //9 ko\n" +
30021 		"	      ^^^\n" +
30022 		"Type mismatch: cannot convert from List<capture#"+capIds[4]+"-of ? extends Collection> to List<? extends Collection<?>>\n" +
30023 		"----------\n" +
30024 		"11. WARNING in X.java (at line 25)\n" +
30025 		"	private final List<Collection> aList = new ArrayList<Collection>();\n" +
30026 		"	                   ^^^^^^^^^^\n" +
30027 		"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
30028 		"----------\n" +
30029 		"12. WARNING in X.java (at line 25)\n" +
30030 		"	private final List<Collection> aList = new ArrayList<Collection>();\n" +
30031 		"	                                                     ^^^^^^^^^^\n" +
30032 		"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
30033 		"----------\n" +
30034 		"13. ERROR in X.java (at line 27)\n" +
30035 		"	final List<Collection<?>> listCopy = new ArrayList<Collection<?>>(this.aList); // ko\n" +
30036 		"	                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
30037 		"The constructor ArrayList<Collection<?>>(List<Collection>) is undefined\n" +
30038 		"----------\n");
30039 }
30040 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=127583 - variation
30041 public void test0911() {
30042 	this.runNegativeTest(
30043 		new String[] {
30044 			"X.java",
30045 			"import java.util.ArrayList;\n" +
30046 			"import java.util.Collection;\n" +
30047 			"import java.util.List;\n" +
30048 			"\n" +
30049 			"public class X {\n" +
30050 			"	void bar() {\n" +
30051 			"		List<Collection> lc1 = null;\n" +
30052 			"		List<Collection<?>> lc2 = null;\n" +
30053 			"		List<? super Collection<?>> lc3 = null;\n" +
30054 			"		List<? super Collection> lc4 = null;\n" +
30055 			"		lc1 = lc2; //1 ko\n" +
30056 			"		lc1 = lc3; //2 ko\n" +
30057 			"		lc1 = lc4; //3 ko\n" +
30058 			"		lc2 = lc1; //4 ko\n" +
30059 			"		lc2 = lc3; //5 ko\n" +
30060 			"		lc2 = lc4; //6 ko\n" +
30061 			"		lc3 = lc1; //7 ok\n" +
30062 			"		lc3 = lc2; //8 ok\n" +
30063 			"		lc3 = lc4; //9 ok\n" +
30064 			"		lc4 = lc1; //10 ok\n" +
30065 			"		lc4 = lc2; //11 ko\n" +
30066 			"		lc4 = lc3; //12 ko\n" +
30067 			"	}\n" +
30068 			"}\n",
30069 		},
30070 		"----------\n" +
30071 		"1. WARNING in X.java (at line 7)\n" +
30072 		"	List<Collection> lc1 = null;\n" +
30073 		"	     ^^^^^^^^^^\n" +
30074 		"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
30075 		"----------\n" +
30076 		"2. WARNING in X.java (at line 10)\n" +
30077 		"	List<? super Collection> lc4 = null;\n" +
30078 		"	             ^^^^^^^^^^\n" +
30079 		"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
30080 		"----------\n" +
30081 		"3. ERROR in X.java (at line 11)\n" +
30082 		"	lc1 = lc2; //1 ko\n" +
30083 		"	      ^^^\n" +
30084 		"Type mismatch: cannot convert from List<Collection<?>> to List<Collection>\n" +
30085 		"----------\n" +
30086 		"4. ERROR in X.java (at line 12)\n" +
30087 		"	lc1 = lc3; //2 ko\n" +
30088 		"	      ^^^\n" +
30089 		"Type mismatch: cannot convert from List<capture#1-of ? super Collection<?>> to List<Collection>\n" +
30090 		"----------\n" +
30091 		"5. ERROR in X.java (at line 13)\n" +
30092 		"	lc1 = lc4; //3 ko\n" +
30093 		"	      ^^^\n" +
30094 		"Type mismatch: cannot convert from List<capture#2-of ? super Collection> to List<Collection>\n" +
30095 		"----------\n" +
30096 		"6. ERROR in X.java (at line 14)\n" +
30097 		"	lc2 = lc1; //4 ko\n" +
30098 		"	      ^^^\n" +
30099 		"Type mismatch: cannot convert from List<Collection> to List<Collection<?>>\n" +
30100 		"----------\n" +
30101 		"7. ERROR in X.java (at line 15)\n" +
30102 		"	lc2 = lc3; //5 ko\n" +
30103 		"	      ^^^\n" +
30104 		"Type mismatch: cannot convert from List<capture#3-of ? super Collection<?>> to List<Collection<?>>\n" +
30105 		"----------\n" +
30106 		"8. ERROR in X.java (at line 16)\n" +
30107 		"	lc2 = lc4; //6 ko\n" +
30108 		"	      ^^^\n" +
30109 		"Type mismatch: cannot convert from List<capture#4-of ? super Collection> to List<Collection<?>>\n" +
30110 		"----------\n" +
30111 		"9. ERROR in X.java (at line 21)\n" +
30112 		"	lc4 = lc2; //11 ko\n" +
30113 		"	      ^^^\n" +
30114 		"Type mismatch: cannot convert from List<Collection<?>> to List<? super Collection>\n" +
30115 		"----------\n" +
30116 		"10. ERROR in X.java (at line 22)\n" +
30117 		"	lc4 = lc3; //12 ko\n" +
30118 		"	      ^^^\n" +
30119 		"Type mismatch: cannot convert from List<capture#12-of ? super Collection<?>> to List<? super Collection>\n" +
30120 		"----------\n");
30121 }
30122 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=127583 - variation
30123 public void test0912() {
30124 	this.runNegativeTest(
30125 		new String[] {
30126 			"X.java",
30127 			"import java.util.*;\n" +
30128 			"\n" +
30129 			"public class X {\n" +
30130 			"	void foo(List<? extends Collection<String>[]> l1, List<Collection[]> l2) {\n" +
30131 			"		l1 = l2;\n" +
30132 			"		l2 = l1;\n" +
30133 			"	}\n" +
30134 			"}\n",
30135 		},
30136 		"----------\n" +
30137 		"1. WARNING in X.java (at line 4)\n" +
30138 		"	void foo(List<? extends Collection<String>[]> l1, List<Collection[]> l2) {\n" +
30139 		"	                                                       ^^^^^^^^^^\n" +
30140 		"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
30141 		"----------\n" +
30142 		"2. ERROR in X.java (at line 5)\n" +
30143 		"	l1 = l2;\n" +
30144 		"	     ^^\n" +
30145 		"Type mismatch: cannot convert from List<Collection[]> to List<? extends Collection<String>[]>\n" +
30146 		"----------\n" +
30147 		"3. ERROR in X.java (at line 6)\n" +
30148 		"	l2 = l1;\n" +
30149 		"	     ^^\n" +
30150 		"Type mismatch: cannot convert from List<capture#2-of ? extends Collection<String>[]> to List<Collection[]>\n" +
30151 		"----------\n");
30152 }
30153 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=127583 - variation
30154 public void test0913() {
30155 	this.runNegativeTest(
30156 		new String[] {
30157 			"X.java",
30158 			"import java.util.*;\n" +
30159 			"public class X {\n" +
30160 			"	void bar() {\n" +
30161 			"		List<Collection[]> lc1 = null;\n" +
30162 			"		List<Collection<?>[]> lc2 = null;\n" +
30163 			"		List<? extends Collection<?>[]> lc3 = null;\n" +
30164 			"		List<? extends Collection[]> lc4 = null;\n" +
30165 			"		lc1 = lc2; //1 ko\n" +
30166 			"		lc1 = lc3; //2 ko\n" +
30167 			"		lc1 = lc4; //3 ko\n" +
30168 			"		lc2 = lc1; //4 ko\n" +
30169 			"		lc2 = lc3; //5 ko\n" +
30170 			"		lc2 = lc4; //6 ko\n" +
30171 			"		lc3 = lc1; //7 ko\n" +
30172 			"		lc3 = lc2; //8 ok\n" +
30173 			"		lc3 = lc4; //9 ko\n" +
30174 			"		lc4 = lc1; //10 ok\n" +
30175 			"		lc4 = lc2; //11 ok\n" +
30176 			"		lc4 = lc3; //12 ok		\n" +
30177 			"	}\n" +
30178 			"}\n",
30179 		},
30180 		"----------\n" +
30181 		"1. WARNING in X.java (at line 4)\n" +
30182 		"	List<Collection[]> lc1 = null;\n" +
30183 		"	     ^^^^^^^^^^\n" +
30184 		"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
30185 		"----------\n" +
30186 		"2. WARNING in X.java (at line 7)\n" +
30187 		"	List<? extends Collection[]> lc4 = null;\n" +
30188 		"	               ^^^^^^^^^^\n" +
30189 		"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
30190 		"----------\n" +
30191 		"3. ERROR in X.java (at line 8)\n" +
30192 		"	lc1 = lc2; //1 ko\n" +
30193 		"	      ^^^\n" +
30194 		"Type mismatch: cannot convert from List<Collection<?>[]> to List<Collection[]>\n" +
30195 		"----------\n" +
30196 		"4. ERROR in X.java (at line 9)\n" +
30197 		"	lc1 = lc3; //2 ko\n" +
30198 		"	      ^^^\n" +
30199 		"Type mismatch: cannot convert from List<capture#1-of ? extends Collection<?>[]> to List<Collection[]>\n" +
30200 		"----------\n" +
30201 		"5. ERROR in X.java (at line 10)\n" +
30202 		"	lc1 = lc4; //3 ko\n" +
30203 		"	      ^^^\n" +
30204 		"Type mismatch: cannot convert from List<capture#2-of ? extends Collection[]> to List<Collection[]>\n" +
30205 		"----------\n" +
30206 		"6. ERROR in X.java (at line 11)\n" +
30207 		"	lc2 = lc1; //4 ko\n" +
30208 		"	      ^^^\n" +
30209 		"Type mismatch: cannot convert from List<Collection[]> to List<Collection<?>[]>\n" +
30210 		"----------\n" +
30211 		"7. ERROR in X.java (at line 12)\n" +
30212 		"	lc2 = lc3; //5 ko\n" +
30213 		"	      ^^^\n" +
30214 		"Type mismatch: cannot convert from List<capture#3-of ? extends Collection<?>[]> to List<Collection<?>[]>\n" +
30215 		"----------\n" +
30216 		"8. ERROR in X.java (at line 13)\n" +
30217 		"	lc2 = lc4; //6 ko\n" +
30218 		"	      ^^^\n" +
30219 		"Type mismatch: cannot convert from List<capture#4-of ? extends Collection[]> to List<Collection<?>[]>\n" +
30220 		"----------\n" +
30221 		"9. ERROR in X.java (at line 14)\n" +
30222 		"	lc3 = lc1; //7 ko\n" +
30223 		"	      ^^^\n" +
30224 		"Type mismatch: cannot convert from List<Collection[]> to List<? extends Collection<?>[]>\n" +
30225 		"----------\n" +
30226 		"10. ERROR in X.java (at line 16)\n" +
30227 		"	lc3 = lc4; //9 ko\n" +
30228 		"	      ^^^\n" +
30229 		"Type mismatch: cannot convert from List<capture#8-of ? extends Collection[]> to List<? extends Collection<?>[]>\n" +
30230 		"----------\n");
30231 }
30232 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=127583 - variation
30233 public void test0914() {
30234 	this.runNegativeTest(
30235 		new String[] {
30236 			"X.java",
30237 			"import java.util.*;\n" +
30238 			"public class X {\n" +
30239 			"	void bar() {\n" +
30240 			"		List<Collection[]> lc1 = null;\n" +
30241 			"		List<Collection<?>[]> lc2 = null;\n" +
30242 			"		List<? super Collection<?>[]> lc3 = null;\n" +
30243 			"		List<? super Collection[]> lc4 = null;\n" +
30244 			"		lc1 = lc2; //1 ko\n" +
30245 			"		lc1 = lc3; //2 ko\n" +
30246 			"		lc1 = lc4; //3 ko\n" +
30247 			"		lc2 = lc1; //4 ko\n" +
30248 			"		lc2 = lc3; //5 ko\n" +
30249 			"		lc2 = lc4; //6 ko\n" +
30250 			"		lc3 = lc1; //7 ok\n" +
30251 			"		lc3 = lc2; //8 ok\n" +
30252 			"		lc3 = lc4; //9 ok\n" +
30253 			"		lc4 = lc1; //10 ok\n" +
30254 			"		lc4 = lc2; //11 ko\n" +
30255 			"		lc4 = lc3; //12 ko		\n" +
30256 			"	}\n" +
30257 			"}\n",
30258 		},
30259 		"----------\n" +
30260 		"1. WARNING in X.java (at line 4)\n" +
30261 		"	List<Collection[]> lc1 = null;\n" +
30262 		"	     ^^^^^^^^^^\n" +
30263 		"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
30264 		"----------\n" +
30265 		"2. WARNING in X.java (at line 7)\n" +
30266 		"	List<? super Collection[]> lc4 = null;\n" +
30267 		"	             ^^^^^^^^^^\n" +
30268 		"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
30269 		"----------\n" +
30270 		"3. ERROR in X.java (at line 8)\n" +
30271 		"	lc1 = lc2; //1 ko\n" +
30272 		"	      ^^^\n" +
30273 		"Type mismatch: cannot convert from List<Collection<?>[]> to List<Collection[]>\n" +
30274 		"----------\n" +
30275 		"4. ERROR in X.java (at line 9)\n" +
30276 		"	lc1 = lc3; //2 ko\n" +
30277 		"	      ^^^\n" +
30278 		"Type mismatch: cannot convert from List<capture#1-of ? super Collection<?>[]> to List<Collection[]>\n" +
30279 		"----------\n" +
30280 		"5. ERROR in X.java (at line 10)\n" +
30281 		"	lc1 = lc4; //3 ko\n" +
30282 		"	      ^^^\n" +
30283 		"Type mismatch: cannot convert from List<capture#2-of ? super Collection[]> to List<Collection[]>\n" +
30284 		"----------\n" +
30285 		"6. ERROR in X.java (at line 11)\n" +
30286 		"	lc2 = lc1; //4 ko\n" +
30287 		"	      ^^^\n" +
30288 		"Type mismatch: cannot convert from List<Collection[]> to List<Collection<?>[]>\n" +
30289 		"----------\n" +
30290 		"7. ERROR in X.java (at line 12)\n" +
30291 		"	lc2 = lc3; //5 ko\n" +
30292 		"	      ^^^\n" +
30293 		"Type mismatch: cannot convert from List<capture#3-of ? super Collection<?>[]> to List<Collection<?>[]>\n" +
30294 		"----------\n" +
30295 		"8. ERROR in X.java (at line 13)\n" +
30296 		"	lc2 = lc4; //6 ko\n" +
30297 		"	      ^^^\n" +
30298 		"Type mismatch: cannot convert from List<capture#4-of ? super Collection[]> to List<Collection<?>[]>\n" +
30299 		"----------\n" +
30300 		"9. ERROR in X.java (at line 18)\n" +
30301 		"	lc4 = lc2; //11 ko\n" +
30302 		"	      ^^^\n" +
30303 		"Type mismatch: cannot convert from List<Collection<?>[]> to List<? super Collection[]>\n" +
30304 		"----------\n" +
30305 		"10. ERROR in X.java (at line 19)\n" +
30306 		"	lc4 = lc3; //12 ko		\n" +
30307 		"	      ^^^\n" +
30308 		"Type mismatch: cannot convert from List<capture#12-of ? super Collection<?>[]> to List<? super Collection[]>\n" +
30309 		"----------\n");
30310 }
30311 
30312 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=128389
30313 public void test0915() {
30314 	this.runNegativeTest(
30315 		new String[] {
30316 			"X.java",
30317 			"public class X<T> {\n" +
30318 			"	class Y1 extends Throwable {\n" +
30319 			"		private static final long serialVersionUID = 1L;\n" +
30320 			"		T t;\n" +
30321 			"	}\n" +
30322 			"	static class Y2 extends Throwable {\n" +
30323 			"		private static final long serialVersionUID = 1L;\n" +
30324 			"	}\n" +
30325 			"	class Y3<U> extends Throwable {\n" +
30326 			"		private static final long serialVersionUID = 1L;\n" +
30327 			"\n" +
30328 			"		T t;\n" +
30329 			"	}\n" +
30330 			"}\n" +
30331 			"class Y4<E> extends Throwable {}\n" +
30332 			"\n",
30333 		},
30334 		"----------\n" +
30335 		"1. ERROR in X.java (at line 2)\n" +
30336 		"	class Y1 extends Throwable {\n" +
30337 		"	                 ^^^^^^^^^\n" +
30338 		"The generic class X<T>.Y1 may not subclass java.lang.Throwable\n" +
30339 		"----------\n" +
30340 		"2. ERROR in X.java (at line 9)\n" +
30341 		"	class Y3<U> extends Throwable {\n" +
30342 		"	                    ^^^^^^^^^\n" +
30343 		"The generic class X<T>.Y3<U> may not subclass java.lang.Throwable\n" +
30344 		"----------\n" +
30345 		"3. WARNING in X.java (at line 15)\n" +
30346 		"	class Y4<E> extends Throwable {}\n" +
30347 		"	      ^^\n" +
30348 		"The serializable class Y4 does not declare a static final serialVersionUID field of type long\n" +
30349 		"----------\n" +
30350 		"4. ERROR in X.java (at line 15)\n" +
30351 		"	class Y4<E> extends Throwable {}\n" +
30352 		"	                    ^^^^^^^^^\n" +
30353 		"The generic class Y4<E> may not subclass java.lang.Throwable\n" +
30354 		"----------\n");
30355 }
30356 
30357 // synchronized inheritance for multiple generic types
30358 public void test0916() {
30359 	runConformTest(
30360 		// test directory preparation
30361 		new String[] { /* test files */
30362 			"X.java",
30363 			"public class X<T extends X2<?>> {\n" +
30364 			"    T m2;\n" +
30365 			"    T getX2() {\n" +
30366 			"        return this.m2;\n" +
30367 			"    }\n" +
30368 			"}\n" +
30369 			"class X2<T extends X3> {\n" +
30370 			"    T m3;\n" +
30371 			"    T getX3() {\n" +
30372 			"        return this.m3;\n" +
30373 			"    }\n" +
30374 			"}\n" +
30375 			"class X3 {\n" +
30376 			"}\n" +
30377 			"class Y1<T extends Y2<?>> extends X<T> {\n" +
30378 			"    public void foo() {\n" +
30379 			"        getX2().getX3().bar(); // getX3 appropriately returns an Y3\n" +
30380 			"    }\n" +
30381 			"}\n" +
30382 			"class Y2<T extends Y3> extends X2<T> {\n" +
30383 			"}\n" +
30384 			"class Y3 extends X3 {\n" +
30385 			"    public void bar() {\n" +
30386 			"    }\n" +
30387 			"}\n"},
30388 		// javac options
30389 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
30390 }
30391 
30392 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=128423
30393 // [1.5][compiler] ClassCastException on illegal code fragment
30394 public void test0917() {
30395 	this.runNegativeTest(
30396 		new String[] {
30397 			"X.java",
30398 			"public class X<T extends A> extends X2<T.M> { }\n" +
30399 			"class X2<T> { }\n" +
30400 			"class A { static class M {} }"
30401 		},
30402 		"----------\n" +
30403 		"1. ERROR in X.java (at line 1)\n" +
30404 		"	public class X<T extends A> extends X2<T.M> { }\n" +
30405 		"	                                       ^^^\n" +
30406 		"Illegal qualified access from the type parameter T\n" +
30407 		"----------\n"
30408 		// cannot select from a type variable
30409 	);
30410 }
30411 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=128423 - variation
30412 public void test0917a() {
30413 	this.runNegativeTest(
30414 		new String[] {
30415 			"X.java",
30416 			"public class X<T> extends X2<T.clazz> { }\n" +
30417 			"class X2<T> { }\n"
30418 		},
30419 		"----------\n" +
30420 		"1. ERROR in X.java (at line 1)\n" +
30421 		"	public class X<T> extends X2<T.clazz> { }\n" +
30422 		"	                             ^^^^^^^\n" +
30423 		"Illegal qualified access from the type parameter T\n" +
30424 		"----------\n"
30425 		// cannot select from a type variable
30426 	);
30427 }
30428 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=128423 - variation
30429 public void test0917b() {
30430 	this.runNegativeTest(
30431 		new String[] {
30432 			"X.java",
30433 			"public class X<T> { Class<T> c = T.class; }"
30434 		},
30435 		"----------\n" +
30436 		"1. ERROR in X.java (at line 1)\n" +
30437 		"	public class X<T> { Class<T> c = T.class; }\n" +
30438 		"	                                 ^^^^^^^\n" +
30439 		"Illegal class literal for the type parameter T\n" +
30440 		"----------\n");
30441 }
30442 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=128423 - variation
30443 public void test0917c() {
30444 	this.runNegativeTest(
30445 		new String[] {
30446 			"X.java",
30447 			"public class X<T> extends X2<T.class> { }\n" +
30448 			"class X2<T> { }\n"
30449 		},
30450 		"----------\n" +
30451 		"1. ERROR in X.java (at line 1)\n" +
30452 		"	public class X<T> extends X2<T.class> { }\n" +
30453 		"	                               ^^^^^\n" +
30454 		"Syntax error on token \"class\", Identifier expected\n" +
30455 		"----------\n");
30456 }
30457 
30458 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=128560
30459 public void test0918() {
30460 	runConformTest(
30461 		// test directory preparation
30462 		new String[] { /* test files */
30463 			"BasicNode.java",
30464 			"class BasicEdge<N extends BasicNode<E, N> & Node<E>, E extends BasicEdge<N, E> & Edge<N>>\n" +
30465 			"		implements Edge<N> {\n" +
30466 			"}\n" +
30467 			"\n" +
30468 			"public class BasicNode<E extends BasicEdge<N, E> & Edge<N>, N extends BasicNode<E, N> & Node<E>>\n" +
30469 			"		implements Node<E> {\n" +
30470 			"}\n" +
30471 			"\n" +
30472 			"interface Edge<N extends Node<? extends Edge<N>>> {\n" +
30473 			"}\n" +
30474 			"\n" +
30475 			"interface Node<E extends Edge<? extends Node<E>>> {\n" +
30476 			"}\n",
30477 		},
30478 	// javac options
30479 	JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
30480 }
30481 
30482 public void test0919() {
30483 	this.runConformTest(
30484 		new String[] {
30485 			"X.java",
30486 			"class Box<E> {\n" +
30487 			"	private E element;\n" +
30488 			"	void put(E elem) {\n" +
30489 			"		this.element = elem;\n" +
30490 			"	}\n" +
30491 			"	E get() {\n" +
30492 			"		return this.element;\n" +
30493 			"	}\n" +
30494 			"	Pair<E, E> asPair() {\n" +
30495 			"		return new Pair<E, E>(this.element, this.element);\n" +
30496 			"	}\n" +
30497 			"	Box<Box<E>> nest() {\n" +
30498 			"		Box<Box<E>> wrapper = new Box<Box<E>>();\n" +
30499 			"		wrapper.put(this);\n" +
30500 			"		return wrapper;\n" +
30501 			"	}\n" +
30502 			"}\n" +
30503 			"\n" +
30504 			"class Pair<U, V> {\n" +
30505 			"	Pair(U u, V v) {\n" +
30506 			"	}\n" +
30507 			"}\n" +
30508 			"\n" +
30509 			"class PandoraBox<T extends Box<T>> extends Box<T> {\n" +
30510 			"}\n" +
30511 			"\n" +
30512 			"public class X {\n" +
30513 			"	void test(PandoraBox<?> pbox) {\n" +
30514 			"		Box<?> box = pbox.get();\n" +
30515 			"		Pair<?,?> pair = pbox.asPair();\n" +
30516 			"		Box<?> nbox = pbox.nest();\n" +
30517 			"	}\n" +
30518 			"}\n",
30519 		},
30520 		"");
30521 }
30522 public void test0920() {
30523 	this.runConformTest(
30524 		new String[] {
30525 			"X.java",
30526 			"import java.util.*;\n" +
30527 			"class Stack<E> {\n" +
30528 			"	private List<E> contents = new ArrayList<E>();\n" +
30529 			"	void push(E e) {\n" +
30530 			"		this.contents.add(e);\n" +
30531 			"	}\n" +
30532 			"	E pop() {\n" +
30533 			"		int last = this.contents.size() - 1;\n" +
30534 			"		if (last < 0) throw new EmptyStackException();\n" +
30535 			"		return this.contents.remove(last);\n" +
30536 			"	}\n" +
30537 			"	private static <T> void doSwap(Stack<T> s) {\n" +
30538 			"		T t1 = s.pop();\n" +
30539 			"		T t2 = s.pop();\n" +
30540 			"		s.push(t1);\n" +
30541 			"		s.push(t2);\n" +
30542 			"	}\n" +
30543 			"	static void swap(Stack<?> s) { doSwap(s); }\n" +
30544 			"}\n" +
30545 			"public class X {\n" +
30546 			"	public static void main(String[] args) {\n" +
30547 			"		Stack<Integer> si = new Stack<Integer>();\n" +
30548 			"		Integer[] ints = { 12, 13, 14, 15, };\n" +
30549 			"		for (Integer i : ints) si.push(i);\n" +
30550 			"		try {\n" +
30551 			"			while(true) {\n" +
30552 			"				System.out.print(\"[\"+si.pop()+\"]\");\n" +
30553 			"			}\n" +
30554 			"		} catch(EmptyStackException e) {\n" +
30555 			"			System.out.println(\"[done]\");\n" +
30556 			"		}\n" +
30557 			"	}\n" +
30558 			"}\n",
30559 		},
30560 		"[15][14][13][12][done]");
30561 }
30562 // FIXME: javac8 rejects
30563 public void test0921() {
30564 	runConformTest(
30565 		// test directory preparation
30566 		new String[] { /* test files */
30567 			"Graph.java",
30568 			"class Node<N extends Node<N,E>, E extends Edge<N,E>> {\n" +
30569 			"}\n" +
30570 			"class Edge<N extends Node<N,E>, E extends Edge<N,E>> {\n" +
30571 			"}\n" +
30572 			"class Graph<N extends Node<N,E>, E extends Edge<N,E>>{\n" +
30573 			"	N n;\n" +
30574 			"	E e;\n" +
30575 			"	private Graph(N n, E e) {\n" +
30576 			"		this.n = n;\n" +
30577 			"		this.e = e;\n" +
30578 			"	}\n" +
30579 			"	static <N extends Node<N,E>, E extends Edge<N,E>>\n" +
30580 			"	Graph<N,E> copy(Graph<N,E> g) {\n" +
30581 			"		return create(g.n,g.e);\n" +
30582 			"	}\n" +
30583 			"	static <N extends Node<N,E>, E extends Edge<N,E>>\n" +
30584 			"	Graph<N,E> create(N n, E e) {\n" +
30585 			"		return new Graph<N,E>(n,e);\n" +
30586 			"	}\n" +
30587 			"	Graph<?,?> builder() {\n" +
30588 			"		Graph<?,?> g = null;\n" +
30589 			"		return copy(g);\n" +
30590 			"	}\n" +
30591 			"}\n",
30592 		},
30593 	// javac options
30594 	this.complianceLevel < ClassFileConstants.JDK1_8 ?
30595 			(JavacTestOptions) JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 :
30596 			JavacTestOptions.DEFAULT/* javac test options */);
30597 }
30598 // Test case which comes from JDT/UI tests TypeEnvironmentTest.testWildcardAssignements
30599 public void test0922() {
30600 	this.runNegativeTest(
30601 		new String[] {
30602 		"Test.java",
30603 		"import java.util.*;\n" +
30604 		"public class Test {\n" +
30605 		"	List<List> list_raw_list;\n" +
30606 		"	{\n" +
30607 		"		Collection<? extends Collection<? extends Number>> col = list_raw_list;\n" +
30608 		"	}\n" +
30609 		"}\n"
30610 		},
30611 		"----------\n" +
30612 		"1. WARNING in Test.java (at line 3)\n" +
30613 		"	List<List> list_raw_list;\n" +
30614 		"	     ^^^^\n" +
30615 		"List is a raw type. References to generic type List<E> should be parameterized\n" +
30616 		"----------\n" +
30617 		"2. ERROR in Test.java (at line 5)\n" +
30618 		"	Collection<? extends Collection<? extends Number>> col = list_raw_list;\n" +
30619 		"	                                                         ^^^^^^^^^^^^^\n" +
30620 		"Type mismatch: cannot convert from List<List> to Collection<? extends Collection<? extends Number>>\n" +
30621 		"----------\n"
30622 	);
30623 }
30624 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=129129
30625 public void test0923() {
30626 	this.runNegativeTest(
30627 		new String[] {
30628 		"X.java",
30629 		"public class X<T> {\n" +
30630 		"\n" +
30631 		"  static void a(Class<? extends X<?>> c) {}\n" +
30632 		"\n" +
30633 		"  static void b(X<?> t) {\n" +
30634 		"    X.a(t.getClass());\n" +
30635 		"  }\n" +
30636 		"}\n"
30637 		},
30638 		"----------\n" +
30639 		"1. ERROR in X.java (at line 6)\n" +
30640 		"	X.a(t.getClass());\n" +
30641 		"	  ^\n" +
30642 		"The method a(Class<? extends X<?>>) in the type X is not applicable for the arguments (Class<capture#2-of ? extends X>)\n" +
30643 		"----------\n");
30644 }
30645 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=129190
30646 public void test0924() {
30647 	runConformTest(
30648 		// test directory preparation
30649 		true /* flush output directory */,
30650 		new String[] { /* test files */
30651 			"ExtendedOuter.java",
30652 			"class Outer<O> {\n" +
30653 			"	class Inner {\n" +
30654 			"	}\n" +
30655 			"\n" +
30656 			"	static void method(Outer<?>.Inner x) {\n" +
30657 			"		System.out.println(\"SUCCESS\");\n" +
30658 			"	}\n" +
30659 			"}\n" +
30660 			"\n" +
30661 			"public class ExtendedOuter<E> extends Outer<E> {\n" +
30662 			"	class ExtendedInner extends Inner {\n" +
30663 			"		{\n" +
30664 			"			Outer.method(this);\n" +
30665 			"		}\n" +
30666 			"	}\n" +
30667 			"	public static void main(String[] args) {\n" +
30668 			"		new ExtendedOuter<String>().new ExtendedInner();\n" +
30669 			"	}\n" +
30670 			"}\n"
30671 		},
30672 		// compiler results
30673 		"" /* expected compiler log */,
30674 		// runtime results
30675 		"SUCCESS" /* expected output string */,
30676 		"" /* expected error string */,
30677 		// javac options
30678 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
30679 }
30680 public void test0925() {
30681 	runConformTest(
30682 		// test directory preparation
30683 		true /* flush output directory */,
30684 		new String[] { /* test files */
30685 			"X.java",
30686 			"import java.util.*;\n" +
30687 			"\n" +
30688 			"public class X<A, B> {\n" +
30689 			"	private List<A> toAdd;\n" +
30690 			"\n" +
30691 			"	public X(List<A> toAdd) {\n" +
30692 			"		this.toAdd = toAdd;\n" +
30693 			"	}\n" +
30694 			"\n" +
30695 			"	private List<A> getRelated(B b) {\n" +
30696 			"		// some application logic\n" +
30697 			"		// for demo\n" +
30698 			"		return toAdd;\n" +
30699 			"	}\n" +
30700 			"\n" +
30701 			"	@SuppressWarnings(\"unchecked\")\n" +
30702 			"	public <L extends List<? super A>, LF extends Factory<L>> L addOrCreate4(\n" +
30703 			"			B b, L l, LF lf) {\n" +
30704 			"		if (l == null) {\n" +
30705 			"			l = lf.create();\n" +
30706 			"		}\n" +
30707 			"		((List<? super A>) l).addAll(getRelated(b)); \n" +
30708 			"		l.addAll(getRelated(b));\n" +
30709 			"		return l;\n" +
30710 			"	}\n" +
30711 			"\n" +
30712 			"	public static class ListFactory<T> implements Factory<List<T>> {\n" +
30713 			"		public List<T> create() {\n" +
30714 			"			return new ArrayList<T>();\n" +
30715 			"		}\n" +
30716 			"	}\n" +
30717 			"\n" +
30718 			"	public static interface Factory<T> {\n" +
30719 			"		public T create();\n" +
30720 			"	}\n" +
30721 			"\n" +
30722 			"	public static void main(String... args) {\n" +
30723 			"		ListFactory<Number> lf = new ListFactory<Number>();\n" +
30724 			"		List<Long> longs = new ArrayList<Long>();\n" +
30725 			"		longs.add(new Long(1));\n" +
30726 			"		X<Long, Number> test = new X<Long, Number>(longs);\n" +
30727 			"		List<Number> ret4 = null;\n" +
30728 			"		ret4 = test.addOrCreate4(1, ret4, lf);\n" +
30729 			"		System.out.println(\"SUCCESS\");\n" +
30730 			"	}\n" +
30731 			"}\n"
30732 		},
30733 		// compiler results
30734 		null /* do not check compiler log */,
30735 		// runtime results
30736 		"SUCCESS" /* expected output string */,
30737 		"" /* expected error string */,
30738 		// javac options
30739 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10_b24 /* javac test options */);
30740 }
30741 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=129261
30742 public void test0926() {
30743 	String xSource =
30744 			"public class X {\n" +
30745 			"	@SuppressWarnings(\"null\")\n" +
30746 			"	public void foo() {\n" +
30747 			"		NonTerminalSourcePart<? extends Tuple<Boolean, Term>> RESULT = null;\n" +
30748 			"		NonTerminalSourcePart<? extends Tuple<? extends Term, ? extends Formula>> t = null;\n" +
30749 			"		RESULT = NonTerminalSourcePart.create(Tuple.create(true, t.value().fst()));\n" +
30750 			"	}\n" +
30751 			"}\n" +
30752 			"\n" +
30753 			"class Term {\n" +
30754 			"}\n" +
30755 			"\n" +
30756 			"class Formula {\n" +
30757 			"}\n" +
30758 			"\n" +
30759 			"final class NonTerminalSourcePart<V> {\n" +
30760 			"	static <V> NonTerminalSourcePart<V> create(final V _value) {\n" +
30761 			"		return null;\n" +
30762 			"	}\n" +
30763 			"	final V value() {\n" +
30764 			"		return null;\n" +
30765 			"	}\n" +
30766 			"}\n" +
30767 			"\n" +
30768 			"class Tuple<A, B> {\n" +
30769 			"	public static <A, B> Tuple<A, B> create(final A a, final B b) {\n" +
30770 			"		return null;\n" +
30771 			"	}\n" +
30772 			"	public A fst() {\n" +
30773 			"		return null;\n" +
30774 			"	}\n" +
30775 			"}\n";
30776 	if (this.complianceLevel < ClassFileConstants.JDK1_8) {
30777 		runNegativeTest(
30778 			new String[] {
30779 				"X.java",
30780 				xSource
30781 			},
30782 			// compiler results
30783 			"----------\n" + /* expected compiler log */
30784 			"1. ERROR in X.java (at line 6)\n" +
30785 			"	RESULT = NonTerminalSourcePart.create(Tuple.create(true, t.value().fst()));\n" +
30786 			"	         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
30787 			"Type mismatch: cannot convert from NonTerminalSourcePart<Tuple<Boolean,capture#3-of ? extends Term>> to NonTerminalSourcePart<? extends Tuple<Boolean,Term>>\n" +
30788 			"----------\n",
30789 			// javac options
30790 			JavacTestOptions.JavacHasABug.JavacBug6557661 /* javac test options */);
30791 	} else {
30792 		runConformTest(
30793 			new String[] {
30794 				"X.java",
30795 				xSource
30796 			});
30797 	}
30798 }
30799 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=129261 - variation
30800 public void test0927() {
30801 	this.runNegativeTest(
30802 		new String[] {
30803 		"X.java",
30804 		"import java.util.*;\n" +
30805 		"@SuppressWarnings(\"null\") public class X {\n" +
30806 		"	public void foo() {\n" +
30807 		"		List<? extends List<Object>> RESULT = null;\n" +
30808 		"		List<? extends Object> lst = null;\n" +
30809 		"		RESULT = Collections.singletonList(Collections.singletonList(lst.get(0)));\n" +
30810 		"	}\n" +
30811 		"	public void bar() {\n" +
30812 		"		List<List<Object>> RESULT = null;\n" +
30813 		"		List<? extends Object> lst = null;\n" +
30814 		"		RESULT = Collections.singletonList(Collections.singletonList(lst.get(0)));\n" +
30815 		"	}\n" +
30816 		"	public void baz() {\n" +
30817 		"		List<List<Object>> RESULT = null;\n" +
30818 		"		List<?> lst = null;\n" +
30819 		"		RESULT = Collections.singletonList(Collections.singletonList(lst.get(0)));\n" +
30820 		"	}\n" +
30821 		"	public void bar2(List<? extends Object> lst) {\n" +
30822 		"		List<Object> RESULT = null;\n" +
30823 		"		RESULT = lst;\n" +
30824 		"		RESULT = Collections.singletonList(lst.get(0));\n" +
30825 		"	}	\n" +
30826 		"	public static void main(String[] args) {\n" +
30827 		"		List<String> ls = new ArrayList<String>();\n" +
30828 		"		ls.add(\"str\");\n" +
30829 		"		new X().bar2(ls);\n" +
30830 		"	}\n" +
30831 		"}\n",
30832 		},
30833 		(this.complianceLevel < ClassFileConstants.JDK1_8 ?
30834 		"----------\n" +
30835 		"1. ERROR in X.java (at line 6)\n" +
30836 		"	RESULT = Collections.singletonList(Collections.singletonList(lst.get(0)));\n" +
30837 		"	         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
30838 		"Type mismatch: cannot convert from List<List<capture#2-of ? extends Object>> to List<? extends List<Object>>\n" +
30839 		"----------\n" +
30840 		"2. ERROR in X.java (at line 11)\n" +
30841 		"	RESULT = Collections.singletonList(Collections.singletonList(lst.get(0)));\n" +
30842 		"	         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
30843 		"Type mismatch: cannot convert from List<List<capture#3-of ? extends Object>> to List<List<Object>>\n" +
30844 		"----------\n" +
30845 		"3. ERROR in X.java (at line 16)\n" +
30846 		"	RESULT = Collections.singletonList(Collections.singletonList(lst.get(0)));\n" +
30847 		"	         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
30848 		"Type mismatch: cannot convert from List<List<capture#4-of ?>> to List<List<Object>>\n" +
30849 		"----------\n" +
30850 		"4. ERROR in X.java (at line 20)\n" +
30851 		"	RESULT = lst;\n" +
30852 		"	         ^^^\n" +
30853 		"Type mismatch: cannot convert from List<capture#5-of ? extends Object> to List<Object>\n" +
30854 		"----------\n" +
30855 		"5. ERROR in X.java (at line 21)\n" +
30856 		"	RESULT = Collections.singletonList(lst.get(0));\n" +
30857 		"	         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
30858 		"Type mismatch: cannot convert from List<capture#6-of ? extends Object> to List<Object>\n" +
30859 		"----------\n"
30860 		:
30861 		"----------\n" +
30862 		"1. ERROR in X.java (at line 20)\n" +
30863 		"	RESULT = lst;\n" +
30864 		"	         ^^^\n" +
30865 		"Type mismatch: cannot convert from List<capture#5-of ? extends Object> to List<Object>\n" +
30866 		"----------\n"));
30867 }
30868 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=129261 - variation
30869 public void test0928() {
30870 	this.runNegativeTest(
30871 		new String[] {
30872 		"X.java",
30873 		"import java.util.*;\n" +
30874 		"public class X {\n" +
30875 		"    public static void main(String[] args) throws Throwable {\n" +
30876 		"	List<?> x1 = new ArrayList<Integer>();\n" +
30877 		"	List<?> x2 = new ArrayList<Integer>();\n" +
30878 		"	x1.addAll(x2);\n" +
30879 		"    }\n" +
30880 		"}\n",
30881 		},
30882 		"----------\n" +
30883 		"1. ERROR in X.java (at line 6)\n" +
30884 		"	x1.addAll(x2);\n" +
30885 		"	   ^^^^^^\n" +
30886 		"The method addAll(Collection<? extends capture#1-of ?>) in the type List<capture#1-of ?> is not applicable for the arguments (List<capture#2-of ?>)\n" +
30887 		"----------\n");
30888 }
30889 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=117119
30890 // SHOULD FAIL AT 1.8 (18.2.3): The method allOf(Class<E>) in the type X is not applicable for the arguments (Class<capture#1-of ? extends Enum>)
30891 public void test0929() {
30892 	this.runNegativeTest(
30893 		new String[] {
30894 		"X.java",
30895 		"import java.util.Collection;\n" +
30896 		"\n" +
30897 		"public class X {\n" +
30898 		"  \n" +
30899 		"  public static <E extends Enum<E>> void fails () {\n" +
30900 		"    Class<? extends Enum> enumType = null;\n" +
30901 		"    final Collection<E> test = allOf(enumType);\n" +
30902 		"\n" +
30903 		"    Collection<? extends Enum> colType = null;\n" +
30904 		"    final Collection<E> test2 = colType;\n" +
30905 		"  }\n" +
30906 		"  \n" +
30907 		"  public static <E extends Enum<E>> Collection<E> allOf(final Class<E> enumType) {\n" +
30908 		"    return null;\n" +
30909 		"  }\n" +
30910 		"}\n",
30911 		},
30912 		"----------\n" +
30913 		"1. WARNING in X.java (at line 6)\n" +
30914 		"	Class<? extends Enum> enumType = null;\n" +
30915 		"	                ^^^^\n" +
30916 		"Enum is a raw type. References to generic type Enum<E> should be parameterized\n" +
30917 		"----------\n" +
30918 		"2. WARNING in X.java (at line 7)\n" +
30919 		"	final Collection<E> test = allOf(enumType);\n" +
30920 		"	                           ^^^^^^^^^^^^^^^\n" +
30921 		"Type safety: Unchecked invocation allOf(Class<capture#1-of ? extends Enum>) of the generic method allOf(Class<E>) of type X\n" +
30922 		"----------\n" +
30923 		"3. WARNING in X.java (at line 7)\n" +
30924 		"	final Collection<E> test = allOf(enumType);\n" +
30925 		"	                           ^^^^^^^^^^^^^^^\n" +
30926 		"Type safety: The expression of type Collection needs unchecked conversion to conform to Collection<E>\n" +
30927 		"----------\n" +
30928 		"4. WARNING in X.java (at line 9)\n" +
30929 		"	Collection<? extends Enum> colType = null;\n" +
30930 		"	                     ^^^^\n" +
30931 		"Enum is a raw type. References to generic type Enum<E> should be parameterized\n" +
30932 		"----------\n" +
30933 		"5. ERROR in X.java (at line 10)\n" +
30934 		"	final Collection<E> test2 = colType;\n" +
30935 		"	                            ^^^^^^^\n" +
30936 		"Type mismatch: cannot convert from Collection<capture#2-of ? extends Enum> to Collection<E>\n" +
30937 		"----------\n");
30938 }
30939 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=119238
30940 public void test0930() {
30941 	this.runNegativeTest(
30942 		new String[] {
30943 		"X.java",
30944 		"public class X<T> {\n" +
30945 		"        public static int I;\n" +
30946 		"        public void foo() {\n" +
30947 		"                X.I= 10;\n" +
30948 		"        }\n" +
30949 		"		 {  Zork z; }\n" +
30950 		"}\n",
30951 		},
30952 		"----------\n" +
30953 		"1. ERROR in X.java (at line 6)\n" +
30954 		"	{  Zork z; }\n" +
30955 		"	   ^^^^\n" +
30956 		"Zork cannot be resolved to a type\n" +
30957 		"----------\n");
30958 }
30959 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=119238 - variation
30960 public void test0931() {
30961 	this.runNegativeTest(
30962 		new String[] {
30963 		"X.java",
30964 		"public class X<T> {\n" +
30965 		"        public static int I;\n" +
30966 		"        public void foo() {\n" +
30967 		"                X<T>.I= 10;\n" +
30968 		"        }\n" +
30969 		"}\n",
30970 		},
30971 		"----------\n" +
30972 		"1. ERROR in X.java (at line 4)\n" +
30973 		"	X<T>.I= 10;\n" +
30974 		"	     ^\n" +
30975 		"Syntax error on token \"I\", VariableDeclaratorId expected after this token\n" +
30976 		"----------\n");
30977 }
30978 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=119238 - variation
30979 public void _test0932() {
30980 	this.runNegativeTest(
30981 		new String[] {
30982 		"X.java",
30983 		"public class X<T> {\n" +
30984 		"        public static int Method() { return 0; }\n" +
30985 		"        public void foo() {\n" +
30986 		"                X.Method();\n" +
30987 		"        }\n" +
30988 		"        public void bar() {\n" +
30989 		"                X<String>.Method();\n" +
30990 		"        }\n" +
30991 		"}\n",
30992 		},
30993 		"----------\n" +
30994 		"1. ERROR in X.java (at line 7)\n" +
30995 		"	X<String>.Method();\n" +
30996 		"	^^^^^^^^^^\n" +
30997 		"Syntax error on token(s), misplaced construct(s)\n" +
30998 		"----------\n");
30999 }
31000 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=128063
31001 public void test0933() {
31002 	this.runNegativeTest(
31003 		new String[] {
31004 		"a/AbstractFoo.java", //================================
31005 		"package a;\n" +
31006 		"public abstract class AbstractFoo<T extends AbstractFoo<T>> {\n" +
31007 		"	protected static class Inner<T extends AbstractFoo<T>> {\n" +
31008 		"		public Inner() {\n" +
31009 		"		}\n" +
31010 		"\n" +
31011 		"		public final void doSmth() {\n" +
31012 		"		}\n" +
31013 		"	}\n" +
31014 		"}\n",
31015 		"b/CustomFoo.java", //================================
31016 		"package b;\n" +
31017 		"import a.AbstractFoo;\n" +
31018 		"public final class CustomFoo extends AbstractFoo<CustomFoo> {\n" +
31019 		"	private Inner<DefaultFoo> defaultInner;\n" +
31020 		"\n" +
31021 		"	Inner<DefaultFoo> getDefaultInner() {\n" +
31022 		"		return (this.defaultInner == null)\n" +
31023 		"				? this.defaultInner = new Inner<DefaultFoo>()\n" +
31024 		"				: this.defaultInner;\n" +
31025 		"	}	\n" +
31026 		"\n" +
31027 		"	private Inner<CustomFoo> customInner;\n" +
31028 		"\n" +
31029 		"	Inner<CustomFoo> getCustomInner() {\n" +
31030 		"		return (this.customInner == null)\n" +
31031 		"				? this.customInner = new Inner<CustomFoo>()\n" +
31032 		"				: this.customInner;\n" +
31033 		"	}	\n" +
31034 		"}\n",
31035 		"b/DefaultFoo.java", //================================
31036 		"package b;\n" +
31037 		"import a.AbstractFoo;\n" +
31038 		"public final class DefaultFoo extends AbstractFoo<DefaultFoo> {\n" +
31039 		"	private Inner<DefaultFoo> defaultInner;\n" +
31040 		"\n" +
31041 		"	Inner<DefaultFoo> getDefaultInner() {\n" +
31042 		"		return (this.defaultInner == null)\n" +
31043 		"				? this.defaultInner = new Inner<DefaultFoo>()\n" +
31044 		"				: this.defaultInner;\n" +
31045 		"	}	\n" +
31046 		"\n" +
31047 		"	private Inner<CustomFoo> customInner;\n" +
31048 		"\n" +
31049 		"	Inner<CustomFoo> getCustomInner() {\n" +
31050 		"		return (this.customInner == null)\n" +
31051 		"				? this.customInner = new Inner<CustomFoo>()\n" +
31052 		"				: this.customInner;\n" +
31053 		"	}\n" +
31054 		"\n" +
31055 		"	///////////////////////////////////////////////////////////////////////\n" +
31056 		"	public void testCompilationFailure(final CustomFoo foo) {\n" +
31057 		"		final DefaultFoo foo1 = this;\n" +
31058 		"		final CustomFoo foo2 = foo;\n" +
31059 		"\n" +
31060 		"		// These get compiled w/o error:\n" +
31061 		"		foo1.getCustomInner().doSmth();\n" +
31062 		"		foo1.getDefaultInner().doSmth();\n" +
31063 		"\n" +
31064 		"		// These do not (Eclipse 3.2.0 M4):\n" +
31065 		"		foo2.getCustomInner().doSmth();\n" +
31066 		"		foo2.getDefaultInner().doSmth();\n" +
31067 		"\n" +
31068 		"		// Expect error\n" +
31069 		"		String s11 = foo1.getCustomInner();\n" +
31070 		"		String s12 = foo2.getDefaultInner();\n" +
31071 		"		String s21 = foo2.getCustomInner();\n" +
31072 		"		String s22 = foo2.getDefaultInner();\n" +
31073 		"\n" +
31074 		"		// However, if we split statements, everything\'s ok: \n" +
31075 		"		final Inner<CustomFoo> customInner2 = foo2.getCustomInner();\n" +
31076 		"		customInner2.doSmth();\n" +
31077 		"\n" +
31078 		"		final Inner<DefaultFoo> defaultInner2 = foo2.getDefaultInner();\n" +
31079 		"		defaultInner2.doSmth();\n" +
31080 		"	}\n" +
31081 		"}\n",
31082 		},
31083 		"----------\n" +
31084 		"1. ERROR in b\\DefaultFoo.java (at line 34)\n" +
31085 		"	String s11 = foo1.getCustomInner();\n" +
31086 		"	             ^^^^^^^^^^^^^^^^^^^^^\n" +
31087 		"Type mismatch: cannot convert from AbstractFoo.Inner<CustomFoo> to String\n" +
31088 		"----------\n" +
31089 		"2. ERROR in b\\DefaultFoo.java (at line 35)\n" +
31090 		"	String s12 = foo2.getDefaultInner();\n" +
31091 		"	             ^^^^^^^^^^^^^^^^^^^^^^\n" +
31092 		"Type mismatch: cannot convert from AbstractFoo.Inner<DefaultFoo> to String\n" +
31093 		"----------\n" +
31094 		"3. ERROR in b\\DefaultFoo.java (at line 36)\n" +
31095 		"	String s21 = foo2.getCustomInner();\n" +
31096 		"	             ^^^^^^^^^^^^^^^^^^^^^\n" +
31097 		"Type mismatch: cannot convert from AbstractFoo.Inner<CustomFoo> to String\n" +
31098 		"----------\n" +
31099 		"4. ERROR in b\\DefaultFoo.java (at line 37)\n" +
31100 		"	String s22 = foo2.getDefaultInner();\n" +
31101 		"	             ^^^^^^^^^^^^^^^^^^^^^^\n" +
31102 		"Type mismatch: cannot convert from AbstractFoo.Inner<DefaultFoo> to String\n" +
31103 		"----------\n");
31104 }
31105 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=128063 - variation
31106 public void test0934() {
31107 	this.runNegativeTest(
31108 		new String[] {
31109 		"X.java", //================================
31110 		"public class X<T> {\n" +
31111 		"	static class Inner<U> {\n" +
31112 		"		static class InInner <V> {\n" +
31113 		"		}\n" +
31114 		"	}\n" +
31115 		"}\n" +
31116 		"class Y<W> extends X<W> {\n" +
31117 		"	void foo() {\n" +
31118 		"		Inner<W> inner = null;\n" +
31119 		"		String s = inner;\n" +
31120 		"	}\n" +
31121 		"}\n",
31122 		},
31123 		"----------\n" +
31124 		"1. ERROR in X.java (at line 10)\n" +
31125 		"	String s = inner;\n" +
31126 		"	           ^^^^^\n" +
31127 		"Type mismatch: cannot convert from X.Inner<W> to String\n" +
31128 		"----------\n");
31129 }
31130 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=128063 - variation
31131 public void test0935() {
31132 	this.runNegativeTest(
31133 		new String[] {
31134 		"X.java", //================================
31135 		"public class X<T> {\n" +
31136 		"	static class Inner<U> {\n" +
31137 		"		class InInner <V> {\n" +
31138 		"		}\n" +
31139 		"	}\n" +
31140 		"}\n" +
31141 		"class Y<W> extends X<W> {\n" +
31142 		"	void foo() {\n" +
31143 		"		Inner<W>.InInner<W> inner = null;\n" +
31144 		"		String s = inner;\n" +
31145 		"	}\n" +
31146 		"}\n",
31147 		},
31148 		"----------\n" +
31149 		"1. ERROR in X.java (at line 10)\n" +
31150 		"	String s = inner;\n" +
31151 		"	           ^^^^^\n" +
31152 		"Type mismatch: cannot convert from X.Inner<W>.InInner<W> to String\n" +
31153 		"----------\n");
31154 }
31155 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=128063 - variation
31156 public void test0936() {
31157 	this.runNegativeTest(
31158 		new String[] {
31159 		"X.java", //================================
31160 		"public class X<T> {\n" +
31161 		"	class Inner<U> {\n" +
31162 		"		class InInner <V> {\n" +
31163 		"		}\n" +
31164 		"	}\n" +
31165 		"}\n" +
31166 		"class Y<W> extends X<W> {\n" +
31167 		"	void foo() {\n" +
31168 		"		Inner<W> inner = null;\n" +
31169 		"		String s = inner;\n" +
31170 		"		\n" +
31171 		"		Inner<W>.InInner<W> inner2 = null;\n" +
31172 		"		s = inner2;\n" +
31173 		"\n" +
31174 		"	}\n" +
31175 		"}\n",
31176 		},
31177 		"----------\n" +
31178 		"1. ERROR in X.java (at line 10)\n" +
31179 		"	String s = inner;\n" +
31180 		"	           ^^^^^\n" +
31181 		"Type mismatch: cannot convert from X<W>.Inner<W> to String\n" +
31182 		"----------\n" +
31183 		"2. ERROR in X.java (at line 13)\n" +
31184 		"	s = inner2;\n" +
31185 		"	    ^^^^^^\n" +
31186 		"Type mismatch: cannot convert from X<W>.Inner<W>.InInner<W> to String\n" +
31187 		"----------\n");
31188 }
31189 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=129190 - variation
31190 public void test0937() {
31191 	this.runNegativeTest(
31192 		new String[] {
31193 		"ExtendedOuter.java", //================================
31194 		"class Outer<O> {\n" +
31195 		"  class Inner {}\n" +
31196 		"\n" +
31197 		"  static void method(Outer.Inner x) {}\n" +
31198 		"}\n" +
31199 		"\n" +
31200 		"public class ExtendedOuter<E> extends Outer<E> {\n" +
31201 		"  class ExtendedInner extends Inner {\n" +
31202 		"    {\n" +
31203 		"      Outer.method(this);\n" +
31204 		"    }\n" +
31205 		"  }\n" +
31206 		"  void foo() {\n" +
31207 		"    Zork zk;\n" +
31208 		"  }\n" +
31209 		"}\n",
31210 		},
31211 		"----------\n" +
31212 		"1. WARNING in ExtendedOuter.java (at line 4)\n" +
31213 		"	static void method(Outer.Inner x) {}\n" +
31214 		"	                   ^^^^^^^^^^^\n" +
31215 		"Outer.Inner is a raw type. References to generic type Outer<O>.Inner should be parameterized\n" +
31216 		"----------\n" +
31217 		"2. ERROR in ExtendedOuter.java (at line 14)\n" +
31218 		"	Zork zk;\n" +
31219 		"	^^^^\n" +
31220 		"Zork cannot be resolved to a type\n" +
31221 		"----------\n");
31222 }
31223 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=129190 - variation
31224 public void test0938() {
31225 	this.runNegativeTest(
31226 		new String[] {
31227 		"ExtendedOuter.java", //================================
31228 		"class Outer<O> {\n" +
31229 		"  class Inner {}\n" +
31230 		"\n" +
31231 		"  static void method(Outer<?>.Inner x) {}\n" +
31232 		"}\n" +
31233 		"\n" +
31234 		"public class ExtendedOuter<E> extends Outer<E> {\n" +
31235 		"  class ExtendedInner extends Inner {\n" +
31236 		"    {\n" +
31237 		"      Outer.method(this);\n" +
31238 		"    }\n" +
31239 		"  }\n" +
31240 		"  void foo() {\n" +
31241 		"    Zork zk;\n" +
31242 		"  }\n" +
31243 		"}\n",
31244 		},
31245 		"----------\n" +
31246 		"1. ERROR in ExtendedOuter.java (at line 14)\n" +
31247 		"	Zork zk;\n" +
31248 		"	^^^^\n" +
31249 		"Zork cannot be resolved to a type\n" +
31250 		"----------\n");
31251 }
31252 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=129190 - variation
31253 public void test0939() {
31254 	this.runNegativeTest(
31255 		new String[] {
31256 		"ExtendedOuter.java", //================================
31257 		"class Outer<O> {\n" +
31258 		"  class Inner {}\n" +
31259 		"\n" +
31260 		"  static <I> void method(Outer<I>.Inner x) {}\n" +
31261 		"}\n" +
31262 		"\n" +
31263 		"public class ExtendedOuter<E> extends Outer<E> {\n" +
31264 		"  class ExtendedInner extends Inner {\n" +
31265 		"    {\n" +
31266 		"      Outer.method(this);\n" +
31267 		"    }\n" +
31268 		"  }\n" +
31269 		"  void foo() {\n" +
31270 		"    Zork zk;\n" +
31271 		"  }\n" +
31272 		"}\n",
31273 		},
31274 		"----------\n" +
31275 		"1. ERROR in ExtendedOuter.java (at line 14)\n" +
31276 		"	Zork zk;\n" +
31277 		"	^^^^\n" +
31278 		"Zork cannot be resolved to a type\n" +
31279 		"----------\n");
31280 }
31281 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=129190 - variation
31282 // force check that I is inferred to E, not Object
31283 public void test0939b() {
31284 	this.runNegativeTest(
31285 		new String[] {
31286 		"ExtendedOuter.java", //================================
31287 		"class Outer<O> {\n" +
31288 		"  class Inner {}\n" +
31289 		"\n" +
31290 		"  static <I> I method(Outer<I>.Inner x) { return null; }\n" +
31291 		"}\n" +
31292 		"\n" +
31293 		"public class ExtendedOuter<E extends A> extends Outer<E> {\n" +
31294 		"  class ExtendedInner extends Inner {\n" +
31295 		"    {\n" +
31296 		"      Outer.method(this).bar();\n" +
31297 		"    }\n" +
31298 		"  }\n" +
31299 		"  void foo() {\n" +
31300 		"    Zork zk;\n" +
31301 		"  }\n" +
31302 		"}\n" +
31303 		"class A { void bar() {} }\n",
31304 		},
31305 		"----------\n" +
31306 		"1. ERROR in ExtendedOuter.java (at line 14)\n" +
31307 		"	Zork zk;\n" +
31308 		"	^^^^\n" +
31309 		"Zork cannot be resolved to a type\n" +
31310 		"----------\n");
31311 }
31312 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=129261 - variation
31313 public void test0940() {
31314 	this.runNegativeTest(
31315 		new String[] {
31316 		"X.java", //================================
31317 		"import java.util.*;\n" +
31318 		"public class X {\n" +
31319 		"        <U extends Object> void bar3(List<U> lst) {\n" +
31320 		"            List<Object> RESULT = null;\n" +
31321 		"            RESULT = lst; // 1\n" +
31322 		"            RESULT = Collections.singletonList(lst.get(0)); // 2\n" +
31323 		"    }              \n" +
31324 		"}\n",
31325 		},
31326 		"----------\n" +
31327 		"1. ERROR in X.java (at line 5)\n" +
31328 		"	RESULT = lst; // 1\n" +
31329 		"	         ^^^\n" +
31330 		"Type mismatch: cannot convert from List<U> to List<Object>\n" +
31331 		"----------\n" +
31332 		(this.complianceLevel < ClassFileConstants.JDK1_8 ?
31333 		"2. ERROR in X.java (at line 6)\n" +
31334 		"	RESULT = Collections.singletonList(lst.get(0)); // 2\n" +
31335 		"	         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
31336 		"Type mismatch: cannot convert from List<U> to List<Object>\n" +
31337 		"----------\n"
31338 		:
31339 		""));
31340 }
31341 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=129261 - variation
31342 public void test0941() {
31343 	String xSource =
31344 		"import java.util.*;\n" +
31345 		"\n" +
31346 		"public class X {\n" +
31347 		"	<T> Map<T,T> foo(T t1, T t2) {\n" +
31348 		"		return null;\n" +
31349 		"	}\n" +
31350 		"	<U extends Object, V extends U> void bar(U u, V v) {\n" +
31351 		"		Map<Object,Object> map1 = foo(u, v);\n" +
31352 		"		Map<U,U> map2 = foo(u, v);\n" +
31353 		"	}	\n" +
31354 		"}\n";
31355 	if (this.complianceLevel < ClassFileConstants.JDK1_8) {
31356 		this.runNegativeTest(
31357 			new String[] {
31358 			"X.java",
31359 			xSource,
31360 			},
31361 			"----------\n" +
31362 			"1. ERROR in X.java (at line 8)\n" +
31363 			"	Map<Object,Object> map1 = foo(u, v);\n" +
31364 			"	                          ^^^^^^^^^\n" +
31365 			"Type mismatch: cannot convert from Map<U,U> to Map<Object,Object>\n" +
31366 			"----------\n");
31367 	} else {
31368 		runConformTest(new String[] { "X.java", xSource });
31369 	}
31370 }
31371 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=129261 - variation
31372 public void test0942() {
31373 	String xSource =
31374 		"import java.util.*;\n" +
31375 		"\n" +
31376 		"public class X {\n" +
31377 		"	<T> Map<T,T> foo(T t1, T t2, T t3) {\n" +
31378 		"		return null;\n" +
31379 		"	}\n" +
31380 		"	<U extends Object, V extends U> void bar(U u, V v) {\n" +
31381 		"		Map<Object,Object> map1 = foo(u, v, null);\n" +
31382 		"		Map<U,U> map2 = foo(u, v, null);\n" +
31383 		"	}	\n" +
31384 		"}\n";
31385 	if (this.complianceLevel < ClassFileConstants.JDK1_8) {
31386 		this.runNegativeTest(
31387 			new String[] {
31388 				"X.java",
31389 				xSource,
31390 			},
31391 			"----------\n" +
31392 			"1. ERROR in X.java (at line 8)\n" +
31393 			"	Map<Object,Object> map1 = foo(u, v, null);\n" +
31394 			"	                          ^^^^^^^^^^^^^^^\n" +
31395 			"Type mismatch: cannot convert from Map<U,U> to Map<Object,Object>\n" +
31396 			"----------\n");
31397 	} else {
31398 		runConformTest(new String[] { "X.java", xSource });
31399 	}
31400 }
31401 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=129261 - variation
31402 public void test0943() {
31403 	String xSource =
31404 		"import java.util.*;\n" +
31405 		"\n" +
31406 		"public class X {\n" +
31407 		"	<T> Map<T,T> foo(T t1, T t2, T t3) {\n" +
31408 		"		return null;\n" +
31409 		"	}\n" +
31410 		"	<U extends Object, V extends U> void bar(U u, V v, List<? extends V> lv) {\n" +
31411 		"		Map<Object,Object> map1 = foo(u, v, lv.get(0));\n" +
31412 		"		Map<U,U> map2 = foo(u, v, lv.get(0));\n" +
31413 		"	}\n" +
31414 		"}\n";
31415 	if (this.complianceLevel < ClassFileConstants.JDK1_8) {
31416 		this.runNegativeTest(
31417 			new String[] {
31418 			"X.java",
31419 			xSource,
31420 			},
31421 			"----------\n" +
31422 			"1. ERROR in X.java (at line 8)\n" +
31423 			"	Map<Object,Object> map1 = foo(u, v, lv.get(0));\n" +
31424 			"	                          ^^^^^^^^^^^^^^^^^^^^\n" +
31425 			"Type mismatch: cannot convert from Map<U,U> to Map<Object,Object>\n" +
31426 			"----------\n");
31427 	} else {
31428 		runConformTest(new String[] { "X.java", xSource });
31429 	}
31430 }
31431 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=129996
31432 public void test0944() {
31433 	this.runNegativeTest(
31434 		new String[] {
31435 		"X.java", //================================
31436 		"import java.util.*;\n" +
31437 		"public class X {\n" +
31438 		"	public static <A> Set<A> method(List<? super A> list) {\n" +
31439 		"		return new HashSet<A>();\n" +
31440 		"	}\n" +
31441 		"	public static void main(String[] args) {\n" +
31442 		"		ArrayList<Number> l = new ArrayList<Number>();\n" +
31443 		"		Set<Integer> s1 = method(l);\n" +
31444 		"		Set<Integer> s2 = (Set<Integer>) method(l);\n" +
31445 		"	}\n" +
31446 		"}\n",
31447 		},
31448 		"----------\n" +
31449 		"1. ERROR in X.java (at line 9)\n" +
31450 		"	Set<Integer> s2 = (Set<Integer>) method(l);\n" +
31451 		"	                  ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
31452 		"Cannot cast from Set<Number> to Set<Integer>\n" +
31453 		"----------\n");
31454 }
31455 public void test0945() {
31456 	this.runNegativeTest(
31457 		new String[] {
31458 		"X.java", //================================
31459 		"import java.util.*;\n" +
31460 		"\n" +
31461 		"public class X {\n" +
31462 		"    public static void main(String[] args){\n" +
31463 		"        Object[] objArray = {new Object()};\n" +
31464 		"        ArrayList<String> strList = new ArrayList<String>();\n" +
31465 		"        transferBug(objArray, strList);\n" +
31466 		"        String str = strList.get(0);\n" +
31467 		"}\n" +
31468 		"public static <Var> void  transferBug(Var[] src, Collection<Var> dest){\n" +
31469 		"    dest.add(src[0]);\n" +
31470 		"}\n" +
31471 		"}\n",
31472 		},
31473 		"----------\n" +
31474 		"1. ERROR in X.java (at line 7)\n" +
31475 		"	transferBug(objArray, strList);\n" +
31476 		"	^^^^^^^^^^^\n" +
31477 		"The method transferBug(Var[], Collection<Var>) in the type X is not applicable for the arguments (Object[], ArrayList<String>)\n" +
31478 		"----------\n");
31479 }
31480 public void test0946() {
31481 	runConformTest(
31482 		// test directory preparation
31483 		true /* flush output directory */,
31484 		new String[] { /* test files */
31485 			"X.java", //================================
31486 			"public class X {\n" +
31487 			"	public static void main(String[] args) {\n" +
31488 			"		operate(Operations.create());\n" +
31489 			"	}\n" +
31490 			"	static <O extends Num<O>> void operate(Operators<O> operators) {\n" +
31491 			"		System.out.println(operators.spawn());\n" +
31492 			"	}\n" +
31493 			"}\n" +
31494 			"class Operations {\n" +
31495 			"	static Operators<?> create() {\n" +
31496 			"		return new IntOperators();\n" +
31497 			"	}\n" +
31498 			"}\n" +
31499 			"interface Num<O> {\n" +
31500 			"	public O spawn();\n" +
31501 			"}\n" +
31502 			"class Int implements Num<Int> {\n" +
31503 			"	public Int spawn() {\n" +
31504 			"		return new Int();\n" +
31505 			"	}\n" +
31506 			"  public String toString() {\n" +
31507 			"    return \"Int\";\n" +
31508 			"  }\n" +
31509 			"}\n" +
31510 			"interface Operators<O extends Num<O>> {\n" +
31511 			"	O spawn();\n" +
31512 			"}\n" +
31513 			"class IntOperators implements Operators<Int> {\n" +
31514 			"	public Int spawn() {\n" +
31515 			"		return new Int();\n" +
31516 			"	}\n" +
31517 			"}\n",
31518 		},
31519 		// compiler results
31520 		null /* do not check compiler log */,
31521 		// runtime results
31522 		"Int" /* expected output string */,
31523 		"" /* expected error string */,
31524 		// javac options
31525 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
31526 }
31527 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=129261 - variation
31528 public void test0947() {
31529 	String xSource =
31530 		"public class X {\n" +
31531 		"        public void bar2(Box<?> b) {\n" +
31532 		"        	Box<Runnable> bx = box(b.element);\n" +
31533 		"        	box(b.element).element.run();\n" +
31534 		"        }\n" +
31535 		"        static <U extends Runnable> Box<U> box(U u) {\n" +
31536 		"        	return new Box<U>(u);\n" +
31537 		"        }\n" +
31538 		"}\n" +
31539 		"class Box<E extends Runnable> {\n" +
31540 		"	E element;\n" +
31541 		"	Box(E element) {\n" +
31542 		"		this.element = element;\n" +
31543 		"	}\n" +
31544 		"}\n";
31545 	if (this.complianceLevel < ClassFileConstants.JDK1_8) {
31546 		this.runNegativeTest(
31547 			new String[] {
31548 			"X.java",
31549 			xSource,
31550 			},
31551 			"----------\n" +
31552 			"1. ERROR in X.java (at line 3)\n" +
31553 			"	Box<Runnable> bx = box(b.element);\n" +
31554 			"	                   ^^^^^^^^^^^^^^\n" +
31555 			"Type mismatch: cannot convert from Box<capture#1-of ?> to Box<Runnable>\n" +
31556 			"----------\n",
31557 			JavacTestOptions.EclipseHasABug.EclipseBug236236);
31558 	} else {
31559 		runConformTest(new String[]{ "X.java", xSource });
31560 	}
31561 
31562 }
31563 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=129261 - variation
31564 public void test0948() {
31565 	this.runConformTest(
31566 		new String[] {
31567 		"X.java", //================================
31568 		"import java.util.*;\n" +
31569 		"public class X {\n" +
31570 		"        public void bar2(Box<?> b1, Box<Runnable> b2) {\n" +
31571 		"        	Pair<Runnable,Runnable> blist = pair(b1.element, b2.element);\n" +
31572 		"        }\n" +
31573 		"        static <U> Pair<U,U> pair(U u1, U u2) {\n" +
31574 		"        	return new Pair<U,U>(u1,u2);\n" +
31575 		"        }\n" +
31576 		"}\n" +
31577 		"class Pair<E,F> {\n" +
31578 		"	Pair(E e, F f){}\n" +
31579 		"}\n" +
31580 		"class Box<E extends Runnable> {\n" +
31581 		"	E element;\n" +
31582 		"	Box(E element) {\n" +
31583 		"		this.element = element;\n" +
31584 		"	}\n" +
31585 		"}\n",
31586 		},
31587 		"");
31588 }
31589 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=128418
31590 public void test0949() {
31591 	this.runNegativeTest(
31592 		new String[] {
31593 		"X.java", //================================
31594 		"import java.util.Arrays;\n" +
31595 		"\n" +
31596 		"public class X {\n" +
31597 		"	public <T> Iterable<T> m(T... ts) {\n" +
31598 		"		return Arrays.asList(ts);\n" +
31599 		"	}\n" +
31600 		"	public <T> void m3(Iterable<T>... ts) {\n" +
31601 		"	}\n" +
31602 		"	public void m2() {\n" +
31603 		"		m3(m(3, 3, 3));\n" +
31604 		"		m3(m());\n" +
31605 		"		m3(m(new Object[]{}));\n" +
31606 		"		Zork z;\n" +
31607 		"	}\n" +
31608 		"}\n",
31609 		},
31610 		this.complianceLevel < ClassFileConstants.JDK1_7 ?
31611 		"----------\n" +
31612 		"1. WARNING in X.java (at line 10)\n" +
31613 		"	m3(m(3, 3, 3));\n" +
31614 		"	^^^^^^^^^^^^^^\n" +
31615 		"Type safety: A generic array of Iterable<Integer> is created for a varargs parameter\n" +
31616 		"----------\n" +
31617 		"2. WARNING in X.java (at line 11)\n" +
31618 		"	m3(m());\n" +
31619 		"	^^^^^^^\n" +
31620 		"Type safety: A generic array of Iterable<Object> is created for a varargs parameter\n" +
31621 		"----------\n" +
31622 		"3. WARNING in X.java (at line 12)\n" +
31623 		"	m3(m(new Object[]{}));\n" +
31624 		"	^^^^^^^^^^^^^^^^^^^^^\n" +
31625 		"Type safety: A generic array of Iterable<Object> is created for a varargs parameter\n" +
31626 		"----------\n" +
31627 		"4. ERROR in X.java (at line 13)\n" +
31628 		"	Zork z;\n" +
31629 		"	^^^^\n" +
31630 		"Zork cannot be resolved to a type\n" +
31631 		"----------\n" :
31632 			"----------\n" +
31633 			"1. WARNING in X.java (at line 4)\n" +
31634 			"	public <T> Iterable<T> m(T... ts) {\n" +
31635 			"	                              ^^\n" +
31636 			"Type safety: Potential heap pollution via varargs parameter ts\n" +
31637 			"----------\n" +
31638 			"2. WARNING in X.java (at line 7)\n" +
31639 			"	public <T> void m3(Iterable<T>... ts) {\n" +
31640 			"	                                  ^^\n" +
31641 			"Type safety: Potential heap pollution via varargs parameter ts\n" +
31642 			"----------\n" +
31643 			"3. WARNING in X.java (at line 10)\n" +
31644 			"	m3(m(3, 3, 3));\n" +
31645 			"	^^^^^^^^^^^^^^\n" +
31646 			"Type safety: A generic array of Iterable<Integer> is created for a varargs parameter\n" +
31647 			"----------\n" +
31648 			"4. WARNING in X.java (at line 11)\n" +
31649 			"	m3(m());\n" +
31650 			"	^^^^^^^\n" +
31651 			"Type safety: A generic array of Iterable<Object> is created for a varargs parameter\n" +
31652 			"----------\n" +
31653 			"5. WARNING in X.java (at line 12)\n" +
31654 			"	m3(m(new Object[]{}));\n" +
31655 			"	^^^^^^^^^^^^^^^^^^^^^\n" +
31656 			"Type safety: A generic array of Iterable<Object> is created for a varargs parameter\n" +
31657 			"----------\n" +
31658 			"6. ERROR in X.java (at line 13)\n" +
31659 			"	Zork z;\n" +
31660 			"	^^^^\n" +
31661 			"Zork cannot be resolved to a type\n" +
31662 			"----------\n");
31663 }
31664 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=128418 - variation
31665 public void test0950() {
31666 	this.runNegativeTest(
31667 		new String[] {
31668 		"X.java", //================================
31669 		"import java.util.Arrays;\n" +
31670 		"\n" +
31671 		"public class X {\n" +
31672 		"	public <T> Iterable<T> m(T[]... ts) {\n" +
31673 		"		return Arrays.asList(ts[0]);\n" +
31674 		"	}\n" +
31675 		"	public <T> void m3(Iterable<T>... ts) {\n" +
31676 		"	}\n" +
31677 		"	public void m2() {\n" +
31678 		"		m3(m(new Integer[]{3, 3, 3}));\n" +
31679 		"		m3(m());\n" +
31680 		"		m3(m(new Object[][]{}));\n" +
31681 		"		Zork z;\n" +
31682 		"	}\n" +
31683 		"}\n",
31684 		},
31685 		this.complianceLevel < ClassFileConstants.JDK1_7 ?
31686 		"----------\n" +
31687 		"1. WARNING in X.java (at line 10)\n" +
31688 		"	m3(m(new Integer[]{3, 3, 3}));\n" +
31689 		"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
31690 		"Type safety: A generic array of Iterable<Object> is created for a varargs parameter\n" +
31691 		"----------\n" +
31692 		"2. WARNING in X.java (at line 11)\n" +
31693 		"	m3(m());\n" +
31694 		"	^^^^^^^\n" +
31695 		"Type safety: A generic array of Iterable<Object> is created for a varargs parameter\n" +
31696 		"----------\n" +
31697 		"3. WARNING in X.java (at line 12)\n" +
31698 		"	m3(m(new Object[][]{}));\n" +
31699 		"	^^^^^^^^^^^^^^^^^^^^^^^\n" +
31700 		"Type safety: A generic array of Iterable<Object> is created for a varargs parameter\n" +
31701 		"----------\n" +
31702 		"4. ERROR in X.java (at line 13)\n" +
31703 		"	Zork z;\n" +
31704 		"	^^^^\n" +
31705 		"Zork cannot be resolved to a type\n" +
31706 		"----------\n" :
31707 			"----------\n" +
31708 			"1. WARNING in X.java (at line 4)\n" +
31709 			"	public <T> Iterable<T> m(T[]... ts) {\n" +
31710 			"	                                ^^\n" +
31711 			"Type safety: Potential heap pollution via varargs parameter ts\n" +
31712 			"----------\n" +
31713 			"2. WARNING in X.java (at line 7)\n" +
31714 			"	public <T> void m3(Iterable<T>... ts) {\n" +
31715 			"	                                  ^^\n" +
31716 			"Type safety: Potential heap pollution via varargs parameter ts\n" +
31717 			"----------\n" +
31718 			"3. WARNING in X.java (at line 10)\n" +
31719 			"	m3(m(new Integer[]{3, 3, 3}));\n" +
31720 			"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
31721 			(this.complianceLevel == ClassFileConstants.JDK1_7?
31722 			"Type safety: A generic array of Iterable<Object> is created for a varargs parameter\n"
31723 			:
31724 			"Type safety: A generic array of Iterable<Integer> is created for a varargs parameter\n"
31725 			) +
31726 			"----------\n" +
31727 			"4. WARNING in X.java (at line 11)\n" +
31728 			"	m3(m());\n" +
31729 			"	^^^^^^^\n" +
31730 			"Type safety: A generic array of Iterable<Object> is created for a varargs parameter\n" +
31731 			"----------\n" +
31732 			"5. WARNING in X.java (at line 12)\n" +
31733 			"	m3(m(new Object[][]{}));\n" +
31734 			"	^^^^^^^^^^^^^^^^^^^^^^^\n" +
31735 			"Type safety: A generic array of Iterable<Object> is created for a varargs parameter\n" +
31736 			"----------\n" +
31737 			"6. ERROR in X.java (at line 13)\n" +
31738 			"	Zork z;\n" +
31739 			"	^^^^\n" +
31740 			"Zork cannot be resolved to a type\n" +
31741 			"----------\n");
31742 }
31743 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=128418 - variation
31744 public void test0951() {
31745 	this.runNegativeTest(
31746 		new String[] {
31747 		"X.java", //================================
31748 		"import java.util.Arrays;\n" +
31749 		"\n" +
31750 		"public class X {\n" +
31751 		"	public <T> Iterable<T> m(T[]... ts) {\n" +
31752 		"		return Arrays.asList(ts[0]);\n" +
31753 		"	}\n" +
31754 		"	public <T> void m3(Iterable<T>... ts) {\n" +
31755 		"	}\n" +
31756 		"	@SuppressWarnings(\"unchecked\")\n" +
31757 		"	public void m2() {\n" +
31758 		"		m3(m(new Integer[]{3, 3, 3}));\n" +
31759 		"		m3(m());\n" +
31760 		"		m3(m(new Object[][]{}));\n" +
31761 		"		Zork z;\n" +
31762 		"	}\n" +
31763 		"}\n",
31764 		},
31765 		this.complianceLevel < ClassFileConstants.JDK1_7 ?
31766 		"----------\n" +
31767 		"1. ERROR in X.java (at line 14)\n" +
31768 		"	Zork z;\n" +
31769 		"	^^^^\n" +
31770 		"Zork cannot be resolved to a type\n" +
31771 		"----------\n" :
31772 			"----------\n" +
31773 			"1. WARNING in X.java (at line 4)\n" +
31774 			"	public <T> Iterable<T> m(T[]... ts) {\n" +
31775 			"	                                ^^\n" +
31776 			"Type safety: Potential heap pollution via varargs parameter ts\n" +
31777 			"----------\n" +
31778 			"2. WARNING in X.java (at line 7)\n" +
31779 			"	public <T> void m3(Iterable<T>... ts) {\n" +
31780 			"	                                  ^^\n" +
31781 			"Type safety: Potential heap pollution via varargs parameter ts\n" +
31782 			"----------\n" +
31783 			"3. ERROR in X.java (at line 14)\n" +
31784 			"	Zork z;\n" +
31785 			"	^^^^\n" +
31786 			"Zork cannot be resolved to a type\n" +
31787 			"----------\n");
31788 }
31789 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=128418 - variation
31790 public void test0952() {
31791 	this.runNegativeTest(
31792 		new String[] {
31793 		"X.java", //================================
31794 		"public class X {\n" +
31795 		"	public <T> Iterable<T> m(T... ts) {\n" +
31796 		"		return null;\n" +
31797 		"	}\n" +
31798 		"	public <T> void m3(Iterable<T>... ts) {\n" +
31799 		"	}\n" +
31800 		"	public void m2() {\n" +
31801 		"		m3(m(null));\n" +
31802 		"		Zork z;\n" +
31803 		"	}\n" +
31804 		"}\n",
31805 		},
31806 		this.complianceLevel < ClassFileConstants.JDK1_7 ?
31807 		"----------\n" +
31808 		"1. WARNING in X.java (at line 8)\n" +
31809 		"	m3(m(null));\n" +
31810 		"	^^^^^^^^^^^\n" +
31811 		"Type safety: A generic array of Iterable<Object> is created for a varargs parameter\n" +
31812 		"----------\n" +
31813 		"2. WARNING in X.java (at line 8)\n" +
31814 		"	m3(m(null));\n" +
31815 		"	   ^^^^^^^\n" +
31816 		"Type null of the last argument to method m(Object...) doesn't exactly match the vararg parameter type. Cast to Object[] to confirm the non-varargs invocation, or pass individual arguments of type Object for a varargs invocation.\n" +
31817 		"----------\n" +
31818 		"3. ERROR in X.java (at line 9)\n" +
31819 		"	Zork z;\n" +
31820 		"	^^^^\n" +
31821 		"Zork cannot be resolved to a type\n" +
31822 		"----------\n" :
31823 			"----------\n" +
31824 			"1. WARNING in X.java (at line 2)\n" +
31825 			"	public <T> Iterable<T> m(T... ts) {\n" +
31826 			"	                              ^^\n" +
31827 			"Type safety: Potential heap pollution via varargs parameter ts\n" +
31828 			"----------\n" +
31829 			"2. WARNING in X.java (at line 5)\n" +
31830 			"	public <T> void m3(Iterable<T>... ts) {\n" +
31831 			"	                                  ^^\n" +
31832 			"Type safety: Potential heap pollution via varargs parameter ts\n" +
31833 			"----------\n" +
31834 			"3. WARNING in X.java (at line 8)\n" +
31835 			"	m3(m(null));\n" +
31836 			"	^^^^^^^^^^^\n" +
31837 			"Type safety: A generic array of Iterable<Object> is created for a varargs parameter\n" +
31838 			"----------\n" +
31839 			"4. WARNING in X.java (at line 8)\n" +
31840 			"	m3(m(null));\n" +
31841 			"	   ^^^^^^^\n" +
31842 			"Type null of the last argument to method m(Object...) doesn't exactly match the vararg parameter type. Cast to Object[] to confirm the non-varargs invocation, or pass individual arguments of type Object for a varargs invocation.\n" +
31843 			"----------\n" +
31844 			"5. ERROR in X.java (at line 9)\n" +
31845 			"	Zork z;\n" +
31846 			"	^^^^\n" +
31847 			"Zork cannot be resolved to a type\n" +
31848 			"----------\n");
31849 }
31850 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=106325
31851 public void test0953() {
31852 	if (this.complianceLevel >= ClassFileConstants.JDK1_7) return;
31853 	this.runNegativeTest(
31854 		new String[] {
31855 		"X.java", //================================
31856 		"import java.lang.ref.WeakReference;\n" +
31857 		"import java.util.Arrays;\n" +
31858 		"import java.util.List;\n" +
31859 		"\n" +
31860 		"public class X {\n" +
31861 		"  void m(WeakReference<Integer> ref) {\n" +
31862 		"    List<WeakReference<Integer>> list= Arrays.asList(ref);\n" +
31863 		"    Zork z;\n" +
31864 		"  }\n" +
31865 		"}\n",
31866 		},
31867 		"----------\n" +
31868 		"1. WARNING in X.java (at line 7)\n" +
31869 		"	List<WeakReference<Integer>> list= Arrays.asList(ref);\n" +
31870 		"	                                   ^^^^^^^^^^^^^^^^^^\n" +
31871 		"Type safety: A generic array of WeakReference<Integer> is created for a varargs parameter\n" +
31872 		"----------\n" +
31873 		"2. ERROR in X.java (at line 8)\n" +
31874 		"	Zork z;\n" +
31875 		"	^^^^\n" +
31876 		"Zork cannot be resolved to a type\n" +
31877 		"----------\n");
31878 }
31879 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=130543
31880 public void test0954() {
31881 	this.runNegativeTest(
31882 		new String[] {
31883 		"X.java", //================================
31884 		"import java.util.*;\n" +
31885 		"\n" +
31886 		"public class X<A,B> {\n" +
31887 		"	class Member<C,D> {}\n" +
31888 		"	static class SMember<U,V> {}\n" +
31889 		"	void foo1() {\n" +
31890 		"		X<?,?>[] xs = new X<?,?>[]{};//1\n" +
31891 		"		for(X<?,?> x : xs) {\n" +
31892 		"			System.out.println(x);\n" +
31893 		"		}\n" +
31894 		"	}\n" +
31895 		"	void bar1() {\n" +
31896 		"		Member<?,?>[] members = new Member<?,?>[]{};//2\n" +
31897 		"		for(Member<?,?> m : members) {\n" +
31898 		"			System.out.println(m);\n" +
31899 		"		}\n" +
31900 		"	}\n" +
31901 		"	void bas1() {\n" +
31902 		"		SMember<?,?>[] members = new SMember<?,?>[]{};//3\n" +
31903 		"		for(SMember<?,?> m : members) {\n" +
31904 		"			System.out.println(m);\n" +
31905 		"		}\n" +
31906 		"	}\n" +
31907 		"	void baz1() {\n" +
31908 		"		class Local<E,F>{}\n" +
31909 		"		Local<?,?>[] locals = new Local<?,?>[]{};//4\n" +
31910 		"		for(Local<?,?> l : locals) {\n" +
31911 		"			System.out.println(l);\n" +
31912 		"		}\n" +
31913 		"	}\n" +
31914 		"	void foo2() {\n" +
31915 		"		X<?,?>[] xs = new X<?,?>[5];//5\n" +
31916 		"		for(X<?,?> x : xs) {\n" +
31917 		"			System.out.println(x);\n" +
31918 		"		}\n" +
31919 		"	}\n" +
31920 		"	void bar2() {\n" +
31921 		"		Member<?,?>[] members = new Member<?,?>[5];//6\n" +
31922 		"		for(Member<?,?> m : members) {\n" +
31923 		"			System.out.println(m);\n" +
31924 		"		}\n" +
31925 		"	}\n" +
31926 		"	void bas2() {\n" +
31927 		"		SMember<?,?>[] members = new SMember<?,?>[5];//7\n" +
31928 		"		for(SMember<?,?> m : members) {\n" +
31929 		"			System.out.println(m);\n" +
31930 		"		}\n" +
31931 		"	}\n" +
31932 		"	void baz2() {\n" +
31933 		"		class Local<E,F>{}\n" +
31934 		"		Local<?,?>[] locals = new Local<?,?>[5];//8\n" +
31935 		"		for(Local<?,?> l : locals) {\n" +
31936 		"			System.out.println(l);\n" +
31937 		"		}\n" +
31938 		"	}\n" +
31939 		"	void foo3() {\n" +
31940 		"		X<?,?>[] xs = new X<?,?>[5];//9\n" +
31941 		"		for(X<?,?> x : xs) {\n" +
31942 		"			System.out.println(x);\n" +
31943 		"		}\n" +
31944 		"	}\n" +
31945 		"	void bar3() {\n" +
31946 		"		X<?,?>.Member<?,?>[] members = new X<?,?>.Member<?,?>[5];//10\n" +
31947 		"		for(X<?,?>.Member<?,?> m : members) {\n" +
31948 		"			System.out.println(m);\n" +
31949 		"		}\n" +
31950 		"	}\n" +
31951 		"	static void baz3() {\n" +
31952 		"		class Local<E,F>{}\n" +
31953 		"		Local<?,?>[] locals = new Local<?,?>[5];//11\n" +
31954 		"		for(Local<?,?> l : locals) {\n" +
31955 		"			System.out.println(l);\n" +
31956 		"		}\n" +
31957 		"	}\n" +
31958 		"}\n",
31959 		},
31960 		"----------\n" +
31961 		"1. ERROR in X.java (at line 13)\n" +
31962 		"	Member<?,?>[] members = new Member<?,?>[]{};//2\n" +
31963 		"	                                         ^^\n" +
31964 		"Cannot create a generic array of X<A,B>.Member<?,?>\n" +
31965 		"----------\n" +
31966 		"2. ERROR in X.java (at line 26)\n" +
31967 		"	Local<?,?>[] locals = new Local<?,?>[]{};//4\n" +
31968 		"	                                      ^^\n" +
31969 		"Cannot create a generic array of Local<?,?>\n" +
31970 		"----------\n" +
31971 		"3. ERROR in X.java (at line 38)\n" +
31972 		"	Member<?,?>[] members = new Member<?,?>[5];//6\n" +
31973 		"	                        ^^^^^^^^^^^^^^^^^^\n" +
31974 		"Cannot create a generic array of X<A,B>.Member<?,?>\n" +
31975 		"----------\n" +
31976 		"4. ERROR in X.java (at line 51)\n" +
31977 		"	Local<?,?>[] locals = new Local<?,?>[5];//8\n" +
31978 		"	                      ^^^^^^^^^^^^^^^^^\n" +
31979 		"Cannot create a generic array of Local<?,?>\n" +
31980 		"----------\n");
31981 }
31982 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=105049
31983 public void test0955() {
31984 	this.runNegativeTest(
31985 		new String[] {
31986 		"X.java", //================================
31987 		"import java.util.List;\n" +
31988 		"public class X<E> {\n" +
31989 		"    void method(Object o) {\n" +
31990 		"        if (o instanceof List<E>[]) { //incorrect: bug 104695\n" +
31991 		"            List<E>[] es= (List<E>[]) o; //unchecked\n" +
31992 		"        }\n" +
31993 		"    }\n" +
31994 		"}\n",
31995 		},
31996 		"----------\n" +
31997 		"1. ERROR in X.java (at line 4)\n" +
31998 		"	if (o instanceof List<E>[]) { //incorrect: bug 104695\n" +
31999 		"	    ^^^^^^^^^^^^^^^^^^^^^^\n" +
32000 		"Cannot perform instanceof check against parameterized type List<E>[]. Use the form List<?>[] instead since further generic type information will be erased at runtime\n" +
32001 		"----------\n" +
32002 		"2. WARNING in X.java (at line 5)\n" +
32003 		"	List<E>[] es= (List<E>[]) o; //unchecked\n" +
32004 		"	              ^^^^^^^^^^^^^\n" +
32005 		"Type safety: Unchecked cast from Object to List<E>[]\n" +
32006 		"----------\n");
32007 }
32008 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=130128
32009 public void test0956() {
32010 	this.runConformTest(
32011 		new String[] {
32012 		"X.java", //================================
32013 		"public class X<F> {\n" +
32014 		"\n" +
32015 		"    public void printNickname(Person<F> person) {\n" +
32016 		"        Person<F>.Nickname nickname = person.getNickname();\n" +
32017 		"        System.out.println(nickname);\n" +
32018 		"    }\n" +
32019 		"\n" +
32020 		"    static class Person<E> {\n" +
32021 		"        private Nickname nickname;\n" +
32022 		"\n" +
32023 		"        public Nickname getNickname() {\n" +
32024 		"            return nickname;\n" +
32025 		"        }\n" +
32026 		"\n" +
32027 		"        public void setNickname(Nickname nickname) {\n" +
32028 		"            this.nickname = nickname;\n" +
32029 		"        }\n" +
32030 		"\n" +
32031 		"        class Nickname {\n" +
32032 		"            private String name;\n" +
32033 		"            private boolean insulting;\n" +
32034 		"        }\n" +
32035 		"    }\n" +
32036 		"}\n",
32037 		},
32038 		"");
32039 }
32040 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=132348
32041 public void test0957() {
32042 	this.runNegativeTest(
32043 		new String[] {
32044 		"AnyInterface.java", //================================
32045 		"public interface AnyInterface {\n" +
32046 		"        public void doSomething();\n" +
32047 		"}",
32048 		"UsingGenericsClass",
32049 		"public class UsingGenericsClass<A,B extends A & AnyInterface> {\n" +
32050 		"        public UsingGenericsClass(){\n" +
32051 		"        }\n" +
32052 		"}"
32053 		},
32054 		"----------\n" +
32055 		"1. ERROR in UsingGenericsClass (at line 1)\n" +
32056 		"	public class UsingGenericsClass<A,B extends A & AnyInterface> {\n" +
32057 		"	                                                ^^^^^^^^^^^^\n" +
32058 		"Cannot specify any additional bound AnyInterface when first bound is a type parameter\n" +
32059 		"----------\n");
32060 }
32061 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=131935
32062 public void test0958() {
32063 	this.runNegativeTest(
32064 		new String[] {
32065 		"X.java", //================================
32066 		"import java.lang.ref.ReferenceQueue;\n" +
32067 		"import java.lang.ref.SoftReference;\n" +
32068 		"import java.util.Hashtable;\n" +
32069 		"\n" +
32070 		"public class X {\n" +
32071 		"	private static final Hashtable<Integer, Soft> cache = new Hashtable<Integer, Soft>();\n" +
32072 		"\n" +
32073 		"	private static final ReferenceQueue<String> trash = new ReferenceQueue<String>();\n" +
32074 		"\n" +
32075 		"	private static final class Soft extends SoftReference<String> {\n" +
32076 		"		int key;\n" +
32077 		"\n" +
32078 		"		Soft() {\n" +
32079 		"			super(null);\n" +
32080 		"		}\n" +
32081 		"	}\n" +
32082 		"\n" +
32083 		"	final Thread clean = new Thread(\"BigTableModel cleaner\") {\n" +
32084 		"		@Override\n" +
32085 		"		public void run() {\n" +
32086 		"			for (;;)\n" +
32087 		"				try {\n" +
32088 		"					cache.remove(((Soft) trash.remove()).key);\n" +
32089 		"				} catch (final InterruptedException e) {\n" +
32090 		"					return;\n" +
32091 		"				}\n" +
32092 		"				Zork z;\n" +
32093 		"		}\n" +
32094 		"	};\n" +
32095 		"}\n"
32096 		},
32097 		"----------\n" +
32098 		"1. ERROR in X.java (at line 27)\n" +
32099 		"	Zork z;\n" +
32100 		"	^^^^\n" +
32101 		"Zork cannot be resolved to a type\n" +
32102 		"----------\n");
32103 }
32104 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=133803
32105 public void test0959() {
32106 	this.runNegativeTest(
32107 		new String[] {
32108 			"X.java", //================================
32109 			"import java.lang.ref.*;\n" +
32110 			"\n" +
32111 			"class Soft extends SoftReference<String> {\n" +
32112 			"    Soft() { super(null); }\n" +
32113 			"}\n" +
32114 			"\n" +
32115 			"class Bug {\n" +
32116 			"    void m(Reference<? extends Number> remove) {\n" +
32117 			"        Soft soft= (Soft) remove;\n" +
32118 			"    }\n" +
32119 			"}\n"
32120 		},
32121 		"----------\n" +
32122 		"1. ERROR in X.java (at line 9)\n" +
32123 		"	Soft soft= (Soft) remove;\n" +
32124 		"	           ^^^^^^^^^^^^^\n" +
32125 		"Cannot cast from Reference<capture#1-of ? extends Number> to Soft\n" +
32126 		"----------\n");
32127 }
32128 
32129 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=118273
32130 // SHOULD FAIL AT 1.8 (RET): Type mismatch: cannot convert from X<Comparable<Comparable<T>>> to X
32131 public void test0960() {
32132 	this.runNegativeTest(
32133 		new String[] {
32134 			"X.java", //================================
32135 			"public class X<A> {\n" +
32136 			"        <B extends Comparable<B>> X<B> newInstance() {\n" +
32137 			"                return new X<B>();\n" +
32138 			"        }\n" +
32139 			"\n" +
32140 			"        X<String>[] bugDemo() {\n" +
32141 			"                X x = newInstance();\n" +
32142 			"                return new X[] { x };\n" +
32143 			"        }\n" +
32144 			"    Zork z;\n" +
32145 			"}\n"
32146 		},
32147 		"----------\n" +
32148 		"1. WARNING in X.java (at line 7)\n" +
32149 		"	X x = newInstance();\n" +
32150 		"	^\n" +
32151 		"X is a raw type. References to generic type X<A> should be parameterized\n" +
32152 		"----------\n" +
32153 		"2. WARNING in X.java (at line 8)\n" +
32154 		"	return new X[] { x };\n" +
32155 		"	       ^^^^^^^^^^^^^\n" +
32156 		"Type safety: The expression of type X[] needs unchecked conversion to conform to X<String>[]\n" +
32157 		"----------\n" +
32158 		"3. ERROR in X.java (at line 10)\n" +
32159 		"	Zork z;\n" +
32160 		"	^^^^\n" +
32161 		"Zork cannot be resolved to a type\n" +
32162 		"----------\n");
32163 }
32164 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=118273 - variation
32165 public void test0961() {
32166 	this.runNegativeTest(
32167 		new String[] {
32168 			"X.java", //================================
32169 			"public class X<A> {\n" +
32170 			"    <B extends Comparable<B>> B newInstance2(X<B> xb) {\n" +
32171 			"            return null;\n" +
32172 			"    }\n" +
32173 			"    void foo() {\n" +
32174 			"        X x = new X();\n" +
32175 			"        Comparable c = newInstance2(x);\n" +
32176 			"    }\n" +
32177 			"    Zork z;\n" +
32178 			"}\n"
32179 		},
32180 		"----------\n" +
32181 		"1. WARNING in X.java (at line 6)\n" +
32182 		"	X x = new X();\n" +
32183 		"	^\n" +
32184 		"X is a raw type. References to generic type X<A> should be parameterized\n" +
32185 		"----------\n" +
32186 		"2. WARNING in X.java (at line 6)\n" +
32187 		"	X x = new X();\n" +
32188 		"	          ^\n" +
32189 		"X is a raw type. References to generic type X<A> should be parameterized\n" +
32190 		"----------\n" +
32191 		"3. WARNING in X.java (at line 7)\n" +
32192 		"	Comparable c = newInstance2(x);\n" +
32193 		"	^^^^^^^^^^\n" +
32194 		"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
32195 		"----------\n" +
32196 		"4. WARNING in X.java (at line 7)\n" +
32197 		"	Comparable c = newInstance2(x);\n" +
32198 		"	               ^^^^^^^^^^^^^^^\n" +
32199 		"Type safety: Unchecked invocation newInstance2(X) of the generic method newInstance2(X<B>) of type X<A>\n" +
32200 		"----------\n" +
32201 		"5. WARNING in X.java (at line 7)\n" +
32202 		"	Comparable c = newInstance2(x);\n" +
32203 		"	                            ^\n" +
32204 		(this.complianceLevel < ClassFileConstants.JDK1_8
32205 		? "Type safety: The expression of type X needs unchecked conversion to conform to X<Comparable>\n"
32206 		: "Type safety: The expression of type X needs unchecked conversion to conform to X<Comparable<Comparable<B>>>\n") +
32207 		"----------\n" +
32208 		"6. ERROR in X.java (at line 9)\n" +
32209 		"	Zork z;\n" +
32210 		"	^^^^\n" +
32211 		"Zork cannot be resolved to a type\n" +
32212 		"----------\n");
32213 }
32214 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=134645
32215 public void test0962() {
32216 	runNegativeTest(
32217 		new String[] {
32218 			"X.java", //================================
32219 			"public class X<T> {\n" +
32220 			"    public void bug() throws Exception {\n" +
32221 			"        throw new Exception(\"Bug134645\") {\n" +
32222 			"            @Override\n" +
32223 			"            public String toString() {\n" +
32224 			"                return \"Bug134645\";\n" +
32225 			"            }\n" +
32226 			"        };\n" +
32227 			"    }\n" +
32228 			"}\n"
32229 		},
32230 		// compiler results
32231 		"----------\n" + /* expected compiler log */
32232 		"1. ERROR in X.java (at line 3)\n" +
32233 		"	throw new Exception(\"Bug134645\") {\n" +
32234 		"	          ^^^^^^^^^\n" +
32235 		"The generic class new Exception(){} may not subclass java.lang.Throwable\n" +
32236 		"----------\n" +
32237 		"2. WARNING in X.java (at line 3)\n" +
32238 		"	throw new Exception(\"Bug134645\") {\n" +
32239 		"	          ^^^^^^^^^^^^^^^^^^^^^^\n" +
32240 		"The serializable class  does not declare a static final serialVersionUID field of type long\n" +
32241 		"----------\n",
32242 		// javac options
32243 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
32244 }
32245 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=134645 - variation
32246 public void test0963() {
32247 	this.runConformTest(
32248 		new String[] {
32249 			"X.java", //================================
32250 			"public class X {\n" +
32251 			"    public void bug() throws Exception {\n" +
32252 			"        throw new Exception(\"Bug134645\") {\n" +
32253 			"            @Override\n" +
32254 			"            public String toString() {\n" +
32255 			"                return \"Bug134645\";\n" +
32256 			"            }\n" +
32257 			"        };\n" +
32258 			"    }\n" +
32259 			"}\n"
32260 		},
32261 		"");
32262 }
32263 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=134645 - variation
32264 public void test0964() {
32265 	this.runConformTest(
32266 		new String[] {
32267 			"X.java", //================================
32268 			"public class X<T> {\n" +
32269 			"    public static void bug() throws Exception {\n" +
32270 			"        throw new Exception(\"Bug134645\") {\n" +
32271 			"            @Override\n" +
32272 			"            public String toString() {\n" +
32273 			"                return \"Bug134645\";\n" +
32274 			"            }\n" +
32275 			"        };\n" +
32276 			"    }\n" +
32277 			"}\n"
32278 		},
32279 		"");
32280 }
32281 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=97494
32282 public void test0965() {
32283 	this.runNegativeTest(
32284 		new String[] {
32285 			"X.java", //================================
32286 			"public class X<T> {\n" +
32287 			"  protected static final Class<X<?>> theClass = (Class<X<?>>) X.class;\n" +
32288 			"  void foo(Class<X> cx) {\n" +
32289 			"	  Class<X<?>> cx1 = cx;\n" +
32290 			"	  Class<X<?>> cx2 = (Class<X<?>>) cx;\n" +
32291 			"  }\n" +
32292 			"}\n"
32293 		},
32294 		"----------\n" +
32295 		"1. ERROR in X.java (at line 2)\n" +
32296 		"	protected static final Class<X<?>> theClass = (Class<X<?>>) X.class;\n" +
32297 		"	                                              ^^^^^^^^^^^^^^^^^^^^^\n" +
32298 		"Cannot cast from Class<X> to Class<X<?>>\n" +
32299 		"----------\n" +
32300 		"2. WARNING in X.java (at line 3)\n" +
32301 		"	void foo(Class<X> cx) {\n" +
32302 		"	               ^\n" +
32303 		"X is a raw type. References to generic type X<T> should be parameterized\n" +
32304 		"----------\n" +
32305 		"3. ERROR in X.java (at line 4)\n" +
32306 		"	Class<X<?>> cx1 = cx;\n" +
32307 		"	                  ^^\n" +
32308 		"Type mismatch: cannot convert from Class<X> to Class<X<?>>\n" +
32309 		"----------\n" +
32310 		"4. ERROR in X.java (at line 5)\n" +
32311 		"	Class<X<?>> cx2 = (Class<X<?>>) cx;\n" +
32312 		"	                  ^^^^^^^^^^^^^^^^\n" +
32313 		"Cannot cast from Class<X> to Class<X<?>>\n" +
32314 		"----------\n");
32315 }
32316 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=115918
32317 public void test0966() {
32318 	this.runConformTest(
32319 		new String[] {
32320 			"Child.java", //================================
32321 			"public class Child extends Parent implements Comparable<Child> {\n" +
32322 			"  public int compareTo(Child o) { return 0; }\n" +
32323 			"}\n" +
32324 			"class Parent extends Base<Child> {}\n" +
32325 			"class Base<T extends Base> {}\n"
32326 		},
32327 		"");
32328 }
32329 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=81949
32330 public void test0967() {
32331 	this.runConformTest(
32332 		new String[] {
32333 			"CSS.java", //================================
32334 			"interface Ac<S extends St<S,A>,A extends Ac<S,A>> {}\n" +
32335 			"interface St<S extends St<S,A>,A extends Ac<S,A>> {}\n" +
32336 			"class CSN<X, Y> extends CSS<X, Y> implements Ac<CSS<X, Y>, CSN<X, Y>> {}\n" +
32337 			"public class CSS<X, Y> implements St<CSS<X, Y>, CSN<X, Y>> {}\n"
32338 		},
32339 		"");
32340 }
32341 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=108045
32342 public void test0968() {
32343 	this.runNegativeTest(
32344 		new String[] {
32345 			"X.java", //================================
32346 			"import java.util.*;\n" +
32347 			"public class X<T0> extends ArrayList<T0> implements I<T0> {\n" +
32348 			"}\n" +
32349 			"interface I<T1> extends Collection {\n" +
32350 			"}\n"
32351 		},
32352 		"----------\n" +
32353 		"1. ERROR in X.java (at line 2)\n" +
32354 		"	public class X<T0> extends ArrayList<T0> implements I<T0> {\n" +
32355 		"	             ^\n" +
32356 		"The interface Collection cannot be implemented more than once with different arguments: Collection<T0> and Collection\n" +
32357 		"----------\n" +
32358 		"2. WARNING in X.java (at line 2)\n" +
32359 		"	public class X<T0> extends ArrayList<T0> implements I<T0> {\n" +
32360 		"	             ^\n" +
32361 		"The serializable class X does not declare a static final serialVersionUID field of type long\n" +
32362 		"----------\n" +
32363 		"3. WARNING in X.java (at line 4)\n" +
32364 		"	interface I<T1> extends Collection {\n" +
32365 		"	                        ^^^^^^^^^^\n" +
32366 		"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
32367 		"----------\n");
32368 }
32369 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=133071
32370 public void test0969() {
32371 	this.runConformTest(
32372 			new String[] {
32373 				"B.java", //================================
32374 				"class B<T extends C> extends A<T> {}\n" +
32375 				"class C extends B<C> {}\n" +
32376 				"class A<T extends C> {}"
32377 			},
32378 			"");
32379 }
32380 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=136946
32381 public void test0970() {
32382 	this.runNegativeTest(
32383 			new String[] {
32384 				"X.java", //================================
32385 				"public interface X<T> { \n" +
32386 				"        interface I1<T> extends X<T> {\n" +
32387 				"                interface I2<T> extends I1<T> {\n" +
32388 				"                }\n" +
32389 				"\n" +
32390 				"                interface I3<T> extends I1<T> {\n" +
32391 				"                }\n" +
32392 				"\n" +
32393 				"                interface I4<T> extends I1.I2<T>, I1.I3<T> {    \n" +
32394 				"                }\n" +
32395 				"        }\n" +
32396 				"}\n" +
32397 				"class XSub<E> implements X<E> {\n" +
32398 				"    I1<E> i1 = null;\n" +
32399 				"    I1.I2<E> i2 = null;\n" +
32400 				"    I1<E>.I2<E> i1i2 = null;\n" +
32401 				"}\n"
32402 			},
32403 			"----------\n" +
32404 			"1. ERROR in X.java (at line 16)\n" +
32405 			"	I1<E>.I2<E> i1i2 = null;\n" +
32406 			"	^^^^^^^^\n" +
32407 			"The member type X.I1.I2<T> cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type X.I1<E>\n" +
32408 			"----------\n");
32409 }
32410 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=136946 - variation
32411 public void test0971() {
32412 	this.runNegativeTest(
32413 			new String[] {
32414 				"X.java", //================================
32415 				"public interface X<T> { \n" +
32416 				"        interface I1<T> extends X {\n" +
32417 				"                interface I2<T> extends I1 {\n" +
32418 				"                }\n" +
32419 				"\n" +
32420 				"                interface I3<T> extends I1 {\n" +
32421 				"                }\n" +
32422 				"\n" +
32423 				"                interface I4<T> extends I1.I2, I1.I3 {    \n" +
32424 				"                }\n" +
32425 				"        }\n" +
32426 				"}\n" +
32427 				"class XSub<E> implements X<E> {\n" +
32428 				"    I1 i1 = null;\n" +
32429 				"    I1.I2 i2 = null;\n" +
32430 				"    I1<E>.I2 i1i2 = null;\n" +
32431 				"}\n"
32432 			},
32433 			"----------\n" +
32434 			"1. WARNING in X.java (at line 2)\n" +
32435 			"	interface I1<T> extends X {\n" +
32436 			"	                        ^\n" +
32437 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
32438 			"----------\n" +
32439 			"2. WARNING in X.java (at line 3)\n" +
32440 			"	interface I2<T> extends I1 {\n" +
32441 			"	                        ^^\n" +
32442 			"X.I1 is a raw type. References to generic type X.I1<T> should be parameterized\n" +
32443 			"----------\n" +
32444 			"3. WARNING in X.java (at line 6)\n" +
32445 			"	interface I3<T> extends I1 {\n" +
32446 			"	                        ^^\n" +
32447 			"X.I1 is a raw type. References to generic type X.I1<T> should be parameterized\n" +
32448 			"----------\n" +
32449 			"4. WARNING in X.java (at line 9)\n" +
32450 			"	interface I4<T> extends I1.I2, I1.I3 {    \n" +
32451 			"	                        ^^^^^\n" +
32452 			"X.I1.I2 is a raw type. References to generic type X.I1.I2<T> should be parameterized\n" +
32453 			"----------\n" +
32454 			"5. WARNING in X.java (at line 9)\n" +
32455 			"	interface I4<T> extends I1.I2, I1.I3 {    \n" +
32456 			"	                               ^^^^^\n" +
32457 			"X.I1.I3 is a raw type. References to generic type X.I1.I3<T> should be parameterized\n" +
32458 			"----------\n" +
32459 			"6. WARNING in X.java (at line 14)\n" +
32460 			"	I1 i1 = null;\n" +
32461 			"	^^\n" +
32462 			"X.I1 is a raw type. References to generic type X.I1<T> should be parameterized\n" +
32463 			"----------\n" +
32464 			"7. WARNING in X.java (at line 15)\n" +
32465 			"	I1.I2 i2 = null;\n" +
32466 			"	^^^^^\n" +
32467 			"X.I1.I2 is a raw type. References to generic type X.I1.I2<T> should be parameterized\n" +
32468 			"----------\n" +
32469 			"8. ERROR in X.java (at line 16)\n" +
32470 			"	I1<E>.I2 i1i2 = null;\n" +
32471 			"	^^^^^^^^\n" +
32472 			"The member type X.I1.I2<T> cannot be qualified with a parameterized type, since it is static. Remove arguments from qualifying type X.I1<E>\n" +
32473 			"----------\n");
32474 }
32475 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=137203
32476 // simulate incremental compile
32477 public void test0972() {
32478 	runConformTest(
32479 		// test directory preparation
32480 		true /* flush output directory */,
32481 		new String[] { /* test files */
32482 			"Outer.java", //================================
32483 			"//Outer.java\n" +
32484 			"public class Outer<O> {\n" +
32485 			"  public class Inner {}\n" +
32486 			"\n" +
32487 			"  public static void method(Outer<?>.Inner x) {\n" +
32488 			"    System.out.println(\"SUCCESS\");\n" +
32489 			"  }\n" +
32490 			"  public static void main(String[] args) {\n" +
32491 			"    Outer<?>.Inner x = null;\n" +
32492 			"    method(x);\n" +
32493 			"  }\n" +
32494 			"}\n" +
32495 			"\n",
32496 			"ExtendedOuter.java", //================================
32497 			"public class ExtendedOuter<E> extends Outer<E> {\n" +
32498 			"  class ExtendedInner extends Inner {\n" +
32499 			"    {\n" +
32500 			"      Outer.method(this);\n" +
32501 			"    }\n" +
32502 			"  }\n" +
32503 			"}\n"
32504 		},
32505 		// compiler results
32506 		"" /* expected compiler log */,
32507 		// runtime results
32508 		"SUCCESS" /* expected output string */,
32509 		"" /* expected error string */,
32510 		// javac options
32511 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
32512 
32513 	this.runConformTest(
32514 			new String[] {
32515 				"Outer.java", //================================
32516 				"//Outer.java\n" +
32517 				"public class Outer<O> {\n" +
32518 				"  public class Inner {}\n" +
32519 				"\n" +
32520 				"  public static void method(Outer.Inner x) {\n" +
32521 				"    System.out.println(\"SUCCESS\");\n" +
32522 				"  }\n" +
32523 				"  public static void main(String[] args) {\n" +
32524 				"    Outer.Inner x = null;\n" +
32525 				"    method(x);\n" +
32526 				"  }\n" +
32527 				"}\n" +
32528 				"\n",
32529 			},
32530 			"SUCCESS",
32531 			null,
32532 			false,
32533 			null);
32534 	this.runConformTest(
32535 			new String[] {
32536 					"ExtendedOuter.java", //================================
32537 					"public class ExtendedOuter<E> extends Outer<E> {\n" +
32538 					"  class ExtendedInner extends Inner {\n" +
32539 					"    {\n" +
32540 					"      Outer.method(this);\n" +
32541 					"    }\n" +
32542 					"  }\n" +
32543 					"  public static void main(String[] args) {\n" +
32544 					"    System.out.println(\"SUCCESS\");\n" +
32545 					"  }\n" +
32546 					"}\n"
32547 
32548 			},
32549 			"SUCCESS",
32550 			null,
32551 			false,
32552 			null);
32553 }
32554 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=137203 - variation
32555 //pure source scenario
32556 public void test0973() {
32557 	this.runConformTest(
32558 			new String[] {
32559 				"Outer.java", //================================
32560 				"//Outer.java\n" +
32561 				"public class Outer<O> {\n" +
32562 				"  public class Inner {}\n" +
32563 				"\n" +
32564 				"  public static void method(Outer.Inner x) {\n" +
32565 				"    System.out.println(\"SUCCESS\");\n" +
32566 				"  }\n" +
32567 				"  public static void main(String[] args) {\n" +
32568 				"    Outer.Inner x = null;\n" +
32569 				"    method(x);\n" +
32570 				"  }\n" +
32571 				"}\n" +
32572 				"\n",
32573 				"ExtendedOuter.java", //================================
32574 				"public class ExtendedOuter<E> extends Outer<E> {\n" +
32575 				"  class ExtendedInner extends Inner {\n" +
32576 				"    {\n" +
32577 				"      Outer.method(this);\n" +
32578 				"    }\n" +
32579 				"  }\n" +
32580 				"}\n"
32581 			},
32582 			"SUCCESS");
32583 }
32584 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=137203 - variation
32585 //simulate incremental compile
32586 public void test0974() {
32587 	this.runConformTest(
32588 			new String[] {
32589 				"Outer.java", //================================
32590 				"//Outer.java\n" +
32591 				"public class Outer<O> {\n" +
32592 				"  public class Inner {}\n" +
32593 				"\n" +
32594 				"  public static void method(Outer.Inner x) {\n" +
32595 				"    System.out.println(\"SUCCESS\");\n" +
32596 				"  }\n" +
32597 				"  public static void main(String[] args) {\n" +
32598 				"    Outer.Inner x = null;\n" +
32599 				"    method(x);\n" +
32600 				"  }\n" +
32601 				"}\n" +
32602 				"\n",
32603 				"ExtendedOuter.java", //================================
32604 				"public class ExtendedOuter<E> extends Outer<E> {\n" +
32605 				"  class ExtendedInner extends Inner {\n" +
32606 				"    {\n" +
32607 				"      Outer.method(this);\n" +
32608 				"    }\n" +
32609 				"  }\n" +
32610 				"}\n"
32611 			},
32612 			"SUCCESS");
32613 	this.runConformTest(
32614 			new String[] {
32615 					"ExtendedOuter.java", //================================
32616 					"public class ExtendedOuter<E> extends Outer<E> {\n" +
32617 					"  class ExtendedInner extends Inner {\n" +
32618 					"    {\n" +
32619 					"		Outer.Inner in;\n" +
32620 					"      Outer.method(this);\n" +
32621 					"    }\n" +
32622 					"  }\n" +
32623 					"  public static void main(String[] args) {\n" +
32624 					"    System.out.println(\"SUCCESS\");\n" +
32625 					"  }\n" +
32626 					"}\n"
32627 
32628 			},
32629 			"SUCCESS",
32630 			null,
32631 			false,
32632 			null);
32633 }
32634 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=122999
32635 public void test0975() {
32636 	this.runNegativeTest(
32637 			new String[] {
32638 				"X.java", //================================
32639 				"import java.util.ArrayList;\n" +
32640 				"\n" +
32641 				"public class X extends ArrayList<Bean> {\n" +
32642 				"   public static class Bean {}\n" +
32643 				"}", // =================
32644 			},
32645 			"----------\n" +
32646 			"1. WARNING in X.java (at line 3)\n" +
32647 			"	public class X extends ArrayList<Bean> {\n" +
32648 			"	             ^\n" +
32649 			"The serializable class X does not declare a static final serialVersionUID field of type long\n" +
32650 			"----------\n" +
32651 			"2. ERROR in X.java (at line 3)\n" +
32652 			"	public class X extends ArrayList<Bean> {\n" +
32653 			"	                                 ^^^^\n" +
32654 			"Bean cannot be resolved to a type\n" +
32655 			"----------\n");
32656 }
32657 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=139525
32658 public void test0976() {
32659 	this.runConformTest(
32660 			new String[] {
32661 					"S.java", // =================
32662 					"import java.util.Collection;\n" +
32663 					"public class S {\n" +
32664 					"        public static void cow(IDA<?, ?, ?, ?, ?, ?> s) {\n" +
32665 					"                Collection<IDA.Enum1> ids = s.getIds();  // Error here\n" +
32666 					"        }\n" +
32667 					"		public static void main(String[] args) {\n" +
32668 					"			System.out.println(\"SUCCESS\");\n" +
32669 					"        }\n" +
32670 					"}\n", // =================
32671 					"ID.java", // =================
32672 					"import java.util.Collection;\n" +
32673 					"public interface ID {\n" +
32674 					"        Collection<? extends Comparable<?>> getIds();\n" +
32675 					"}\n", // =================
32676 					"IDA.java", // =================
32677 					"import java.util.Collection;\n" +
32678 					"public interface IDA<T1, C1, E1, E2, C2, T2> extends ID {\n" +
32679 					"        enum Enum1 {\n" +
32680 					"                ONE, TWO\n" +
32681 					"        }\n" +
32682 					"        Collection<IDA.Enum1> getIds();\n" +
32683 					"}\n", // =================
32684 			},
32685 			"SUCCESS");
32686 	this.runConformTest(
32687 			new String[] {
32688 					"S.java", // =================
32689 					"import java.util.Collection;\n" +
32690 					"public class S {\n" +
32691 					"        public static void cow(IDA<?, ?, ?, ?, ?, ?> s) {\n" +
32692 					"                Collection<IDA.Enum1> ids = s.getIds();  // Error here\n" +
32693 					"        }\n" +
32694 					"		public static void main(String[] args) {\n" +
32695 					"			System.out.println(\"SUCCESS2\");\n" +
32696 					"        }\n" +
32697 					"}\n", // =================
32698 			},
32699 			"SUCCESS2",
32700 			null,
32701 			false,
32702 			null);
32703 }
32704 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=139619
32705 public void test0977() {
32706 	this.runConformTest(
32707 			new String[] {
32708 					"MMTPProtocol.java", // =================
32709 					"import java.io.InputStream;\n" +
32710 					"import java.util.HashSet;\n" +
32711 					"import bug.ProtocolManager;\n" +
32712 					"abstract class AbstractProtocol<R, O> implements ProtocolManager<R, O> {\n" +
32713 					"    public AbstractProtocol(HashSet<O> manager, String grp) {}\n" +
32714 					"    AbstractProtocol(){} \n" +
32715 					"     public void connect(ConnectType type) { }\n" +
32716 					"}\n" +
32717 					"public abstract class MMTPProtocol extends AbstractProtocol<InputStream, String> {\n" +
32718 					"    public void connect(ConnectType type) {}\n" +
32719 					"}\n", // =================
32720 					"bug/ProtocolManager.java", // =================
32721 					"package bug;\n" +
32722 					"public interface ProtocolManager<R, O>{\n" +
32723 					"    public enum ConnectType {Client,Server}\n" +
32724 					"    public void connect(ConnectType type) ;\n" +
32725 					"    public boolean receive(R input) throws Exception;\n" +
32726 					"}", // =================
32727 			},
32728 			"");
32729 	this.runConformTest(
32730 			new String[] {
32731 					"MMTPProtocol.java", // =================
32732 					"import java.io.InputStream;\n" +
32733 					"import java.util.HashSet;\n" +
32734 					"import bug.ProtocolManager;\n" +
32735 					"abstract class AbstractProtocol<R, O> implements ProtocolManager<R, O> {\n" +
32736 					"    public AbstractProtocol(HashSet<O> manager, String grp) {}\n" +
32737 					"    AbstractProtocol(){} \n" +
32738 					"     public void connect(ConnectType type) { }\n" +
32739 					"}\n" +
32740 					"public abstract class MMTPProtocol extends AbstractProtocol<InputStream, String> {\n" +
32741 					"    public void connect(ConnectType type) {}\n" +
32742 					"}\n", // =================
32743 			},
32744 			"",
32745 			null,
32746 			false,
32747 			null);
32748 }
32749 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=139669
32750 public void test0978() {
32751 	this.runConformTest(
32752 			new String[] {
32753 					"B.java", // =================
32754 					"public class B<T> implements A<T> {\n" +
32755 					"  public void foo(A.C c) {}\n" +
32756 					"}", // =================
32757 					"A.java", // =================
32758 					"public interface A<T> {\n" +
32759 					"  void foo(A.C c);\n" +
32760 					"  class C {}\n" +
32761 					"}", // =================
32762 			},
32763 			"");
32764 	this.runConformTest(
32765 			new String[] {
32766 					"A.java", // =================
32767 					"public interface A<T> {\n" +
32768 					"  void foo(A.C c);\n" +
32769 					"  class C {}\n" +
32770 					"}", // =================
32771 			},
32772 			"",
32773 			null,
32774 			false,
32775 			null);
32776 }
32777 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=139669
32778 public void test0979() {
32779 	this.runConformTest(
32780 			new String[] {
32781 					"B.java", // =================
32782 					"public class B<T> extends A<T> {\n" +
32783 					"  @Override\n" +
32784 					"  public void foo(A.C c) {}\n" +
32785 					"}", // =================
32786 					"A.java", // =================
32787 					"public class A<T> {\n" +
32788 					"  public void foo(A.C c) {}\n" +
32789 					"  public static class C {}\n" +
32790 					"}", // =================
32791 			},
32792 			"");
32793 	this.runConformTest(
32794 			new String[] {
32795 					"A.java", // =================
32796 					"public class A<T> {\n" +
32797 					"  public void foo(A.C c) {}\n" +
32798 					"  public static class C {}\n" +
32799 					"}", // =================
32800 			},
32801 			"",
32802 			null,
32803 			false,
32804 			null);
32805 }
32806 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=140772
32807 public void test0980() {
32808 	this.runConformTest(
32809 			new String[] {
32810 					"X.java", // =================
32811 					"import java.util.Collections;\n" +
32812 					"import java.util.Set;\n" +
32813 					"\n" +
32814 					"public class X {\n" +
32815 					"        public Set<Object> keySet() {\n" +
32816 					"                return Collections.<Object> emptySet();\n" +
32817 					"        }\n" +
32818 					"}", // =================
32819 			},
32820 			"");
32821 }
32822 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=140569
32823 //simulate incremental compile
32824 public void test0981() {
32825 	this.runConformTest(
32826 			new String[] {
32827 				"Outer.java", //================================
32828 				"//Outer.java\n" +
32829 				"public class Outer<O> {\n" +
32830 				"  public class Inner {}\n" +
32831 				"\n" +
32832 				"  public static void main(String[] args) {\n" +
32833 				"    System.out.println(\"SUCCESS\");\n" +
32834 				"  }\n" +
32835 				"}\n" +
32836 				"\n",
32837 				"ExtendedOuter.java", //================================
32838 				"public class ExtendedOuter<E> extends Outer<E> {\n" +
32839 				"  class ExtendedInner extends Inner {\n" +
32840 				"    public void method(){\n" +
32841 				"      Worker.method(this);\n" +
32842 				"    }\n" +
32843 				"  }\n" +
32844 				"}\n",
32845 				"Worker.java", //================================
32846 				"public class Worker {\n" +
32847 				"  public static void method(Outer.Inner i) {}\n" +
32848 				"}\n", //================================
32849 			},
32850 			"SUCCESS");
32851 	this.runConformTest(
32852 			new String[] {
32853 					"ExtendedOuter.java", //================================
32854 					"public class ExtendedOuter<E> extends Outer<E> {\n" +
32855 					"  class ExtendedInner extends Inner {\n" +
32856 					"    public void method(){\n" +
32857 					"      Worker.method(this);\n" +
32858 					"    }\n" +
32859 					"  }\n" +
32860 					"  public static void main(String[] args) {\n" +
32861 					"    System.out.println(\"SUCCESS\");\n" +
32862 					"  }\n" +
32863 					"}\n", //================================
32864 			},
32865 			"SUCCESS",
32866 			null,
32867 			false,
32868 			null);
32869 }
32870 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=140569
32871 //simulate incremental compile
32872 public void test0982() {
32873 	this.runConformTest(
32874 			new String[] {
32875 				"Outer.java", //================================
32876 				"//Outer.java\n" +
32877 				"public class Outer<O> {\n" +
32878 				"  public class Inner {\n" +
32879 				"  		public class Inner2 {}\n" +
32880 				"	}\n" +
32881 				"\n" +
32882 				"  public static void main(String[] args) {\n" +
32883 				"    System.out.println(\"SUCCESS\");\n" +
32884 				"  }\n" +
32885 				"}\n" +
32886 				"\n",
32887 				"ExtendedOuter.java", //================================
32888 				"public class ExtendedOuter<E> extends Outer<E> {\n" +
32889 				"  class ExtendedInner extends Inner {\n" +
32890 				"    class ExtendedInner2 extends Inner2 {\n" +
32891 				"      public void method(){\n" +
32892 				"        Worker.method(this);\n" +
32893 				"      }\n" +
32894 				"    }\n" +
32895 				"  }\n" +
32896 				"}\n",
32897 				"Worker.java", //================================
32898 				"public class Worker {\n" +
32899 				"  public static void method(Outer.Inner.Inner2 i) {}\n" +
32900 				"}\n", //================================
32901 			},
32902 			"SUCCESS");
32903 	this.runConformTest(
32904 			new String[] {
32905 					"ExtendedOuter.java", //================================
32906 					"public class ExtendedOuter<E> extends Outer<E> {\n" +
32907 					"  class ExtendedInner extends Inner {\n" +
32908 					"    class ExtendedInner2 extends Inner2 {\n" +
32909 					"      public void method(){\n" +
32910 					"        Worker.method(this);\n" +
32911 					"      }\n" +
32912 					"    }\n" +
32913 					"  }\n" +
32914 					"  public static void main(String[] args) {\n" +
32915 					"    System.out.println(\"SUCCESS\");\n" +
32916 					"  }\n" +
32917 					"}\n", //================================
32918 			},
32919 			"SUCCESS",
32920 			null,
32921 			false,
32922 			null);
32923 }
32924 public void test0983() {
32925 	this.runNegativeTest(
32926 			new String[] {
32927 					"X.java", // =================
32928 					"import java.util.*;\n" +
32929 					"\n" +
32930 					"public class X {\n" +
32931 					"    public static void main(String[] args) throws Throwable {\n" +
32932 					"	List<?> l1 = new ArrayList<Integer>();\n" +
32933 					"	List<?> l2 = new ArrayList<Integer>();\n" +
32934 					"	l1.addAll(l2);\n" +
32935 					"    }\n" +
32936 					"}\n", // =================
32937 			},
32938 			"----------\n" +
32939 			"1. ERROR in X.java (at line 7)\n" +
32940 			"	l1.addAll(l2);\n" +
32941 			"	   ^^^^^^\n" +
32942 			"The method addAll(Collection<? extends capture#1-of ?>) in the type List<capture#1-of ?> is not applicable for the arguments (List<capture#2-of ?>)\n" +
32943 			"----------\n");
32944 }
32945 // generic inner class within a non generic one
32946 public void test0984() {
32947 	runConformTest(
32948 		// test directory preparation
32949 		new String[] { /* test files */
32950 			"X.java",
32951 			"public class X {\n" +
32952 			"  public class XX<T> {}\n" +
32953 			"}",
32954 			"I.java",
32955 			"public interface I {\n" +
32956 			"    X.XX<String> foo();\n" +
32957 			"}",
32958 			"Y.java",
32959 			"public class Y extends X implements I {\n" +
32960 			"  public XX<String> foo() {\n" +
32961 			"    return null;\n" +
32962 			"  }\n" +
32963 			"}",
32964 		},
32965 		// runtime results
32966 		"" /* expected output string */);
32967 	runConformTest(
32968 		// test directory preparation
32969 		false /* do not flush output directory */,
32970 		new String[] { /* test files */
32971 			"Y.java",
32972 			"public class Y extends X implements I {\n" +
32973 			"  public XX<String> foo() {\n" +
32974 			"    return null;\n" +
32975 			"  }\n" +
32976 			"}",
32977 			},
32978 		// compiler results
32979 		"" /* expected compiler log */,
32980 		// runtime results
32981 		"" /* expected output string */,
32982 		"" /* expected error string */,
32983 		// javac options
32984 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
32985 }
32986 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=141330
32987 public void test0985() {
32988 	Map options = getCompilerOptions();
32989 	options.put(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION, JavaCore.IGNORE);
32990 	this.runNegativeTest(
32991 			new String[] {
32992 					"X.java", // =================
32993 					"import java.util.*;\n" +
32994 					"public class X {\n" +
32995 					"    public void testBreak() {\n" +
32996 					"        List<Class<Object>>  lco = Arrays.asList(String.class, Integer.class, Long.class);\n" +
32997 					"    }\n" +
32998 					"}\n", // =================
32999 			},
33000 			"----------\n" +
33001 			"1. ERROR in X.java (at line 4)\n" +
33002 			"	List<Class<Object>>  lco = Arrays.asList(String.class, Integer.class, Long.class);\n" +
33003 			"	                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33004 			"Type mismatch: cannot convert from List<Class<? extends "+intersection("Object","Serializable","Comparable<?>")+">> to List<Class<Object>>\n" +
33005 			"----------\n",
33006 			null,
33007 			true,
33008 			options);
33009 }
33010 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=91709
33011 public void test0986() {
33012 	this.runConformTest(
33013 			new String[] {
33014 					"T.java", // =================
33015 					"public class T {\n" +
33016 					"	public T() {\n" +
33017 					"		S<String> s = new S<String>();\n" +
33018 					"		s.setObj(\"S\");\n" +
33019 					"		System.out.print(s.getObj());\n" +
33020 					"		S<Integer> i = new S<Integer>();\n" +
33021 					"		i.setObj(new Integer(100));\n" +
33022 					"		System.out.print(i.getObj());\n" +
33023 					"		S<MyClass> m = new S<MyClass>();\n" +
33024 					"		m.setObj(new MyClass(\"[Terry]\"));\n" +
33025 					"		System.out.print(m.getObj());\n" +
33026 					"		S<MyClass> x = new S<MyClass>(new MyClass(\"[Corbet]\"));\n" +
33027 					"		System.out.print(x.getObj());\n" +
33028 					"	} // End of Constructor for T.\n" +
33029 					"	public static void main(String[] args) {\n" +
33030 					"		try {\n" +
33031 					"			new T();\n" +
33032 					"			System.out.println(\"SUCCESS\");\n" +
33033 					"		} catch (Exception ex) {\n" +
33034 					"			ex.printStackTrace();\n" +
33035 					"		}\n" +
33036 					"	} // End of main().\n" +
33037 					"\n" +
33038 					"	class MyClass {\n" +
33039 					"		private String str;\n" +
33040 					"		public MyClass(String str) {\n" +
33041 					"			this.str = str;\n" +
33042 					"		} // End of Constructor for MyClass.\n" +
33043 					"		@Override\n" +
33044 					"		public String toString() {\n" +
33045 					"			return (\"MyClass = \" + str);\n" +
33046 					"		} // End of toString().\n" +
33047 					"	} // End of Embedded MyClass Class.\n" +
33048 					"} // End of T Class.\n",  // =================
33049 					"S.java", // =================
33050 					"public class S<$T> extends B<$T> {\n" +
33051 					"	public S() {\n" +
33052 					"		super();\n" +
33053 					"	} // End of Constructor for S.\n" +
33054 					"	public S($T obj) {\n" +
33055 					"		super(obj);\n" +
33056 					"	} // End of Constructor for S.\n" +
33057 					"} // End of S Class.\n",  // =================
33058 					"B.java", // =================
33059 					"public abstract class B<$T> {\n" +
33060 					"	$T obj;\n" +
33061 					"	public B() {\n" +
33062 					"		;\n" +
33063 					"	} // End of Constructor for B.\n" +
33064 					"	public B($T obj) {\n" +
33065 					"		this.obj = obj;\n" +
33066 					"	} // End ofg Constructor of B.\n" +
33067 					"	public $T getObj() {\n" +
33068 					"		return (obj);\n" +
33069 					"	} // End of getObj().\n" +
33070 					"	public void setObj($T obj) {\n" +
33071 					"		this.obj = obj;\n" +
33072 					"	} // End of setObj().\n" +
33073 					"} // End of B Class.", // =================
33074 
33075 			},
33076 			"S100MyClass = [Terry]MyClass = [Corbet]SUCCESS");
33077 }
33078 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=140643
33079 public void test0987() {
33080 	String expectedOutput = new CompilerOptions(getCompilerOptions()).sourceLevel < ClassFileConstants.JDK1_6
33081     ?	"----------\n" +
33082 		"1. ERROR in X.java (at line 7)\n" +
33083 		"	abstract class GLinkElementView<M,CM> extends AbstractLinkView<M> {}\n" +
33084 		"	               ^^^^^^^^^^^^^^^^\n" +
33085 		"The return types are incompatible for the inherited methods EditPart.getViewer(), AbstractLinkView<M>.getViewer()\n" +
33086 		"----------\n" +
33087 		"2. ERROR in X.java (at line 11)\n" +
33088 		"	public ISheetViewer getViewer() { return null; }	\n" +
33089 		"	       ^^^^^^^^^^^^\n" +
33090 		"The return type is incompatible with EditPart.getViewer()\n" +
33091 		"----------\n" +
33092 		"3. ERROR in X.java (at line 11)\n" +
33093 		"	public ISheetViewer getViewer() { return null; }	\n" +
33094 		"	                    ^^^^^^^^^^^\n" +
33095 		"The method getViewer() of type AbstractLinkView<M> must override a superclass method\n" +
33096 		"----------\n"
33097     :	"----------\n" +
33098 		"1. ERROR in X.java (at line 7)\n" +
33099 		"	abstract class GLinkElementView<M,CM> extends AbstractLinkView<M> {}\n" +
33100 		"	               ^^^^^^^^^^^^^^^^\n" +
33101 		"The return types are incompatible for the inherited methods EditPart.getViewer(), AbstractLinkView<M>.getViewer()\n" +
33102 		"----------\n" +
33103 		"2. ERROR in X.java (at line 11)\n" +
33104 		"	public ISheetViewer getViewer() { return null; }	\n" +
33105 		"	       ^^^^^^^^^^^^\n" +
33106 		"The return type is incompatible with EditPart.getViewer()\n" +
33107 		"----------\n";
33108 	this.runNegativeTest(
33109 			new String[] {
33110 				"X.java",//===================
33111 				"public class X {\n" +
33112 				"	void bar(GLinkElementView<?,?> g) {\n" +
33113 				"		g.getViewer();\n" +
33114 				"	}\n" +
33115 				"}\n" +
33116 				"\n" +
33117 				"abstract class GLinkElementView<M,CM> extends AbstractLinkView<M> {}\n" +
33118 				"\n" +
33119 				"abstract class AbstractLinkView<M> extends AbstractConnectionEditPart implements ILinkViewElement {\n" +
33120 				"	@Override\n" +
33121 				"	public ISheetViewer getViewer() { return null; }	\n" +
33122 				"}\n" +
33123 				"\n" +
33124 				"abstract class AbstractConnectionEditPart implements EditPart {}\n" +
33125 				"\n" +
33126 				"abstract class AbstractEditPart implements EditPart {\n" +
33127 				"	public EditPartViewer getViewer() { return null; }\n" +
33128 				"}\n" +
33129 				"\n" +
33130 				"interface ILinkViewElement {\n" +
33131 				"	public ISheetViewer getViewer();\n" +
33132 				"}\n" +
33133 				"\n" +
33134 				"interface ISheetViewer {}\n" +
33135 				"\n" +
33136 				"interface EditPart {\n" +
33137 				"	EditPartViewer getViewer();\n" +
33138 				"}\n" +
33139 				"\n" +
33140 				"interface EditPartViewer {}\n", // =================
33141 			},
33142 			expectedOutput);
33143 }
33144 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=140643 - variation
33145 public void test0988() {
33146 	this.runNegativeTest(
33147 			new String[] {
33148 				"X.java",//===================
33149 				"public class X {\n" +
33150 				"	void bar(GLinkElementView<?,?> g) {\n" +
33151 				"		g.getViewer();\n" +
33152 				"	}\n" +
33153 				"}\n" +
33154 				"\n" +
33155 				"abstract class GLinkElementView<M,CM> extends AbstractLinkView<M> {}\n" +
33156 				"\n" +
33157 				"abstract class AbstractLinkView<M> extends AbstractConnectionEditPart implements ILinkViewElement, IModelChangeListener {\n" +
33158 				"	@Override\n" +
33159 				"	public SheetViewer getViewer() { return null; }	\n" +
33160 				"}\n" +
33161 				"\n" +
33162 				"abstract class AbstractConnectionEditPart extends AbstractGraphicalEditPart implements ConnectionEditPart {}\n" +
33163 				"\n" +
33164 				"abstract class AbstractGraphicalEditPart extends AbstractEditPart implements GraphicalEditPart {}\n" +
33165 				"\n" +
33166 				"abstract class AbstractEditPart implements EditPart {\n" +
33167 				"	public EditPartViewer getViewer() { return null; }\n" +
33168 				"}\n" +
33169 				"\n" +
33170 				"interface ILinkViewElement extends INodeViewElement {\n" +
33171 				"	public ISheetViewer getViewer();\n" +
33172 				"}\n" +
33173 				"\n" +
33174 				"class SheetViewer implements ISheetViewer {}\n" +
33175 				"\n" +
33176 				"interface ISheetViewer {}\n" +
33177 				"\n" +
33178 				"interface EditPart {\n" +
33179 				"	EditPartViewer getViewer();\n" +
33180 				"}\n" +
33181 				"\n" +
33182 				"interface ConnectionEditPart extends GraphicalEditPart {}\n" +
33183 				"interface GraphicalEditPart extends EditPart {}\n" +
33184 				"interface EditPartViewer {}\n" +
33185 				"interface IModelChangeListener {}\n" +
33186 				"\n" +
33187 				"interface INodeViewElement {\n" +
33188 				"	public ISheetViewer getViewer();\n" +
33189 				"}", // =================
33190 			},
33191 			"----------\n" +
33192 			"1. ERROR in X.java (at line 7)\n" +
33193 			"	abstract class GLinkElementView<M,CM> extends AbstractLinkView<M> {}\n" +
33194 			"	               ^^^^^^^^^^^^^^^^\n" +
33195 			"The return types are incompatible for the inherited methods EditPart.getViewer(), AbstractLinkView<M>.getViewer()\n" +
33196 			"----------\n" +
33197 			"2. ERROR in X.java (at line 11)\n" +
33198 			"	public SheetViewer getViewer() { return null; }	\n" +
33199 			"	       ^^^^^^^^^^^\n" +
33200 			"The return type is incompatible with AbstractEditPart.getViewer()\n" +
33201 			"----------\n");
33202 }
33203 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=142653
33204 public void test0989() {
33205 	this.runNegativeTest(
33206 			new String[] {
33207 				"Child.java",//===================
33208 				"public class Child extends Parent<Object> {}\n" +
33209 				"abstract class Parent<T> extends Grandparent<T> implements IParent {}\n" +
33210 				"interface IParent<T> extends IGrandparent<T> {}\n" +
33211 				"abstract class Grandparent<T> implements IGrandparent<T> {}\n" +
33212 				"interface IGrandparent<T> {}", // =================, // =================
33213 			},
33214 			"----------\n" +
33215 			"1. ERROR in Child.java (at line 2)\n" +
33216 			"	abstract class Parent<T> extends Grandparent<T> implements IParent {}\n" +
33217 			"	               ^^^^^^\n" +
33218 			"The interface IGrandparent cannot be implemented more than once with different arguments: IGrandparent<T> and IGrandparent\n" +
33219 			"----------\n" +
33220 			"2. WARNING in Child.java (at line 2)\n" +
33221 			"	abstract class Parent<T> extends Grandparent<T> implements IParent {}\n" +
33222 			"	                                                           ^^^^^^^\n" +
33223 			"IParent is a raw type. References to generic type IParent<T> should be parameterized\n" +
33224 			"----------\n");
33225 }
33226 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=142653 - variation
33227 public void test0990() {
33228 	this.runNegativeTest(
33229 			new String[] {
33230 				"Child.java",//===================
33231 				"public class Child extends Parent<Object> {}\n" +
33232 				"abstract class Parent<T> extends Grandparent<T> implements IParent<?> {}\n" +
33233 				"interface IParent<T> extends IGrandparent<T> {}\n" +
33234 				"abstract class Grandparent<T> implements IGrandparent<T> {}\n" +
33235 				"interface IGrandparent<T> {}", // =================, // =================
33236 			},
33237 			"----------\n" +
33238 			"1. ERROR in Child.java (at line 1)\n" +
33239 			"	public class Child extends Parent<Object> {}\n" +
33240 			"	             ^^^^^\n" +
33241 			"The hierarchy of the type Child is inconsistent\n" +
33242 			"----------\n" +
33243 			"2. ERROR in Child.java (at line 2)\n" +
33244 			"	abstract class Parent<T> extends Grandparent<T> implements IParent<?> {}\n" +
33245 			"	                                                           ^^^^^^^\n" +
33246 			"The type Parent cannot extend or implement IParent<?>. A supertype may not specify any wildcard\n" +
33247 			"----------\n");
33248 }
33249 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=142653 - variation
33250 public void test0991() {
33251 	this.runNegativeTest(
33252 			new String[] {
33253 				"X.java",//===================
33254 				"public class X extends SX<String> implements IX<Object> {}\n" +
33255 				"class SX<T> extends TX<Thread> implements IX<T> {}\n" +
33256 				"class TX<U> implements IX<U> {}\n" +
33257 				"interface IX<V> {}\n", // =================, // =================
33258 			},
33259 			"----------\n" +
33260 			"1. ERROR in X.java (at line 1)\n" +
33261 			"	public class X extends SX<String> implements IX<Object> {}\n" +
33262 			"	             ^\n" +
33263 			"The interface IX cannot be implemented more than once with different arguments: IX<Thread> and IX<Object>\n" +
33264 			"----------\n" +
33265 			"2. ERROR in X.java (at line 2)\n" +
33266 			"	class SX<T> extends TX<Thread> implements IX<T> {}\n" +
33267 			"	      ^^\n" +
33268 			"The interface IX cannot be implemented more than once with different arguments: IX<Thread> and IX<T>\n" +
33269 			"----------\n");
33270 }
33271 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=142653 - variation
33272 public void test0992() {
33273 	this.runNegativeTest(
33274 			new String[] {
33275 				"X.java",//===================
33276 				"import java.util.*;\n" +
33277 				"public abstract class X<T0> implements Collection, I<T0> {\n" +
33278 				"	\n" +
33279 				"	void foo() {\n" +
33280 				"		this.add(new Object());\n" +
33281 				"		this.add(null);\n" +
33282 				"	}\n" +
33283 				"}\n" +
33284 				"interface I<T1> extends Collection<String> {\n" +
33285 				"}\n", // =================, // =================
33286 			},
33287 			"----------\n" +
33288 			"1. ERROR in X.java (at line 2)\n" +
33289 			"	public abstract class X<T0> implements Collection, I<T0> {\n" +
33290 			"	                      ^\n" +
33291 			"The interface Collection cannot be implemented more than once with different arguments: Collection<String> and Collection\n" +
33292 			"----------\n" +
33293 			"2. WARNING in X.java (at line 2)\n" +
33294 			"	public abstract class X<T0> implements Collection, I<T0> {\n" +
33295 			"	                                       ^^^^^^^^^^\n" +
33296 			"Collection is a raw type. References to generic type Collection<E> should be parameterized\n" +
33297 			"----------\n" +
33298 			"3. WARNING in X.java (at line 5)\n" +
33299 			"	this.add(new Object());\n" +
33300 			"	^^^^^^^^^^^^^^^^^^^^^^\n" +
33301 			"Type safety: The method add(Object) belongs to the raw type Collection. References to generic type Collection<E> should be parameterized\n" +
33302 			"----------\n" +
33303 			"4. WARNING in X.java (at line 6)\n" +
33304 			"	this.add(null);\n" +
33305 			"	^^^^^^^^^^^^^^\n" +
33306 			"Type safety: The method add(Object) belongs to the raw type Collection. References to generic type Collection<E> should be parameterized\n" +
33307 			"----------\n");
33308 }
33309 
33310 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=142897
33311 public void test0993() {
33312 	runConformTest(
33313 		true,
33314 		new String[] {
33315 			"X.java",//===================
33316 			"public class X {\n" +
33317 			"  public class Inner {\n" +
33318 			"    Inner() {\n" +
33319 			"      System.out.println(\"SUCCESS\");\n" +
33320 			"    }\n" +
33321 			"  }\n" +
33322 			"  public static void main(String[] args) {\n" +
33323 			"    new ATest<X>();\n" +
33324 			"  }\n" +
33325 			"}\n" +
33326 			"\n" +
33327 			"class ATest<T extends X> {\n" +
33328 			"   public ATest() {\n" +
33329 			"      T instance = makeInstance();\n" +
33330 			"      X.Inner peq = instance.new Inner(); //**\n" +
33331 			"   }\n" +
33332 			"\n" +
33333 			"   private T makeInstance() {\n" +
33334 			"      return (T) new X();\n" +
33335 			"   }\n" +
33336 			"}", // =================
33337 		},
33338 		null,
33339 		"SUCCESS",
33340 		null,
33341 		JavacTestOptions.JavacHasABug.JavacBug6569404);
33342 }
33343 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=142897 - variation
33344 public void test0994() {
33345 	this.runConformTest(
33346 			new String[] {
33347 				"X.java",//===================
33348 				"public class X {\n" +
33349 				"  public class Inner {\n" +
33350 				"    Inner() {\n" +
33351 				"      System.out.println(\"SUCCESS\");\n" +
33352 				"    }\n" +
33353 				"  }\n" +
33354 				"  void foo(boolean b, X1 x1, X2 x2) {\n" +
33355 				"	  (b ? x1 : x2).new Inner();\n" +
33356 				"  }\n" +
33357 				"  public static void main(String[] args) {\n" +
33358 				"    new X().foo(true, new X1(), new X2());\n" +
33359 				"  }\n" +
33360 				"}\n" +
33361 				"\n" +
33362 				"class X1 extends X implements Comparable<X1> {\n" +
33363 				"  public int compareTo(X1 other) {\n" +
33364 				"    return 0;\n" +
33365 				"  }\n" +
33366 				"}\n" +
33367 				"class X2 extends X implements Comparable<X2> {\n" +
33368 				"  public int compareTo(X2 other) {\n" +
33369 				"    return 0;\n" +
33370 				"  }\n" +
33371 				"}\n", // =================
33372 			},
33373 			"SUCCESS");
33374 }
33375 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=142964
33376 public void _test0995() {
33377 	this.runNegativeTest(
33378 			new String[] {
33379 				"X.java",//===================
33380 				"public class X {\n" +
33381 				"  public class Inner {\n" +
33382 				"  }\n" +
33383 				"  void foo(boolean b, X1 x1, X2 x2) {\n" +
33384 				"	  Comparable<? extends X> cx1 = b ? x1 : x2;\n" +
33385 				"	  Comparable<X> cx2 = b ? x1 : x2;\n" +
33386 				"	  String s = b ? x1 : x2;\n" +
33387 				"  }\n" +
33388 				"}\n" +
33389 				"\n" +
33390 				"abstract class X1 extends X implements Comparable<X1> {}\n" +
33391 				"abstract class X2 extends X implements Comparable<X2> {}", // =================
33392 			},
33393 			"SUCCESS");
33394 }
33395 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=143793
33396 public void test0996() {
33397 	this.runNegativeTest(
33398 			new String[] {
33399 				"X.java",//===================
33400 				"import java.util.ArrayList;\n" +
33401 				"import java.util.List;\n" +
33402 				"\n" +
33403 				"public class X<T> {\n" +
33404 				"  private T aObject = null;\n" +
33405 				"  public static <U> List<U> castList(final List<? extends Object> pList, final Class<U> pClass) {\n" +
33406 				"    final List<U> result = new ArrayList<U>();\n" +
33407 				"    for (Object o:pList) {\n" +
33408 				"      if (pClass.isInstance(o)) {\n" +
33409 				"        result.add(pClass.cast(o));\n" +
33410 				"      }\n" +
33411 				"    }\n" +
33412 				"    return result;\n" +
33413 				"  }\n" +
33414 				"\n" +
33415 				"  public static void main(final String[] pArgs) {\n" +
33416 				"    final List<Object> l1 = new ArrayList<Object>();\n" +
33417 				"    l1.add(new X<String>());\n" +
33418 				"    l1.add(new X<String>());\n" +
33419 				"    final List<X<?>> l2 = castList(l1, List.class);\n" +
33420 				"    \n" +
33421 				"    List<X> l3 = l2;\n" +
33422 				"    List<X<String>> l4 = null;\n" +
33423 				"    l3 = l4;\n" +
33424 				"  }\n" +
33425 				"\n" +
33426 				"}\n", // =================
33427 			},
33428 			"----------\n" +
33429 			"1. ERROR in X.java (at line 20)\n" +
33430 			"	final List<X<?>> l2 = castList(l1, List.class);\n" +
33431 			"	                      ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33432 			"Type mismatch: cannot convert from List<List> to List<X<?>>\n" +
33433 			"----------\n" +
33434 			"2. WARNING in X.java (at line 22)\n" +
33435 			"	List<X> l3 = l2;\n" +
33436 			"	     ^\n" +
33437 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
33438 			"----------\n" +
33439 			"3. ERROR in X.java (at line 22)\n" +
33440 			"	List<X> l3 = l2;\n" +
33441 			"	             ^^\n" +
33442 			"Type mismatch: cannot convert from List<X<?>> to List<X>\n" +
33443 			"----------\n" +
33444 			"4. ERROR in X.java (at line 24)\n" +
33445 			"	l3 = l4;\n" +
33446 			"	     ^^\n" +
33447 			"Type mismatch: cannot convert from List<X<String>> to List<X>\n" +
33448 			"----------\n");
33449 }
33450 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=142897 - variation
33451 public void test0997() {
33452 	runConformTest(
33453 		true,
33454 		new String[] {
33455 			"X.java",//===================
33456 			"public class X implements Outer {\n" +
33457 			"  public static void main(String[] args) {\n" +
33458 			"    new ATest<X>();\n" +
33459 			"  }\n" +
33460 			"}\n" +
33461 			"interface Outer {\n" +
33462 			"  public class Inner {\n" +
33463 			"    Inner() {\n" +
33464 			"      System.out.println(\"SUCCESS\");\n" +
33465 			"    }\n" +
33466 			"  }\n" +
33467 			"}\n" +
33468 			"\n" +
33469 			"class ATest<T extends Outer> {\n" +
33470 			"   public ATest() {\n" +
33471 			"      Outer.Inner peq = new T.Inner(); //**\n" +
33472 			"   }\n" +
33473 			"\n" +
33474 			"   private T makeInstance() {\n" +
33475 			"      return (T) new X();\n" +
33476 			"   }\n" +
33477 			"}", // =================
33478 		},
33479 		null,
33480 		"SUCCESS",
33481 		null,
33482 		JavacTestOptions.JavacHasABug.JavacBug6569404);
33483 }
33484 //regression test for https://bugs.eclipse.org/bugs/show_bug.cgi?id=144261
33485 public void test0998() {
33486 	this.runConformTest(
33487 		new String[] {
33488 			"X.java",
33489 			"class X {\n" +
33490 			"    static abstract class Generic<F> {\n" +
33491 			"        static class Inner {\n" +
33492 			"            static class InnerInner { }\n" +
33493 			"            InnerInner createTableModel() {\n" +
33494 			"                return new InnerInner();\n" +
33495 			"            }\n" +
33496 			"        }\n" +
33497 			"    }\n" +
33498 			"    static class SubGeneric<S> extends Generic<S> {\n" +
33499 			"        static class SubInner extends Inner {\n" +
33500 			"            InnerInner createTableModel() {\n" +
33501 			"                return super.createTableModel(); \n" +
33502 			"            }\n" +
33503 			"        }\n" +
33504 			"    }\n" +
33505 			"}",
33506 		},
33507 		"");
33508 }
33509 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=144879
33510 // SHOULD FAIL AT 1.8 (18.2.3): The method chain(Iterator<E>...) in the type X is not applicable for the arguments (Iterator[])
33511 public void test0999() {
33512 	this.runNegativeTest(
33513 		new String[] {
33514 			"X.java",
33515 			"import java.util.*;\n" +
33516 			"public class X {\n" +
33517 			"	public static final <T,E extends T> Iterator<T> chain(Iterator<E>... it) {\n" +
33518 			"		return null;\n" +
33519 			"	}\n" +
33520 			"	void foo1() {\n" +
33521 			"		List<Integer> l1 = Arrays.asList(1, 2, 3);\n" +
33522 			"		List<Float> l2 = Arrays.asList(4f, 5f, 6f);\n" +
33523 			"		Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
33524 			"	}\n" +
33525 			"	void foo2() {\n" +
33526 			"		List<Integer> l1 = Arrays.asList(1, 2, 3);\n" +
33527 			"		List<Float> l2 = Arrays.asList(4f, 5f, 6f);\n" +
33528 			"		Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" +
33529 			"	}\n" +
33530 			"	void foo3() {\n" +
33531 			"		List<Integer> l1 = Arrays.asList(1, 2, 3);\n" +
33532 			"		Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" +
33533 			"	}\n" +
33534 			"}", // =================
33535 		},
33536 		this.complianceLevel < ClassFileConstants.JDK1_7 ?
33537 		"----------\n" +
33538 		"1. WARNING in X.java (at line 9)\n" +
33539 		"	Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
33540 		"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33541 		"Type safety: Unchecked invocation chain(Iterator[]) of the generic method chain(Iterator<E>...) of type X\n" +
33542 		"----------\n" +
33543 		"2. WARNING in X.java (at line 9)\n" +
33544 		"	Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
33545 		"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33546 		"Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<Number>\n" +
33547 		"----------\n" +
33548 		"3. WARNING in X.java (at line 9)\n" +
33549 		"	Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
33550 		"	                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33551 		"Type safety: The expression of type Iterator[] needs unchecked conversion to conform to Iterator<Number>[]\n" +
33552 		"----------\n" +
33553 		"4. ERROR in X.java (at line 14)\n" +
33554 		"	Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" +
33555 		"	                         ^^^^^\n" +
33556 		"The method chain(Iterator<E>...) in the type X is not applicable for the arguments (Iterator<Integer>, Iterator<Float>)\n" +
33557 		"----------\n" +
33558 		"5. WARNING in X.java (at line 18)\n" +
33559 		"	Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" +
33560 		"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33561 		"Type safety: A generic array of Iterator<Integer> is created for a varargs parameter\n" +
33562 		"----------\n" :
33563 			"----------\n" +
33564 			"1. WARNING in X.java (at line 3)\n" +
33565 			"	public static final <T,E extends T> Iterator<T> chain(Iterator<E>... it) {\n" +
33566 			"	                                                                     ^^\n" +
33567 			"Type safety: Potential heap pollution via varargs parameter it\n" +
33568 			"----------\n" +
33569 			"2. WARNING in X.java (at line 9)\n" +
33570 			"	Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
33571 			"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33572 			"Type safety: Unchecked invocation chain(Iterator[]) of the generic method chain(Iterator<E>...) of type X\n" +
33573 			"----------\n" +
33574 			"3. WARNING in X.java (at line 9)\n" +
33575 			"	Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
33576 			"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33577 			"Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<Number>\n" +
33578 			"----------\n" +
33579 			"4. WARNING in X.java (at line 9)\n" +
33580 			"	Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
33581 			"	                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33582 			(this.complianceLevel < ClassFileConstants.JDK1_8
33583 			? "Type safety: The expression of type Iterator[] needs unchecked conversion to conform to Iterator<Number>[]\n"
33584 			: "Type safety: The expression of type Iterator[] needs unchecked conversion to conform to Iterator<Object>[]\n") +
33585 			"----------\n" +
33586 			"5. ERROR in X.java (at line 14)\n" +
33587 			"	Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" +
33588 			"	                         ^^^^^\n" +
33589 			"The method chain(Iterator<E>...) in the type X is not applicable for the arguments (Iterator<Integer>, Iterator<Float>)\n" +
33590 			"----------\n" +
33591 			"6. WARNING in X.java (at line 18)\n" +
33592 			"	Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" +
33593 			"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33594 			"Type safety: A generic array of Iterator<Integer> is created for a varargs parameter\n" +
33595 			"----------\n");
33596 }
33597 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=144879
33598 public void test1000() {
33599 	this.runNegativeTest(
33600 		new String[] {
33601 			"X.java",
33602 			"import java.util.*;\n" +
33603 			"public class X {\n" +
33604 			"	public static final <T> Iterator<T> chain(Iterator<? extends T>... it) {\n" +
33605 			"		return null;\n" +
33606 			"	}\n" +
33607 			"	void foo1() {\n" +
33608 			"		List<Integer> l1 = Arrays.asList(1, 2, 3);\n" +
33609 			"		List<Float> l2 = Arrays.asList(4f, 5f, 6f);\n" +
33610 			"		Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
33611 			"	}\n" +
33612 			"	void foo2() {\n" +
33613 			"		List<Integer> l1 = Arrays.asList(1, 2, 3);\n" +
33614 			"		List<Float> l2 = Arrays.asList(4f, 5f, 6f);\n" +
33615 			"		Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" +
33616 			"	}\n" +
33617 			"	void foo3() {\n" +
33618 			"		List<Integer> l1 = Arrays.asList(1, 2, 3);\n" +
33619 			"		Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" +
33620 			"	}\n" +
33621 			"}", // =================
33622 		},
33623 		this.complianceLevel < ClassFileConstants.JDK1_7 ?
33624 		"----------\n" +
33625 		"1. WARNING in X.java (at line 9)\n" +
33626 		"	Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
33627 		"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33628 		"Type safety: Unchecked invocation chain(Iterator[]) of the generic method chain(Iterator<? extends T>...) of type X\n" +
33629 		"----------\n" +
33630 		"2. WARNING in X.java (at line 9)\n" +
33631 		"	Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
33632 		"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33633 		"Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<Number>\n" +
33634 		"----------\n" +
33635 		"3. WARNING in X.java (at line 9)\n" +
33636 		"	Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
33637 		"	                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33638 		"Type safety: The expression of type Iterator[] needs unchecked conversion to conform to Iterator<? extends Number>[]\n" +
33639 		"----------\n" +
33640 		"4. WARNING in X.java (at line 14)\n" +
33641 		"	Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" +
33642 		"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33643 		"Type safety: A generic array of Iterator<? extends "+ intersection("Number", "Comparable<?>") +"> is created for a varargs parameter\n" +
33644 		"----------\n" +
33645 		"5. ERROR in X.java (at line 14)\n" +
33646 		"	Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" +
33647 		"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33648 		"Type mismatch: cannot convert from Iterator<"+ intersection("Number", "Comparable<?>") +"> to Iterator<Number>\n" +
33649 		"----------\n" +
33650 		"6. WARNING in X.java (at line 18)\n" +
33651 		"	Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" +
33652 		"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33653 		"Type safety: A generic array of Iterator<? extends Integer> is created for a varargs parameter\n" +
33654 		"----------\n" +
33655 		"7. ERROR in X.java (at line 18)\n" +
33656 		"	Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" +
33657 		"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33658 		"Type mismatch: cannot convert from Iterator<Integer> to Iterator<Number>\n" +
33659 		"----------\n" :
33660 		(this.complianceLevel == ClassFileConstants.JDK1_7 ?
33661 			"----------\n" +
33662 			"1. WARNING in X.java (at line 3)\n" +
33663 			"	public static final <T> Iterator<T> chain(Iterator<? extends T>... it) {\n" +
33664 			"	                                                                   ^^\n" +
33665 			"Type safety: Potential heap pollution via varargs parameter it\n" +
33666 			"----------\n" +
33667 			"2. WARNING in X.java (at line 9)\n" +
33668 			"	Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
33669 			"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33670 			"Type safety: Unchecked invocation chain(Iterator[]) of the generic method chain(Iterator<? extends T>...) of type X\n" +
33671 			"----------\n" +
33672 			"3. WARNING in X.java (at line 9)\n" +
33673 			"	Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
33674 			"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33675 			"Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<Number>\n" +
33676 			"----------\n" +
33677 			"4. WARNING in X.java (at line 9)\n" +
33678 			"	Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
33679 			"	                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33680 			"Type safety: The expression of type Iterator[] needs unchecked conversion to conform to Iterator<? extends Number>[]\n" +
33681 			"----------\n" +
33682 			"5. WARNING in X.java (at line 14)\n" +
33683 			"	Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" +
33684 			"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33685 			"Type safety: A generic array of Iterator<? extends Number&"+ intersection("Comparable<?>") +"> is created for a varargs parameter\n" +
33686 			"----------\n" +
33687 			"6. ERROR in X.java (at line 14)\n" +
33688 			"	Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" +
33689 			"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33690 			"Type mismatch: cannot convert from Iterator<Number&"+ intersection("Comparable<?>") +"> to Iterator<Number>\n" +
33691 			"----------\n" +
33692 			"7. WARNING in X.java (at line 18)\n" +
33693 			"	Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" +
33694 			"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33695 			"Type safety: A generic array of Iterator<? extends Integer> is created for a varargs parameter\n" +
33696 			"----------\n" +
33697 			"8. ERROR in X.java (at line 18)\n" +
33698 			"	Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" +
33699 			"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33700 			"Type mismatch: cannot convert from Iterator<Integer> to Iterator<Number>\n" +
33701 			"----------\n"
33702 		:	// no more errors in JDK1_8+
33703 			"----------\n" +
33704 			"1. WARNING in X.java (at line 3)\n" +
33705 			"	public static final <T> Iterator<T> chain(Iterator<? extends T>... it) {\n" +
33706 			"	                                                                   ^^\n" +
33707 			"Type safety: Potential heap pollution via varargs parameter it\n" +
33708 			"----------\n" +
33709 			"2. WARNING in X.java (at line 9)\n" +
33710 			"	Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
33711 			"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33712 			"Type safety: Unchecked invocation chain(Iterator[]) of the generic method chain(Iterator<? extends T>...) of type X\n" +
33713 			"----------\n" +
33714 			"3. WARNING in X.java (at line 9)\n" +
33715 			"	Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
33716 			"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33717 			"Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<Number>\n" +
33718 			"----------\n" +
33719 			"4. WARNING in X.java (at line 9)\n" +
33720 			"	Iterator<Number> it1 = X.chain(new Iterator[] { l1.iterator(), l2.iterator() });\n" +
33721 			"	                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33722 			"Type safety: The expression of type Iterator[] needs unchecked conversion to conform to Iterator<? extends Object>[]\n" +
33723 			"----------\n" +
33724 			"5. WARNING in X.java (at line 14)\n" +
33725 			"	Iterator<Number> it2 = X.chain(l1.iterator(), l2.iterator());\n" +
33726 			"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33727 			"Type safety: A generic array of Iterator<? extends Number> is created for a varargs parameter\n" +
33728 			"----------\n" +
33729 			"6. WARNING in X.java (at line 18)\n" +
33730 			"	Iterator<Number> it2 = X.chain(l1.iterator(), l1.iterator());\n" +
33731 			"	                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33732 			"Type safety: A generic array of Iterator<? extends Number> is created for a varargs parameter\n" +
33733 			"----------\n"
33734 		)
33735 	);
33736 }
33737 public void test1001() {
33738 	this.runConformTest(
33739 		new String[] {
33740 			"X.java",
33741 			"public class X {\n" +
33742 			"	static class Box<T> {}\n" +
33743 			"	static class ABox<T extends A> {}\n" +
33744 			"	static class A {}\n" +
33745 			"	\n" +
33746 			"	void foo(ABox<? extends A> a1, ABox<?> a2) {\n" +
33747 			"		a1 = a2;	\n" +
33748 			"	}\n" +
33749 			"}", // =================
33750 		},
33751 		"");
33752 }
33753 public void test1002() {
33754 	this.runNegativeTest(
33755 		new String[] {
33756 			"Base.java",
33757 			"class Base {\n" +
33758 			"}\n" +
33759 			"class Foo<U extends Base, V extends Bar<U, Foo<U, V>>> {\n" +
33760 			"	U u;\n" +
33761 			"	V v;\n" +
33762 			"}\n" +
33763 			"class Bar<E extends Base, F extends Foo<E, Bar<E, F>>> {\n" +
33764 			"	E e;\n" +
33765 			"	F f;\n" +
33766 			"}\n", // =================
33767 		},
33768 		"----------\n" +
33769 		"1. ERROR in Base.java (at line 3)\n" +
33770 		"	class Foo<U extends Base, V extends Bar<U, Foo<U, V>>> {\n" +
33771 		"	                                           ^^^\n" +
33772 		"Bound mismatch: The type Foo<U,V> is not a valid substitute for the bounded parameter <F extends Foo<E,Bar<E,F>>> of the type Bar<E,F>\n" +
33773 		"----------\n" +
33774 		"2. ERROR in Base.java (at line 7)\n" +
33775 		"	class Bar<E extends Base, F extends Foo<E, Bar<E, F>>> {\n" +
33776 		"	                                           ^^^\n" +
33777 		"Bound mismatch: The type Bar<E,F> is not a valid substitute for the bounded parameter <V extends Bar<U,Foo<U,V>>> of the type Foo<U,V>\n" +
33778 		"----------\n");
33779 }
33780 public void test1003() {
33781 	this.runConformTest(
33782 		new String[] {
33783 			"B.java",
33784 			"class B {\n" +
33785 			"}\n" +
33786 			"class S<BB extends B, SS extends S<BB, SS, TT>, TT extends T<BB, SS, TT>> {\n" +
33787 			"	BB b;\n" +
33788 			"	TT t;\n" +
33789 			"}\n" +
33790 			"class T<BB extends B, SS extends S<BB, SS, TT>, TT extends T<BB, SS, TT>> {\n" +
33791 			"	BB b;\n" +
33792 			"	SS t;\n" +
33793 			"}\n", // =================
33794 		},
33795 		"");
33796 }
33797 public void test1004() {
33798 	runConformTest(
33799 		// test directory preparation
33800 		new String[] { /* test files */
33801 			"X.java",
33802 			"public class X {\n" +
33803 			"	<B> B getOtherValue() {\n" +
33804 			"		return null;\n" +
33805 			"	}\n" +
33806 			"	<A> A getValue() {\n" +
33807 			"		return getOtherValue();\n" +
33808 			"	}\n" +
33809 			"}", // =================
33810 		},
33811 		// javac options
33812 		JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
33813 }
33814 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=145420
33815 public void test1005() {
33816 	runConformTest(
33817 		// test directory preparation
33818 		true /* flush output directory */,
33819 		new String[] { /* test files */
33820 			"X.java",
33821 			"public class X<T1,T2> {\n" +
33822 			"\n" +
33823 			"    private static final Object NULL_REF = new Object();\n" +
33824 			"    private Object data;\n" +
33825 			"\n" +
33826 			"    private static <RT> RT unwrap(Object obj) {\n" +
33827 			"        return (RT)(obj == NULL_REF ? null : obj);\n" +
33828 			"    }\n" +
33829 			"\n" +
33830 			"    public T1 getAsT1() {\n" +
33831 			"        return unwrap(data);\n" +
33832 			"    }\n" +
33833 			"\n" +
33834 			"    public T2 getAsT2() {\n" +
33835 			"        return unwrap(data);\n" +
33836 			"    }\n" +
33837 			"}", // =================
33838 		},
33839 	// compiler results
33840 	null /* do not check compiler log */,
33841 	// runtime results
33842 	"" /* expected output string */,
33843 	"" /* expected error string */,
33844 	// javac options
33845 	JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
33846 }
33847 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=145420 - variant
33848 public void test1005b() {
33849 	this.runNegativeTest(
33850 		new String[] {
33851 			"X.java",
33852 			"public class X<T1,T2> {\n" +
33853 			"\n" +
33854 			"    private static final Object NULL_REF = new Object();\n" +
33855 			"    private Object data;\n" +
33856 			"\n" +
33857 			"    private static <RT> RT unwrap(Object obj) {\n" +
33858 			"        return (RT)(obj == NULL_REF ? null : obj);\n" +
33859 			"    }\n" +
33860 			"\n" +
33861 			"    public T1 getAsT1() {\n" +
33862 			"        return unwrap(data);\n" +
33863 			"    }\n" +
33864 			"\n" +
33865 			"    public T2 getAsT2() {\n" +
33866 			"        return unwrap(data);\n" +
33867 			"    }\n" +
33868 			"    Zork z;\n" +
33869 			"}", // =================
33870 		},
33871 		"----------\n" +
33872 		"1. WARNING in X.java (at line 7)\n" +
33873 		"	return (RT)(obj == NULL_REF ? null : obj);\n" +
33874 		"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
33875 		"Type safety: Unchecked cast from Object to RT\n" +
33876 		"----------\n" +
33877 		"2. ERROR in X.java (at line 17)\n" +
33878 		"	Zork z;\n" +
33879 		"	^^^^\n" +
33880 		"Zork cannot be resolved to a type\n" +
33881 		"----------\n");
33882 }
33883 public void test1006() {
33884 	this.runConformTest(
33885 		new String[] {
33886 			"X.java",
33887 			"class Reference<T> {\n" +
33888 			"	T target;\n" +
33889 			"	Reference(T target) {\n" +
33890 			"		this.target = target;\n" +
33891 			"	}\n" +
33892 			"	T deref() {\n" +
33893 			"		return this.target;\n" +
33894 			"	}\n" +
33895 			"	static <U> Reference<U> create(U u) {\n" +
33896 			"		return new Reference<U>(u);\n" +
33897 			"	}\n" +
33898 			"}\n" +
33899 			"class BaseObject {}\n" +
33900 			"class Person extends BaseObject {}\n" +
33901 			"class Building extends BaseObject {}\n" +
33902 			"\n" +
33903 			"public class X {\n" +
33904 			"	void foo(Building b, Person p) {\n" +
33905 			"		Reference<Building> bRef = Reference.create(b);\n" +
33906 			"		Reference<Person> pRef = Reference.create(p);\n" +
33907 			"\n" +
33908 			"		final Building building = bRef.deref();\n" +
33909 			"		final Person person = pRef.deref();\n" +
33910 			"	}\n" +
33911 			"}", // =================
33912 		},
33913 		"");
33914 }
33915 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=147381
33916 public void test1007() {
33917 	this.runNegativeTest(
33918 		new String[] {
33919 			"GenericsProblem.java",
33920 			"public class GenericsProblem {\n" +
33921 			"	public <T> void test(T val) {\n" +
33922 			"		GenericsProblem gp = new GenericsProblem();\n" +
33923 			"		Class<? extends GenericsProblem> cl2 = gp.getClass();\n" +
33924 			"		Class<? extends T> cl = val.getClass();\n" +
33925 			"	}\n" +
33926 			"}\n",
33927 		},
33928 		"----------\n" +
33929 		"1. ERROR in GenericsProblem.java (at line 5)\n" +
33930 		"	Class<? extends T> cl = val.getClass();\n" +
33931 		"	                        ^^^^^^^^^^^^^^\n" +
33932 		"Type mismatch: cannot convert from Class<capture#2-of ? extends Object> to Class<? extends T>\n" +
33933 		"----------\n");
33934 }
33935 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061
33936 // FAIL ERRMSG (type display)
33937 public void test1008() {
33938 	if (this.complianceLevel >= ClassFileConstants.JDK1_8)
33939 		return;
33940 	runNegativeTest(
33941 		new String[] {
33942 			"X.java",
33943 			"public class X {\n" +
33944 			"	void foo(L l, C<? extends X> c) {\n" +
33945 			"		X x = bar(l, c);\n" +
33946 			"	}\n" +
33947 			"	<T> T bar(L<T> l, C<? extends T> c) { \n" +
33948 			"		return zork;\n" +
33949 			"	}	\n" +
33950 			"}\n" +
33951 			"class C<E> {}\n" +
33952 			"class L<E> {}\n" +
33953 			"\n" +
33954 			"\n", // =================
33955 		},
33956 		"----------\n" +
33957 		"1. WARNING in X.java (at line 2)\n" +
33958 		"	void foo(L l, C<? extends X> c) {\n" +
33959 		"	         ^\n" +
33960 		"L is a raw type. References to generic type L<E> should be parameterized\n" +
33961 		"----------\n" +
33962 		"2. WARNING in X.java (at line 3)\n" +
33963 		"	X x = bar(l, c);\n" +
33964 		"	      ^^^^^^^^^\n" +
33965 		"Type safety: Unchecked invocation bar(L, C<capture#1-of ? extends X>) of the generic method bar(L<T>, C<? extends T>) of type X\n" +
33966 		"----------\n" +
33967 		"3. WARNING in X.java (at line 3)\n" +
33968 		"	X x = bar(l, c);\n" +
33969 		"	          ^\n" +
33970 		"Type safety: The expression of type L needs unchecked conversion to conform to L<X>\n" +
33971 		"----------\n" +
33972 		"4. ERROR in X.java (at line 6)\n" +
33973 		"	return zork;\n" +
33974 		"	       ^^^^\n" +
33975 		"zork cannot be resolved to a variable\n" +
33976 		"----------\n");
33977 }
33978 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061 - variation
33979 public void test1009() {
33980 	this.runNegativeTest(
33981 		new String[] {
33982 			"X.java",
33983 			"import java.util.Map;\n" +
33984 			"public class X {\n" +
33985 			"\n" +
33986 			"	void foo(Map<String,Map> map) {\n" +
33987 			"		bar(map);\n" +
33988 			"	}\n" +
33989 			"	<U,V> void bar(Map<U,Map<U,V>> map) {\n" +
33990 			"	}\n" +
33991 			"}\n", // =================
33992 		},
33993 		"----------\n" +
33994 		"1. WARNING in X.java (at line 4)\n" +
33995 		"	void foo(Map<String,Map> map) {\n" +
33996 		"	                    ^^^\n" +
33997 		"Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
33998 		"----------\n" +
33999 		"2. ERROR in X.java (at line 5)\n" +
34000 		"	bar(map);\n" +
34001 		"	^^^\n" +
34002 		"The method bar(Map<U,Map<U,V>>) in the type X is not applicable for the arguments (Map<String,Map>)\n" +
34003 		"----------\n");
34004 }
34005 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061 - variation
34006 public void test1010() {
34007 	this.runNegativeTest(
34008 		new String[] {
34009 			"X.java",
34010 			"import java.util.Map;\n" +
34011 			"public class X {\n" +
34012 			"\n" +
34013 			"	void foo(Map<String,Map> map) {\n" +
34014 			"		bar(map);\n" +
34015 			"	}\n" +
34016 			"	<U,V> void bar(Map<U,? extends Map<U,V>> map) {\n" +
34017 			"	}\n" +
34018 			"}\n", // =================
34019 		},
34020 		"----------\n" +
34021 		"1. WARNING in X.java (at line 4)\n" +
34022 		"	void foo(Map<String,Map> map) {\n" +
34023 		"	                    ^^^\n" +
34024 		"Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
34025 		"----------\n" +
34026 		"2. ERROR in X.java (at line 5)\n" +
34027 		"	bar(map);\n" +
34028 		"	^^^\n" +
34029 		"The method bar(Map<U,? extends Map<U,V>>) in the type X is not applicable for the arguments (Map<String,Map>)\n" +
34030 		"----------\n");
34031 }
34032 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061 - variation
34033 public void test1011() {
34034 	this.runNegativeTest(
34035 		new String[] {
34036 			"X.java",
34037 			"import java.util.*;\n" +
34038 			"public class X {\n" +
34039 			"	void foo(HashMap map, String s, Map<String,String> map2) {\n" +
34040 			"		bar(map, s, map2); //1\n" +
34041 			"		bar(map2, s, map2); //2\n" +
34042 			"		bar2(map, s, map2); //3\n" +
34043 			"		bar3(map, s, map2); //4\n" +
34044 			"	}\n" +
34045 			"	<U> void bar(Map<U,U> map, U u, Map<U,U> map2) {}\n" +
34046 			"	void bar2(Map<String,String> map, String s, Map<String,String> map2) {}\n" +
34047 			"	<U> void bar3(Map<String,String> map, U s, Map<U,U> map2) {}\n" +
34048 			"}\n", // =================
34049 		},
34050 		"----------\n" +
34051 		"1. WARNING in X.java (at line 3)\n" +
34052 		"	void foo(HashMap map, String s, Map<String,String> map2) {\n" +
34053 		"	         ^^^^^^^\n" +
34054 		"HashMap is a raw type. References to generic type HashMap<K,V> should be parameterized\n" +
34055 		"----------\n" +
34056 		"2. WARNING in X.java (at line 4)\n" +
34057 		"	bar(map, s, map2); //1\n" +
34058 		"	^^^^^^^^^^^^^^^^^\n" +
34059 		"Type safety: Unchecked invocation bar(HashMap, String, Map<String,String>) of the generic method bar(Map<U,U>, U, Map<U,U>) of type X\n" +
34060 		"----------\n" +
34061 		"3. WARNING in X.java (at line 4)\n" +
34062 		"	bar(map, s, map2); //1\n" +
34063 		"	    ^^^\n" +
34064 		"Type safety: The expression of type HashMap needs unchecked conversion to conform to Map<String,String>\n" +
34065 		"----------\n" +
34066 		"4. WARNING in X.java (at line 6)\n" +
34067 		"	bar2(map, s, map2); //3\n" +
34068 		"	     ^^^\n" +
34069 		"Type safety: The expression of type HashMap needs unchecked conversion to conform to Map<String,String>\n" +
34070 		"----------\n" +
34071 		"5. WARNING in X.java (at line 7)\n" +
34072 		"	bar3(map, s, map2); //4\n" +
34073 		"	^^^^^^^^^^^^^^^^^^\n" +
34074 		"Type safety: Unchecked invocation bar3(HashMap, String, Map<String,String>) of the generic method bar3(Map<String,String>, U, Map<U,U>) of type X\n" +
34075 		"----------\n" +
34076 		"6. WARNING in X.java (at line 7)\n" +
34077 		"	bar3(map, s, map2); //4\n" +
34078 		"	     ^^^\n" +
34079 		"Type safety: The expression of type HashMap needs unchecked conversion to conform to Map<String,String>\n" +
34080 		"----------\n");
34081 }
34082 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061 - variation
34083 public void test1012() {
34084 	runNegativeTest(
34085 		new String[] {
34086 			"X.java",
34087 			"public class X {\n" +
34088 			"	void foo(L l, C<X> c) {\n" +
34089 			"		X x = bar1(l, c);\n" +
34090 			"		L<X> lx = bar2(l, c);\n" +
34091 			"		C<X> cx = bar3(l, c);\n" +
34092 			"	}\n" +
34093 			"	<T> T bar1(L<T> l, C<T> c) {\n" +
34094 			"		return null;\n" +
34095 			"	}\n" +
34096 			"	<T> L<T> bar2(L<T> l, C<T> c) {\n" +
34097 			"		return null;\n" +
34098 			"	}\n" +
34099 			"	<T> C<T> bar3(L<T> l, C<T> c) {\n" +
34100 			"		return zork;\n" +
34101 			"	}\n" +
34102 			"}\n" +
34103 			"\n" +
34104 			"class C<E> {}\n" +
34105 			"class L<E> {}\n", // =================
34106 		},
34107 		"----------\n" +
34108 		"1. WARNING in X.java (at line 2)\n" +
34109 		"	void foo(L l, C<X> c) {\n" +
34110 		"	         ^\n" +
34111 		"L is a raw type. References to generic type L<E> should be parameterized\n" +
34112 		"----------\n" +
34113 		"2. WARNING in X.java (at line 3)\n" +
34114 		"	X x = bar1(l, c);\n" +
34115 		"	      ^^^^^^^^^^\n" +
34116 		"Type safety: Unchecked invocation bar1(L, C<X>) of the generic method bar1(L<T>, C<T>) of type X\n" +
34117 		"----------\n" +
34118 		"3. WARNING in X.java (at line 3)\n" +
34119 		"	X x = bar1(l, c);\n" +
34120 		"	           ^\n" +
34121 		"Type safety: The expression of type L needs unchecked conversion to conform to L<X>\n" +
34122 		"----------\n" +
34123 		"4. WARNING in X.java (at line 4)\n" +
34124 		"	L<X> lx = bar2(l, c);\n" +
34125 		"	          ^^^^^^^^^^\n" +
34126 		"Type safety: Unchecked invocation bar2(L, C<X>) of the generic method bar2(L<T>, C<T>) of type X\n" +
34127 		"----------\n" +
34128 		"5. WARNING in X.java (at line 4)\n" +
34129 		"	L<X> lx = bar2(l, c);\n" +
34130 		"	          ^^^^^^^^^^\n" +
34131 		"Type safety: The expression of type L needs unchecked conversion to conform to L<X>\n" +
34132 		"----------\n" +
34133 		"6. WARNING in X.java (at line 4)\n" +
34134 		"	L<X> lx = bar2(l, c);\n" +
34135 		"	               ^\n" +
34136 		"Type safety: The expression of type L needs unchecked conversion to conform to L<X>\n" +
34137 		"----------\n" +
34138 		"7. WARNING in X.java (at line 5)\n" +
34139 		"	C<X> cx = bar3(l, c);\n" +
34140 		"	          ^^^^^^^^^^\n" +
34141 		"Type safety: Unchecked invocation bar3(L, C<X>) of the generic method bar3(L<T>, C<T>) of type X\n" +
34142 		"----------\n" +
34143 		"8. WARNING in X.java (at line 5)\n" +
34144 		"	C<X> cx = bar3(l, c);\n" +
34145 		"	          ^^^^^^^^^^\n" +
34146 		"Type safety: The expression of type C needs unchecked conversion to conform to C<X>\n" +
34147 		"----------\n" +
34148 		"9. WARNING in X.java (at line 5)\n" +
34149 		"	C<X> cx = bar3(l, c);\n" +
34150 		"	               ^\n" +
34151 		"Type safety: The expression of type L needs unchecked conversion to conform to L<X>\n" +
34152 		"----------\n" +
34153 		"10. ERROR in X.java (at line 14)\n" +
34154 		"	return zork;\n" +
34155 		"	       ^^^^\n" +
34156 		"zork cannot be resolved to a variable\n" +
34157 		"----------\n");
34158 }
34159 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061 - variation
34160 public void test1013() {
34161 	this.runNegativeTest(
34162 		new String[] {
34163 			"X.java",
34164 			"import java.util.*;\n" +
34165 			"\n" +
34166 			"public class X {\n" +
34167 			"	public static void main(String[] args) {\n" +
34168 			"		List<String> ls = new ArrayList<String>();\n" +
34169 			"		ls.add(\"foo\");\n" +
34170 			"		List<X> lx = new ArrayList<X>();\n" +
34171 			"		lx.add(new X());\n" +
34172 			"		new X().foo(ls, lx);\n" +
34173 			"	}\n" +
34174 			"	void done() {\n" +
34175 			"		System.out.println(zork);\n" +
34176 			"	}\n" +
34177 			"	void foo(List l1, List<X> l2) {\n" +
34178 			"		X x = bar1(l1, l2);\n" +
34179 			"		x.done();\n" +
34180 			"		List<X> lx = bar2(l1, l2);\n" +
34181 			"		lx.get(0).done();\n" +
34182 			"	}\n" +
34183 			"	<T> T bar1(List<T> l1, List<T> l2) {\n" +
34184 			"		return l1.get(0);\n" +
34185 			"	}\n" +
34186 			"	<T> List<T> bar2(List<T> l1, List<T> l2) {\n" +
34187 			"		return l1;\n" +
34188 			"	}\n" +
34189 			"}\n", // =================
34190 		},
34191 		"----------\n" +
34192 		"1. ERROR in X.java (at line 12)\n" +
34193 		"	System.out.println(zork);\n" +
34194 		"	                   ^^^^\n" +
34195 		"zork cannot be resolved to a variable\n" +
34196 		"----------\n" +
34197 		"2. WARNING in X.java (at line 14)\n" +
34198 		"	void foo(List l1, List<X> l2) {\n" +
34199 		"	         ^^^^\n" +
34200 		"List is a raw type. References to generic type List<E> should be parameterized\n" +
34201 		"----------\n" +
34202 		"3. WARNING in X.java (at line 15)\n" +
34203 		"	X x = bar1(l1, l2);\n" +
34204 		"	      ^^^^^^^^^^^^\n" +
34205 		"Type safety: Unchecked invocation bar1(List, List<X>) of the generic method bar1(List<T>, List<T>) of type X\n" +
34206 		"----------\n" +
34207 		"4. WARNING in X.java (at line 15)\n" +
34208 		"	X x = bar1(l1, l2);\n" +
34209 		"	           ^^\n" +
34210 		"Type safety: The expression of type List needs unchecked conversion to conform to List<X>\n" +
34211 		"----------\n" +
34212 		"5. WARNING in X.java (at line 17)\n" +
34213 		"	List<X> lx = bar2(l1, l2);\n" +
34214 		"	             ^^^^^^^^^^^^\n" +
34215 		"Type safety: Unchecked invocation bar2(List, List<X>) of the generic method bar2(List<T>, List<T>) of type X\n" +
34216 		"----------\n" +
34217 		"6. WARNING in X.java (at line 17)\n" +
34218 		"	List<X> lx = bar2(l1, l2);\n" +
34219 		"	             ^^^^^^^^^^^^\n" +
34220 		"Type safety: The expression of type List needs unchecked conversion to conform to List<X>\n" +
34221 		"----------\n" +
34222 		"7. WARNING in X.java (at line 17)\n" +
34223 		"	List<X> lx = bar2(l1, l2);\n" +
34224 		"	                  ^^\n" +
34225 		"Type safety: The expression of type List needs unchecked conversion to conform to List<X>\n" +
34226 		"----------\n");
34227 }
34228 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061 - variation
34229 public void test1014() {
34230 	this.runNegativeTest(
34231 		new String[] {
34232 			"X.java",
34233 			"import java.util.*;\n" +
34234 			"\n" +
34235 			"public class X {\n" +
34236 			"	void foo1(List l, List<String> ls) {\n" +
34237 			"		Set<Map.Entry<String,String>> mss1 = bar(l, ls).entrySet();\n" +
34238 			"		String s = bar(l, ls).entrySet();\n" +
34239 			"	}\n" +
34240 			"	<U,V> Map<U,V> bar(List<U> lu, List<V> lv) { return null; }\n" +
34241 			"}\n", // =================
34242 		},
34243 		"----------\n" +
34244 		"1. WARNING in X.java (at line 4)\n" +
34245 		"	void foo1(List l, List<String> ls) {\n" +
34246 		"	          ^^^^\n" +
34247 		"List is a raw type. References to generic type List<E> should be parameterized\n" +
34248 		"----------\n" +
34249 		"2. WARNING in X.java (at line 5)\n" +
34250 		"	Set<Map.Entry<String,String>> mss1 = bar(l, ls).entrySet();\n" +
34251 		"	                                     ^^^^^^^^^^\n" +
34252 		"Type safety: Unchecked invocation bar(List, List<String>) of the generic method bar(List<U>, List<V>) of type X\n" +
34253 		"----------\n" +
34254 		"3. WARNING in X.java (at line 5)\n" +
34255 		"	Set<Map.Entry<String,String>> mss1 = bar(l, ls).entrySet();\n" +
34256 		"	                                     ^^^^^^^^^^^^^^^^^^^^^\n" +
34257 		"Type safety: The expression of type Set needs unchecked conversion to conform to Set<Map.Entry<String,String>>\n" +
34258 		"----------\n" +
34259 		"4. WARNING in X.java (at line 5)\n" +
34260 		"	Set<Map.Entry<String,String>> mss1 = bar(l, ls).entrySet();\n" +
34261 		"	                                         ^\n" +
34262 		"Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
34263 		"----------\n" +
34264 		"5. WARNING in X.java (at line 6)\n" +
34265 		"	String s = bar(l, ls).entrySet();\n" +
34266 		"	           ^^^^^^^^^^\n" +
34267 		"Type safety: Unchecked invocation bar(List, List<String>) of the generic method bar(List<U>, List<V>) of type X\n" +
34268 		"----------\n" +
34269 		"6. ERROR in X.java (at line 6)\n" +
34270 		"	String s = bar(l, ls).entrySet();\n" +
34271 		"	           ^^^^^^^^^^^^^^^^^^^^^\n" +
34272 		"Type mismatch: cannot convert from Set to String\n" +
34273 		"----------\n" +
34274 		"7. WARNING in X.java (at line 6)\n" +
34275 		"	String s = bar(l, ls).entrySet();\n" +
34276 		"	               ^\n" +
34277 		"Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
34278 		"----------\n");
34279 }
34280 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061 - variation
34281 // FAIL SHOULD RAISE MORE WARNINGS?
34282 public void test1015() {
34283 	if (this.complianceLevel >= ClassFileConstants.JDK1_8)
34284 		return;
34285 	this.runNegativeTest(
34286 		new String[] {
34287 			"X.java",
34288 			"import java.util.*;\n" +
34289 			"public class X {\n" +
34290 			"	void foo1(List l, List<String> ls) {\n" +
34291 			"		List<String> ls1 = bar(l, ls);\n" +
34292 			"		String s = bar(l, ls);\n" +
34293 			"	}\n" +
34294 			"	<U,V> List<V> bar(List<U> lu, List<V> lv) { return null; }\n" +
34295 			"}\n", // =================
34296 		},
34297 		"----------\n" +
34298 		"1. WARNING in X.java (at line 3)\n" +
34299 		"	void foo1(List l, List<String> ls) {\n" +
34300 		"	          ^^^^\n" +
34301 		"List is a raw type. References to generic type List<E> should be parameterized\n" +
34302 		"----------\n" +
34303 		"2. WARNING in X.java (at line 4)\n" +
34304 		"	List<String> ls1 = bar(l, ls);\n" +
34305 		"	                   ^^^^^^^^^^\n" +
34306 		"Type safety: Unchecked invocation bar(List, List<String>) of the generic method bar(List<U>, List<V>) of type X\n" +
34307 		"----------\n" +
34308 		"3. WARNING in X.java (at line 4)\n" +
34309 		"	List<String> ls1 = bar(l, ls);\n" +
34310 		"	                   ^^^^^^^^^^\n" +
34311 		"Type safety: The expression of type List needs unchecked conversion to conform to List<String>\n" +
34312 		"----------\n" +
34313 		"4. WARNING in X.java (at line 4)\n" +
34314 		"	List<String> ls1 = bar(l, ls);\n" +
34315 		"	                       ^\n" +
34316 		"Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
34317 		"----------\n" +
34318 		"5. WARNING in X.java (at line 5)\n" +
34319 		"	String s = bar(l, ls);\n" +
34320 		"	           ^^^^^^^^^^\n" +
34321 		"Type safety: Unchecked invocation bar(List, List<String>) of the generic method bar(List<U>, List<V>) of type X\n" +
34322 		"----------\n" +
34323 		"6. ERROR in X.java (at line 5)\n" +
34324 		"	String s = bar(l, ls);\n" +
34325 		"	           ^^^^^^^^^^\n" +
34326 		"Type mismatch: cannot convert from List to String\n" +
34327 		"----------\n" +
34328 		"7. WARNING in X.java (at line 5)\n" +
34329 		"	String s = bar(l, ls);\n" +
34330 		"	               ^\n" +
34331 		"Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
34332 		"----------\n");
34333 }
34334 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061 - variation
34335 // SHOULD FAIL AT 1.8 (RET): Type mismatch: cannot convert from List<Object> to List
34336 public void test1016() {
34337 	this.runNegativeTest(
34338 		new String[] {
34339 			"X.java",
34340 			"import java.util.*;\n" +
34341 			"public class X {\n" +
34342 			"	void foo1() {\n" +
34343 			"		List ls1 = bar(null);\n" +
34344 			"		List<String> ls2 = bar(null);\n" +
34345 			"		String s = bar(null);\n" +
34346 			"	}\n" +
34347 			"	<U> List<U> bar(List<U> lu) { return null; }\n" +
34348 			"}\n", // =================
34349 		},
34350 		"----------\n" +
34351 		"1. WARNING in X.java (at line 4)\n" +
34352 		"	List ls1 = bar(null);\n" +
34353 		"	^^^^\n" +
34354 		"List is a raw type. References to generic type List<E> should be parameterized\n" +
34355 		"----------\n" +
34356 		"2. ERROR in X.java (at line 6)\n" +
34357 		"	String s = bar(null);\n" +
34358 		"	           ^^^^^^^^^\n" +
34359 		"Type mismatch: cannot convert from List<Object> to String\n" +
34360 		"----------\n");
34361 }
34362 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061 - variation
34363 public void test1017() {
34364 	this.runNegativeTest(
34365 		new String[] {
34366 			"SortedList.java",
34367 			"import java.util.*;\n" +
34368 			"\n" +
34369 			"public class SortedList<E extends Comparable> extends LinkedList<E>\n" +
34370 			"{\n" +
34371 			"    public boolean add(E e){\n" +
34372 			"      int index = Collections.binarySearch(this,e);\n" +
34373 			"      if (index<0)\n" +
34374 			"      super.add(-index-1,e);\n" +
34375 			"      return true;\n" +
34376 			"  }\n" +
34377 			"}", // =================
34378 		},
34379 		"----------\n" +
34380 		"1. WARNING in SortedList.java (at line 3)\n" +
34381 		"	public class SortedList<E extends Comparable> extends LinkedList<E>\n" +
34382 		"	             ^^^^^^^^^^\n" +
34383 		"The serializable class SortedList does not declare a static final serialVersionUID field of type long\n" +
34384 		"----------\n" +
34385 		"2. WARNING in SortedList.java (at line 3)\n" +
34386 		"	public class SortedList<E extends Comparable> extends LinkedList<E>\n" +
34387 		"	                                  ^^^^^^^^^^\n" +
34388 		"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
34389 		"----------\n" +
34390 		"3. WARNING in SortedList.java (at line 5)\n" +
34391 		"	public boolean add(E e){\n" +
34392 		"	               ^^^^^^^^\n" +
34393 		"The method add(E) of type SortedList<E> should be tagged with @Override since it actually overrides a superclass method\n" +
34394 		"----------\n" +
34395 		"4. ERROR in SortedList.java (at line 6)\n" +
34396 		"	int index = Collections.binarySearch(this,e);\n" +
34397 		"	                        ^^^^^^^^^^^^\n" +
34398 		"The method binarySearch(List<? extends Comparable<? super T>>, T) in the type Collections is not applicable for the arguments (SortedList<E>, E)\n" +
34399 		"----------\n");
34400 }
34401 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=148061 - variation
34402 public void test1018() {
34403 	this.runConformTest(
34404 		new String[] {
34405 			"X.java",
34406 			"public class X<U,V> {\n" +
34407 			"\n" +
34408 			"	void foo(U u) {\n" +
34409 			"		bar(u, new Exception());\n" +
34410 			"	}\n" +
34411 			"	<T extends Exception> T bar(U u, T t) { return null; }\n" +
34412 			"}", // =================
34413 		},
34414 		"");
34415 }
34416 public void test1018a() {
34417 	runConformTest(
34418 		// test directory preparation
34419 		true /* flush output directory */,
34420 		new String[] { /* test files */
34421 			"X.java",
34422 			"class A<T> {}\n" +
34423 			"\n" +
34424 			"class B<E> extends A<X<String>> {}\n" +
34425 			"\n" +
34426 			"public class X<E extends String> extends B<E> {\n" +
34427 			"    public static void main(String[] args) {\n" +
34428 			"        System.out.println(\"SUCCESS\");\n" +
34429 			"    }\n" +
34430 			"}"
34431 		},
34432 		// compiler results
34433 		null /* do not check compiler log */,
34434 		// runtime results
34435 		"SUCCESS" /* expected output string */,
34436 		"" /* expected error string */,
34437 		// javac options
34438 		JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
34439 }
34440 public void test1019() {
34441 	this.runNegativeTest(
34442 		new String[] {
34443 			"X.java",
34444 			"public class X {\n" +
34445 			"	public static void main(String[] args) {\n" +
34446 			"		double[] d1 = new double[] { 1.0, 2.0, 3.0, 4.0 };\n" +
34447 			"		System.out.println(deepToString(d1));\n" +
34448 			"\n" +
34449 			"		Double[] d2 = new Double[] { 1.0, 2.0, 3.0, 4.0 };\n" +
34450 			"		System.out.println(deepToString(d2));\n" +
34451 			"	\n" +
34452 			"	}\n" +
34453 			"\n" +
34454 			"	public static <T> String deepToString(T[] array) {\n" +
34455 			"		StringBuffer s = new StringBuffer();\n" +
34456 			"		for (T t : array) {\n" +
34457 			"			s.append(t.toString());\n" +
34458 			"			s.append(\",\");\n" +
34459 			"		}\n" +
34460 			"		if (s.length() > 0) {\n" +
34461 			"			s.setLength(s.length() - 1); // removes last \",\"\n" +
34462 			"		}\n" +
34463 			"		return s.toString();\n" +
34464 			"	}\n" +
34465 			"}\n", // =================
34466 		},
34467 		"----------\n" +
34468 		"1. ERROR in X.java (at line 4)\n" +
34469 		"	System.out.println(deepToString(d1));\n" +
34470 		"	                   ^^^^^^^^^^^^\n" +
34471 		"The method deepToString(T[]) in the type X is not applicable for the arguments (double[])\n" +
34472 		"----------\n");
34473 }
34474 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=149573
34475 public void test1020() {
34476 	this.runNegativeTest(
34477 		new String[] {
34478 			"X.java",
34479 			"import java.util.List;\n" +
34480 			"\n" +
34481 			"public class X {\n" +
34482 			"	void foo(List<? extends Exception> l1, List<? extends Exception> l2) {\n" +
34483 			"		l1.add(l2.get(0));\n" +
34484 			"	}\n" +
34485 			"}\n", // =================
34486 		},
34487 		"----------\n" +
34488 		"1. ERROR in X.java (at line 5)\n" +
34489 		"	l1.add(l2.get(0));\n" +
34490 		"	   ^^^\n" +
34491 		"The method add(capture#1-of ? extends Exception) in the type List<capture#1-of ? extends Exception> is not applicable for the arguments (capture#2-of ? extends Exception)\n" +
34492 		"----------\n");
34493 }
34494 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=149376
34495 public void test1021() {
34496 	this.runConformTest(
34497 		new String[] {
34498 			"p/SomeClass.java",
34499 			"package p;\n" +
34500 			"import static p.SomeClass.SomeEnum.*;\n" +
34501 			"public abstract class SomeClass<T> extends Object {\n" +
34502 			"	public enum SomeEnum {\n" +
34503 			"		A;\n" +
34504 			"	};\n" +
34505 			"}\n",
34506 		},
34507 		""
34508 	);
34509 }
34510 public void test1021b() { // should this case be allowed?
34511 	this.runNegativeTest(
34512 		new String[] {
34513 			"p/SomeClass2.java",
34514 			"package p;\n" +
34515 			"import static p.SomeClass2.M1.*;\n" +
34516 			"public abstract class SomeClass2<T> extends M {\n" +
34517 			"	public static class M1 extends M2 {}\n" +
34518 			"	public static class M2 extends M3 {}\n" +
34519 			"	public static class M3 {\n" +
34520 			"		public static class M {}\n" +
34521 			"	}\n" +
34522 			"}\n",
34523 		},
34524 		"----------\n" +
34525 		"1. ERROR in p\\SomeClass2.java (at line 3)\n" +
34526 		"	public abstract class SomeClass2<T> extends M {\n" +
34527 		"	                                            ^\n" +
34528 		"M cannot be resolved to a type\n" +
34529 		"----------\n" +
34530 		"2. ERROR in p\\SomeClass2.java (at line 4)\n" +
34531 		"	public static class M1 extends M2 {}\n" +
34532 		"	                               ^^\n" +
34533 		"Cycle detected: a cycle exists in the type hierarchy between SomeClass2.M1 and SomeClass2<T>\n" +
34534 		"----------\n"
34535 	);
34536 }
34537 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=151410 (duplicate of 149376)
34538 public void test1021c() {
34539 	runConformTest(
34540 		new String[] {
34541 			"ccs/jdtbug/filters/NameRF.java",
34542 			"package ccs.jdtbug.filters;\n" +
34543 			"import static ccs.jdtbug.ResultFilter.Action.*;\n" +
34544 			"import ccs.jdtbug.*;\n" +
34545 			"public class NameRF implements ResultFilter<String> {\n" +
34546 			"	public NameRF() {}\n" +
34547 			"	public Action getAction(String in, int ntotal, int naccept) {\n" +
34548 			"		return YES;\n" +
34549 			"	}\n" +
34550 			"} // end class\n",
34551 			"ccs/jdtbug/ResultFilter.java",
34552 			"package ccs.jdtbug;\n" +
34553 			"import java.io.*;\n" +
34554 			"public interface ResultFilter<T> {\n" +
34555 			"	public enum Action {\n" +
34556 			"		YES, NO, CANCEL\n" +
34557 			"	}\n" +
34558 			"	public Action getAction(T in, int ntotal, int naccept) throws IOException;\n" +
34559 			"} // end interface\n"
34560 		}
34561 	);
34562 }
34563 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=150294
34564 public void test1022() {
34565 	this.runNegativeTest(
34566 		new String[] {
34567 			"X.java",
34568 			"public class X {\n" +
34569 			"	public static void main(String[] args) {\n" +
34570 			"		String testString = \"test string\";\n" +
34571 			"\n" +
34572 			"		testWithNonGeneric(testString);\n" +
34573 			"		testWithGeneric(testString);\n" +
34574 			"	}\n" +
34575 			"\n" +
34576 			"	private static void testWithNonGeneric(String input) {\n" +
34577 			"		Class<? extends String> clazz = input.getClass();\n" +
34578 			"\n" +
34579 			"		System.out.println(clazz.getName());\n" +
34580 			"	}\n" +
34581 			"\n" +
34582 			"	private static <T> void testWithGeneric(T input) {\n" +
34583 			"		Class<? extends T> clazz = input.getClass();\n" +
34584 			"\n" +
34585 			"		System.out.println(clazz.getName());\n" +
34586 			"	}\n" +
34587 			"}", // =================,
34588 		},
34589 		"----------\n" +
34590 		"1. ERROR in X.java (at line 16)\n" +
34591 		"	Class<? extends T> clazz = input.getClass();\n" +
34592 		"	                           ^^^^^^^^^^^^^^^^\n" +
34593 		"Type mismatch: cannot convert from Class<capture#3-of ? extends Object> to Class<? extends T>\n" +
34594 		"----------\n");
34595 }
34596 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=150362
34597 public void test1023() {
34598 	this.runNegativeTest(
34599 		new String[] {
34600 			"X.java",
34601 			"import java.util.Map;\n" +
34602 			"import java.util.Properties;\n" +
34603 			"\n" +
34604 			"public class X {\n" +
34605 			"\n" +
34606 			"	public static void main(String[] args) {\n" +
34607 			"		Properties props = new Properties();\n" +
34608 			"		for (Map.Entry<String, ?> entry : props.entrySet()) {\n" +
34609 			"			System.out.println(entry);\n" +
34610 			"		}\n" +
34611 			"		for (Map.Entry<String, ?> entry : ((Map<String, ?>) props).entrySet()) {\n" +
34612 			"			System.out.println(entry);\n" +
34613 			"		}\n" +
34614 			"		for (Map.Entry<Object, ?> entry : ((Map<Object, ?>) props).entrySet()) {\n" +
34615 			"			System.out.println(entry);\n" +
34616 			"		}\n" +
34617 			"		for (Map.Entry<Object, ?> entry : props.entrySet()) {\n" +
34618 			"			System.out.println(entry);\n" +
34619 			"		}\n" +
34620 			"		for (Map.Entry<?, ?> entry : ((Map<?, ?>) props).entrySet()) {\n" +
34621 			"			System.out.println(entry);\n" +
34622 			"		}\n" +
34623 			"		for (Map.Entry<?, ?> entry : props.entrySet()) {\n" +
34624 			"			System.out.println(entry);\n" +
34625 			"		}\n" +
34626 			"	}\n" +
34627 			"}", // =================,
34628 		},
34629 		"----------\n" +
34630 		"1. ERROR in X.java (at line 8)\n" +
34631 		"	for (Map.Entry<String, ?> entry : props.entrySet()) {\n" +
34632 		"	                                  ^^^^^^^^^^^^^^^^\n" +
34633 		"Type mismatch: cannot convert from element type Map.Entry<Object,Object> to Map.Entry<String,?>\n" +
34634 		"----------\n" +
34635 		"2. ERROR in X.java (at line 11)\n" +
34636 		"	for (Map.Entry<String, ?> entry : ((Map<String, ?>) props).entrySet()) {\n" +
34637 		"	                                  ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
34638 		"Cannot cast from Properties to Map<String,?>\n" +
34639 		"----------\n");
34640 }
34641 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=151275
34642 public void test1024() {
34643 	runConformTest(
34644 		true,
34645 		new String[] {
34646 			"X.java",
34647 			"public class X {\n" +
34648 			"	public static void main(String[] args) {\n" +
34649 			"		Integer castInteger = genericCast(1); // works\n" +
34650 			"		int castInt1 = genericCast(1); // fails in javac but works in Eclipse\n" +
34651 			"		int castInt2 = X.<Integer> genericCast(1); // workaround for javac\n" +
34652 			"		int castInt3 = (Integer) genericCast(1); // workaround for javac\n" +
34653 			"	}\n" +
34654 			"	private static <T> T genericCast(Object input) {\n" +
34655 			"		@SuppressWarnings(\"unchecked\")\n" +
34656 			"		T castValue = (T) input;\n" +
34657 			"		return castValue;\n" +
34658 			"	}\n" +
34659 			"}", // =================,
34660 		},
34661 		null,
34662 		"",
34663 		null,
34664 		JavacTestOptions.EclipseJustification.EclipseBug151275);
34665 }
34666 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=155753
34667 public void test1025() {
34668 	this.runConformTest(
34669 		new String[] {
34670 			"GenericBaseClass.java",
34671 			"public class GenericBaseClass<P, C> {\n" +
34672 			"  public GenericBaseClass() {\n" +
34673 			"    if (!(this instanceof ASubGenericClass)) {\n" +
34674 			"      System.out.println(\"I\'m not ASubClass\");\n" +
34675 			"    }\n" +
34676 			"  }\n" +
34677 			"}\n" +
34678 			"\n" +
34679 			"class ASubGenericClass extends GenericBaseClass<GenericBaseClass, GenericBaseClass> {\n" +
34680 			"  public ASubGenericClass() {\n" +
34681 			"    // This compiles with both\n" +
34682 			"    GenericBaseClass<GenericBaseClass, GenericBaseClass> hey = this;\n" +
34683 			"  }\n" +
34684 			"}", // =================
34685 		},
34686 		"");
34687 }
34688 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=155753
34689 public void test1026() {
34690 	runConformTest(
34691 		// test directory preparation
34692 		new String[] { /* test files */
34693 			"X.java",
34694 			"import java.util.LinkedHashSet;\n" +
34695 			"import java.util.Set;\n" +
34696 			"\n" +
34697 			"public class X {\n" +
34698 			"\n" +
34699 			"    public class A {};\n" +
34700 			"    public class B extends A {};\n" +
34701 			"\n" +
34702 			"	public static void main(String[] args) {\n" +
34703 			"        X g = new X();\n" +
34704 			"        Set<A> set = g.newSet(g.new B());\n" +
34705 			"    }\n" +
34706 			"    public <T, V extends T> Set<T> newSet(V v) {\n" +
34707 			"        Set<T> set = new LinkedHashSet<T>();\n" +
34708 			"        set.add(v);\n" +
34709 			"        return set;\n" +
34710 			"    }\n" +
34711 			"}\n" // =================
34712 		},
34713 		// javac options
34714 		JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
34715 }
34716 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=155753 - variation
34717 public void test1027() {
34718 	runConformTest(
34719 		// test directory preparation
34720 		new String[] { /* test files */
34721 			"X.java",
34722 			this.complianceLevel < ClassFileConstants.JDK1_7 ?
34723 			"import java.util.LinkedHashSet;\n" +
34724 			"import java.util.Set;\n" +
34725 			"\n" +
34726 			"public class X {\n" +
34727 			"\n" +
34728 			"    public class A {};\n" +
34729 			"    public class B extends A {};\n" +
34730 			"\n" +
34731 			"    public static void main(String[] args) {\n" +
34732 			"        X g = new X();\n" +
34733 			"        Set<A> set = g.newSet(g.new B());\n" +
34734 			"    }\n" +
34735 			"    public <T, V extends T> Set<T> newSet(V... objects) {\n" +
34736 			"        Set<T> set = new LinkedHashSet<T>();\n" +
34737 			"        for (T t : objects) {\n" +
34738 			"            set.add(t);\n" +
34739 			"        }\n" +
34740 			"        return set;\n" +
34741 			"    }\n" +
34742 			"}\n" +
34743 			"\n" :
34744 				"import java.util.LinkedHashSet;\n" +
34745 				"import java.util.Set;\n" +
34746 				"\n" +
34747 				"public class X {\n" +
34748 				"\n" +
34749 				"    public class A {};\n" +
34750 				"    public class B extends A {};\n" +
34751 				"\n" +
34752 				"    public static void main(String[] args) {\n" +
34753 				"        X g = new X();\n" +
34754 				"        Set<A> set = g.newSet(g.new B());\n" +
34755 				"    }\n" +
34756 				"    @SuppressWarnings(\"unchecked\")\n" +
34757 				"    public <T, V extends T> Set<T> newSet(V... objects) {\n" +
34758 				"        Set<T> set = new LinkedHashSet<T>();\n" +
34759 				"        for (T t : objects) {\n" +
34760 				"            set.add(t);\n" +
34761 				"        }\n" +
34762 				"        return set;\n" +
34763 				"    }\n" +
34764 				"}\n" +
34765 				"\n", // =================, // =================
34766 		},
34767 		// javac options
34768 		JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
34769 }
34770 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=155753 - variation
34771 public void test1028() {
34772 	runConformTest(
34773 		// test directory preparation
34774 		new String[] { /* test files */
34775 			"X.java",
34776 			"import java.util.LinkedHashSet;\n" +
34777 			"import java.util.Set;\n" +
34778 			"\n" +
34779 			"public class X {\n" +
34780 			"\n" +
34781 			"	public static void main(String[] args) {\n" +
34782 			"        X g = new X();\n" +
34783 			"        Set<A> set = g.newSet(new B());\n" +
34784 			"    }\n" +
34785 			"    public <T, V extends T> Set<T> newSet(V v) {\n" +
34786 			"        Set<T> set = new LinkedHashSet<T>();\n" +
34787 			"        set.add(v);\n" +
34788 			"        return set;\n" +
34789 			"    }\n" +
34790 			"}\n" +
34791 			"\n" +
34792 			"class A {};\n" +
34793 			"class B extends A {};\n", // =================
34794 		},
34795 		// javac options
34796 		JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
34797 }
34798 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=156016
34799 public void test1029() {
34800 	Map options = getCompilerOptions();
34801 	options.put(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION, JavaCore.IGNORE);
34802 	String xSource =
34803 			"import java.util.Arrays;\n" +
34804 			"import java.util.List;\n" +
34805 			"\n" +
34806 			"public class X {\n" +
34807 			"        public static <T extends Number> List<T> makeNumberList(T a, T b) {\n" +
34808 			"                return Arrays.asList(a, b);\n" +
34809 			"        }\n" +
34810 			"\n" +
34811 			"        public static void main(String... args) {\n" +
34812 			"                List<Number> name = makeNumberList(5, 5D);\n" +
34813 			"        }\n" +
34814 			"}";
34815 	if (this.complianceLevel < ClassFileConstants.JDK1_8) {
34816 		this.runNegativeTest(
34817 			new String[] {
34818 				"X.java",
34819 				xSource,
34820 			},
34821 			"----------\n" +
34822 			"1. ERROR in X.java (at line 10)\n" +
34823 			"	List<Number> name = makeNumberList(5, 5D);\n" +
34824 			"	                    ^^^^^^^^^^^^^^^^^^^^^\n" +
34825 			"Type mismatch: cannot convert from List<"+ intersection("Number", "Comparable<?>") +"> to List<Number>\n" +
34826 			"----------\n",
34827 			null,
34828 			true,
34829 			options);
34830 	} else {
34831 		runConformTest(new String[] { "X.java", xSource });
34832 	}
34833 }
34834 public void test1030() {
34835 	this.runConformTest(
34836 		new String[] {
34837 			"X.java",
34838 			"import java.util.*;\n" +
34839 			"\n" +
34840 			"public class X {\n" +
34841 			"	public class PointList<W> extends Object implements Iterable<W> {\n" +
34842 			"		private List<W> theList = new ArrayList<W>();\n" +
34843 			"\n" +
34844 			"		public Iterator<W> iterator() {\n" +
34845 			"			return theList.iterator();\n" +
34846 			"		}\n" +
34847 			"	}\n" +
34848 			"\n" +
34849 			"	private PointList<Waypoint> waypoints = new PointList<Waypoint>();\n" +
34850 			"\n" +
34851 			"	public void printWaypoints() {\n" +
34852 			"		for (Waypoint waypoint : waypoints) { // ***** This line does not compile *****\n" +
34853 			"			System.out.println(waypoint.toString());\n" +
34854 			"		}\n" +
34855 			"		for (Iterator<Waypoint> it = waypoints.iterator(); it.hasNext();) {\n" +
34856 			"			Waypoint waypoint = it.next();\n" +
34857 			"			System.out.println(waypoint.toString());\n" +
34858 			"		}\n" +
34859 			"	}\n" +
34860 			"}\n" +
34861 			"\n" +
34862 			"class Waypoint {}", // =================
34863 		},
34864 		"");
34865 }
34866 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=156765
34867 // FAIL EXTRA ERR: outer non-generic invocation cannot yet feed expected type into inner inference
34868 public void test1031() {
34869 	this.runNegativeTest(
34870 		new String[] {
34871 			"X.java",
34872 			"import java.io.Serializable;\n" +
34873 			"\n" +
34874 			"interface IValue extends Serializable {\n" +
34875 			"	public <T extends Comparable<? super T>> T getComparableValue();\n" +
34876 			"}\n" +
34877 			"\n" +
34878 			"@SuppressWarnings(\"null\")\n" +
34879 			"public class X {\n" +
34880 			"	public static void foo0() {\n" +
34881 			"		IValue val1 = null;\n" +
34882 			"		Object o = val1.getComparableValue(); // 0\n" +
34883 			"	}\n" +
34884 			"	public static void foo1() {\n" +
34885 			"		IValue val1 = null;\n" +
34886 			"		String s = val1.getComparableValue(); // 1\n" +
34887 			"	}\n" +
34888 			"	public static int foo2() {\n" +
34889 			"		IValue val1 = null;\n" +
34890 			"		IValue val2 = null;\n" +
34891 			"		return val1.getComparableValue().compareTo(val2.getComparableValue()); // 2\n" +
34892 			"	}	\n" +
34893 			"	public static int foo3() {\n" +
34894 			"		Comparable<? super String> c = \"aaa\"; // 3\n" +
34895 			"		Comparable<? super Object> o = new Object(); // 4\n" +
34896 			"		return 0;\n" +
34897 			"	}\n" +
34898 			"}", // =================
34899 		},
34900 		"----------\n" +
34901 		"1. ERROR in X.java (at line 24)\n" +
34902 		"	Comparable<? super Object> o = new Object(); // 4\n" +
34903 		"	                               ^^^^^^^^^^^^\n" +
34904 		"Type mismatch: cannot convert from Object to Comparable<? super Object>\n" +
34905 		"----------\n");
34906 }
34907 public void test1032() {
34908 	runConformTest(
34909 		// test directory preparation
34910 		true /* flush output directory */,
34911 		new String[] { /* test files */
34912 			"X.java",
34913 			"import java.io.*;\n" +
34914 			"\n" +
34915 			"public class X {\n" +
34916 			"	<T> T test(String name) {\n" +
34917 			"\n" +
34918 			"		try {\n" +
34919 			"			InputStream in = new FileInputStream(name);\n" +
34920 			"			return (T) new ObjectInputStream(in).readObject();\n" +
34921 			"		} catch (Exception e) {\n" +
34922 			"		}\n" +
34923 			"		return null;\n" +
34924 			"	}\n" +
34925 			"\n" +
34926 			"	<U> U text() {\n" +
34927 			"		return test(\"data\");\n" +
34928 			"	}\n" +
34929 			"}", // =================
34930 		},
34931 		// compiler results
34932 		null /* do not check compiler log */,
34933 		// runtime results
34934 		"" /* expected output string */,
34935 		"" /* expected error string */,
34936 		// javac options
34937 		JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
34938 }
34939 public void test1032a() {
34940 	this.runNegativeTest(
34941 		new String[] {
34942 			"X.java",
34943 			"import java.io.*;\n" +
34944 			"\n" +
34945 			"public class X {\n" +
34946 			"	<T> T test(String name) {\n" +
34947 			"\n" +
34948 			"		try {\n" +
34949 			"			InputStream in = new FileInputStream(name);\n" +
34950 			"			return (T) new ObjectInputStream(in).readObject();\n" +
34951 			"		} catch (Exception e) {\n" +
34952 			"		}\n" +
34953 			"		return null;\n" +
34954 			"	}\n" +
34955 			"\n" +
34956 			"	<U> U text() {\n" +
34957 			"		return test(\"data\");\n" +
34958 			"	}\n" +
34959 			"	Zork z;\n" +
34960 			"}", // =================
34961 		},
34962 		"----------\n" +
34963 		"1. WARNING in X.java (at line 8)\n" +
34964 		"	return (T) new ObjectInputStream(in).readObject();\n" +
34965 		"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
34966 		"Type safety: Unchecked cast from Object to T\n" +
34967 		"----------\n" +
34968 		"2. ERROR in X.java (at line 17)\n" +
34969 		"	Zork z;\n" +
34970 		"	^^^^\n" +
34971 		"Zork cannot be resolved to a type\n" +
34972 		"----------\n");
34973 }
34974 public void test1033() {
34975 	this.runNegativeTest(
34976 		new String[] {
34977 			"X.java",
34978 			"public class X<T> {\n" +
34979 			"	public static void main(String[] args) {\n" +
34980 			"		X x = new X();\n" +
34981 			"		x.bar1(Integer.TYPE);\n" +
34982 			"		x.bar2(Integer.TYPE);\n" +
34983 			"		x.bar2(\"\");\n" +
34984 			"	} \n" +
34985 			"	 void bar1(Class<?>... classes) {}\n" +
34986 			"	 void bar2(Class... classes) {}\n" +
34987 			"	 \n" +
34988 			"}", // =================
34989 
34990 		},
34991 		"----------\n" +
34992 		"1. WARNING in X.java (at line 3)\n" +
34993 		"	X x = new X();\n" +
34994 		"	^\n" +
34995 		"X is a raw type. References to generic type X<T> should be parameterized\n" +
34996 		"----------\n" +
34997 		"2. WARNING in X.java (at line 3)\n" +
34998 		"	X x = new X();\n" +
34999 		"	          ^\n" +
35000 		"X is a raw type. References to generic type X<T> should be parameterized\n" +
35001 		"----------\n" +
35002 		"3. WARNING in X.java (at line 4)\n" +
35003 		"	x.bar1(Integer.TYPE);\n" +
35004 		"	^^^^^^^^^^^^^^^^^^^^\n" +
35005 		"Type safety: The method bar1(Class...) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
35006 		"----------\n" +
35007 		"4. ERROR in X.java (at line 6)\n" +
35008 		"	x.bar2(\"\");\n" +
35009 		"	  ^^^^\n" +
35010 		"The method bar2(Class...) in the type X is not applicable for the arguments (String)\n" +
35011 		"----------\n" +
35012 		"5. WARNING in X.java (at line 9)\n" +
35013 		"	void bar2(Class... classes) {}\n" +
35014 		"	          ^^^^^\n" +
35015 		"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
35016 		"----------\n");
35017 }
35018 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=158519
35019 // FAIL ERRMSG
35020 public void test1034() {
35021 	this.runNegativeTest(
35022 		new String[] {
35023 			"ChainedClosure.java",
35024 			"interface Closure<I> {\n" +
35025 			"    public void execute(I input);\n" +
35026 			"}\n" +
35027 			"\n" +
35028 			"class ChainedClosure<I> implements Closure<I> {\n" +
35029 			"    private final Closure<? super I>[] iClosures;\n" +
35030 			"    @SuppressWarnings(\"unchecked\")\n" +
35031 			"    public static <I> Closure<I> getInstance(Closure<? super I> closure1, Closure<? super I> closure2) {\n" +
35032 			"        if (closure1 == null || closure2 == null) {\n" +
35033 			"            throw new IllegalArgumentException(\"Closures must not be null\");\n" +
35034 			"        }\n" +
35035 			"        Closure<I>[] closures = new Closure[] { closure1, closure2 };\n" +
35036 			"        return new ChainedClosure<I>(closures);\n" +
35037 			"    }\n" +
35038 			"    public ChainedClosure(Closure<? super I>[] closures) {\n" +
35039 			"        super();\n" +
35040 			"        iClosures = closures;\n" +
35041 			"    }\n" +
35042 			"    public void execute(I input) {\n" +
35043 			"        for (int i = 0; i < iClosures.length; i++) {\n" +
35044 			"            iClosures[i].execute(input);\n" +
35045 			"        }\n" +
35046 			"    }\n" +
35047 			"}\n" +
35048 			"class ClosureUtils {\n" +
35049 			"    public static <J> Closure<J> chainedClosure(Closure<? super J> closure1, Closure<? super J> closure2) {\n" +
35050 			"        return ChainedClosure.getInstance(closure1, closure2);\n" +
35051 			"    }\n" +
35052 			"    public static Closure<String> chainedClosure2(Closure<? super String> closure1, Closure<? super String> closure2) {\n" +
35053 			"        return ChainedClosure.getInstance(closure1, closure2);\n" +
35054 			"    }\n" +
35055 			"    public static <J> Closure<String> chainedClosure3(Closure<? super J> closure1, Closure<? super J> closure2) {\n" +
35056 			"        return ChainedClosure.getInstance(closure1, closure2);\n" +
35057 			"    }\n" +
35058 			"}", // =================
35059 
35060 		},
35061 		this.complianceLevel < ClassFileConstants.JDK1_8 ?
35062 		"----------\n" +
35063 		"1. ERROR in ChainedClosure.java (at line 33)\n" +
35064 		"	return ChainedClosure.getInstance(closure1, closure2);\n" +
35065 		"	                      ^^^^^^^^^^^\n" +
35066 		"The method getInstance(Closure<? super I>, Closure<? super I>) in the type ChainedClosure is not applicable for the arguments (Closure<capture#10-of ? super J>, Closure<capture#11-of ? super J>)\n" +
35067 		"----------\n" :
35068 			"----------\n" +
35069 			"1. ERROR in ChainedClosure.java (at line 33)\n" +
35070 			"	return ChainedClosure.getInstance(closure1, closure2);\n" +
35071 			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
35072 			"Type mismatch: cannot convert from Closure<capture#10-of ? super J & capture#11-of ? super J> to Closure<String>\n" +
35073 			"----------\n",
35074 		JavacTestOptions.DEFAULT);
35075 }
35076 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=158531
35077 public void test1035() {
35078 	this.runConformTest(
35079 		new String[] {
35080 			"ComparableComparator.java",
35081 			"import java.util.Comparator;\n" +
35082 			"\n" +
35083 			"@SuppressWarnings({\"unchecked\", \"rawtypes\"})\n" +
35084 			"class ComparableComparator<T extends Comparable<? super T>> implements Comparator<T> {\n" +
35085 			"\n" +
35086 			"	static ComparableComparator instance = new ComparableComparator();\n" +
35087 			"\n" +
35088 			"public static <W extends Comparable<? super W>> ComparableComparator<W> getInstance() {\n" +
35089 			"	return instance;\n" +
35090 			"}\n" +
35091 			"static <M extends Comparable<M>> Comparator<M> bar() {\n" +
35092 			"	return null;\n" +
35093 			"}\n" +
35094 			"static <M extends String> Comparator<M> baz() {\n" +
35095 			"	return null;\n" +
35096 			"}\n" +
35097 			"public int compare(T obj1, T obj2) {\n" +
35098 			"	return obj1.compareTo(obj2);\n" +
35099 			"}\n" +
35100 			"}\n" +
35101 			"\n" +
35102 			"@SuppressWarnings({\"unchecked\", \"rawtypes\"})\n" +
35103 			"class ComparatorUtils {\n" +
35104 			"\n" +
35105 			"	static Comparator BAR = ComparableComparator.bar();//0\n" +
35106 			"	static Comparator NATURAL_COMPARATOR = ComparableComparator.getInstance();//1\n" +
35107 			"	static Object BAR2 = ComparableComparator.bar();//1a\n" +
35108 			"	static Comparator BAR3 = ComparableComparator.baz();//1b\n" +
35109 			"\n" +
35110 			"public static <T extends Comparable<? super T>> Comparator<T> naturalComparator() {\n" +
35111 			"	return NATURAL_COMPARATOR;\n" +
35112 			"}\n" +
35113 			"\n" +
35114 			"public static <U> Comparator<U> nullLowComparator(Comparator<U> comparator) {\n" +
35115 			"	if (comparator == null)\n" +
35116 			"		comparator = (Comparator<U>) naturalComparator();//2\n" +
35117 			"	return new NullComparator<U>(comparator, false);\n" +
35118 			"}\n" +
35119 			"}\n" +
35120 			"\n" +
35121 			"@SuppressWarnings(\"unchecked\")\n" +
35122 			"class NullComparator<V> implements Comparator<V> {\n" +
35123 			"\n" +
35124 			"	Comparator<V> nonNullComparator;\n" +
35125 			"	boolean nullsAreHigh;\n" +
35126 			"\n" +
35127 			"public NullComparator() {\n" +
35128 			"	this((Comparator<V>) ComparableComparator.getInstance(), true);//3\n" +
35129 			"}\n" +
35130 			"\n" +
35131 			"public NullComparator(Comparator<V> nonNullComparator) {\n" +
35132 			"	this(nonNullComparator, true);\n" +
35133 			"}\n" +
35134 			"\n" +
35135 			"public NullComparator(boolean nullsAreHigh) {\n" +
35136 			"	this((Comparator<V>) ComparableComparator.getInstance(), nullsAreHigh);//4\n" +
35137 			"}\n" +
35138 			"\n" +
35139 			"public NullComparator(Comparator<V> nonNullComparator, boolean nullsAreHigh) {\n" +
35140 			"	this.nonNullComparator = nonNullComparator;\n" +
35141 			"	this.nullsAreHigh = nullsAreHigh;\n" +
35142 			"	if (nonNullComparator == null) {\n" +
35143 			"		throw new NullPointerException(\"null nonNullComparator\");\n" +
35144 			"	}\n" +
35145 			"}\n" +
35146 			"\n" +
35147 			"public int compare(V obj1, V obj2) {\n" +
35148 			"	return 0;\n" +
35149 			"}\n" +
35150 			"}", // =================
35151 
35152 		});
35153 }
35154 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=158548
35155 public void test1036() {
35156 	this.runNegativeTest(
35157 		new String[] {
35158 			"X.java",
35159 			"public class X<T extends String> {\n" +
35160 			"	\n" +
35161 			"	List<Zork> list;\n" +
35162 			"	Map<Zork,Zork>.Entry<List<Zork>,List<Zork>>	entry;\n" +
35163 			"	jaavaa.util.Map<Zork,Zork>.Entry<List<Zork>,List<Zork>>	entry2;\n" +
35164 			"	\n" +
35165 			"	p.q.Map.Entry entry3;\n" +
35166 			"	\n" +
35167 			"	String<Object>.Y<List> y; // wrong\n" +
35168 			"	X<Object>.Y<List> y1; // wrong\n" +
35169 			"	X<String>.Y<List> y2;\n" +
35170 			"}", // =================
35171 		},
35172 		"----------\n" +
35173 		"1. WARNING in X.java (at line 1)\n" +
35174 		"	public class X<T extends String> {\n" +
35175 		"	                         ^^^^^^\n" +
35176 		"The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
35177 		"----------\n" +
35178 		"2. ERROR in X.java (at line 3)\n" +
35179 		"	List<Zork> list;\n" +
35180 		"	^^^^\n" +
35181 		"List cannot be resolved to a type\n" +
35182 		"----------\n" +
35183 		"3. ERROR in X.java (at line 3)\n" +
35184 		"	List<Zork> list;\n" +
35185 		"	     ^^^^\n" +
35186 		"Zork cannot be resolved to a type\n" +
35187 		"----------\n" +
35188 		"4. ERROR in X.java (at line 4)\n" +
35189 		"	Map<Zork,Zork>.Entry<List<Zork>,List<Zork>>	entry;\n" +
35190 		"	^^^\n" +
35191 		"Map cannot be resolved to a type\n" +
35192 		"----------\n" +
35193 		"5. ERROR in X.java (at line 4)\n" +
35194 		"	Map<Zork,Zork>.Entry<List<Zork>,List<Zork>>	entry;\n" +
35195 		"	    ^^^^\n" +
35196 		"Zork cannot be resolved to a type\n" +
35197 		"----------\n" +
35198 		"6. ERROR in X.java (at line 4)\n" +
35199 		"	Map<Zork,Zork>.Entry<List<Zork>,List<Zork>>	entry;\n" +
35200 		"	         ^^^^\n" +
35201 		"Zork cannot be resolved to a type\n" +
35202 		"----------\n" +
35203 		"7. ERROR in X.java (at line 4)\n" +
35204 		"	Map<Zork,Zork>.Entry<List<Zork>,List<Zork>>	entry;\n" +
35205 		"	                     ^^^^\n" +
35206 		"List cannot be resolved to a type\n" +
35207 		"----------\n" +
35208 		"8. ERROR in X.java (at line 4)\n" +
35209 		"	Map<Zork,Zork>.Entry<List<Zork>,List<Zork>>	entry;\n" +
35210 		"	                          ^^^^\n" +
35211 		"Zork cannot be resolved to a type\n" +
35212 		"----------\n" +
35213 		"9. ERROR in X.java (at line 4)\n" +
35214 		"	Map<Zork,Zork>.Entry<List<Zork>,List<Zork>>	entry;\n" +
35215 		"	                                ^^^^\n" +
35216 		"List cannot be resolved to a type\n" +
35217 		"----------\n" +
35218 		"10. ERROR in X.java (at line 4)\n" +
35219 		"	Map<Zork,Zork>.Entry<List<Zork>,List<Zork>>	entry;\n" +
35220 		"	                                     ^^^^\n" +
35221 		"Zork cannot be resolved to a type\n" +
35222 		"----------\n" +
35223 		"11. ERROR in X.java (at line 5)\n" +
35224 		"	jaavaa.util.Map<Zork,Zork>.Entry<List<Zork>,List<Zork>>	entry2;\n" +
35225 		"	^^^^^^\n" +
35226 		"jaavaa cannot be resolved to a type\n" +
35227 		"----------\n" +
35228 		"12. ERROR in X.java (at line 5)\n" +
35229 		"	jaavaa.util.Map<Zork,Zork>.Entry<List<Zork>,List<Zork>>	entry2;\n" +
35230 		"	                ^^^^\n" +
35231 		"Zork cannot be resolved to a type\n" +
35232 		"----------\n" +
35233 		"13. ERROR in X.java (at line 5)\n" +
35234 		"	jaavaa.util.Map<Zork,Zork>.Entry<List<Zork>,List<Zork>>	entry2;\n" +
35235 		"	                     ^^^^\n" +
35236 		"Zork cannot be resolved to a type\n" +
35237 		"----------\n" +
35238 		"14. ERROR in X.java (at line 5)\n" +
35239 		"	jaavaa.util.Map<Zork,Zork>.Entry<List<Zork>,List<Zork>>	entry2;\n" +
35240 		"	                                 ^^^^\n" +
35241 		"List cannot be resolved to a type\n" +
35242 		"----------\n" +
35243 		"15. ERROR in X.java (at line 5)\n" +
35244 		"	jaavaa.util.Map<Zork,Zork>.Entry<List<Zork>,List<Zork>>	entry2;\n" +
35245 		"	                                      ^^^^\n" +
35246 		"Zork cannot be resolved to a type\n" +
35247 		"----------\n" +
35248 		"16. ERROR in X.java (at line 5)\n" +
35249 		"	jaavaa.util.Map<Zork,Zork>.Entry<List<Zork>,List<Zork>>	entry2;\n" +
35250 		"	                                            ^^^^\n" +
35251 		"List cannot be resolved to a type\n" +
35252 		"----------\n" +
35253 		"17. ERROR in X.java (at line 5)\n" +
35254 		"	jaavaa.util.Map<Zork,Zork>.Entry<List<Zork>,List<Zork>>	entry2;\n" +
35255 		"	                                                 ^^^^\n" +
35256 		"Zork cannot be resolved to a type\n" +
35257 		"----------\n" +
35258 		"18. ERROR in X.java (at line 7)\n" +
35259 		"	p.q.Map.Entry entry3;\n" +
35260 		"	^\n" +
35261 		"p cannot be resolved to a type\n" +
35262 		"----------\n" +
35263 		"19. ERROR in X.java (at line 9)\n" +
35264 		"	String<Object>.Y<List> y; // wrong\n" +
35265 		"	^^^^^^\n" +
35266 		"The type String is not generic; it cannot be parameterized with arguments <Object>\n" +
35267 		"----------\n" +
35268 		"20. ERROR in X.java (at line 10)\n" +
35269 		"	X<Object>.Y<List> y1; // wrong\n" +
35270 		"	^^^^^^^^^^^\n" +
35271 		"X.Y cannot be resolved to a type\n" +
35272 		"----------\n" +
35273 		"21. ERROR in X.java (at line 10)\n" +
35274 		"	X<Object>.Y<List> y1; // wrong\n" +
35275 		"	  ^^^^^^\n" +
35276 		"Bound mismatch: The type Object is not a valid substitute for the bounded parameter <T extends String> of the type X<T>\n" +
35277 		"----------\n" +
35278 		"22. ERROR in X.java (at line 10)\n" +
35279 		"	X<Object>.Y<List> y1; // wrong\n" +
35280 		"	            ^^^^\n" +
35281 		"List cannot be resolved to a type\n" +
35282 		"----------\n" +
35283 		"23. ERROR in X.java (at line 11)\n" +
35284 		"	X<String>.Y<List> y2;\n" +
35285 		"	^^^^^^^^^^^\n" +
35286 		"X.Y cannot be resolved to a type\n" +
35287 		"----------\n" +
35288 		"24. ERROR in X.java (at line 11)\n" +
35289 		"	X<String>.Y<List> y2;\n" +
35290 		"	            ^^^^\n" +
35291 		"List cannot be resolved to a type\n" +
35292 		"----------\n");
35293 }
35294 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=158548 - variation
35295 public void test1037() {
35296 	this.runNegativeTest(
35297 		new String[] {
35298 			"X.java",
35299 			"public class X<T extends String> {\n" +
35300 			"	\n" +
35301 			"	List<? extends Zork> list;\n" +
35302 			"	Map.Entry<?,? super Zork>	entry;\n" +
35303 			"}", // =================
35304 		},
35305 		"----------\n" +
35306 		"1. WARNING in X.java (at line 1)\n" +
35307 		"	public class X<T extends String> {\n" +
35308 		"	                         ^^^^^^\n" +
35309 		"The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
35310 		"----------\n" +
35311 		"2. ERROR in X.java (at line 3)\n" +
35312 		"	List<? extends Zork> list;\n" +
35313 		"	^^^^\n" +
35314 		"List cannot be resolved to a type\n" +
35315 		"----------\n" +
35316 		"3. ERROR in X.java (at line 3)\n" +
35317 		"	List<? extends Zork> list;\n" +
35318 		"	               ^^^^\n" +
35319 		"Zork cannot be resolved to a type\n" +
35320 		"----------\n" +
35321 		"4. ERROR in X.java (at line 4)\n" +
35322 		"	Map.Entry<?,? super Zork>	entry;\n" +
35323 		"	^^^\n" +
35324 		"Map cannot be resolved to a type\n" +
35325 		"----------\n" +
35326 		"5. ERROR in X.java (at line 4)\n" +
35327 		"	Map.Entry<?,? super Zork>	entry;\n" +
35328 		"	                    ^^^^\n" +
35329 		"Zork cannot be resolved to a type\n" +
35330 		"----------\n");
35331 }
35332 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=159021 - variation
35333 public void test1038() throws Exception {
35334 	Map options = getCompilerOptions();
35335 	options.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
35336 	this.runConformTest(
35337 		new String[] {
35338 			"X.java",
35339 			"interface I<T> {\n" +
35340 			"    int CONST = A.foo();\n" +
35341 			"}\n" +
35342 			"\n" +
35343 			"class A<U> {\n" +
35344 			"        static int foo() {\n" +
35345 			"        System.out.println(\"SUCCESS\");\n" +
35346 			"        return 0;\n" +
35347 			"    }\n" +
35348 			"}\n" +
35349 			"class B<V> implements I<V> {\n" +
35350 			"	static int LOCAL_STATIC;\n" +
35351 			"	int local_field;\n" +
35352 			"    B(int param) {\n" +
35353 			"        int i = CONST; // keep for possible <clinit>\n" +
35354 			"        int j = param; // may optimize out\n" +
35355 			"        int k = LOCAL_STATIC; // may optimize out\n" +
35356 			"        int l = local_field; // may optimize out\n" +
35357 			"    }\n" +
35358 			"}\n" +
35359 			"public class X {\n" +
35360 			"    public static void main(String[] args) {\n" +
35361 			"        new B<String>(12);\n" +
35362 			"    }\n" +
35363 			"}", // =================
35364 		},
35365 		"SUCCESS",
35366 		null,
35367 		false,
35368 		null,
35369 		options,
35370 		null);
35371 	// check the reference to I.CONST still got generated (for <clinit> invocation side-effect)
35372 	String expectedOutput =
35373 		"  // Method descriptor #10 (I)V\n" +
35374 		"  // Stack: 1, Locals: 2\n" +
35375 		"  B(int param);\n" +
35376 		"    0  aload_0 [this]\n" +
35377 		"    1  invokespecial java.lang.Object() [12]\n" +
35378 		"    4  getstatic B.CONST : int [15]\n" +
35379 		"    7  pop\n" +
35380 		"    8  return\n" +
35381 		"      Line numbers:\n" +
35382 		"        [pc: 0, line: 14]\n" +
35383 		"        [pc: 4, line: 15]\n" +
35384 		"        [pc: 8, line: 19]\n" +
35385 		"      Local variable table:\n" +
35386 		"        [pc: 0, pc: 9] local: this index: 0 type: B\n" +
35387 		"        [pc: 0, pc: 9] local: param index: 1 type: int\n";
35388 
35389 	File f = new File(OUTPUT_DIR + File.separator + "B.class");
35390 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
35391 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
35392 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
35393 	int index = result.indexOf(expectedOutput);
35394 	if (index == -1 || expectedOutput.length() == 0) {
35395 		System.out.println(Util.displayString(result, 3));
35396 	}
35397 	if (index == -1) {
35398 		assertEquals("Wrong contents", expectedOutput, result);
35399 	}
35400 }
35401 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=159021 - variation
35402 public void test1039() throws Exception {
35403 	Map options = getCompilerOptions();
35404 	options.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
35405 	this.runConformTest(
35406 		new String[] {
35407 			"X.java",
35408 			"interface I<T> {\n" +
35409 			"	Value<String> CONST = A.foo(\"[I.CONST]\");\n" +
35410 			"}\n" +
35411 			"class Value<V> {\n" +
35412 			"	static String NAME = \"\";\n" +
35413 			"	V v;\n" +
35414 			"	Value(V v) {\n" +
35415 			"		this.v = v;\n" +
35416 			"	}\n" +
35417 			"}\n" +
35418 			"class A {\n" +
35419 			"	static Value<String> foo(String str) {\n" +
35420 			"		System.out.print(str);\n" +
35421 			"		return new Value<String>(\"str\");\n" +
35422 			"	}\n" +
35423 			"}\n" +
35424 			"class B<V> implements I<V> {\n" +
35425 			"	static Value<String> LOCAL_STATIC = A.foo(\"[B.LOCAL_STATIC]\");\n" +
35426 			"	Value<String> local_field = A.foo(\"[B.local_field]\");\n" +
35427 			"	B(Value<String> param) {\n" +
35428 			"		String i = CONST.NAME; // keep for possible <clinit>\n" +
35429 			"		String j = param.NAME; // may optimize out\n" +
35430 			"		String k = LOCAL_STATIC.NAME; // may optimize out\n" +
35431 			"		String l = local_field.NAME; // may optimize out\n" +
35432 			"	}\n" +
35433 			"}\n" +
35434 			"public class X {\n" +
35435 			"	public static void main(String[] args) {\n" +
35436 			"		new B<String>(new Value<String>(\"[PARAM]\"));\n" +
35437 			"	}\n" +
35438 			"}", // =================
35439 		},
35440 		"[B.LOCAL_STATIC][B.local_field][I.CONST]",
35441 		null,
35442 		false,
35443 		null,
35444 		options,
35445 		null);
35446 	// check the reference to I.CONST still got generated (for <clinit> invocation side-effect)
35447 	String expectedOutput =
35448 		"  // Method descriptor #28 (LValue;)V\n" +
35449 		"  // Signature: (LValue<Ljava/lang/String;>;)V\n" +
35450 		"  // Stack: 2, Locals: 2\n" +
35451 		"  B(Value param);\n" +
35452 		"     0  aload_0 [this]\n" +
35453 		"     1  invokespecial java.lang.Object() [30]\n" +
35454 		"     4  aload_0 [this]\n" +
35455 		"     5  ldc <String \"[B.local_field]\"> [32]\n" +
35456 		"     7  invokestatic A.foo(java.lang.String) : Value [17]\n" +
35457 		"    10  putfield B.local_field : Value [34]\n" +
35458 		"    13  getstatic B.CONST : Value [36]\n" +
35459 		"    16  pop\n" +
35460 		"    17  getstatic Value.NAME : java.lang.String [39]\n" +
35461 		"    20  pop\n" +
35462 		"    21  getstatic Value.NAME : java.lang.String [39]\n" +
35463 		"    24  pop\n" +
35464 		"    25  getstatic Value.NAME : java.lang.String [39]\n" +
35465 		"    28  pop\n" +
35466 		"    29  getstatic Value.NAME : java.lang.String [39]\n" +
35467 		"    32  pop\n" +
35468 		"    33  return\n" +
35469 		"      Line numbers:\n" +
35470 		"        [pc: 0, line: 20]\n" +
35471 		"        [pc: 4, line: 19]\n" +
35472 		"        [pc: 13, line: 21]\n" +
35473 		"        [pc: 21, line: 22]\n" +
35474 		"        [pc: 25, line: 23]\n" +
35475 		"        [pc: 29, line: 24]\n" +
35476 		"        [pc: 33, line: 25]\n" +
35477 		"      Local variable table:\n" +
35478 		"        [pc: 0, pc: 34] local: this index: 0 type: B\n" +
35479 		"        [pc: 0, pc: 34] local: param index: 1 type: Value\n";
35480 
35481 	File f = new File(OUTPUT_DIR + File.separator + "B.class");
35482 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
35483 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
35484 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
35485 	int index = result.indexOf(expectedOutput);
35486 	if (index == -1 || expectedOutput.length() == 0) {
35487 		System.out.println(Util.displayString(result, 3));
35488 	}
35489 	if (index == -1) {
35490 		assertEquals("Wrong contents", expectedOutput, result);
35491 	}
35492 }
35493 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=159021 - variation
35494 public void test1040() throws Exception {
35495 	Map options = getCompilerOptions();
35496 	options.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
35497 	this.runConformTest(
35498 		new String[] {
35499 			"X.java",
35500 			"interface I<T> {\n" +
35501 			"	Value<String> CONST = A.foo(\"[I.CONST]\");\n" +
35502 			"}\n" +
35503 			"class Value<V> {\n" +
35504 			"	static String NAME = \"\";\n" +
35505 			"	V v;\n" +
35506 			"	Value(V v) {\n" +
35507 			"		this.v = v;\n" +
35508 			"	}\n" +
35509 			"}\n" +
35510 			"class A {\n" +
35511 			"	static Value<String> foo(String str) {\n" +
35512 			"		System.out.print(str);\n" +
35513 			"		return new Value<String>(\"str\");\n" +
35514 			"	}\n" +
35515 			"}\n" +
35516 			"class B<V> implements I<V> {\n" +
35517 			"	static Value<String> LOCAL_STATIC = A.foo(\"[B.LOCAL_STATIC]\");\n" +
35518 			"	Value<String> local_field = A.foo(\"[B.local_field]\");\n" +
35519 			"	B(Value<String> param) {\n" +
35520 			"		String i = this.CONST.NAME; // keep for possible <clinit>\n" +
35521 			"		String k = this.LOCAL_STATIC.NAME; // may optimize out\n" +
35522 			"		String l = this.local_field.NAME; // may optimize out\n" +
35523 			"	}\n" +
35524 			"}\n" +
35525 			"public class X {\n" +
35526 			"	public static void main(String[] args) {\n" +
35527 			"		new B<String>(new Value<String>(\"[PARAM]\"));\n" +
35528 			"	}\n" +
35529 			"}", // =================
35530 		},
35531 		"[B.LOCAL_STATIC][B.local_field][I.CONST]",
35532 		null,
35533 		false,
35534 		null,
35535 		options,
35536 		null);
35537 	// check the reference to I.CONST still got generated (for <clinit> invocation side-effect)
35538 	String expectedOutput =
35539 		"  // Method descriptor #28 (LValue;)V\n" +
35540 		"  // Signature: (LValue<Ljava/lang/String;>;)V\n" +
35541 		"  // Stack: 2, Locals: 2\n" +
35542 		"  B(Value param);\n" +
35543 		"     0  aload_0 [this]\n" +
35544 		"     1  invokespecial java.lang.Object() [30]\n" +
35545 		"     4  aload_0 [this]\n" +
35546 		"     5  ldc <String \"[B.local_field]\"> [32]\n" +
35547 		"     7  invokestatic A.foo(java.lang.String) : Value [17]\n" +
35548 		"    10  putfield B.local_field : Value [34]\n" +
35549 		"    13  getstatic B.CONST : Value [36]\n" +
35550 		"    16  pop\n" +
35551 		"    17  getstatic Value.NAME : java.lang.String [39]\n" +
35552 		"    20  pop\n" +
35553 		"    21  getstatic Value.NAME : java.lang.String [39]\n" +
35554 		"    24  pop\n" +
35555 		"    25  getstatic Value.NAME : java.lang.String [39]\n" +
35556 		"    28  pop\n" +
35557 		"    29  return\n" +
35558 		"      Line numbers:\n" +
35559 		"        [pc: 0, line: 20]\n" +
35560 		"        [pc: 4, line: 19]\n" +
35561 		"        [pc: 13, line: 21]\n" +
35562 		"        [pc: 21, line: 22]\n" +
35563 		"        [pc: 25, line: 23]\n" +
35564 		"        [pc: 29, line: 24]\n" +
35565 		"      Local variable table:\n" +
35566 		"        [pc: 0, pc: 30] local: this index: 0 type: B\n" +
35567 		"        [pc: 0, pc: 30] local: param index: 1 type: Value\n";
35568 
35569 	File f = new File(OUTPUT_DIR + File.separator + "B.class");
35570 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
35571 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
35572 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
35573 	int index = result.indexOf(expectedOutput);
35574 	if (index == -1 || expectedOutput.length() == 0) {
35575 		System.out.println(Util.displayString(result, 3));
35576 	}
35577 	if (index == -1) {
35578 		assertEquals("Wrong contents", expectedOutput, result);
35579 	}
35580 }
35581 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=159245
35582 public void test1041() {
35583 	this.runNegativeTest(
35584 		new String[] {
35585 			"p/X.java",
35586 			"package p;\n" +
35587 			"\n" +
35588 			"public class X<T> {\n" +
35589 			"	{\n" +
35590 			"		X rawx = null;\n" +
35591 			"		X[] rawxs = { rawx };\n" +
35592 			"		System.out.println(rawxs.length);\n" +
35593 			"	}\n" +
35594 			"	{\n" +
35595 			"		p.X rawx = null;\n" +
35596 			"		p.X[] rawxs = { rawx };\n" +
35597 			"		System.out.println(rawxs.length);\n" +
35598 			"	}\n" +
35599 			"	Zork z;\n" +
35600 			"}", // =================
35601 		},
35602 		"----------\n" +
35603 		"1. WARNING in p\\X.java (at line 5)\n" +
35604 		"	X rawx = null;\n" +
35605 		"	^\n" +
35606 		"X is a raw type. References to generic type X<T> should be parameterized\n" +
35607 		"----------\n" +
35608 		"2. WARNING in p\\X.java (at line 6)\n" +
35609 		"	X[] rawxs = { rawx };\n" +
35610 		"	^\n" +
35611 		"X is a raw type. References to generic type X<T> should be parameterized\n" +
35612 		"----------\n" +
35613 		"3. WARNING in p\\X.java (at line 10)\n" +
35614 		"	p.X rawx = null;\n" +
35615 		"	^^^\n" +
35616 		"X is a raw type. References to generic type X<T> should be parameterized\n" +
35617 		"----------\n" +
35618 		"4. WARNING in p\\X.java (at line 11)\n" +
35619 		"	p.X[] rawxs = { rawx };\n" +
35620 		"	^^^\n" +
35621 		"X is a raw type. References to generic type X<T> should be parameterized\n" +
35622 		"----------\n" +
35623 		"5. ERROR in p\\X.java (at line 14)\n" +
35624 		"	Zork z;\n" +
35625 		"	^^^^\n" +
35626 		"Zork cannot be resolved to a type\n" +
35627 		"----------\n");
35628 }
35629 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=159818
35630 public void test1042() {
35631 	this.runNegativeTest(
35632 		new String[] {
35633 			"X.java",
35634 			"public class X {\n" +
35635 			"	public <T extends Object> void foo(T x) {\n" +
35636 			"	    Class<? extends T> c = x.getClass();\n" +
35637 			"	}\n" +
35638 			"}\n", // =================
35639 		},
35640 		"----------\n" +
35641 		"1. ERROR in X.java (at line 3)\n" +
35642 		"	Class<? extends T> c = x.getClass();\n" +
35643 		"	                       ^^^^^^^^^^^^\n" +
35644 		"Type mismatch: cannot convert from Class<capture#1-of ? extends Object> to Class<? extends T>\n" +
35645 		"----------\n");
35646 }
35647 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=159214
35648 public void test1043() {
35649 	this.runNegativeTest(
35650 		new String[] {
35651 			"A.java",
35652 			"class A<T extends Number, S extends T> {\n" +
35653 			"  T t;\n" +
35654 			"  S s;\n" +
35655 			"  void test(A<? extends Long, ? extends S> a) {\n" +
35656 			"    this.t = this.s; //fine\n" +
35657 			"    a.t = a.s;\n" +
35658 			"  }\n" +
35659 			"}", // =================
35660 		},
35661 		"----------\n" +
35662 		"1. ERROR in A.java (at line 6)\n" +
35663 		"	a.t = a.s;\n" +
35664 		"	      ^^^\n" +
35665 		"Type mismatch: cannot convert from capture#4-of ? extends S to capture#1-of ? extends Long\n" +
35666 		"----------\n",
35667 		JavacTestOptions.EclipseJustification.EclipseBug159214);
35668 }
35669 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=159214 - variation
35670 public void test1044() {
35671 	this.runConformTest(
35672 		new String[] {
35673 			"X.java",
35674 			"class X<T extends Number> {\n" +
35675 			"    X<? extends Object> x;\n" +
35676 			"}", // =================
35677 		},
35678 		"");
35679 }
35680 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=159214 - variation
35681 public void test1045() {
35682 	this.runConformTest(
35683 		new String[] {
35684 			"X.java",
35685 			"class X<T extends Number, S extends T> {\n" +
35686 			"        X<? extends Long,? extends S> x;\n" +
35687 			"}",
35688 		},
35689 		"");
35690 }
35691 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=160132
35692 public void test1046() {
35693 	this.runConformTest(
35694 		new String[] {
35695 			"X.java", //========================
35696 			"public interface X<E extends Object & X.Entry> {\n" +
35697 			"  interface Entry {\n" +
35698 			"    interface Internal extends Entry {\n" +
35699 			"      Internal createEntry();\n" +
35700 			"    }\n" +
35701 			"  }\n" +
35702 			"}\n", //========================
35703 			"Y.java",
35704 			"public class Y implements X.Entry.Internal {\n" +
35705 			"  public Internal createEntry() {\n" +
35706 			"    return null;\n" +
35707 			"  }\n" +
35708 			"}\n" , //========================
35709 		},
35710 		"");
35711 	// compile Y against X binary
35712 	this.runConformTest(
35713 			new String[] {
35714 				"Y.java", //========================
35715 				"public class Y implements X.Entry.Internal {\n" +
35716 				"  public Internal createEntry() {\n" +
35717 				"    return null;\n" +
35718 				"  }\n" +
35719 				"}\n" , //========================
35720 			},
35721 			"",
35722 			null,
35723 			false,
35724 			null);
35725 }
35726 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=160132 - variation
35727 public void test1047() {
35728 	this.runConformTest(
35729 		new String[] {
35730 			"p/X.java", //========================
35731 			"package p;\n" +
35732 			"public interface X<E extends Object & X.Entry> {\n" +
35733 			"  interface Entry {\n" +
35734 			"    interface Internal extends Entry {\n" +
35735 			"      Internal createEntry();\n" +
35736 			"    }\n" +
35737 			"  }\n" +
35738 			"}\n", //========================
35739 			"Y.java",
35740 			"import p.X.Entry.Internal;\n" +
35741 			"public class Y implements Internal {\n" +
35742 			"  public Internal createEntry() {\n" +
35743 			"    return null;\n" +
35744 			"  }\n" +
35745 			"}\n" , //========================
35746 		},
35747 		"");
35748 	// compile Y against X binary
35749 	this.runConformTest(
35750 			new String[] {
35751 				"Y.java", //========================
35752 				"import p.X.Entry.Internal;\n" +
35753 				"public class Y implements Internal {\n" +
35754 				"  public Internal createEntry() {\n" +
35755 				"    return null;\n" +
35756 				"  }\n" +
35757 				"}\n" , //========================
35758 			},
35759 			"",
35760 			null,
35761 			false,
35762 			null);
35763 }
35764 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=160132 - variation
35765 public void test1048() {
35766 	this.runConformTest(
35767 		new String[] {
35768 			"X.java", //========================
35769 			"public interface X {\n" +
35770 			"  static class Entry {\n" +
35771 			"    static abstract class Internal extends Entry {\n" +
35772 			"      abstract Internal createEntry();\n" +
35773 			"    }\n" +
35774 			"  }\n" +
35775 			"}\n", //========================
35776 			"Y.java",
35777 			"public class Y extends  X.Entry.Internal {\n" +
35778 			"  @Override public Internal createEntry() {\n" +
35779 			"    return null;\n" +
35780 			"  }\n" +
35781 			"}\n" , //========================
35782 		},
35783 		"");
35784 	// compile Y against X binary
35785 	this.runConformTest(
35786 			new String[] {
35787 				"Y.java", //========================
35788 				"public class Y extends X.Entry.Internal {\n" +
35789 				"  @Override public Internal createEntry() {\n" +
35790 				"    return null;\n" +
35791 				"  }\n" +
35792 				"}\n" , //========================
35793 			},
35794 			"",
35795 			null,
35796 			false,
35797 			null);
35798 }
35799 public void test1049() {
35800 	this.runConformTest(
35801 		new String[] {
35802 			"X.java", //========================
35803 			"import java.util.*;\n" +
35804 			"public class X {\n" +
35805 			"}\n" +
35806 			"\n" +
35807 			"//===================\n" +
35808 			"interface FooHandle<T extends Foo<T>> extends BarHandle<T> {}\n" +
35809 			"interface Foo<T extends Foo<T>> extends FooHandle<T>, Bar<T> {\n" +
35810 			"	FooHandle<T> foo();\n" +
35811 			"}\n" +
35812 			"//===================\n" +
35813 			"interface EveHandle<T extends Baz<T>> extends SimpleHandle {}\n" +
35814 			"interface Eve<T extends Baz<T>> extends Simple, EveHandle<T> {\n" +
35815 			"	List<BobHandle> foo();\n" +
35816 			"	BazHandle<T> handles();\n" +
35817 			"}\n" +
35818 			"\n" +
35819 			"//===================\n" +
35820 			"interface BobHandle extends BillHandle {}\n" +
35821 			"interface Bob extends BobHandle, Bill {}\n" +
35822 			"\n" +
35823 			"//===================\n" +
35824 			"interface BarHandle<T extends Bar<T>> extends BazHandle<T> {\n" +
35825 			"	boolean same(BarHandle<?> o);\n" +
35826 			"}\n" +
35827 			"interface Bar<T extends Bar<T>> extends Baz<T>, BarHandle<T> {\n" +
35828 			"	BarHandle<T> handle();\n" +
35829 			"}\n" +
35830 			"\n" +
35831 			"//===================\n" +
35832 			"interface BazHandle<T extends Baz<T>> {\n" +
35833 			"	T baz();\n" +
35834 			"	boolean same(BazHandle<?> o);\n" +
35835 			"}\n" +
35836 			"interface Baz<T extends Baz<T>> extends BazHandle<T> {\n" +
35837 			"	BazHandle<T> handle();\n" +
35838 			"	T baz();\n" +
35839 			"}\n" +
35840 			"\n" +
35841 			"//===================\n" +
35842 			"interface BillHandle extends FooHandle<Bill> {}\n" +
35843 			"interface Bill extends BillHandle, Foo<Bill> {}\n" +
35844 			"\n" +
35845 			"//===================\n" +
35846 			"interface SimpleHandle extends BazHandle<Simple> {}\n" +
35847 			"interface Simple extends Baz<Simple>, SimpleHandle {}\n" +
35848 			"\n" +
35849 			"//===================\n" +
35850 			"interface KeyHandle extends FooHandle<Key> {}\n" +
35851 			"interface Key extends Foo<Key>, KeyHandle {}\n" +
35852 			"\n" +
35853 			"//===================\n" +
35854 			"interface ClydeHandle extends BillHandle {}\n" +
35855 			"interface Clyde extends ClydeHandle, Bill {\n" +
35856 			"	void add(BobHandle h);\n" +
35857 			"	public List<BobHandle> handles();\n" +
35858 			"}\n" +
35859 			"\n" +
35860 			"//===================\n" +
35861 			"interface FredHandle<T extends Fred<T>> extends BarHandle<T> {}\n" +
35862 			"interface Fred<T extends Fred<T>> extends FredHandle<T>, Bar<T> {}\n" +
35863 			"\n", // =================
35864 		},
35865 		"");
35866 }
35867 public void test1050() {
35868 	String expectedOutput =
35869 		"xxx\n" +
35870     	"true\n" +
35871     	"ClassCastException: Object[] cannot be cast to String[]\n" +
35872     	"ClassCastException: Object[] cannot be cast to String[]";
35873 
35874 	this.runConformTest(
35875 		new String[] {
35876 			"X.java", //========================
35877 			"class Container<E> {\n" +
35878 			"  public Container() {\n" +
35879 			"    data = (E[]) new Object[100];\n" +
35880 			"  }\n" +
35881 			"  protected E[] data;\n" +
35882 			"  protected int size;\n" +
35883 			"  E get(int index) {\n" +
35884 			"    return data[index];\n" +
35885 			"  }\n" +
35886 			"  void add(E object) {\n" +
35887 			"    data[size++] = object;\n" +
35888 			"  }\n" +
35889 			"  E[] data() {\n" +
35890 			"    return data;\n" +
35891 			"  }\n" +
35892 			"}\n" +
35893 			"class StringContainer extends Container<String> {\n" +
35894 			"  public StringContainer() {\n" +
35895 			"  }\n" +
35896 			"  public void doSomething() {\n" +
35897 			"    add(\"xxx\");\n" +
35898 			"    System.out.println(get(0));\n" +
35899 			"    System.out.println((\"\" + data()).\n" +
35900 			"      startsWith(\"[Ljava.lang.Object;@\"));\n" +
35901 			"    try {\n" +
35902 			"      System.out.println(data[0]);\n" +
35903 			"    } catch (ClassCastException e) {\n" +
35904 			"      System.out.println(\"ClassCastException: Object[] cannot be cast to String[]\");\n" +
35905 			"    }\n" +
35906 			"    try {\n" +
35907 			"      System.out.println(data()[0]);\n" +
35908 			"    } catch (ClassCastException e) {\n" +
35909 			"      System.out.println(\"ClassCastException: Object[] cannot be cast to String[]\");\n" +
35910 			"    }\n" +
35911 			"  }\n" +
35912 			"}\n" +
35913 			"public class X {\n" +
35914 			"  public static void main(String[] args) {\n" +
35915 			"    StringContainer x = new StringContainer();\n" +
35916 			"    x.doSomething();\n" +
35917 			"  }\n" +
35918 			"}", // =================
35919 		},
35920 		expectedOutput);
35921 }
35922 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=114088
35923 public void test1051() {
35924 	this.runConformTest(
35925 		new String[] {
35926 			"X.java",
35927 			"import java.util.List;\n" +
35928 			"\n" +
35929 			"public class X {\n" +
35930 			"	public interface Intf<N> {\n" +
35931 			"		void foo(List<Conc<N>.Inner> ls);\n" +
35932 			"	}\n" +
35933 			"\n" +
35934 			"	public class Conc<N> {\n" +
35935 			"		Intf<N> impl;\n" +
35936 			"		public Conc(Intf<N> impl) {\n" +
35937 			"			this.impl = impl;\n" +
35938 			"		}\n" +
35939 			"		public class Inner { }\n" +
35940 			"\n" +
35941 			"		public void bar(List<Conc<N>.Inner> ls) {\n" +
35942 			"			impl.foo(ls);\n" +
35943 			"		}\n" +
35944 			"	}\n" +
35945 			"}",
35946 		},
35947 		"");
35948 }
35949 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=115691
35950 public void test1052() {
35951 	Map options = getCompilerOptions();
35952 	options.put(CompilerOptions.OPTION_ReportUncheckedTypeOperation, CompilerOptions.ERROR);
35953 	options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.ERROR);
35954 	options.put(CompilerOptions.OPTION_ReportUnnecessaryTypeCheck, CompilerOptions.ERROR);
35955 	this.runConformTest(
35956 		new String[] {
35957 			"X.java",
35958 			"public class X extends java.util.ArrayList<Integer> {\n" +
35959 			"	private static final long serialVersionUID = 713223190582506215L;\n" +
35960 			"	static void test() {\n" +
35961 			"		java.util.ArrayList<?> a1 = new X();\n" +
35962 			"		X b1 = (X) a1;\n" +
35963 			"		X c1 = X.class.cast(a1);\n" +
35964 			"		java.util.ArrayList<Integer> a2 = new X();\n" +
35965 			"		X b2 = (X) a2;\n" +
35966 			"	}\n" +
35967 			"}",
35968 		},
35969 		"",
35970 		null,
35971 		true,
35972 		null,
35973 		options,
35974 		null);
35975 }
35976 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=122163
35977 public void test1053() {
35978 	this.runConformTest(
35979 		new String[] {
35980 			"X.java",
35981 			"class X<V,R> {\n" +
35982 			"    class innerclass {\n" +
35983 			"        void foo() {\n" +
35984 			"            X<V,R> c = X.this;\n" +
35985 			"        }\n" +
35986 			"    }\n" +
35987 			"}",
35988 		},
35989 		"");
35990 }
35991 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=142935
35992 public void test1054() {
35993 	Map customOptions = getCompilerOptions();
35994 	// check no unsafe type operation problem is issued
35995 	customOptions.put(CompilerOptions.OPTION_ReportUncheckedTypeOperation, CompilerOptions.IGNORE);
35996 	customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
35997 	String expectedOutput =
35998 		"----------\n" +
35999 		"1. ERROR in X.java (at line 11)\n" +
36000 		"	Bar bar= clazz.getAnnotation(Bar.class);\n" +
36001 		"	         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
36002 		"Type mismatch: cannot convert from Annotation to Bar\n" +
36003 		"----------\n";
36004 	this.runNegativeTest(
36005 		new String[] {
36006 			"X.java",
36007 			"import java.lang.annotation.Retention;\n" +
36008 			"import java.lang.annotation.RetentionPolicy;\n" +
36009 			"import java.lang.reflect.Method;\n" +
36010 			"\n" +
36011 			"@Bar\n" +
36012 			"public class X {\n" +
36013 			"\n" +
36014 			"        @Bar\n" +
36015 			"        public void bar() throws Exception {\n" +
36016 			"                Class clazz= X.class;\n" +
36017 			"                Bar bar= clazz.getAnnotation(Bar.class);\n" +
36018 			"                Method method= clazz.getMethod(\"bar\");\n" +
36019 			"                Bar bar2= method.getAnnotation(Bar.class);\n" +
36020 			"        }\n" +
36021 			"}\n" +
36022 			"\n" +
36023 			"@Retention(RetentionPolicy.RUNTIME)\n" +
36024 			"@interface Bar {\n" +
36025 			"}",
36026 		},
36027 		expectedOutput,
36028 		null,
36029 		true,
36030 		customOptions);
36031 }
36032 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=142935
36033 public void test1055() {
36034 	this.runConformTest(
36035 		new String[] {
36036 			"X.java",
36037 			"import java.lang.annotation.Retention;\n" +
36038 			"import java.lang.annotation.RetentionPolicy;\n" +
36039 			"import java.lang.reflect.Method;\n" +
36040 			"\n" +
36041 			"@Bar\n" +
36042 			"public class X {\n" +
36043 			"\n" +
36044 			"        @Bar\n" +
36045 			"        public void bar() throws Exception {\n" +
36046 			"                Class<X> clazz= X.class;\n" +
36047 			"                Bar bar= clazz.getAnnotation(Bar.class);\n" +
36048 			"                Method method= clazz.getMethod(\"bar\");\n" +
36049 			"                Bar bar2= method.getAnnotation(Bar.class);\n" +
36050 			"        }\n" +
36051 			"}\n" +
36052 			"\n" +
36053 			"@Retention(RetentionPolicy.RUNTIME)\n" +
36054 			"@interface Bar {\n" +
36055 			"}",
36056 		},
36057 		"");
36058 }
36059 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=162400
36060 public void test1056() {
36061 	this.runConformTest(
36062 		new String[] {
36063 			"X.java",
36064 			"public class X {\n" +
36065 			"	static <T> T foo() {\n" +
36066 			"		return null;\n" +
36067 			"	}\n" +
36068 			"	public static void main(String[] args) {\n" +
36069 			"		String[] s = { foo() };\n" +
36070 			"	}	\n" +
36071 			"}\n",
36072 		},
36073 		"");
36074 }
36075 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=159738
36076 public void test1057() {
36077 	this.runConformTest(
36078 		new String[] {
36079 			"X.java",
36080 			"import java.util.Map;\n" +
36081 			"\n" +
36082 			"class GenericType<E extends Object & Comparable<E> & Map.Entry<String, E>> {\n" +
36083 			"	public void doSomething(E e) {\n" +
36084 			"		System.out.println(e.compareTo(e.getValue()));\n" +
36085 			"	}\n" +
36086 			"}\n" +
36087 			"class ConcreteType {\n" +
36088 			"	public void doSomething(Object obj) {\n" +
36089 			"		System.out.println(((Comparable) obj).compareTo(((Map.Entry) obj).getValue()));\n" +
36090 			"	}\n" +
36091 			"}\n" +
36092 			"public class X {\n" +
36093 			"	public static void main(String[] args) {\n" +
36094 			"		try {\n" +
36095 			"			new GenericType().doSomething(\"a1\");\n" +
36096 			"		} catch (Throwable e) {\n" +
36097 			"			System.out.print(\"[\" + e.getClass().getSimpleName() + \":1]\");\n" +
36098 			"		}\n" +
36099 			"		try {\n" +
36100 			"			new ConcreteType().doSomething(\"a2\");\n" +
36101 			"		} catch (Throwable e) {\n" +
36102 			"			System.out.print(\"[\" + e.getClass().getSimpleName() + \":2]\");\n" +
36103 			"		}\n" +
36104 			"	}\n" +
36105 			"}\n", // =================,
36106 		},
36107 		"[ClassCastException:1][ClassCastException:2]");
36108 }
36109 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=141289
36110 public void test1058() throws Exception {
36111 	runConformTest(
36112 		// test directory preparation
36113 		true /* flush output directory */,
36114 		new String[] { /* test files */
36115 			"X.java", // =================
36116 			"public class X {\n" +
36117 			"        public static void main(String[] args) {\n" +
36118 			"        	try {\n" +
36119 			"                int foo = 0;\n" +
36120 			"                String bar = \"zero\";\n" +
36121 			"                System.out.println((foo != 0 ? foo : bar).compareTo(null));\n" +
36122 			"        	} catch(NullPointerException e) {\n" +
36123 			"        		System.out.println(\"SUCCESS\");\n" +
36124 			"        	}\n" +
36125 			"        }\n" +
36126 			"}", // =================
36127 		},
36128 		// compiler results
36129 		"" /* expected compiler log */,
36130 		// runtime results
36131 		"SUCCESS" /* expected output string */,
36132 		"" /* expected error string */,
36133 		// javac options
36134 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
36135 	String expectedOutput =
36136 		"  // Method descriptor #15 ([Ljava/lang/String;)V\n" +
36137 		"  // Stack: 3, Locals: 3\n" +
36138 		"  public static void main(java.lang.String[] args);\n" +
36139 		"     0  iconst_0\n" +
36140 		"     1  istore_1 [foo]\n" +
36141 		"     2  ldc <String \"zero\"> [16]\n" +
36142 		"     4  astore_2 [bar]\n" +
36143 		"     5  getstatic java.lang.System.out : java.io.PrintStream [18]\n" +
36144 		"     8  iload_1 [foo]\n" +
36145 		"     9  ifeq 19\n" +
36146 		"    12  iload_1 [foo]\n" +
36147 		"    13  invokestatic java.lang.Integer.valueOf(int) : java.lang.Integer [24]\n" +
36148 		"    16  goto 20\n" +
36149 		"    19  aload_2 [bar]\n" +
36150 		"    20  aconst_null\n" +
36151 		"    21  invokeinterface java.lang.Comparable.compareTo(java.lang.Object) : int [30] [nargs: 2]\n" +
36152 		"    26  invokevirtual java.io.PrintStream.println(int) : void [36]\n" +
36153 		"    29  goto 41\n" +
36154 		"    32  astore_1 [e]\n" +
36155 		"    33  getstatic java.lang.System.out : java.io.PrintStream [18]\n" +
36156 		"    36  ldc <String \"SUCCESS\"> [42]\n" +
36157 		"    38  invokevirtual java.io.PrintStream.println(java.lang.String) : void [44]\n" +
36158 		"    41  return\n" +
36159 		"      Exception Table:\n" +
36160 		"        [pc: 0, pc: 29] -> 32 when : java.lang.NullPointerException\n" +
36161 		"      Line numbers:\n" +
36162 		"        [pc: 0, line: 4]\n" +
36163 		"        [pc: 2, line: 5]\n" +
36164 		"        [pc: 5, line: 6]\n" +
36165 		"        [pc: 29, line: 7]\n" +
36166 		"        [pc: 33, line: 8]\n" +
36167 		"        [pc: 41, line: 10]\n" +
36168 		"      Local variable table:\n" +
36169 		"        [pc: 0, pc: 42] local: args index: 0 type: java.lang.String[]\n" +
36170 		"        [pc: 2, pc: 29] local: foo index: 1 type: int\n" +
36171 		"        [pc: 5, pc: 29] local: bar index: 2 type: java.lang.String\n" +
36172 		"        [pc: 33, pc: 41] local: e index: 1 type: java.lang.NullPointerException\n";
36173 
36174 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
36175 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
36176 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
36177 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
36178 	int index = result.indexOf(expectedOutput);
36179 	if (index == -1 || expectedOutput.length() == 0) {
36180 		System.out.println(Util.displayString(result, 3));
36181 	}
36182 	if (index == -1) {
36183 		assertEquals("Wrong contents", expectedOutput, result);
36184 	}
36185 }
36186 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=160795
36187 public void test1059() {
36188 	this.runNegativeTest(
36189 		new String[] {
36190 			"A.java", // =================
36191 			"class A<T> {\n" +
36192 			"    <S> S test(A<S> a) {\n" +
36193 			"        return null;\n" +
36194 			"    }\n" +
36195 			"\n" +
36196 			"    void m() {\n" +
36197 			"        A<?> a = null;\n" +
36198 			"        Number b = test(a);\n" +
36199 			"    }\n" +
36200 			"}", // =================
36201 		},
36202 		"----------\n" +
36203 		"1. ERROR in A.java (at line 8)\n" +
36204 		"	Number b = test(a);\n" +
36205 		"	           ^^^^^^^\n" +
36206 		"Type mismatch: cannot convert from capture#1-of ? to Number\n" +
36207 		"----------\n");
36208 }
36209 // See corresponding FIXME in TypeBinding.isTypeArgumentContainedBy(..)
36210 public void test1060() {
36211 	runConformTest(
36212 		// test directory preparation
36213 		new String[] { /* test files */
36214 			"X.java", // =================
36215 			"import java.util.Collection;\n" +
36216 			"import java.util.List;\n" +
36217 			"\n" +
36218 			"public class X {\n" +
36219 			"    public static <B> void m(List<? super B> list,Collection<? super B> coll) {\n" +
36220 			"        m(list,coll);\n" +
36221 			"    }\n" +
36222 			"}", // =================
36223 		},
36224 		// javac options
36225 		JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
36226 }
36227 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=159752
36228 public void test1061() {
36229 	runConformTest(
36230 		// test directory preparation
36231 		new String[] { /* test files */
36232 			"predicate/Predicate.java", // =================
36233 			"package predicate;\n" +
36234 			"public interface Predicate<T> {\n" +
36235 			"	public boolean evaluate(T object);\n" +
36236 			"}\n" +
36237 			"final class AndPredicate<T> implements Predicate<T> {\n" +
36238 			"	private final Predicate<? super T> iPredicate1;\n" +
36239 			"	private final Predicate<? super T> iPredicate2;\n" +
36240 			"	public static <T> Predicate<T> getInstance(Predicate<? super T> predicate1,\n" +
36241 			"			Predicate<? super T> predicate2) {\n" +
36242 			"		if (predicate1 == null || predicate2 == null) {\n" +
36243 			"			throw new IllegalArgumentException(\"Predicate must not be null\");\n" +
36244 			"		}\n" +
36245 			"		return new AndPredicate<T>(predicate1, predicate2);\n" +
36246 			"	}\n" +
36247 			"	public AndPredicate(Predicate<? super T> predicate1,\n" +
36248 			"			Predicate<? super T> predicate2) {\n" +
36249 			"		super();\n" +
36250 			"		iPredicate1 = predicate1;\n" +
36251 			"		iPredicate2 = predicate2;\n" +
36252 			"	}\n" +
36253 			"	public boolean evaluate(T object) {\n" +
36254 			"		return iPredicate1.evaluate(object) && iPredicate2.evaluate(object);\n" +
36255 			"	}\n" +
36256 			"}\n" +
36257 			"class PredicateUtils {\n" +
36258 			"\n" +
36259 			"	public static <T> Predicate<T> andPredicate(\n" +
36260 			"			Predicate<? super T> predicate1, Predicate<? super T> predicate2) {\n" +
36261 			"		return AndPredicate.getInstance(predicate1, predicate2);\n" +
36262 			"	}\n" +
36263 			"}", // =================
36264 		},
36265 		// javac options
36266 		JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
36267 }
36268 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=148041
36269 public void test1062() {
36270 	this.runNegativeTest(
36271 		new String[] {
36272 			"X.java", // =================
36273 			"import java.util.HashSet;\n" +
36274 			"import java.util.Iterator;\n" +
36275 			"import java.util.Set;\n" +
36276 			"\n" +
36277 			"public class X {\n" +
36278 			"	public static void main(String[] args) {\n" +
36279 			"		Set<X> set = new HashSet<X>();\n" +
36280 			"		for (Iterator<X> iterator = set.iterator(); iterator.hasNext();) {\n" +
36281 			"			Set<X> element1 = iterator.next();\n" +
36282 			"			Set<X> element2 = (Set<X>) iterator.next(); // warning\n" +
36283 			"		}\n" +
36284 			"	}\n" +
36285 			"}", // =================
36286 		},
36287 		"----------\n" +
36288 		"1. ERROR in X.java (at line 9)\n" +
36289 		"	Set<X> element1 = iterator.next();\n" +
36290 		"	                  ^^^^^^^^^^^^^^^\n" +
36291 		"Type mismatch: cannot convert from X to Set<X>\n" +
36292 		"----------\n" +
36293 		"2. WARNING in X.java (at line 10)\n" +
36294 		"	Set<X> element2 = (Set<X>) iterator.next(); // warning\n" +
36295 		"	                  ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
36296 		"Type safety: Unchecked cast from X to Set<X>\n" +
36297 		"----------\n");
36298 }
36299 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=148041 - variation
36300 public void test1063() {
36301 	this.runNegativeTest(
36302 		new String[] {
36303 			"X.java", // =================
36304 			"import java.util.HashSet;\n" +
36305 			"import java.util.Iterator;\n" +
36306 			"import java.util.Set;\n" +
36307 			"\n" +
36308 			"public class X {\n" +
36309 			"	public static void main(String[] args) {\n" +
36310 			"		Set<Cloneable> set = new HashSet<Cloneable>();\n" +
36311 			"		for (Iterator<Cloneable> iterator = set.iterator(); iterator.hasNext();) {\n" +
36312 			"			Set<Cloneable> element1 = iterator.next();\n" +
36313 			"			Set<Cloneable> element2 = (Set<Cloneable>) iterator.next(); // warning\n" +
36314 			"		}\n" +
36315 			"	}\n" +
36316 			"}", // =================
36317 		},
36318 		"----------\n" +
36319 		"1. ERROR in X.java (at line 9)\n" +
36320 		"	Set<Cloneable> element1 = iterator.next();\n" +
36321 		"	                          ^^^^^^^^^^^^^^^\n" +
36322 		"Type mismatch: cannot convert from Cloneable to Set<Cloneable>\n" +
36323 		"----------\n" +
36324 		"2. WARNING in X.java (at line 10)\n" +
36325 		"	Set<Cloneable> element2 = (Set<Cloneable>) iterator.next(); // warning\n" +
36326 		"	                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
36327 		"Type safety: Unchecked cast from Cloneable to Set<Cloneable>\n" +
36328 		"----------\n");
36329 }
36330 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=148041 - variation
36331 public void test1064() {
36332 	this.runNegativeTest(
36333 		new String[] {
36334 			"X.java", // =================
36335 			"import java.util.HashSet;\n" +
36336 			"import java.util.Iterator;\n" +
36337 			"\n" +
36338 			"public class X {\n" +
36339 			"	public static void main(String[] args) {\n" +
36340 			"		HashSet<X> set = new HashSet<X>();\n" +
36341 			"		for (Iterator<X> iterator = set.iterator(); iterator.hasNext();) {\n" +
36342 			"			HashSet<X> element1 = iterator.next();\n" +
36343 			"			HashSet<X> element2 = (HashSet<X>) iterator.next();\n" +
36344 			"		}\n" +
36345 			"	}\n" +
36346 			"}", // =================
36347 		},
36348 		"----------\n" +
36349 		"1. ERROR in X.java (at line 8)\n" +
36350 		"	HashSet<X> element1 = iterator.next();\n" +
36351 		"	                      ^^^^^^^^^^^^^^^\n" +
36352 		"Type mismatch: cannot convert from X to HashSet<X>\n" +
36353 		"----------\n" +
36354 		"2. ERROR in X.java (at line 9)\n" +
36355 		"	HashSet<X> element2 = (HashSet<X>) iterator.next();\n" +
36356 		"	                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
36357 		"Cannot cast from X to HashSet<X>\n" +
36358 		"----------\n");
36359 }
36360 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=141289 - variation
36361 public void test1065() throws Exception {
36362 	runConformTest(
36363 		// test directory preparation
36364 		true /* flush output directory */,
36365 		new String[] { /* test files */
36366 			"X.java", // =================
36367 			"public class X {\n" +
36368 			"	void testFoo(boolean t, A a, B b) {\n" +
36369 			"		System.out.print((t ? a : b).foo());\n" +
36370 			"	}\n" +
36371 			"	void testBar(boolean t, A a, B b) {\n" +
36372 			"		System.out.print((t ? a : b).bar());\n" +
36373 			"	}\n" +
36374 			"	public static void main(String[] args) {\n" +
36375 			"		X x = new X();\n" +
36376 			"		A a = new A();\n" +
36377 			"		B b = new B();\n" +
36378 			"		x.testFoo(true, a, b);\n" +
36379 			"		x.testFoo(false, a, b);\n" +
36380 			"		x.testBar(true, a, b);\n" +
36381 			"		x.testBar(false, a, b);\n" +
36382 			"	}\n" +
36383 			"}\n" +
36384 			"interface Foo { 	String foo(); }\n" +
36385 			"interface Bar { String bar(); }\n" +
36386 			"class A implements Foo, Bar {\n" +
36387 			"	public String foo() { return \"[A#foo()]\"; }\n" +
36388 			"	public String bar() { return \"[A#bar()]\"; }\n" +
36389 			"}\n" +
36390 			"class B implements Foo, Bar {\n" +
36391 			"	public String foo() { return \"[B#foo()]\"; }\n" +
36392 			"	public String bar() { return \"[B#bar()]\"; }\n" +
36393 			"}\n", // =================
36394 		},
36395 		// compiler results
36396 		"" /* expected compiler log */,
36397 		// runtime results
36398 		"[A#foo()][B#foo()][A#bar()][B#bar()]" /* expected output string */,
36399 		"" /* expected error string */,
36400 		// javac options
36401 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
36402 	// 	check presence of checkcast in #testFoo() and #testBar()
36403 	String expectedOutput = this.complianceLevel == ClassFileConstants.JDK1_5
36404 			?	"  // Method descriptor #15 (ZLA;LB;)V\n" +
36405 				"  // Stack: 2, Locals: 4\n" +
36406 				"  void testFoo(boolean t, A a, B b);\n" +
36407 				"     0  getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
36408 				"     3  iload_1 [t]\n" +
36409 				"     4  ifeq 11\n" +
36410 				"     7  aload_2 [a]\n" +
36411 				"     8  goto 12\n" +
36412 				"    11  aload_3 [b]\n" +
36413 				"    12  invokeinterface Foo.foo() : java.lang.String [22] [nargs: 1]\n" +
36414 				"    17  invokevirtual java.io.PrintStream.print(java.lang.String) : void [28]\n" +
36415 				"    20  return\n" +
36416 				"      Line numbers:\n" +
36417 				"        [pc: 0, line: 3]\n" +
36418 				"        [pc: 20, line: 4]\n" +
36419 				"      Local variable table:\n" +
36420 				"        [pc: 0, pc: 21] local: this index: 0 type: X\n" +
36421 				"        [pc: 0, pc: 21] local: t index: 1 type: boolean\n" +
36422 				"        [pc: 0, pc: 21] local: a index: 2 type: A\n" +
36423 				"        [pc: 0, pc: 21] local: b index: 3 type: B\n" +
36424 				"  \n" +
36425 				"  // Method descriptor #15 (ZLA;LB;)V\n" +
36426 				"  // Stack: 2, Locals: 4\n" +
36427 				"  void testBar(boolean t, A a, B b);\n" +
36428 				"     0  getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
36429 				"     3  iload_1 [t]\n" +
36430 				"     4  ifeq 11\n" +
36431 				"     7  aload_2 [a]\n" +
36432 				"     8  goto 12\n" +
36433 				"    11  aload_3 [b]\n" +
36434 				"    12  checkcast Bar [41]\n" +
36435 				"    15  invokeinterface Bar.bar() : java.lang.String [43] [nargs: 1]\n" +
36436 				"    20  invokevirtual java.io.PrintStream.print(java.lang.String) : void [28]\n" +
36437 				"    23  return\n" +
36438 				"      Line numbers:\n" +
36439 				"        [pc: 0, line: 6]\n" +
36440 				"        [pc: 23, line: 7]\n" +
36441 				"      Local variable table:\n" +
36442 				"        [pc: 0, pc: 24] local: this index: 0 type: X\n" +
36443 				"        [pc: 0, pc: 24] local: t index: 1 type: boolean\n" +
36444 				"        [pc: 0, pc: 24] local: a index: 2 type: A\n" +
36445 				"        [pc: 0, pc: 24] local: b index: 3 type: B\n"
36446 			:	"  // Method descriptor #15 (ZLA;LB;)V\n" +
36447 				"  // Stack: 2, Locals: 4\n" +
36448 				"  void testFoo(boolean t, A a, B b);\n" +
36449 				"     0  getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
36450 				"     3  iload_1 [t]\n" +
36451 				"     4  ifeq 11\n" +
36452 				"     7  aload_2 [a]\n" +
36453 				"     8  goto 12\n" +
36454 				"    11  aload_3 [b]\n" +
36455 				"    12  invokeinterface Foo.foo() : java.lang.String [22] [nargs: 1]\n" +
36456 				"    17  invokevirtual java.io.PrintStream.print(java.lang.String) : void [28]\n" +
36457 				"    20  return\n" +
36458 				"      Line numbers:\n" +
36459 				"        [pc: 0, line: 3]\n" +
36460 				"        [pc: 20, line: 4]\n" +
36461 				"      Local variable table:\n" +
36462 				"        [pc: 0, pc: 21] local: this index: 0 type: X\n" +
36463 				"        [pc: 0, pc: 21] local: t index: 1 type: boolean\n" +
36464 				"        [pc: 0, pc: 21] local: a index: 2 type: A\n" +
36465 				"        [pc: 0, pc: 21] local: b index: 3 type: B\n" +
36466 				"      Stack map table: number of frames 2\n" +
36467 				"        [pc: 11, same_locals_1_stack_item, stack: {java.io.PrintStream}]\n" +
36468 				"        [pc: 12, full, stack: {java.io.PrintStream, Foo}, locals: {X, int, A, B}]\n" +
36469 				"  \n" +
36470 				"  // Method descriptor #15 (ZLA;LB;)V\n" +
36471 				"  // Stack: 2, Locals: 4\n" +
36472 				"  void testBar(boolean t, A a, B b);\n" +
36473 				"     0  getstatic java.lang.System.out : java.io.PrintStream [16]\n" +
36474 				"     3  iload_1 [t]\n" +
36475 				"     4  ifeq 11\n" +
36476 				"     7  aload_2 [a]\n" +
36477 				"     8  goto 12\n" +
36478 				"    11  aload_3 [b]\n" +
36479 				"    12  checkcast Bar [46]\n" +
36480 				"    15  invokeinterface Bar.bar() : java.lang.String [48] [nargs: 1]\n" +
36481 				"    20  invokevirtual java.io.PrintStream.print(java.lang.String) : void [28]\n" +
36482 				"    23  return\n" +
36483 				"      Line numbers:\n" +
36484 				"        [pc: 0, line: 6]\n" +
36485 				"        [pc: 23, line: 7]\n" +
36486 				"      Local variable table:\n" +
36487 				"        [pc: 0, pc: 24] local: this index: 0 type: X\n" +
36488 				"        [pc: 0, pc: 24] local: t index: 1 type: boolean\n" +
36489 				"        [pc: 0, pc: 24] local: a index: 2 type: A\n" +
36490 				"        [pc: 0, pc: 24] local: b index: 3 type: B\n" +
36491 				"      Stack map table: number of frames 2\n" +
36492 				"        [pc: 11, same_locals_1_stack_item, stack: {java.io.PrintStream}]\n" +
36493 				"        [pc: 12, full, stack: {java.io.PrintStream, Foo}, locals: {X, int, A, B}]\n";
36494 
36495 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
36496 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
36497 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
36498 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
36499 	int index = result.indexOf(expectedOutput);
36500 	if (index == -1 || expectedOutput.length() == 0) {
36501 		System.out.println(Util.displayString(result, 3));
36502 	}
36503 	if (index == -1) {
36504 		assertEquals("Wrong contents", expectedOutput, result);
36505 	}
36506 }
36507 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=141289 - variation
36508 public void test1066() throws Exception {
36509 	this.runConformTest(
36510 		new String[] {
36511 			"X.java", // =================
36512 			"import java.util.*;\n" +
36513 			"public class X {\n" +
36514 			"	public static void main(String[] args) {\n" +
36515 			"		X x = new X();\n" +
36516 			"		List l = new ArrayList();\n" +
36517 			"		l.add(\"zork\");\n" +
36518 			"		List<A> la = l;\n" +
36519 			"		List<B> lb = l;\n" +
36520 			"		boolean t = true, f = false;\n" +
36521 			"		try {\n" +
36522 			"			System.out.print((t ? la.get(0) : lb.get(0)).foo());\n" +
36523 			"		} catch (Throwable e) {\n" +
36524 			"			System.out.print(\"[\" + e.getClass().getSimpleName() + \":foo(1)]\");\n" +
36525 			"		}		\n" +
36526 			"		try {\n" +
36527 			"			System.out.print((f ? la.get(0) : lb.get(0)).foo());\n" +
36528 			"		} catch (Throwable e) {\n" +
36529 			"			System.out.print(\"[\" + e.getClass().getSimpleName() + \":foo(2)]\");\n" +
36530 			"		}		\n" +
36531 			"		try {\n" +
36532 			"			System.out.print((t ? la.get(0) : lb.get(0)).bar());\n" +
36533 			"		} catch (Throwable e) {\n" +
36534 			"			System.out.print(\"[\" + e.getClass().getSimpleName() + \":bar(1)]\");\n" +
36535 			"		}		\n" +
36536 			"		try {\n" +
36537 			"			System.out.print((f ? la.get(0) : lb.get(0)).bar());\n" +
36538 			"		} catch (Throwable e) {\n" +
36539 			"			System.out.print(\"[\" + e.getClass().getSimpleName() + \":bar(2)]\");\n" +
36540 			"		}		\n" +
36541 			"	}\n" +
36542 			"}\n" +
36543 			"interface Foo { 	String foo(); }\n" +
36544 			"interface Bar { String bar(); }\n" +
36545 			"abstract class A implements Foo, Bar { }\n" +
36546 			"abstract class B implements Foo, Bar { }\n", // =================
36547 		},
36548 		"[ClassCastException:foo(1)][ClassCastException:foo(2)][ClassCastException:bar(1)][ClassCastException:bar(2)]");
36549 	// 	check presence of checkcast
36550 	String expectedOutput = this.complianceLevel == ClassFileConstants.JDK1_5
36551 			?	"  // Stack: 4, Locals: 8\n" +
36552 				"  public static void main(java.lang.String[] args);\n" +
36553 				"      0  new X [1]\n" +
36554 				"      3  dup\n" +
36555 				"      4  invokespecial X() [16]\n" +
36556 				"      7  astore_1 [x]\n" +
36557 				"      8  new java.util.ArrayList [17]\n" +
36558 				"     11  dup\n" +
36559 				"     12  invokespecial java.util.ArrayList() [19]\n" +
36560 				"     15  astore_2 [l]\n" +
36561 				"     16  aload_2 [l]\n" +
36562 				"     17  ldc <String \"zork\"> [20]\n" +
36563 				"     19  invokeinterface java.util.List.add(java.lang.Object) : boolean [22] [nargs: 2]\n" +
36564 				"     24  pop\n" +
36565 				"     25  aload_2 [l]\n" +
36566 				"     26  astore_3 [la]\n" +
36567 				"     27  aload_2 [l]\n" +
36568 				"     28  astore 4 [lb]\n" +
36569 				"     30  iconst_1\n" +
36570 				"     31  istore 5 [t]\n" +
36571 				"     33  iconst_0\n" +
36572 				"     34  istore 6 [f]\n" +
36573 				"     36  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
36574 				"     39  iload 5 [t]\n" +
36575 				"     41  ifeq 57\n" +
36576 				"     44  aload_3 [la]\n" +
36577 				"     45  iconst_0\n" +
36578 				"     46  invokeinterface java.util.List.get(int) : java.lang.Object [34] [nargs: 2]\n" +
36579 				"     51  checkcast Foo [38]\n" +
36580 				"     54  goto 68\n" +
36581 				"     57  aload 4 [lb]\n" +
36582 				"     59  iconst_0\n" +
36583 				"     60  invokeinterface java.util.List.get(int) : java.lang.Object [34] [nargs: 2]\n" +
36584 				"     65  checkcast Foo [38]\n" +
36585 				"     68  invokeinterface Foo.foo() : java.lang.String [40] [nargs: 1]\n" +
36586 				"     73  invokevirtual java.io.PrintStream.print(java.lang.String) : void [44]\n" +
36587 				"     76  goto 115\n" +
36588 				"     79  astore 7 [e]\n" +
36589 				"     81  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
36590 				"     84  new java.lang.StringBuilder [50]\n" +
36591 				"     87  dup\n" +
36592 				"     88  ldc <String \"[\"> [52]\n" +
36593 				"     90  invokespecial java.lang.StringBuilder(java.lang.String) [54]\n" +
36594 				"     93  aload 7 [e]\n" +
36595 				"     95  invokevirtual java.lang.Object.getClass() : java.lang.Class [56]\n" +
36596 				"     98  invokevirtual java.lang.Class.getSimpleName() : java.lang.String [60]\n" +
36597 				"    101  invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [65]\n" +
36598 				"    104  ldc <String \":foo(1)]\"> [69]\n" +
36599 				"    106  invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [65]\n" +
36600 				"    109  invokevirtual java.lang.StringBuilder.toString() : java.lang.String [71]\n" +
36601 				"    112  invokevirtual java.io.PrintStream.print(java.lang.String) : void [44]\n" +
36602 				"    115  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
36603 				"    118  iload 6 [f]\n" +
36604 				"    120  ifeq 136\n" +
36605 				"    123  aload_3 [la]\n" +
36606 				"    124  iconst_0\n" +
36607 				"    125  invokeinterface java.util.List.get(int) : java.lang.Object [34] [nargs: 2]\n" +
36608 				"    130  checkcast Foo [38]\n" +
36609 				"    133  goto 147\n" +
36610 				"    136  aload 4 [lb]\n" +
36611 				"    138  iconst_0\n" +
36612 				"    139  invokeinterface java.util.List.get(int) : java.lang.Object [34] [nargs: 2]\n" +
36613 				"    144  checkcast Foo [38]\n" +
36614 				"    147  invokeinterface Foo.foo() : java.lang.String [40] [nargs: 1]\n" +
36615 				"    152  invokevirtual java.io.PrintStream.print(java.lang.String) : void [44]\n" +
36616 				"    155  goto 194\n" +
36617 				"    158  astore 7 [e]\n" +
36618 				"    160  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
36619 				"    163  new java.lang.StringBuilder [50]\n" +
36620 				"    166  dup\n" +
36621 				"    167  ldc <String \"[\"> [52]\n" +
36622 				"    169  invokespecial java.lang.StringBuilder(java.lang.String) [54]\n" +
36623 				"    172  aload 7 [e]\n" +
36624 				"    174  invokevirtual java.lang.Object.getClass() : java.lang.Class [56]\n" +
36625 				"    177  invokevirtual java.lang.Class.getSimpleName() : java.lang.String [60]\n" +
36626 				"    180  invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [65]\n" +
36627 				"    183  ldc <String \":foo(2)]\"> [74]\n" +
36628 				"    185  invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [65]\n" +
36629 				"    188  invokevirtual java.lang.StringBuilder.toString() : java.lang.String [71]\n" +
36630 				"    191  invokevirtual java.io.PrintStream.print(java.lang.String) : void [44]\n" +
36631 				"    194  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
36632 				"    197  iload 5 [t]\n" +
36633 				"    199  ifeq 215\n" +
36634 				"    202  aload_3 [la]\n" +
36635 				"    203  iconst_0\n" +
36636 				"    204  invokeinterface java.util.List.get(int) : java.lang.Object [34] [nargs: 2]\n" +
36637 				"    209  checkcast Foo [38]\n" +
36638 				"    212  goto 226\n" +
36639 				"    215  aload 4 [lb]\n" +
36640 				"    217  iconst_0\n" +
36641 				"    218  invokeinterface java.util.List.get(int) : java.lang.Object [34] [nargs: 2]\n" +
36642 				"    223  checkcast Foo [38]\n" +
36643 				"    226  checkcast Bar [76]\n" +
36644 				"    229  invokeinterface Bar.bar() : java.lang.String [78] [nargs: 1]\n" +
36645 				"    234  invokevirtual java.io.PrintStream.print(java.lang.String) : void [44]\n" +
36646 				"    237  goto 276\n" +
36647 				"    240  astore 7 [e]\n" +
36648 				"    242  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
36649 				"    245  new java.lang.StringBuilder [50]\n" +
36650 				"    248  dup\n" +
36651 				"    249  ldc <String \"[\"> [52]\n" +
36652 				"    251  invokespecial java.lang.StringBuilder(java.lang.String) [54]\n" +
36653 				"    254  aload 7 [e]\n" +
36654 				"    256  invokevirtual java.lang.Object.getClass() : java.lang.Class [56]\n" +
36655 				"    259  invokevirtual java.lang.Class.getSimpleName() : java.lang.String [60]\n" +
36656 				"    262  invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [65]\n" +
36657 				"    265  ldc <String \":bar(1)]\"> [81]\n" +
36658 				"    267  invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [65]\n" +
36659 				"    270  invokevirtual java.lang.StringBuilder.toString() : java.lang.String [71]\n" +
36660 				"    273  invokevirtual java.io.PrintStream.print(java.lang.String) : void [44]\n" +
36661 				"    276  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
36662 				"    279  iload 6 [f]\n" +
36663 				"    281  ifeq 297\n" +
36664 				"    284  aload_3 [la]\n" +
36665 				"    285  iconst_0\n" +
36666 				"    286  invokeinterface java.util.List.get(int) : java.lang.Object [34] [nargs: 2]\n" +
36667 				"    291  checkcast Foo [38]\n" +
36668 				"    294  goto 308\n" +
36669 				"    297  aload 4 [lb]\n" +
36670 				"    299  iconst_0\n" +
36671 				"    300  invokeinterface java.util.List.get(int) : java.lang.Object [34] [nargs: 2]\n" +
36672 				"    305  checkcast Foo [38]\n" +
36673 				"    308  checkcast Bar [76]\n" +
36674 				"    311  invokeinterface Bar.bar() : java.lang.String [78] [nargs: 1]\n" +
36675 				"    316  invokevirtual java.io.PrintStream.print(java.lang.String) : void [44]\n" +
36676 				"    319  goto 358\n" +
36677 				"    322  astore 7 [e]\n" +
36678 				"    324  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
36679 				"    327  new java.lang.StringBuilder [50]\n" +
36680 				"    330  dup\n" +
36681 				"    331  ldc <String \"[\"> [52]\n" +
36682 				"    333  invokespecial java.lang.StringBuilder(java.lang.String) [54]\n" +
36683 				"    336  aload 7 [e]\n" +
36684 				"    338  invokevirtual java.lang.Object.getClass() : java.lang.Class [56]\n" +
36685 				"    341  invokevirtual java.lang.Class.getSimpleName() : java.lang.String [60]\n" +
36686 				"    344  invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [65]\n" +
36687 				"    347  ldc <String \":bar(2)]\"> [83]\n" +
36688 				"    349  invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [65]\n" +
36689 				"    352  invokevirtual java.lang.StringBuilder.toString() : java.lang.String [71]\n" +
36690 				"    355  invokevirtual java.io.PrintStream.print(java.lang.String) : void [44]\n" +
36691 				"    358  return\n" +
36692 				"      Exception Table:\n" +
36693 				"        [pc: 36, pc: 76] -> 79 when : java.lang.Throwable\n" +
36694 				"        [pc: 115, pc: 155] -> 158 when : java.lang.Throwable\n" +
36695 				"        [pc: 194, pc: 237] -> 240 when : java.lang.Throwable\n" +
36696 				"        [pc: 276, pc: 319] -> 322 when : java.lang.Throwable\n" +
36697 				"      Line numbers:\n" +
36698 				"        [pc: 0, line: 4]\n" +
36699 				"        [pc: 8, line: 5]\n" +
36700 				"        [pc: 16, line: 6]\n" +
36701 				"        [pc: 25, line: 7]\n" +
36702 				"        [pc: 27, line: 8]\n" +
36703 				"        [pc: 30, line: 9]\n" +
36704 				"        [pc: 36, line: 11]\n" +
36705 				"        [pc: 76, line: 12]\n" +
36706 				"        [pc: 81, line: 13]\n" +
36707 				"        [pc: 115, line: 16]\n" +
36708 				"        [pc: 155, line: 17]\n" +
36709 				"        [pc: 160, line: 18]\n" +
36710 				"        [pc: 194, line: 21]\n" +
36711 				"        [pc: 237, line: 22]\n" +
36712 				"        [pc: 242, line: 23]\n" +
36713 				"        [pc: 276, line: 26]\n" +
36714 				"        [pc: 319, line: 27]\n" +
36715 				"        [pc: 324, line: 28]\n" +
36716 				"        [pc: 358, line: 30]\n" +
36717 				"      Local variable table:\n" +
36718 				"        [pc: 0, pc: 359] local: args index: 0 type: java.lang.String[]\n" +
36719 				"        [pc: 8, pc: 359] local: x index: 1 type: X\n" +
36720 				"        [pc: 16, pc: 359] local: l index: 2 type: java.util.List\n" +
36721 				"        [pc: 27, pc: 359] local: la index: 3 type: java.util.List\n" +
36722 				"        [pc: 30, pc: 359] local: lb index: 4 type: java.util.List\n" +
36723 				"        [pc: 33, pc: 359] local: t index: 5 type: boolean\n" +
36724 				"        [pc: 36, pc: 359] local: f index: 6 type: boolean\n" +
36725 				"        [pc: 81, pc: 115] local: e index: 7 type: java.lang.Throwable\n" +
36726 				"        [pc: 160, pc: 194] local: e index: 7 type: java.lang.Throwable\n" +
36727 				"        [pc: 242, pc: 276] local: e index: 7 type: java.lang.Throwable\n" +
36728 				"        [pc: 324, pc: 358] local: e index: 7 type: java.lang.Throwable\n" +
36729 				"      Local variable type table:\n" +
36730 				"        [pc: 27, pc: 359] local: la index: 3 type: java.util.List<A>\n" +
36731 				"        [pc: 30, pc: 359] local: lb index: 4 type: java.util.List<B>\n"
36732 			:	"  // Method descriptor #15 ([Ljava/lang/String;)V\n" +
36733 				"  // Stack: 4, Locals: 8\n" +
36734 				"  public static void main(java.lang.String[] args);\n" +
36735 				"      0  new X [1]\n" +
36736 				"      3  dup\n" +
36737 				"      4  invokespecial X() [16]\n" +
36738 				"      7  astore_1 [x]\n" +
36739 				"      8  new java.util.ArrayList [17]\n" +
36740 				"     11  dup\n" +
36741 				"     12  invokespecial java.util.ArrayList() [19]\n" +
36742 				"     15  astore_2 [l]\n" +
36743 				"     16  aload_2 [l]\n" +
36744 				"     17  ldc <String \"zork\"> [20]\n" +
36745 				"     19  invokeinterface java.util.List.add(java.lang.Object) : boolean [22] [nargs: 2]\n" +
36746 				"     24  pop\n" +
36747 				"     25  aload_2 [l]\n" +
36748 				"     26  astore_3 [la]\n" +
36749 				"     27  aload_2 [l]\n" +
36750 				"     28  astore 4 [lb]\n" +
36751 				"     30  iconst_1\n" +
36752 				"     31  istore 5 [t]\n" +
36753 				"     33  iconst_0\n" +
36754 				"     34  istore 6 [f]\n" +
36755 				"     36  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
36756 				"     39  iload 5 [t]\n" +
36757 				"     41  ifeq 57\n" +
36758 				"     44  aload_3 [la]\n" +
36759 				"     45  iconst_0\n" +
36760 				"     46  invokeinterface java.util.List.get(int) : java.lang.Object [34] [nargs: 2]\n" +
36761 				"     51  checkcast Foo [38]\n" +
36762 				"     54  goto 68\n" +
36763 				"     57  aload 4 [lb]\n" +
36764 				"     59  iconst_0\n" +
36765 				"     60  invokeinterface java.util.List.get(int) : java.lang.Object [34] [nargs: 2]\n" +
36766 				"     65  checkcast Foo [38]\n" +
36767 				"     68  invokeinterface Foo.foo() : java.lang.String [40] [nargs: 1]\n" +
36768 				"     73  invokevirtual java.io.PrintStream.print(java.lang.String) : void [44]\n" +
36769 				"     76  goto 115\n" +
36770 				"     79  astore 7 [e]\n" +
36771 				"     81  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
36772 				"     84  new java.lang.StringBuilder [50]\n" +
36773 				"     87  dup\n" +
36774 				"     88  ldc <String \"[\"> [52]\n" +
36775 				"     90  invokespecial java.lang.StringBuilder(java.lang.String) [54]\n" +
36776 				"     93  aload 7 [e]\n" +
36777 				"     95  invokevirtual java.lang.Object.getClass() : java.lang.Class [56]\n" +
36778 				"     98  invokevirtual java.lang.Class.getSimpleName() : java.lang.String [60]\n" +
36779 				"    101  invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [65]\n" +
36780 				"    104  ldc <String \":foo(1)]\"> [69]\n" +
36781 				"    106  invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [65]\n" +
36782 				"    109  invokevirtual java.lang.StringBuilder.toString() : java.lang.String [71]\n" +
36783 				"    112  invokevirtual java.io.PrintStream.print(java.lang.String) : void [44]\n" +
36784 				"    115  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
36785 				"    118  iload 6 [f]\n" +
36786 				"    120  ifeq 136\n" +
36787 				"    123  aload_3 [la]\n" +
36788 				"    124  iconst_0\n" +
36789 				"    125  invokeinterface java.util.List.get(int) : java.lang.Object [34] [nargs: 2]\n" +
36790 				"    130  checkcast Foo [38]\n" +
36791 				"    133  goto 147\n" +
36792 				"    136  aload 4 [lb]\n" +
36793 				"    138  iconst_0\n" +
36794 				"    139  invokeinterface java.util.List.get(int) : java.lang.Object [34] [nargs: 2]\n" +
36795 				"    144  checkcast Foo [38]\n" +
36796 				"    147  invokeinterface Foo.foo() : java.lang.String [40] [nargs: 1]\n" +
36797 				"    152  invokevirtual java.io.PrintStream.print(java.lang.String) : void [44]\n" +
36798 				"    155  goto 194\n" +
36799 				"    158  astore 7 [e]\n" +
36800 				"    160  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
36801 				"    163  new java.lang.StringBuilder [50]\n" +
36802 				"    166  dup\n" +
36803 				"    167  ldc <String \"[\"> [52]\n" +
36804 				"    169  invokespecial java.lang.StringBuilder(java.lang.String) [54]\n" +
36805 				"    172  aload 7 [e]\n" +
36806 				"    174  invokevirtual java.lang.Object.getClass() : java.lang.Class [56]\n" +
36807 				"    177  invokevirtual java.lang.Class.getSimpleName() : java.lang.String [60]\n" +
36808 				"    180  invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [65]\n" +
36809 				"    183  ldc <String \":foo(2)]\"> [74]\n" +
36810 				"    185  invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [65]\n" +
36811 				"    188  invokevirtual java.lang.StringBuilder.toString() : java.lang.String [71]\n" +
36812 				"    191  invokevirtual java.io.PrintStream.print(java.lang.String) : void [44]\n" +
36813 				"    194  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
36814 				"    197  iload 5 [t]\n" +
36815 				"    199  ifeq 215\n" +
36816 				"    202  aload_3 [la]\n" +
36817 				"    203  iconst_0\n" +
36818 				"    204  invokeinterface java.util.List.get(int) : java.lang.Object [34] [nargs: 2]\n" +
36819 				"    209  checkcast Foo [38]\n" +
36820 				"    212  goto 226\n" +
36821 				"    215  aload 4 [lb]\n" +
36822 				"    217  iconst_0\n" +
36823 				"    218  invokeinterface java.util.List.get(int) : java.lang.Object [34] [nargs: 2]\n" +
36824 				"    223  checkcast Foo [38]\n" +
36825 				"    226  checkcast Bar [76]\n" +
36826 				"    229  invokeinterface Bar.bar() : java.lang.String [78] [nargs: 1]\n" +
36827 				"    234  invokevirtual java.io.PrintStream.print(java.lang.String) : void [44]\n" +
36828 				"    237  goto 276\n" +
36829 				"    240  astore 7 [e]\n" +
36830 				"    242  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
36831 				"    245  new java.lang.StringBuilder [50]\n" +
36832 				"    248  dup\n" +
36833 				"    249  ldc <String \"[\"> [52]\n" +
36834 				"    251  invokespecial java.lang.StringBuilder(java.lang.String) [54]\n" +
36835 				"    254  aload 7 [e]\n" +
36836 				"    256  invokevirtual java.lang.Object.getClass() : java.lang.Class [56]\n" +
36837 				"    259  invokevirtual java.lang.Class.getSimpleName() : java.lang.String [60]\n" +
36838 				"    262  invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [65]\n" +
36839 				"    265  ldc <String \":bar(1)]\"> [81]\n" +
36840 				"    267  invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [65]\n" +
36841 				"    270  invokevirtual java.lang.StringBuilder.toString() : java.lang.String [71]\n" +
36842 				"    273  invokevirtual java.io.PrintStream.print(java.lang.String) : void [44]\n" +
36843 				"    276  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
36844 				"    279  iload 6 [f]\n" +
36845 				"    281  ifeq 297\n" +
36846 				"    284  aload_3 [la]\n" +
36847 				"    285  iconst_0\n" +
36848 				"    286  invokeinterface java.util.List.get(int) : java.lang.Object [34] [nargs: 2]\n" +
36849 				"    291  checkcast Foo [38]\n" +
36850 				"    294  goto 308\n" +
36851 				"    297  aload 4 [lb]\n" +
36852 				"    299  iconst_0\n" +
36853 				"    300  invokeinterface java.util.List.get(int) : java.lang.Object [34] [nargs: 2]\n" +
36854 				"    305  checkcast Foo [38]\n" +
36855 				"    308  checkcast Bar [76]\n" +
36856 				"    311  invokeinterface Bar.bar() : java.lang.String [78] [nargs: 1]\n" +
36857 				"    316  invokevirtual java.io.PrintStream.print(java.lang.String) : void [44]\n" +
36858 				"    319  goto 358\n" +
36859 				"    322  astore 7 [e]\n" +
36860 				"    324  getstatic java.lang.System.out : java.io.PrintStream [28]\n" +
36861 				"    327  new java.lang.StringBuilder [50]\n" +
36862 				"    330  dup\n" +
36863 				"    331  ldc <String \"[\"> [52]\n" +
36864 				"    333  invokespecial java.lang.StringBuilder(java.lang.String) [54]\n" +
36865 				"    336  aload 7 [e]\n" +
36866 				"    338  invokevirtual java.lang.Object.getClass() : java.lang.Class [56]\n" +
36867 				"    341  invokevirtual java.lang.Class.getSimpleName() : java.lang.String [60]\n" +
36868 				"    344  invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [65]\n" +
36869 				"    347  ldc <String \":bar(2)]\"> [83]\n" +
36870 				"    349  invokevirtual java.lang.StringBuilder.append(java.lang.String) : java.lang.StringBuilder [65]\n" +
36871 				"    352  invokevirtual java.lang.StringBuilder.toString() : java.lang.String [71]\n" +
36872 				"    355  invokevirtual java.io.PrintStream.print(java.lang.String) : void [44]\n" +
36873 				"    358  return\n" +
36874 				"      Exception Table:\n" +
36875 				"        [pc: 36, pc: 76] -> 79 when : java.lang.Throwable\n" +
36876 				"        [pc: 115, pc: 155] -> 158 when : java.lang.Throwable\n" +
36877 				"        [pc: 194, pc: 237] -> 240 when : java.lang.Throwable\n" +
36878 				"        [pc: 276, pc: 319] -> 322 when : java.lang.Throwable\n" +
36879 				"      Line numbers:\n" +
36880 				"        [pc: 0, line: 4]\n" +
36881 				"        [pc: 8, line: 5]\n" +
36882 				"        [pc: 16, line: 6]\n" +
36883 				"        [pc: 25, line: 7]\n" +
36884 				"        [pc: 27, line: 8]\n" +
36885 				"        [pc: 30, line: 9]\n" +
36886 				"        [pc: 36, line: 11]\n" +
36887 				"        [pc: 76, line: 12]\n" +
36888 				"        [pc: 81, line: 13]\n" +
36889 				"        [pc: 115, line: 16]\n" +
36890 				"        [pc: 155, line: 17]\n" +
36891 				"        [pc: 160, line: 18]\n" +
36892 				"        [pc: 194, line: 21]\n" +
36893 				"        [pc: 237, line: 22]\n" +
36894 				"        [pc: 242, line: 23]\n" +
36895 				"        [pc: 276, line: 26]\n" +
36896 				"        [pc: 319, line: 27]\n" +
36897 				"        [pc: 324, line: 28]\n" +
36898 				"        [pc: 358, line: 30]\n" +
36899 				"      Local variable table:\n" +
36900 				"        [pc: 0, pc: 359] local: args index: 0 type: java.lang.String[]\n" +
36901 				"        [pc: 8, pc: 359] local: x index: 1 type: X\n" +
36902 				"        [pc: 16, pc: 359] local: l index: 2 type: java.util.List\n" +
36903 				"        [pc: 27, pc: 359] local: la index: 3 type: java.util.List\n" +
36904 				"        [pc: 30, pc: 359] local: lb index: 4 type: java.util.List\n" +
36905 				"        [pc: 33, pc: 359] local: t index: 5 type: boolean\n" +
36906 				"        [pc: 36, pc: 359] local: f index: 6 type: boolean\n" +
36907 				"        [pc: 81, pc: 115] local: e index: 7 type: java.lang.Throwable\n" +
36908 				"        [pc: 160, pc: 194] local: e index: 7 type: java.lang.Throwable\n" +
36909 				"        [pc: 242, pc: 276] local: e index: 7 type: java.lang.Throwable\n" +
36910 				"        [pc: 324, pc: 358] local: e index: 7 type: java.lang.Throwable\n" +
36911 				"      Local variable type table:\n" +
36912 				"        [pc: 27, pc: 359] local: la index: 3 type: java.util.List<A>\n" +
36913 				"        [pc: 30, pc: 359] local: lb index: 4 type: java.util.List<B>\n" +
36914 				"      Stack map table: number of frames 16\n" +
36915 				"        [pc: 57, full, stack: {java.io.PrintStream}, locals: {java.lang.String[], X, java.util.List, java.util.List, java.util.List, int, int}]\n" +
36916 				"        [pc: 68, full, stack: {java.io.PrintStream, Foo}, locals: {java.lang.String[], X, java.util.List, java.util.List, java.util.List, int, int}]\n" +
36917 				"        [pc: 79, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n" +
36918 				"        [pc: 115, same]\n" +
36919 				"        [pc: 136, same_locals_1_stack_item, stack: {java.io.PrintStream}]\n" +
36920 				"        [pc: 147, full, stack: {java.io.PrintStream, Foo}, locals: {java.lang.String[], X, java.util.List, java.util.List, java.util.List, int, int}]\n" +
36921 				"        [pc: 158, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n" +
36922 				"        [pc: 194, same]\n" +
36923 				"        [pc: 215, same_locals_1_stack_item, stack: {java.io.PrintStream}]\n" +
36924 				"        [pc: 226, full, stack: {java.io.PrintStream, Foo}, locals: {java.lang.String[], X, java.util.List, java.util.List, java.util.List, int, int}]\n" +
36925 				"        [pc: 240, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n" +
36926 				"        [pc: 276, same]\n" +
36927 				"        [pc: 297, same_locals_1_stack_item, stack: {java.io.PrintStream}]\n" +
36928 				"        [pc: 308, full, stack: {java.io.PrintStream, Foo}, locals: {java.lang.String[], X, java.util.List, java.util.List, java.util.List, int, int}]\n" +
36929 				"        [pc: 322, same_locals_1_stack_item, stack: {java.lang.Throwable}]\n" +
36930 				"        [pc: 358, same]\n";
36931 
36932 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
36933 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
36934 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
36935 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
36936 	int index = result.indexOf(expectedOutput);
36937 	if (index == -1 || expectedOutput.length() == 0) {
36938 		System.out.println(Util.displayString(result, 3));
36939 	}
36940 	if (index == -1) {
36941 		assertEquals("Wrong contents", expectedOutput, result);
36942 	}
36943 }
36944 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=162991
36945 // using only source types
36946 public void test1067() {
36947 	this.runConformTest(
36948 		new String[] {
36949 			"Something.java",
36950 			"public interface Something {\n" +
36951 			"\n" +
36952 			"}", // =================
36953 			"Doing.java", // =================
36954 			"public interface Doing {\n" +
36955 			"        public <S extends Something, T extends S> T get(Class<S> clazz);\n" +
36956 			"}", // =================
36957 			"DoingImpl.java", // =================
36958 			"public class DoingImpl implements Doing {\n" +
36959 			"        public <S extends Something, T extends S> T get(Class<S> clazz) {\n" +
36960 			"                return null;\n" +
36961 			"        }\n" +
36962 			"}" // =================
36963 		},
36964 		"");
36965 }
36966 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=162991
36967 // using source and binary types
36968 public void test1068() {
36969 	this.runConformTest(
36970 		new String[] {
36971 			"Something.java",
36972 			"public interface Something {\n" +
36973 			"\n" +
36974 			"}", // =================
36975 			"Doing.java", // =================
36976 			"public interface Doing {\n" +
36977 			"        public <S extends Something, T extends S> T get(Class<S> clazz);\n" +
36978 			"}", // =================
36979 		},
36980 		"");
36981 	this.runConformTest(
36982 		new String[] {
36983 			"DoingImpl.java", // =================
36984 			"public class DoingImpl implements Doing {\n" +
36985 			"        public <S extends Something, T extends S> T get(Class<S> clazz) {\n" +
36986 			"                return null;\n" +
36987 			"        }\n" +
36988 			"}" // =================
36989 		},
36990 		"",
36991 		null,
36992 		false,
36993 		null);
36994 }
36995 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=163262
36996 public void test1069() {
36997 	this.runConformTest(
36998 		new String[] {
36999 			"Bug.java", // =================
37000 			"public class Bug<A> {\n" +
37001 			"   void bug() {\n" +
37002 			"      new Runnable() {\n" +
37003 			"         public void run() {\n" +
37004 			"            Bug<A> bug = Bug.this;\n" +
37005 			"         }\n" +
37006 			"      };\n" +
37007 			"   }\n" +
37008 			"}",
37009 		},
37010 		"");
37011 }
37012 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=163262
37013 public void test1070() {
37014 	this.runConformTest(
37015 		new String[] {
37016 			"Bug.java", // =================
37017 			"public class Bug<A> {\n" +
37018 			"   Bug<A> reproduce() {\n" +
37019 			"      return Bug.this;\n" +
37020 			"   }\n" +
37021 			"}",
37022 		},
37023 		"");
37024 }
37025 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=159939
37026 public void test1071() {
37027 	this.runNegativeTest(
37028 		new String[] {
37029 			"X.java", // =================
37030 			"import java.util.*;\n" +
37031 			"public class X {\n" +
37032 			"        List<void[]> x = null;\n" +
37033 			"        void[] y;\n" +
37034 			"        void[] foo(void[] arg) {\n" +
37035 			"                void[] local;\n" +
37036 			"        }\n" +
37037 			"}",
37038 		},
37039 		"----------\n" +
37040 		"1. ERROR in X.java (at line 3)\n" +
37041 		"	List<void[]> x = null;\n" +
37042 		"	     ^^^^^^\n" +
37043 		"void[] is an invalid type\n" +
37044 		"----------\n" +
37045 		"2. ERROR in X.java (at line 4)\n" +
37046 		"	void[] y;\n" +
37047 		"	^^^^^^\n" +
37048 		"void[] is an invalid type\n" +
37049 		"----------\n" +
37050 		"3. ERROR in X.java (at line 5)\n" +
37051 		"	void[] foo(void[] arg) {\n" +
37052 		"	^^^^^^\n" +
37053 		"void[] is an invalid type\n" +
37054 		"----------\n" +
37055 		"4. ERROR in X.java (at line 5)\n" +
37056 		"	void[] foo(void[] arg) {\n" +
37057 		"	           ^^^^^^\n" +
37058 		"void[] is an invalid type\n" +
37059 		"----------\n" +
37060 		"5. ERROR in X.java (at line 6)\n" +
37061 		"	void[] local;\n" +
37062 		"	^^^^^^\n" +
37063 		"void[] is an invalid type\n" +
37064 		"----------\n");
37065 }
37066 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=159939
37067 public void test1072() {
37068 	Map options = getCompilerOptions();
37069 	options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
37070 	this.runNegativeTest(
37071 		new String[] {
37072 			"X.java", // =================
37073 			"import java.util.*;\n" +
37074 			"public class X {\n" +
37075 			"        List<void[]> x = null;\n" +
37076 			"        void[] y;\n" +
37077 			"        void[] foo(void[] arg) {\n" +
37078 			"                void[] local;\n" +
37079 			"                Class c = void[].class;\n" +
37080 			"        }\n" +
37081 			"}",
37082 		},
37083 		"----------\n" +
37084 		"1. ERROR in X.java (at line 3)\n" +
37085 		"	List<void[]> x = null;\n" +
37086 		"	     ^^^^^^\n" +
37087 		"void[] is an invalid type\n" +
37088 		"----------\n" +
37089 		"2. ERROR in X.java (at line 4)\n" +
37090 		"	void[] y;\n" +
37091 		"	^^^^^^\n" +
37092 		"void[] is an invalid type\n" +
37093 		"----------\n" +
37094 		"3. ERROR in X.java (at line 5)\n" +
37095 		"	void[] foo(void[] arg) {\n" +
37096 		"	^^^^^^\n" +
37097 		"void[] is an invalid type\n" +
37098 		"----------\n" +
37099 		"4. ERROR in X.java (at line 5)\n" +
37100 		"	void[] foo(void[] arg) {\n" +
37101 		"	           ^^^^^^\n" +
37102 		"void[] is an invalid type\n" +
37103 		"----------\n" +
37104 		"5. ERROR in X.java (at line 6)\n" +
37105 		"	void[] local;\n" +
37106 		"	^^^^^^\n" +
37107 		"void[] is an invalid type\n" +
37108 		"----------\n" +
37109 		"6. ERROR in X.java (at line 7)\n" +
37110 		"	Class c = void[].class;\n" +
37111 		"	          ^^^^^^\n" +
37112 		"void[] is an invalid type\n" +
37113 		"----------\n",
37114 		null,
37115 		true,
37116 		options);
37117 }
37118 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=159939
37119 public void test1073() {
37120 	Map options = getCompilerOptions();
37121 	options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
37122 	this.runNegativeTest(
37123 		new String[] {
37124 			"X.java", // =================
37125 			"import java.util.*;\n" +
37126 			"public class X {\n" +
37127 			"        List<void[]> x = null;\n" +
37128 			"        void[] y;\n" +
37129 			"        void[] foo(void[] arg) {\n" +
37130 			"                try {\n" +
37131 			"                        void[] local;\n" +
37132 			"                        Class c = void[].class;\n" +
37133 			"                } catch(void[] e) {\n" +
37134 			"                }\n" +
37135 			"        }\n" +
37136 			"}",
37137 		},
37138 		"----------\n" +
37139 		"1. ERROR in X.java (at line 3)\n" +
37140 		"	List<void[]> x = null;\n" +
37141 		"	     ^^^^^^\n" +
37142 		"void[] is an invalid type\n" +
37143 		"----------\n" +
37144 		"2. ERROR in X.java (at line 4)\n" +
37145 		"	void[] y;\n" +
37146 		"	^^^^^^\n" +
37147 		"void[] is an invalid type\n" +
37148 		"----------\n" +
37149 		"3. ERROR in X.java (at line 5)\n" +
37150 		"	void[] foo(void[] arg) {\n" +
37151 		"	^^^^^^\n" +
37152 		"void[] is an invalid type\n" +
37153 		"----------\n" +
37154 		"4. ERROR in X.java (at line 5)\n" +
37155 		"	void[] foo(void[] arg) {\n" +
37156 		"	           ^^^^^^\n" +
37157 		"void[] is an invalid type\n" +
37158 		"----------\n" +
37159 		"5. ERROR in X.java (at line 7)\n" +
37160 		"	void[] local;\n" +
37161 		"	^^^^^^\n" +
37162 		"void[] is an invalid type\n" +
37163 		"----------\n" +
37164 		"6. ERROR in X.java (at line 8)\n" +
37165 		"	Class c = void[].class;\n" +
37166 		"	          ^^^^^^\n" +
37167 		"void[] is an invalid type\n" +
37168 		"----------\n" +
37169 		"7. ERROR in X.java (at line 9)\n" +
37170 		"	} catch(void[] e) {\n" +
37171 		"	        ^^^^^^\n" +
37172 		"void[] is an invalid type\n" +
37173 		"----------\n",
37174 		null,
37175 		true,
37176 		options);
37177 }
37178 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=159939
37179 public void test1074() {
37180 	Map options = getCompilerOptions();
37181 	options.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
37182 	this.runNegativeTest(
37183 		new String[] {
37184 			"X.java", // =================
37185 			"import java.util.*;\n" +
37186 			"public class X {\n" +
37187 			"        List<void[]> x = null;\n" +
37188 			"        void[] y;\n" +
37189 			"        void[] foo(void[] arg) {\n" +
37190 			"                try {\n" +
37191 			"                        void[] local = new void[0];\n" +
37192 			"                        void[] local1 = new void[]{ null, null };\n" +
37193 			"                        void[] local2 = { null, null };\n" +
37194 			"                        System.out.println((void[]) null);\n" +
37195 			"                        Class c = void[].class;\n" +
37196 			"                } catch(void[] e) {\n" +
37197 			"                }\n" +
37198 			"        }\n" +
37199 			"}",
37200 		},
37201 		"----------\n" +
37202 		"1. ERROR in X.java (at line 3)\n" +
37203 		"	List<void[]> x = null;\n" +
37204 		"	     ^^^^^^\n" +
37205 		"void[] is an invalid type\n" +
37206 		"----------\n" +
37207 		"2. ERROR in X.java (at line 4)\n" +
37208 		"	void[] y;\n" +
37209 		"	^^^^^^\n" +
37210 		"void[] is an invalid type\n" +
37211 		"----------\n" +
37212 		"3. ERROR in X.java (at line 5)\n" +
37213 		"	void[] foo(void[] arg) {\n" +
37214 		"	^^^^^^\n" +
37215 		"void[] is an invalid type\n" +
37216 		"----------\n" +
37217 		"4. ERROR in X.java (at line 5)\n" +
37218 		"	void[] foo(void[] arg) {\n" +
37219 		"	           ^^^^^^\n" +
37220 		"void[] is an invalid type\n" +
37221 		"----------\n" +
37222 		"5. ERROR in X.java (at line 7)\n" +
37223 		"	void[] local = new void[0];\n" +
37224 		"	^^^^^^\n" +
37225 		"void[] is an invalid type\n" +
37226 		"----------\n" +
37227 		"6. ERROR in X.java (at line 7)\n" +
37228 		"	void[] local = new void[0];\n" +
37229 		"	               ^^^^^^^^^^^\n" +
37230 		"void[] is an invalid type\n" +
37231 		"----------\n" +
37232 		"7. ERROR in X.java (at line 8)\n" +
37233 		"	void[] local1 = new void[]{ null, null };\n" +
37234 		"	^^^^^^\n" +
37235 		"void[] is an invalid type\n" +
37236 		"----------\n" +
37237 		"8. ERROR in X.java (at line 8)\n" +
37238 		"	void[] local1 = new void[]{ null, null };\n" +
37239 		"	                ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
37240 		"void[] is an invalid type\n" +
37241 		"----------\n" +
37242 		"9. ERROR in X.java (at line 9)\n" +
37243 		"	void[] local2 = { null, null };\n" +
37244 		"	^^^^^^\n" +
37245 		"void[] is an invalid type\n" +
37246 		"----------\n" +
37247 		"10. ERROR in X.java (at line 10)\n" +
37248 		"	System.out.println((void[]) null);\n" +
37249 		"	                    ^^^^^^\n" +
37250 		"void[] is an invalid type\n" +
37251 		"----------\n" +
37252 		"11. ERROR in X.java (at line 11)\n" +
37253 		"	Class c = void[].class;\n" +
37254 		"	          ^^^^^^\n" +
37255 		"void[] is an invalid type\n" +
37256 		"----------\n" +
37257 		"12. ERROR in X.java (at line 12)\n" +
37258 		"	} catch(void[] e) {\n" +
37259 		"	        ^^^^^^\n" +
37260 		"void[] is an invalid type\n" +
37261 		"----------\n",
37262 		null,
37263 		true,
37264 		options);
37265 }
37266 
37267 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=163680
37268 public void test1075() {
37269 	runConformTest(
37270 		// test directory preparation
37271 		new String[] { /* test files */
37272 			"X.java",
37273 			"public class X <T extends X<?>.J>{\n" +
37274 			"	public class J implements I<T>{}\n" +
37275 			"}\n",
37276 			"I.java",
37277 			"public interface I <T> {}\n",
37278 			"Y.java",
37279 			"public class Y extends X {}\n",
37280 		},
37281 		// runtime results
37282 		"" /* expected output string */);
37283 	runConformTest(
37284 		// test directory preparation
37285 		false /* do not flush output directory */,
37286 		new String[] {
37287 			"Y.java",
37288 			"public class Y extends X {}",
37289 		},
37290 		// compiler results
37291 		null /* do not check compiler log */,
37292 		// runtime results
37293 		"" /* expected output string */,
37294 		"" /* expected error string */,
37295 		// javac options
37296 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
37297 }
37298 
37299 // FAIL ERRMSG
37300 public void test1076() {
37301 	if (this.complianceLevel >= ClassFileConstants.JDK1_8)
37302 		return;
37303 	this.runNegativeTest(
37304 		new String[] {
37305 			"X.java",
37306 			"import java.util.List;\n" +
37307 			"public class X {\n" +
37308 			"	List<Thread> threads;\n" +
37309 			"	void foo(String[] strings) {}\n" +
37310 			"	void bar() {\n" +
37311 			"		foo(this.threads.toArray(new String[this.threads.size()]));\n" +
37312 			"		foo(myToArray(this.threads, new String[this.threads.size()]));\n" +
37313 			"		foo(myToArray2(this.threads, new String[this.threads.size()]));\n" +
37314 			"	}\n" +
37315 			"	\n" +
37316 			"	static <T, E> T[] myToArray(List<E> list, T[] a) {\n" +
37317 			"		return list.toArray(a);\n" +
37318 			"	}\n" +
37319 			"	static <T, E extends T> T[] myToArray2(List<E> list, T[] a) {\n" +
37320 			"		return list.toArray(a);\n" +
37321 			"	}\n" +
37322 			"}\n",
37323 		},
37324 		"----------\n" +
37325 		"1. ERROR in X.java (at line 8)\n" +
37326 		"	foo(myToArray2(this.threads, new String[this.threads.size()]));\n" +
37327 		"	    ^^^^^^^^^^\n" +
37328 		"Bound mismatch: The generic method myToArray2(List<E>, T[]) of type X is not applicable for the arguments (List<Thread>, String[]). The inferred type Thread is not a valid substitute for the bounded parameter <E extends T>\n" +
37329 		"----------\n");
37330 }
37331 // check presence of field hiding warning
37332 public void test1077() {
37333 	this.runNegativeTest(
37334 		new String[] {
37335 			"X.java",
37336 			"public class X {\n" +
37337 			"	static class Y<T> {\n" +
37338 			"		static int foo;\n" +
37339 			"	}\n" +
37340 			"	static class Z<U> extends Y<U> {\n" +
37341 			"		int foo;\n" +
37342 			"		{\n" +
37343 			"			foo = 1;\n" +
37344 			"		}\n" +
37345 			"	}\n" +
37346 			"	Zork z;\n" +
37347 			"}\n" +
37348 			"\n",
37349 		},
37350 		"----------\n" +
37351 		"1. WARNING in X.java (at line 6)\n" +
37352 		"	int foo;\n" +
37353 		"	    ^^^\n" +
37354 		"The field X.Z<U>.foo is hiding a field from type X.Y<U>\n" +
37355 		"----------\n" +
37356 		"2. ERROR in X.java (at line 11)\n" +
37357 		"	Zork z;\n" +
37358 		"	^^^^\n" +
37359 		"Zork cannot be resolved to a type\n" +
37360 		"----------\n");
37361 }
37362 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=165143
37363 public void test1078() {
37364 	this.runNegativeTest(
37365 		new String[] {
37366 			"X.java",
37367 			"import java.util.List;\n" +
37368 			"import java.util.Map;\n" +
37369 			"\n" +
37370 			"public class X \n" +
37371 			"{\n" +
37372 			"  public static void main(String[] args)\n" +
37373 			"  {\n" +
37374 			"    Object object = null;\n" +
37375 			"\n" +
37376 			"    List list = (List)object;//[1]\n" +
37377 			"\n" +
37378 			"    foo((List)object);//[2]\n" +
37379 			"    foo((List<?>)object);//[3]\n" +
37380 			"    foo((List<Object>)object);//[4]unchecked cast\n" +
37381 			"    foo((List<? extends Object>)object);//[5]\n" +
37382 			"\n" +
37383 			"    foo((Map)object);//[6]\n" +
37384 			"    foo((Map<?, ?>)object);//[7]\n" +
37385 			"    foo((Map<Object, ?>)object);//[8]unchecked cast\n" +
37386 			"    foo((Map<?, Object>)object);//[9]unchecked cast\n" +
37387 			"    foo((Map<Object, Object>)object);//[10]unchecked cast\n" +
37388 			"    foo((Map<? extends Object, Object>)object);//[11]unchecked cast\n" +
37389 			"    foo((Map<? extends Object, ? extends Object>)object);//[12]\n" +
37390 			"    Zork z;\n" +
37391 			"  }\n" +
37392 			"\n" +
37393 			"  public static void foo(List<?> list) {\n" +
37394 			"  }\n" +
37395 			"\n" +
37396 			"  public static void foo(Map<?, ?> map) {\n" +
37397 			"  }\n" +
37398 			"}", // =================,
37399 		},
37400 		// unchecked warnings on [4][5][8][9][10][11][12]
37401 		"----------\n" +
37402 		"1. WARNING in X.java (at line 10)\n" +
37403 		"	List list = (List)object;//[1]\n" +
37404 		"	^^^^\n" +
37405 		"List is a raw type. References to generic type List<E> should be parameterized\n" +
37406 		"----------\n" +
37407 		"2. WARNING in X.java (at line 10)\n" +
37408 		"	List list = (List)object;//[1]\n" +
37409 		"	             ^^^^\n" +
37410 		"List is a raw type. References to generic type List<E> should be parameterized\n" +
37411 		"----------\n" +
37412 		"3. WARNING in X.java (at line 12)\n" +
37413 		"	foo((List)object);//[2]\n" +
37414 		"	     ^^^^\n" +
37415 		"List is a raw type. References to generic type List<E> should be parameterized\n" +
37416 		"----------\n" +
37417 		"4. WARNING in X.java (at line 14)\n" +
37418 		"	foo((List<Object>)object);//[4]unchecked cast\n" +
37419 		"	    ^^^^^^^^^^^^^^^^^^^^\n" +
37420 		"Type safety: Unchecked cast from Object to List<Object>\n" +
37421 		"----------\n" +
37422 		"5. WARNING in X.java (at line 15)\n" +
37423 		"	foo((List<? extends Object>)object);//[5]\n" +
37424 		"	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
37425 		"Type safety: Unchecked cast from Object to List<? extends Object>\n" +
37426 		"----------\n" +
37427 		"6. WARNING in X.java (at line 17)\n" +
37428 		"	foo((Map)object);//[6]\n" +
37429 		"	     ^^^\n" +
37430 		"Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
37431 		"----------\n" +
37432 		"7. WARNING in X.java (at line 19)\n" +
37433 		"	foo((Map<Object, ?>)object);//[8]unchecked cast\n" +
37434 		"	    ^^^^^^^^^^^^^^^^^^^^^^\n" +
37435 		"Type safety: Unchecked cast from Object to Map<Object,?>\n" +
37436 		"----------\n" +
37437 		"8. WARNING in X.java (at line 20)\n" +
37438 		"	foo((Map<?, Object>)object);//[9]unchecked cast\n" +
37439 		"	    ^^^^^^^^^^^^^^^^^^^^^^\n" +
37440 		"Type safety: Unchecked cast from Object to Map<?,Object>\n" +
37441 		"----------\n" +
37442 		"9. WARNING in X.java (at line 21)\n" +
37443 		"	foo((Map<Object, Object>)object);//[10]unchecked cast\n" +
37444 		"	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
37445 		"Type safety: Unchecked cast from Object to Map<Object,Object>\n" +
37446 		"----------\n" +
37447 		"10. WARNING in X.java (at line 22)\n" +
37448 		"	foo((Map<? extends Object, Object>)object);//[11]unchecked cast\n" +
37449 		"	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
37450 		"Type safety: Unchecked cast from Object to Map<? extends Object,Object>\n" +
37451 		"----------\n" +
37452 		"11. WARNING in X.java (at line 23)\n" +
37453 		"	foo((Map<? extends Object, ? extends Object>)object);//[12]\n" +
37454 		"	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
37455 		"Type safety: Unchecked cast from Object to Map<? extends Object,? extends Object>\n" +
37456 		"----------\n" +
37457 		"12. ERROR in X.java (at line 24)\n" +
37458 		"	Zork z;\n" +
37459 		"	^^^^\n" +
37460 		"Zork cannot be resolved to a type\n" +
37461 		"----------\n");
37462 }
37463 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=165143 - variation
37464 public void test1079() {
37465 	this.runNegativeTest(
37466 		new String[] {
37467 			"X.java",
37468 			"public class X<E> {\n" +
37469 			"    X<? extends String> bar(Object o) {\n" +
37470 			"    	return (AX<? extends String>) o;\n" +
37471 			"   	 Zork z;\n" +
37472 			"    }\n" +
37473 			"}\n" +
37474 			"class AX<F> extends X<F> {}\n", // =================,
37475 		},
37476 		"----------\n" +
37477 		"1. WARNING in X.java (at line 3)\n" +
37478 		"	return (AX<? extends String>) o;\n" +
37479 		"	       ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
37480 		"Type safety: Unchecked cast from Object to AX<? extends String>\n" +
37481 		"----------\n" +
37482 		"2. ERROR in X.java (at line 4)\n" +
37483 		"	Zork z;\n" +
37484 		"	^^^^\n" +
37485 		"Zork cannot be resolved to a type\n" +
37486 		"----------\n");
37487 }
37488 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=165143 - variation
37489 public void test1080() {
37490 	this.runNegativeTest(
37491 		new String[] {
37492 			"X.java",
37493 			"public class X<E> {\n" +
37494 			"	CX<E> foo(X<String> x) {\n" +
37495 			"		return (CX<E>) x; // unchecked\n" +
37496 			"	}\n" +
37497 			"	BX bar(X<String> x) {\n" +
37498 			"		return (BX) x;\n" +
37499 			"	}\n" +
37500 			"   Zork z;\n" +
37501 			"}\n" +
37502 			"class AX<F> extends X<F> {}\n" +
37503 			"class BX extends AX<String> {}\n" +
37504 			"class CX<G> extends AX<String> {}\n", // =================,
37505 		},
37506 		"----------\n" +
37507 		"1. WARNING in X.java (at line 3)\n" +
37508 		"	return (CX<E>) x; // unchecked\n" +
37509 		"	       ^^^^^^^^^\n" +
37510 		"Type safety: Unchecked cast from X<String> to CX<E>\n" +
37511 		"----------\n" +
37512 		"2. ERROR in X.java (at line 8)\n" +
37513 		"	Zork z;\n" +
37514 		"	^^^^\n" +
37515 		"Zork cannot be resolved to a type\n" +
37516 		"----------\n");
37517 }
37518 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=165143 - variation
37519 public void test1081() {
37520 	this.runNegativeTest(
37521 		new String[] {
37522 			"X.java",
37523 			"public class X<E> {\n" +
37524 			"	AX<Object> foo(X<String> x) {\n" +
37525 			"		return (BX) x;\n" +
37526 			"	}\n" +
37527 			"}\n" +
37528 			"class AX<F> extends X<F> {}\n" +
37529 			"class BX extends AX<Object> {}\n", // =================,
37530 		},
37531 		"----------\n" +
37532 		"1. ERROR in X.java (at line 3)\n" +
37533 		"	return (BX) x;\n" +
37534 		"	       ^^^^^^\n" +
37535 		"Cannot cast from X<String> to BX\n" +
37536 		"----------\n");
37537 }
37538 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=165143 - variation
37539 public void test1082() {
37540 	this.runNegativeTest(
37541 		new String[] {
37542 			"X.java",
37543 			"public class X<E> {\n" +
37544 			"	CX<E> foo(X<String> x) {\n" +
37545 			"		return (CX<E>) x; // unchecked\n" +
37546 			"	}\n" +
37547 			"   Zork z;\n" +
37548 			"}\n" +
37549 			"class AX<F> extends X<F> {}\n" +
37550 			"class CX<G> extends AX {}\n", // =================,
37551 		},
37552 		"----------\n" +
37553 		"1. WARNING in X.java (at line 3)\n" +
37554 		"	return (CX<E>) x; // unchecked\n" +
37555 		"	       ^^^^^^^^^\n" +
37556 		"Type safety: Unchecked cast from X<String> to CX<E>\n" +
37557 		"----------\n" +
37558 		"2. ERROR in X.java (at line 5)\n" +
37559 		"	Zork z;\n" +
37560 		"	^^^^\n" +
37561 		"Zork cannot be resolved to a type\n" +
37562 		"----------\n" +
37563 		"3. WARNING in X.java (at line 8)\n" +
37564 		"	class CX<G> extends AX {}\n" +
37565 		"	                    ^^\n" +
37566 		"AX is a raw type. References to generic type AX<F> should be parameterized\n" +
37567 		"----------\n");
37568 }
37569 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=106451 - variation
37570 public void test1083() {
37571 	this.runNegativeTest(
37572 		new String[] {
37573 			"X.java", // =================
37574 			"import java.io.Serializable;\n" +
37575 			"import java.util.LinkedList;\n" +
37576 			"\n" +
37577 			"class SerializableList extends LinkedList<Serializable> {\n" +
37578 			"	private static final long serialVersionUID = 1L; \n" +
37579 			"}\n" +
37580 			"public class X {\n" +
37581 			"    @SuppressWarnings({\"nls\", \"unused\"})\n" +
37582 			"    public static void main(String[] args) {\n" +
37583 			"        LinkedList<String> linkedList= new LinkedList<String>();\n" +
37584 			"        linkedList.add(\"Hello\");\n" +
37585 			"        java.util.List<? extends Serializable> a = linkedList;\n" +
37586 			"        java.util.List<String> b = (LinkedList<String>) a; // unchecked\n" +
37587 			"        java.util.List<Integer> c = (LinkedList<Integer>) a; // unchecked\n" +
37588 			"        java.util.List<Runtime> d = (LinkedList<Runtime>) a; // inconvertible / unchecked ?\n" +
37589 			"        c.get(0).intValue(); // fails at run time\n" +
37590 			"        d.get(0).gc(); // fails at run time\n" +
37591 			"        Zork z;\n" +
37592 			"    }\n" +
37593 			"}\n", // =================
37594 		},
37595 		"----------\n" +
37596 		"1. WARNING in X.java (at line 13)\n" +
37597 		"	java.util.List<String> b = (LinkedList<String>) a; // unchecked\n" +
37598 		"	                           ^^^^^^^^^^^^^^^^^^^^^^\n" +
37599 		"Type safety: Unchecked cast from List<capture#1-of ? extends Serializable> to LinkedList<String>\n" +
37600 		"----------\n" +
37601 		"2. WARNING in X.java (at line 14)\n" +
37602 		"	java.util.List<Integer> c = (LinkedList<Integer>) a; // unchecked\n" +
37603 		"	                            ^^^^^^^^^^^^^^^^^^^^^^^\n" +
37604 		"Type safety: Unchecked cast from List<capture#2-of ? extends Serializable> to LinkedList<Integer>\n" +
37605 		"----------\n" +
37606 		"3. WARNING in X.java (at line 15)\n" +
37607 		"	java.util.List<Runtime> d = (LinkedList<Runtime>) a; // inconvertible / unchecked ?\n" +
37608 		"	                            ^^^^^^^^^^^^^^^^^^^^^^^\n" +
37609 		"Type safety: Unchecked cast from List<capture#3-of ? extends Serializable> to LinkedList<Runtime>\n" +
37610 		"----------\n" +
37611 		"4. ERROR in X.java (at line 18)\n" +
37612 		"	Zork z;\n" +
37613 		"	^^^^\n" +
37614 		"Zork cannot be resolved to a type\n" +
37615 		"----------\n");
37616 }
37617 
37618 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=158870
37619 public void test1084() {
37620 	this.runNegativeTest(
37621 		new String[] {
37622 			"X.java",
37623 			"class Y<T> {\n" +
37624 			"}\n" +
37625 			"class Z<T> {\n" +
37626 			"}\n" +
37627 			"class X {\n" +
37628 			"  void foo() {\n" +
37629 			"    Z<Y<?>> l1 = null;\n" +
37630 			"    Z<Y> l2 = (Z<Y>) l1;\n" +
37631 			"  }\n" +
37632 			"}",
37633 		},
37634 		"----------\n" +
37635 		"1. WARNING in X.java (at line 8)\n" +
37636 		"	Z<Y> l2 = (Z<Y>) l1;\n" +
37637 		"	  ^\n" +
37638 		"Y is a raw type. References to generic type Y<T> should be parameterized\n" +
37639 		"----------\n" +
37640 		"2. ERROR in X.java (at line 8)\n" +
37641 		"	Z<Y> l2 = (Z<Y>) l1;\n" +
37642 		"	          ^^^^^^^^^\n" +
37643 		"Cannot cast from Z<Y<?>> to Z<Y>\n" +
37644 		"----------\n" +
37645 		"3. WARNING in X.java (at line 8)\n" +
37646 		"	Z<Y> l2 = (Z<Y>) l1;\n" +
37647 		"	             ^\n" +
37648 		"Y is a raw type. References to generic type Y<T> should be parameterized\n" +
37649 		"----------\n");
37650 }
37651 
37652 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=165291
37653 public void test1085() {
37654 	this.runNegativeTest(
37655 		new String[] {
37656 			"Y.java",
37657 			"class Z {\n" +
37658 			"        Z z1 = z1;\n" +
37659 			"        Z[] z2 = z2;\n" +
37660 			"}\n" +
37661 			"public class Y<E> {\n" +
37662 			"		E e0 = es[0];\n" +
37663 			"		E e = e;\n" +
37664 			"        E[] es = es;\n" +
37665 			"		E e2 = e2.e;\n" +
37666 			"}", // =================
37667 		},
37668 		"----------\n" +
37669 		"1. ERROR in Y.java (at line 2)\n" +
37670 		"	Z z1 = z1;\n" +
37671 		"	       ^^\n" +
37672 		"Cannot reference a field before it is defined\n" +
37673 		"----------\n" +
37674 		"2. ERROR in Y.java (at line 3)\n" +
37675 		"	Z[] z2 = z2;\n" +
37676 		"	         ^^\n" +
37677 		"Cannot reference a field before it is defined\n" +
37678 		"----------\n" +
37679 		"3. ERROR in Y.java (at line 6)\n" +
37680 		"	E e0 = es[0];\n" +
37681 		"	       ^^\n" +
37682 		"Cannot reference a field before it is defined\n" +
37683 		"----------\n" +
37684 		"4. ERROR in Y.java (at line 7)\n" +
37685 		"	E e = e;\n" +
37686 		"	      ^\n" +
37687 		"Cannot reference a field before it is defined\n" +
37688 		"----------\n" +
37689 		"5. ERROR in Y.java (at line 8)\n" +
37690 		"	E[] es = es;\n" +
37691 		"	         ^^\n" +
37692 		"Cannot reference a field before it is defined\n" +
37693 		"----------\n" +
37694 		"6. ERROR in Y.java (at line 9)\n" +
37695 		"	E e2 = e2.e;\n" +
37696 		"	       ^^\n" +
37697 		"Cannot reference a field before it is defined\n" +
37698 		"----------\n" +
37699 		"7. ERROR in Y.java (at line 9)\n" +
37700 		"	E e2 = e2.e;\n" +
37701 		"	          ^\n" +
37702 		"e cannot be resolved or is not a field\n" +
37703 		"----------\n");
37704 }
37705 
37706 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=165645
37707 public void test1086() {
37708 	this.runNegativeTest(
37709 		new String[] {
37710 			"X.java",
37711 			"interface IFoo { void foo(); }\n" +
37712 			"interface IBar { void bar(); }\n" +
37713 			"public class X<Bar extends IFoo> {\n" +
37714 			"	class Bar implements IBar { public void bar(){} }\n" +
37715 			"	void foo(Bar b) {\n" +
37716 			"		b.foo(); // unbound (Bar is member type)\n" +
37717 			"		b.bar(); // ok\n" +
37718 			"	}\n" +
37719 			"}\n", // =================,
37720 		},
37721 		"----------\n" +
37722 		"1. ERROR in X.java (at line 6)\n" +
37723 		"	b.foo(); // unbound (Bar is member type)\n" +
37724 		"	  ^^^\n" +
37725 		"The method foo() is undefined for the type X<Bar>.Bar\n" +
37726 		"----------\n");
37727 }
37728 
37729 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=165645 - variation
37730 public void test1087() {
37731 	runConformTest(
37732 		// test directory preparation
37733 		new String[] { /* test files */
37734 			"X.java",
37735 			"public class X<M> {\n" +
37736 			"	static public class M {\n" +
37737 			"	}\n" +
37738 			"	static public class M2 extends M {\n" +
37739 			"	}\n" +
37740 			"}\n" +
37741 			"\n", // =================
37742 		},
37743 		// javac options
37744 		JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
37745 }
37746 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=165679
37747 public void test1088() {
37748 	this.runNegativeTest(
37749 			new String[] {
37750 				"X.java",
37751 				"public class X<M> {\n" +
37752 				"	static public class M {}\n" +
37753 				"	Zork z;\n" +
37754 				"	void foo() {\n" +
37755 				"		class M {} // hides member\n" +
37756 				"	}\n" +
37757 				"}\n" +
37758 				"class Y <T> {\n" +
37759 				"	class Local {}\n" +
37760 				"	void foo() {\n" +
37761 				"		class T {}; // hiding warning\n" +
37762 				"		class Local {};\n" +
37763 				"	}\n" +
37764 				"	static void bar() {\n" +
37765 				"		class T {}; // no hiding warning\n" +
37766 				"		class Local {}; // no hiding warning\n" +
37767 				"	}	\n" +
37768 				"}\n", // =================
37769 			},
37770 			"----------\n" +
37771 			"1. ERROR in X.java (at line 3)\n" +
37772 			"	Zork z;\n" +
37773 			"	^^^^\n" +
37774 			"Zork cannot be resolved to a type\n" +
37775 			"----------\n" +
37776 			"2. WARNING in X.java (at line 5)\n" +
37777 			"	class M {} // hides member\n" +
37778 			"	      ^\n" +
37779 			"The type M is hiding the type X.M\n" +
37780 			"----------\n" +
37781 			"3. WARNING in X.java (at line 11)\n" +
37782 			"	class T {}; // hiding warning\n" +
37783 			"	      ^\n" +
37784 			"The nested type T is hiding the type parameter T of type Y<T>\n" +
37785 			"----------\n" +
37786 			"4. WARNING in X.java (at line 12)\n" +
37787 			"	class Local {};\n" +
37788 			"	      ^^^^^\n" +
37789 			"The type Local is hiding the type Y<T>.Local\n" +
37790 			"----------\n");
37791 }
37792 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=165679 - variation
37793 public void test1089() {
37794 	this.runNegativeTest(
37795 		new String[] {
37796 			"X.java",
37797 			"public class X {\n" +
37798 			"	class U {}\n" +
37799 			"	<T> void foo(T t) {\n" +
37800 			"		class T {\n" +
37801 			"			T t = t;\n" +
37802 			"		}\n" +
37803 			"		class U {\n" +
37804 			"		}\n" +
37805 			"	}\n" +
37806 			"}\n" +
37807 			"\n", // =================
37808 		},
37809 		"----------\n" +
37810 		"1. WARNING in X.java (at line 4)\n" +
37811 		"	class T {\n" +
37812 		"	      ^\n" +
37813 		"The nested type T is hiding the type parameter T of the generic method foo(T) of type X\n" +
37814 		"----------\n" +
37815 		"2. WARNING in X.java (at line 5)\n" +
37816 		"	T t = t;\n" +
37817 		"	  ^\n" +
37818 		"The field T.t is hiding another local variable defined in an enclosing scope\n" +
37819 		"----------\n" +
37820 		"3. ERROR in X.java (at line 5)\n" +
37821 		"	T t = t;\n" +
37822 		"	      ^\n" +
37823 		"Cannot reference a field before it is defined\n" +
37824 		"----------\n" +
37825 		"4. WARNING in X.java (at line 7)\n" +
37826 		"	class U {\n" +
37827 		"	      ^\n" +
37828 		"The type U is hiding the type X.U\n" +
37829 		"----------\n");
37830 }
37831 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=165679 - variation
37832 public void _test1090() {
37833 	this.runNegativeTest(
37834 		new String[] {
37835 			"X.java",
37836 			"public class X <T,U> {\n" +
37837 			"	class T {} // warn hiding type parameter\n" +
37838 			"	class U<U> {}// warn hiding type parameter+warn param hiding member type\n" +
37839 			"	\n" +
37840 			"	void foo() {\n" +
37841 			"		class Local {\n" +
37842 			"			class T {} // warn hiding type parameter\n" +
37843 			"			class U<U> {}// warn hiding type parameter+warn param hiding member type\n" +
37844 			"		}\n" +
37845 			"	}\n" +
37846 			"	static void bar() {\n" +
37847 			"		class Local {\n" +
37848 			"			class T {} // no warn\n" +
37849 			"			class U<U> {} // no warn\n" +
37850 			"		}\n" +
37851 			"	}\n" +
37852 			"}", // =================
37853 		},
37854 		"???");
37855 }
37856 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=165909
37857 public void test1091() {
37858 	this.runNegativeTest(
37859 		new String[] {
37860 			"X.java",
37861 			"import java.util.Map;\n" +
37862 			"\n" +
37863 			"public class X {\n" +
37864 			"	void foo() {\n" +
37865 			"		  Object a = null;\n" +
37866 			"		  Map.Entry<String, String> aa = (Map.Entry<String, String>)a;		\n" +
37867 			"	}\n" +
37868 			"	void bar() {\n" +
37869 			"		  Number a = null;\n" +
37870 			"		  Map.Entry<String, String> aa = (Map.Entry<String, String>)a;		\n" +
37871 			"		  Zork z;\n" +
37872 			"	}\n" +
37873 			"}\n", // =================
37874 		},
37875 		"----------\n" +
37876 		"1. WARNING in X.java (at line 6)\n" +
37877 		"	Map.Entry<String, String> aa = (Map.Entry<String, String>)a;		\n" +
37878 		"	                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
37879 		"Type safety: Unchecked cast from Object to Map.Entry<String,String>\n" +
37880 		"----------\n" +
37881 		"2. WARNING in X.java (at line 10)\n" +
37882 		"	Map.Entry<String, String> aa = (Map.Entry<String, String>)a;		\n" +
37883 		"	                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
37884 		"Type safety: Unchecked cast from Number to Map.Entry<String,String>\n" +
37885 		"----------\n" +
37886 		"3. ERROR in X.java (at line 11)\n" +
37887 		"	Zork z;\n" +
37888 		"	^^^^\n" +
37889 		"Zork cannot be resolved to a type\n" +
37890 		"----------\n");
37891 }
37892 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=166490
37893 public void test1092() {
37894 	Map customOptions = getCompilerOptions();
37895 	customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
37896 	this.runConformTest(
37897 		new String[] {
37898 			"Class_01.java",
37899 			"public interface Class_01<H extends Class_02<? extends Class_01>> extends\n" +
37900 			"		Class_09<H> {\n" +
37901 			"}",
37902 			"Class_02.java",
37903 			"public interface Class_02<E extends Class_01<? extends Class_02>> extends\n" +
37904 			"		Class_10<E> {\n" +
37905 			"}",
37906 			"Class_03.java",
37907 			"public abstract class Class_03<E extends Class_01<? super H>, H extends Class_02<? super E>, P extends Class_06<? extends Class_07>>\n" +
37908 			"		extends Class_08<E, H, P> implements Class_05 {\n" +
37909 			"}",
37910 			"Class_04.java",
37911 			"public interface Class_04 extends Class_06<Class_18>, Class_19{\n" +
37912 			"}",
37913 			"Class_05.java",
37914 			"public interface Class_05{\n" +
37915 			"}",
37916 			"Class_06.java",
37917 			"public interface Class_06<H extends Class_07<? extends Class_06>> extends\n" +
37918 			"		Class_13<H, Class_12>, Class_17 {\n" +
37919 			"}",
37920 			"Class_07.java",
37921 			"public interface Class_07<P extends Class_06<? extends Class_07>> extends\n" +
37922 			"		Class_14<P, Class_12> {\n" +
37923 			"}",
37924 			"Class_08.java",
37925 			"public abstract class Class_08<E extends Class_09<? super H>, H extends Class_10<? super E>, P extends Class_06<? extends Class_07>>\n" +
37926 			"		extends Class_11<E, H, Class_12> implements Class_05 {\n" +
37927 			"}",
37928 			"Class_09.java",
37929 			"public interface Class_09<H extends Class_10<? extends Class_09>> extends\n" +
37930 			"		Class_13<H, Class_12>, Class_17 {\n" +
37931 			"}",
37932 			"Class_10.java",
37933 			"public interface Class_10<E extends Class_09<? extends Class_10>> extends\n" +
37934 			"		Class_14<E, Class_12> {\n" +
37935 			"}",
37936 			"Class_11.java",
37937 			"public abstract class Class_11<E extends Class_13<? super H, O>, H extends Class_14<? super E, O>, O>\n" +
37938 			"		extends Class_15<E, H, O> implements Class_05 {\n" +
37939 			"}",
37940 			"Class_12.java",
37941 			"public final class Class_12 {\n" +
37942 			"}",
37943 			"Class_13.java",
37944 			"public interface Class_13<H extends Class_14<?, O>, O>{\n" +
37945 			"}",
37946 			"Class_14.java",
37947 			"public interface Class_14<E extends Class_13<?, O>, O>{\n" +
37948 			"}",
37949 			"Class_15.java",
37950 			"public abstract class Class_15<E extends Class_13<? super H, O>, H extends Class_14<? super E, O>, O>\n" +
37951 			"		extends Class_16 {\n" +
37952 			"}",
37953 			"Class_16.java",
37954 			"public abstract class Class_16{\n" +
37955 			"}",
37956 			"Class_17.java",
37957 			"public interface Class_17{\n" +
37958 			"}",
37959 			"Class_18.java",
37960 			"public interface Class_18 extends Class_07<Class_04>{\n" +
37961 			"}",
37962 			"Class_19.java",
37963 			"public interface Class_19{\n" +
37964 			"}",
37965 			"MyClass.java",
37966 			"abstract class MyClass<E extends Class_01<? super H>, H extends Class_02<? super E>>\n" +
37967 			"		extends Class_03<E, H, Class_04> implements Class_05 {\n" +
37968 			"}"
37969 		},
37970 		"",
37971 		null,
37972 		true,
37973 		null,
37974 		customOptions,
37975 		null);
37976 
37977 	// incremental build
37978 	this.runConformTest(
37979 			new String[] {
37980 					"Class_01.java",
37981 					"public interface Class_01<H extends Class_02<? extends Class_01>> extends\n" +
37982 					"		Class_09<H> {\n" +
37983 					"}",
37984 			},
37985 			"",
37986 			null,
37987 			false,
37988 			null,
37989 			customOptions,
37990 			null);
37991 }
37992 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=156952
37993 // invalid bug - regression test only
37994 public void test1093() {
37995 	Map customOptions = getCompilerOptions();
37996 	customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
37997 	this.runNegativeTest(new String[] {
37998 			"X.java",
37999 			"public class X<T> {\n" +
38000 			"  X<T> foo() {\n" +
38001 			"    return this;\n" +
38002 			"  }\n" +
38003 			"  T bar(T p) {\n" +
38004 			"    return p;\n" + "  }\n"	+
38005 			"  public static void main (String args) {\n" +
38006 			"    X<String> x1 = new X<String>();\n"	+
38007 			"    System.out.println(x1.foo().bar(\"OK\"));\n" + // OK
38008 			"    X x2 = new X<String>();\n"	+
38009 			"    System.out.println(x2.foo().bar(\"OK\"));\n" + // KO: type safety issue
38010 			"  }\n" +
38011 			"}\n"
38012 		},
38013 		"----------\n" +
38014 		"1. WARNING in X.java (at line 12)\n" +
38015 		"	System.out.println(x2.foo().bar(\"OK\"));\n" +
38016 		"	                   ^^^^^^^^^^^^^^^^^^\n" +
38017 		"Type safety: The method bar(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
38018 		"----------\n",
38019 		null /* no extra class libraries */,
38020 		true /* flush output directory */,
38021 		customOptions,
38022 		false /* do not generate output */,
38023 		false /* do not show category */,
38024 		false /* do not show warning token */,
38025 		false  /* do not skip javac for this peculiar test */,
38026 		false  /* do not perform statements recovery */);
38027 }
38028 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=167268
38029 public void test1094() {
38030 	Map customOptions = getCompilerOptions();
38031 	customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
38032 	this.runConformTest(
38033 		new String[] {
38034 			"Crazy.java",
38035 			"public interface Crazy<O extends Other, T extends O> {}",
38036 			"ExampleFactory.java",
38037 			"public interface ExampleFactory {\n" +
38038 			"	<O extends Other, T extends O> Crazy<O, T> createCrazy();\n" +
38039 			"}",
38040 			"Other.java",
38041 			"public interface Other {}",
38042 			"ExampleFactoryImpl.java",
38043 			"public class ExampleFactoryImpl implements ExampleFactory {\n" +
38044 			"	public <O extends Other, T extends O> Crazy<O, T> createCrazy() {\n" +
38045 			"		return null;\n" +
38046 			"	}\n" +
38047 			"}"
38048 		},
38049 		"",
38050 		null /* no extra class libraries */,
38051 		true /* flush output directory */,
38052 		null /* vm arguments*/,
38053 		customOptions,
38054 		null /* compiler requestor*/);
38055 	this.runConformTest(
38056 		new String[] {
38057 			"ExampleFactoryImpl.java",
38058 			"public class ExampleFactoryImpl implements ExampleFactory {\n" +
38059 			"	public <O extends Other, T extends O> Crazy<O, T> createCrazy() {\n" +
38060 			"		return null;\n" +
38061 			"	}\n" +
38062 			"}"
38063 		},
38064 		"",
38065 		null /* no extra class libraries */,
38066 		false /* flush output directory */,
38067 		null /* vm arguments*/,
38068 		customOptions,
38069 		null /* compiler requestor*/);
38070 }
38071 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=167952
38072 //invalid bug - regression test only
38073 public void test1095() {
38074 	Map customOptions = getCompilerOptions();
38075 	customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
38076 	customOptions.put(CompilerOptions.OPTION_ReportUncheckedTypeOperation, CompilerOptions.IGNORE);
38077 	runNegativeTest(
38078 	// test directory preparation
38079 	true /* flush output directory */,
38080 	new String[] { /* test files */
38081 		"X.java",
38082 		"import java.lang.reflect.Constructor;\n" +
38083 		"\n" +
38084 		"@interface Annot {\n" +
38085 		"	String message() default \"\"; //$NON-NLS-1$\n" +
38086 		"}\n" +
38087 		"\n" +
38088 		"public class X {\n" +
38089 		"	X() {\n" +
38090 		"	}\n" +
38091 		"	public String getAnnotationValue(Constructor constructor){\n" +
38092 		"		Annot annotation = constructor.getAnnotation(Annot.class);\n" +
38093 		"		return (annotation != null) ? annotation.message() : null;\n" +
38094 		"	}\n" +
38095 		"}"
38096 	},
38097 	// compiler options
38098 	null /* no class libraries */,
38099 	customOptions /* custom options */,
38100 	// compiler results
38101 	"----------\n" + /* expected compiler log */
38102 	"1. ERROR in X.java (at line 11)\n" +
38103 	"	Annot annotation = constructor.getAnnotation(Annot.class);\n" +
38104 	"	                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
38105 	"Type mismatch: cannot convert from Annotation to Annot\n" +
38106 	"----------\n",
38107 	// javac options
38108 	JavacTestOptions.JavacHasABug.JavacBug6400189 /* javac test options */);
38109 }
38110 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=167952
38111 //invalid bug - regression test only
38112 public void test1096() {
38113 	Map customOptions = getCompilerOptions();
38114 	customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
38115 	customOptions.put(CompilerOptions.OPTION_ReportUncheckedTypeOperation, CompilerOptions.IGNORE);
38116 	this.runConformTest(
38117 		new String[] {
38118 			"X.java",
38119 			"import java.lang.reflect.Constructor;\n" +
38120 			"\n" +
38121 			"@interface Annot {\n" +
38122 			"	String message() default \"\"; //$NON-NLS-1$\n" +
38123 			"}\n" +
38124 			"\n" +
38125 			"public class X {\n" +
38126 			"	X() {\n" +
38127 			"	}\n" +
38128 			"	public String getAnnotationValue(Constructor<X> constructor){\n" +
38129 			"		Annot annotation = constructor.getAnnotation(Annot.class);\n" +
38130 			"		return (annotation != null) ? annotation.message() : null;\n" +
38131 			"	}\n" +
38132 			"}"
38133 		},
38134 		"",
38135 		null /* no extra class libraries */,
38136 		true /* flush output directory */,
38137 		null,
38138 		customOptions,
38139 		null/* do not perform statements recovery */);
38140 }
38141 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=168232
38142 public void _test1097() {
38143 	runNegativeTest(
38144 		// test directory preparation
38145 		new String[] { /* test files */
38146 			"X.java",
38147 			"public class X {\n" +
38148 			"	String[] foo = new <Zork>String[] {};\n" +
38149 			"}"
38150 		},
38151 		// compiler results
38152 		"----------\n" + /* expected compiler log */
38153 		"1. ERROR in X.java (at line 2)\n" +
38154 		"	String[] foo = new <Zork>String[] {};\n" +
38155 		"	               ^^^^^^^^^^^^^^^^^^\n" +
38156 		"Syntax error on token(s), misplaced construct(s)\n" +
38157 		"----------\n" +
38158 		"2. ERROR in X.java (at line 2)\n" +
38159 		"	String[] foo = new <Zork>String[] {};\n" +
38160 		"	                        ^\n" +
38161 		"Syntax error on token \">\", , expected\n" +
38162 		"----------\n",
38163 		// javac options
38164 		JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
38165 }
38166 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=152961
38167 public void test1098() {
38168 	String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ?
38169 			"----------\n" +
38170 			"1. ERROR in X.java (at line 9)\n" +
38171 			"	class Y extends Zork {}\n" +
38172 			"	                ^^^^\n" +
38173 			"Zork cannot be resolved to a type\n" +
38174 			"----------\n"
38175 			:
38176 			"----------\n" +
38177 			"1. WARNING in X.java (at line 5)\n" +
38178 			"	private class Y<T> extends A {\n" +
38179 			"	              ^\n" +
38180 			"Access to enclosing constructor X.A() is emulated by a synthetic accessor method\n" +
38181 			"----------\n" +
38182 			"2. ERROR in X.java (at line 9)\n" +
38183 			"	class Y extends Zork {}\n" +
38184 			"	                ^^^^\n" +
38185 			"Zork cannot be resolved to a type\n" +
38186 			"----------\n";
38187 	this.runNegativeTest(new String[] {
38188 			"X.java",
38189 			"public class X { \n" +
38190 			"   private class A {\n" +
38191 			"    class B {}\n" +
38192 			"  }\n" +
38193 			"  private class Y<T> extends A {\n" +
38194 			"  }\n" +
38195 			"  Y<String>.B d = null;\n" +
38196 			"}\n" +
38197 			"class Y extends Zork {}\n"
38198 		},
38199 		errMessage);
38200 }
38201 public void test1099() {
38202 	runConformTest(
38203 		// test directory preparation
38204 		true /* flush output directory */,
38205 		new String[] { /* test files */
38206 			"X.java",
38207 			"import java.util.*;\n" +
38208 			"\n" +
38209 			"public class X {\n" +
38210 			"\n" +
38211 			"    public class A {};\n" +
38212 			"    public class B extends A {\n" +
38213 			"    	@Override\n" +
38214 			"    	public String toString() {\n" +
38215 			"    		return \"SUCCESS\";\n" +
38216 			"    	}\n" +
38217 			"    }\n" +
38218 			"\n" +
38219 			"    public static void main(String[] args) {\n" +
38220 			"        X x = new X();\n" +
38221 			"        List<A> l = x.newList(x.new B());\n" +
38222 			"		for (A a: l) {\n" +
38223 			"			System.out.println(a);\n" +
38224 			"		}\n" +
38225 			"    }\n" +
38226 			"\n" +
38227 			"    public <U, V extends U> List<U> newList(V... values) {\n" +
38228 			"        List<U> l = new ArrayList<U>();\n" +
38229 			"        for (V v : values) {\n" +
38230 			"            l.add(v);\n" +
38231 			"        }\n" +
38232 			"        return l;\n" +
38233 			"    }\n" +
38234 			"\n" +
38235 			"}\n"
38236 		},
38237 		// compiler results
38238 		this.complianceLevel < ClassFileConstants.JDK1_7 ? "" :
38239 				"----------\n" +
38240 				"1. WARNING in X.java (at line 21)\n" +
38241 				"	public <U, V extends U> List<U> newList(V... values) {\n" +
38242 				"	                                             ^^^^^^\n" +
38243 				"Type safety: Potential heap pollution via varargs parameter values\n" +
38244 				"----------\n",
38245 		// runtime results
38246 		"SUCCESS" /* expected output string */,
38247 		"" /* expected error string */,
38248 		// javac options
38249 		JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
38250 }
38251 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=170318
38252 public void test1100() {
38253 	this.runNegativeTest(new String[] {
38254 			"X.java",
38255 			"class X<T> {\n" +
38256 			"}\n" +
38257 			"class Y<T> {\n" +
38258 			"  public void foo(final X<?> x) {\n" +
38259 			"  }\n" +
38260 			"}\n" +
38261 			"class Z extends Y {\n" +
38262 			"  public void foo(final X<?> x) {\n" +
38263 			"    super.foo(x);\n" +
38264 			"  }\n" +
38265 			"}"
38266 		},
38267 		"----------\n" +
38268 		"1. WARNING in X.java (at line 7)\n" +
38269 		"	class Z extends Y {\n" +
38270 		"	                ^\n" +
38271 		"Y is a raw type. References to generic type Y<T> should be parameterized\n" +
38272 		"----------\n" +
38273 		"2. ERROR in X.java (at line 8)\n" +
38274 		"	public void foo(final X<?> x) {\n" +
38275 		"	            ^^^^^^^^^^^^^^^^^\n" +
38276 		"Name clash: The method foo(X<?>) of type Z has the same erasure as foo(X) of type Y but does not override it\n" +
38277 		"----------\n" +
38278 		"3. WARNING in X.java (at line 9)\n" +
38279 		"	super.foo(x);\n" +
38280 		"	^^^^^^^^^^^^\n" +
38281 		"Type safety: The method foo(X) belongs to the raw type Y. References to generic type Y<T> should be parameterized\n" +
38282 		"----------\n");
38283 }
38284 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=172189
38285 public void test1101() {
38286 	this.runNegativeTest(new String[] {
38287 			"X.java",
38288 			"import java.util.*;\n" +
38289 			"\n" +
38290 			"public final class X<A, B> {\n" +
38291 			"    public A a;\n" +
38292 			"    public B b;\n" +
38293 			"    public X(A pa, B pb) {\n" +
38294 			"        a = pa;\n" +
38295 			"        b = pb;\n" +
38296 			"    }\n" +
38297 			"    public static <A, B> X<A, B> create(A pa, B pb) {\n" +
38298 			"        return new X<A, B>(pa, pb);\n" +
38299 			"    }\n" +
38300 			"    public static void main(String[] args) {\n" +
38301 			"        List<X<String, Object>> list = new ArrayList<X<String,Object>>();\n" +
38302 			"        list.add(X.<?, Object>create(\"\", \"\"));\n" +
38303 			"    }\n" +
38304 			"}"
38305 		},
38306 		"----------\n" +
38307 		"1. ERROR in X.java (at line 15)\n" +
38308 		"	list.add(X.<?, Object>create(\"\", \"\"));\n" +
38309 		"	            ^\n" +
38310 		"Wildcard is not allowed at this location\n" +
38311 		"----------\n");
38312 }
38313 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=174434
38314 public void test1102() {
38315 	this.runNegativeTest(new String[] {
38316 			"X.java",
38317 			"public class X {\n" +
38318 			"	<T> X(T t) {\n" +
38319 			"	}\n" +
38320 			"\n" +
38321 			"	class A {\n" +
38322 			"		<T> A(T t) {\n" +
38323 			"		}\n" +
38324 			"	}\n" +
38325 			"\n" +
38326 			"	public static void main(String[] args) {\n" +
38327 			"		new<?> X(null);\n" +
38328 			"	}\n" +
38329 			"}"
38330 		},
38331 		"----------\n" +
38332 		"1. ERROR in X.java (at line 11)\n" +
38333 		"	new<?> X(null);\n" +
38334 		"	    ^\n" +
38335 		"Wildcard is not allowed at this location\n" +
38336 		"----------\n");
38337 }
38338 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=174434
38339 public void test1103() {
38340 	this.runNegativeTest(new String[] {
38341 			"X.java",
38342 			"public class X {\n" +
38343 			"	<T> X(T t) {\n" +
38344 			"	}\n" +
38345 			"	X(int i) {\n" +
38346 			"		<?>this(null);\n" +
38347 			"	}\n" +
38348 			"}"
38349 		},
38350 		"----------\n" +
38351 		"1. ERROR in X.java (at line 5)\n" +
38352 		"	<?>this(null);\n" +
38353 		"	 ^\n" +
38354 		"Wildcard is not allowed at this location\n" +
38355 		"----------\n");
38356 }
38357 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=174434
38358 public void test1104() {
38359 	this.runNegativeTest(new String[] {
38360 			"X.java",
38361 			"public class X {\n" +
38362 			"	<T> X(T t) { }\n" +
38363 			"	\n" +
38364 			"	class A {\n" +
38365 			"		<T> A(T t) { }\n" +
38366 			"	}\n" +
38367 			"\n" +
38368 			"	public static void main(String[] args) {\n" +
38369 			"		new X(null).new <?> A(null);\n" +
38370 			"	}\n" +
38371 			"}"
38372 		},
38373 		"----------\n" +
38374 		"1. ERROR in X.java (at line 9)\n" +
38375 		"	new X(null).new <?> A(null);\n" +
38376 		"	                 ^\n" +
38377 		"Wildcard is not allowed at this location\n" +
38378 		"----------\n");
38379 }
38380 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=174724
38381 public void test1105() {
38382 	Map customOptions = getCompilerOptions();
38383 	customOptions.put(CompilerOptions.OPTION_ReportRawTypeReference, CompilerOptions.IGNORE);
38384 	this.runNegativeTest(new String[] {
38385 			"X.java",
38386 			"public class X {\n" +
38387 			"	public static void main(String[] args) {\n" +
38388 			"		Class foo = Class.<? extends Object>forName(Integer.class.getName());\n" +
38389 			"	}\n" +
38390 			"}"
38391 		},
38392 		"----------\n" +
38393 		"1. ERROR in X.java (at line 3)\n" +
38394 		"	Class foo = Class.<? extends Object>forName(Integer.class.getName());\n" +
38395 		"	                   ^^^^^^^^^^^^^^^^\n" +
38396 		"Wildcard is not allowed at this location\n" +
38397 		"----------\n",
38398 		null,
38399 		true,
38400 		customOptions);
38401 }
38402 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=174766
38403 public void test1106() {
38404 	runNegativeTest(
38405 		// test directory preparation
38406 		new String[] { /* test files */
38407 			"X.java",
38408 			"public class X<T> {\n" +
38409 			"	public class Y extends Exception {\n" +
38410 			"     private static final long serialVersionUID = 1L;\n" +
38411 			"	}\n" +
38412 			"}"
38413 		},
38414 		// compiler results
38415 		"----------\n" +  /* expected compiler log */
38416 		"1. ERROR in X.java (at line 2)\n" +
38417 		"	public class Y extends Exception {\n" +
38418 		"	                       ^^^^^^^^^\n" +
38419 		"The generic class X<T>.Y may not subclass java.lang.Throwable\n" +
38420 		"----------\n",
38421 		// javac options
38422 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
38423 }
38424 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=172913
38425 public void test1107() throws Exception {
38426 	this.runConformTest(
38427 		new String[] {
38428 			"X.java",
38429 			"import java.util.ArrayList;\n" +
38430 			"import java.util.Collection;\n" +
38431 			"import java.util.HashMap;\n" +
38432 			"import java.util.Iterator;\n" +
38433 			"import java.util.List;\n" +
38434 			"\n" +
38435 			"public class X {\n" +
38436 			"  private void processLocks(HashMap locksMap, Object key) {\n" +
38437 			"    for (Iterator iter = locksMap.keySet().iterator(); iter.hasNext();) {\n" +
38438 			"      Object call = iter.next();\n" +
38439 			"      List locks = externLocks((Collection) locksMap.get(call), call);\n" +
38440 			"      // ...\n" +
38441 			"    }\n" +
38442 			"  }\n" +
38443 			"  private List externLocks(Collection locks, Object call) {\n" +
38444 			"    List result = new ArrayList();\n" +
38445 			"    // ..\n" +
38446 			"    return result;\n" +
38447 			"  }\n" +
38448 			"}\n",
38449 		},
38450 		"");
38451 	// ensure only one instance of: checkcast java.util.Collection
38452 	String expectedOutput =
38453 		"  // Method descriptor #15 (Ljava/util/HashMap;Ljava/lang/Object;)V\n" +
38454 		"  // Stack: 3, Locals: 6\n" +
38455 		"  private void processLocks(java.util.HashMap locksMap, java.lang.Object key);\n" +
38456 		"     0  aload_1 [locksMap]\n" +
38457 		"     1  invokevirtual java.util.HashMap.keySet() : java.util.Set [16]\n" +
38458 		"     4  invokeinterface java.util.Set.iterator() : java.util.Iterator [22] [nargs: 1]\n" +
38459 		"     9  astore_3 [iter]\n" +
38460 		"    10  goto 38\n" +
38461 		"    13  aload_3 [iter]\n" +
38462 		"    14  invokeinterface java.util.Iterator.next() : java.lang.Object [28] [nargs: 1]\n" +
38463 		"    19  astore 4 [call]\n" +
38464 		"    21  aload_0 [this]\n" +
38465 		"    22  aload_1 [locksMap]\n" +
38466 		"    23  aload 4 [call]\n" +
38467 		"    25  invokevirtual java.util.HashMap.get(java.lang.Object) : java.lang.Object [34]\n" +
38468 		"    28  checkcast java.util.Collection [38]\n" +
38469 		"    31  aload 4 [call]\n" +
38470 		"    33  " +
38471 		(isMinimumCompliant(ClassFileConstants.JDK11) ? "invokevirtual" : "invokespecial") +
38472 		" X.externLocks(java.util.Collection, java.lang.Object) : java.util.List [40]\n" +
38473 		"    36  astore 5\n" +
38474 		"    38  aload_3 [iter]\n" +
38475 		"    39  invokeinterface java.util.Iterator.hasNext() : boolean [44] [nargs: 1]\n" +
38476 		"    44  ifne 13\n" +
38477 		"    47  return\n" +
38478 		"      Line numbers:\n" +
38479 		"        [pc: 0, line: 9]\n" +
38480 		"        [pc: 13, line: 10]\n" +
38481 		"        [pc: 21, line: 11]\n" +
38482 		"        [pc: 38, line: 9]\n" +
38483 		"        [pc: 47, line: 14]\n" +
38484 		"      Local variable table:\n" +
38485 		"        [pc: 0, pc: 48] local: this index: 0 type: X\n" +
38486 		"        [pc: 0, pc: 48] local: locksMap index: 1 type: java.util.HashMap\n" +
38487 		"        [pc: 0, pc: 48] local: key index: 2 type: java.lang.Object\n" +
38488 		"        [pc: 10, pc: 47] local: iter index: 3 type: java.util.Iterator\n" +
38489 		"        [pc: 21, pc: 38] local: call index: 4 type: java.lang.Object\n";
38490 
38491 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
38492 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
38493 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
38494 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
38495 	int index = result.indexOf(expectedOutput);
38496 	if (index == -1 || expectedOutput.length() == 0) {
38497 		System.out.println(Util.displayString(result, 3));
38498 	}
38499 	if (index == -1) {
38500 		assertEquals("Wrong contents", expectedOutput, result);
38501 	}
38502 }
38503 public void test1108() {
38504 	this.runConformTest(
38505 		new String[] {
38506 			"X.java",
38507 			"interface UnaryFunction <A, R, X extends Throwable> {\n" +
38508 			"    public R invoke(A o) throws X;\n" +
38509 			"}\n" +
38510 			" \n" +
38511 			"public class X implements UnaryFunction<String,Void,RuntimeException> {\n" +
38512 			"    public Void invoke(String o) throws RuntimeException {\n" +
38513 			"        return null;\n" +
38514 			"    }\n" +
38515 			"}\n", // =================
38516 		},
38517 		"");
38518 }
38519 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=176591
38520 //?: cuts assignment context
38521 public void test1109() {
38522 	String xSource =
38523 			"class X {\n" +
38524 			"  public Y<String> foo()\n" +
38525 			"  {\n" +
38526 			"    return true ? Z.bar() : null;\n" +
38527 			"  }\n" +
38528 			"}\n" +
38529 			"class Y<T> {\n" +
38530 			"}\n" +
38531 			"class Z {\n" +
38532 			"  static <U> Y<U> bar() {\n" +
38533 			"    return null;\n" +
38534 			"  }\n" +
38535 			"}\n";
38536 	if (this.complianceLevel < ClassFileConstants.JDK1_8) {
38537 		this.runNegativeTest(
38538 			new String[] {
38539 				"X.java",
38540 				xSource,
38541 			},
38542 			"----------\n" +
38543 			"1. ERROR in X.java (at line 4)\n" +
38544 			"	return true ? Z.bar() : null;\n" +
38545 			"	       ^^^^^^^^^^^^^^^^^^^^^\n" +
38546 			"Type mismatch: cannot convert from Y<Object> to Y<String>\n" +
38547 			"----------\n");
38548 	} else {
38549 		runConformTest(
38550 			new String[] {
38551 				"X.java",
38552 				xSource
38553 			});
38554 	}
38555 }
38556 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=176591
38557 //variant
38558 public void test1110() {
38559 	this.runConformTest(
38560 		new String[] {
38561 			"X.java",
38562 			"class X {\n" +
38563 			"  public Y<String> foo()\n" +
38564 			"  {\n" +
38565 			"    return true ? Z.<String>bar() : null;\n" +
38566 			"  }\n" +
38567 			"}\n" +
38568 			"class Y<T> {\n" +
38569 			"}\n" +
38570 			"class Z {\n" +
38571 			"  static <U> Y<U> bar() {\n" +
38572 			"    return null;\n" +
38573 			"  }\n" +
38574 			"}\n",
38575 		},
38576 		"");
38577 }
38578 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=177194
38579 public void test1111() {
38580 	Map settings = getCompilerOptions();
38581 	settings.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
38582 	this.runConformTest(
38583 		new String[] {
38584 			"X.java",
38585 			"class A<T> {\n" +
38586 			"        public T foo(Object o) {\n" +
38587 			"                return (T) o; // should get unchecked warning\n" +
38588 			"        }\n" +
38589 			"}\n" +
38590 			"\n" +
38591 			"public class X {\n" +
38592 			"        public static void main(String[] args) {\n" +
38593 			"                A<X> a = new A<X>();\n" +
38594 			"                try {\n" +
38595 			"	                X s = a.foo(new Object());\n" +
38596 			"                } catch(ClassCastException e) {\n" +
38597 			"                	System.out.println(\"SUCCESS\");\n" +
38598 			"                	return;\n" +
38599 			"                }\n" +
38600 			"            	System.out.println(\"FAILED\");\n" +
38601 			"        }\n" +
38602 			"}\n", // =================
38603 		},
38604 		"SUCCESS",
38605 		null,
38606 		true,
38607 		null,
38608 		settings,
38609 		null);
38610 }
38611 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=177194 - variation
38612 public void test1112() {
38613 	Map settings = getCompilerOptions();
38614 	settings.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
38615 	this.runConformTest(
38616 		new String[] {
38617 			"X.java",
38618 			"class A<T> {\n" +
38619 			"        public T foo;\n" +
38620 			"}\n" +
38621 			"\n" +
38622 			"public class X {\n" +
38623 			"        public static void main(String[] args) {\n" +
38624 			"                A<X> a = new A<X>();\n" +
38625 			"				 A ua = a;\n" +
38626 			"				 ua.foo = new Object();\n" +
38627 			"                try {\n" +
38628 			"	                X s = a.foo;\n" +
38629 			"                } catch(ClassCastException e) {\n" +
38630 			"                	System.out.println(\"SUCCESS\");\n" +
38631 			"                	return;\n" +
38632 			"                }\n" +
38633 			"            	System.out.println(\"FAILED\");\n" +
38634 			"        }\n" +
38635 			"}\n", // =================
38636 		},
38637 		"SUCCESS",
38638 		null,
38639 		true,
38640 		null,
38641 		settings,
38642 		null);
38643 }
38644 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=177194 - variation
38645 public void test1113() {
38646 	Map settings = getCompilerOptions();
38647 	settings.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
38648 	this.runConformTest(
38649 		new String[] {
38650 			"X.java",
38651 			"class A<T> {\n" +
38652 			"        public T foo;\n" +
38653 			"}\n" +
38654 			"\n" +
38655 			"public class X extends A<X>{\n" +
38656 			"        public static void main(String[] args) {\n" +
38657 			"			new X().foo();\n" +
38658 			"		 }\n" +
38659 			" 		 public void foo() {\n" +
38660 			"				 A ua = this;\n" +
38661 			"				 ua.foo = new Object();\n" +
38662 			"                try {\n" +
38663 			"	                X s = foo;\n" +
38664 			"                } catch(ClassCastException e) {\n" +
38665 			"                	System.out.println(\"SUCCESS\");\n" +
38666 			"                	return;\n" +
38667 			"                }\n" +
38668 			"            	System.out.println(\"FAILED\");\n" +
38669 			"        }\n" +
38670 			"}\n", // =================
38671 		},
38672 		"SUCCESS",
38673 		null,
38674 		true,
38675 		null,
38676 		settings,
38677 		null);
38678 }
38679 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=177194 - variation
38680 public void test1114() {
38681 	Map settings = getCompilerOptions();
38682 	settings.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
38683 	this.runConformTest(
38684 		new String[] {
38685 			"X.java",
38686 			"class A<T> {\n" +
38687 			"        public T foo;\n" +
38688 			"}\n" +
38689 			"\n" +
38690 			"public class X extends A<X>{\n" +
38691 			"        public static void main(String[] args) {\n" +
38692 			"			new X().foo();\n" +
38693 			"		 }\n" +
38694 			" 		 public void foo() {\n" +
38695 			"				 A ua = this;\n" +
38696 			"				 ua.foo = new Object();\n" +
38697 			"                try {\n" +
38698 			"	                X s = this.foo;\n" +
38699 			"                } catch(ClassCastException e) {\n" +
38700 			"                	System.out.println(\"SUCCESS\");\n" +
38701 			"                	return;\n" +
38702 			"                }\n" +
38703 			"            	System.out.println(\"FAILED\");\n" +
38704 			"        }\n" +
38705 			"}\n", // =================
38706 		},
38707 		"SUCCESS",
38708 		null,
38709 		true,
38710 		null,
38711 		settings,
38712 		null);
38713 }
38714 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=177194 - variation
38715 public void test1115() {
38716 	Map settings = getCompilerOptions();
38717 	settings.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
38718 	this.runConformTest(
38719 		new String[] {
38720 			"X.java",
38721 			"class A<T> {\n" +
38722 			"        public T foo;\n" +
38723 			"}\n" +
38724 			"\n" +
38725 			"public class X {\n" +
38726 			"		 static X ROOT;\n" +
38727 			"        public static void main(String[] args) {\n" +
38728 			"                A<X> a = new A<X>();\n" +
38729 			"				 A ua = a;\n" +
38730 			"				 ua.foo = new Object();\n" +
38731 			"                try {\n" +
38732 			"	                X s = a.foo.ROOT;\n" +
38733 			"                } catch(ClassCastException e) {\n" +
38734 			"                	System.out.println(\"SUCCESS\");\n" +
38735 			"                	return;\n" +
38736 			"                }\n" +
38737 			"            	System.out.println(\"FAILED\");\n" +
38738 			"        }\n" +
38739 			"}\n", // =================
38740 		},
38741 		"SUCCESS",
38742 		null,
38743 		true,
38744 		null,
38745 		settings,
38746 		null);
38747 }
38748 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=177194 - variation
38749 public void test1116() {
38750 	this.runConformTest(
38751 		new String[] {
38752 			"X.java",
38753 			"import java.io.Serializable;\n" +
38754 			"\n" +
38755 			"interface I {\n" +
38756 			"    int CONST = 1;\n" +
38757 			"}\n" +
38758 			"\n" +
38759 			"class Z<T extends Serializable&I> {\n" +
38760 			"    T c;\n" +
38761 			"    Z(T c) {\n" +
38762 			"        this.c = c;\n" +
38763 			"    }\n" +
38764 			"    int foo() {\n" +
38765 			"        return c.CONST;\n" +
38766 			"    }\n" +
38767 			"}\n" +
38768 			"\n" +
38769 			"public class X implements Serializable, I {\n" +
38770 			"    public static void main(String argv[]) {\n" +
38771 			"        Z<X> z = new Z<X>(new X());\n" +
38772 			"        Z rawz = z;\n" +
38773 			"        rawz.c = new Serializable(){};\n" +
38774 			"        try {\n" +
38775 			"	        z.foo();\n" +
38776 			"        } catch(ClassCastException e) {\n" +
38777 			"        	System.out.println(\"SUCCESS\");\n" +
38778 			"        }\n" +
38779 			"    }\n" +
38780 			"}\n", // =================
38781 		},
38782 		"SUCCESS");
38783 }
38784 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=177194 - variation
38785 public void test1117() throws Exception {
38786 	Map options = getCompilerOptions();
38787 	options.put(CompilerOptions.OPTION_PreserveUnusedLocal, CompilerOptions.OPTIMIZE_OUT);
38788 	this.runConformTest(
38789 		new String[] {
38790 			"X.java",
38791 			"interface I<T> {\n" +
38792 			"	Value<String> CONST = null;\n" +
38793 			"}\n" +
38794 			"class Value<V> {\n" +
38795 			"	String NAME = \"VALUE\";\n" +
38796 			"}\n" +
38797 			"class B<V> implements I<V> {\n" +
38798 			"	B(Value<String> param) {\n" +
38799 			"		Value<String> v0 = CONST;\n" +
38800 			"		Value<String> v1 = this.CONST;\n" +
38801 			"		String s2 = CONST.NAME;\n" +
38802 			"		Value<String> v3 = I.CONST;\n" +
38803 			"		Value<String> v4 = B.CONST;\n" +
38804 			"	}\n" +
38805 			"}\n" +
38806 			"public class X {\n" +
38807 			"	public static void main(String[] args) {\n" +
38808 			"		try {\n" +
38809 			"			new B<String>(new Value<String>());\n" +
38810 			"		} catch(NullPointerException e) {\n" +
38811 			"			System.out.println(\"SUCCESS\");\n" +
38812 			"		}\n" +
38813 			"	}\n" +
38814 			"}\n", // =================
38815 		},
38816 		"SUCCESS",
38817 		null,
38818 		false,
38819 		null,
38820 		options,
38821 		null);
38822 	// check the reference to I.CONST is generated as B.CONST, except for v3 still issuing I.CONST
38823 	String expectedOutput =
38824 		"  // Method descriptor #8 (LValue;)V\n" +
38825 		"  // Signature: (LValue<Ljava/lang/String;>;)V\n" +
38826 		"  // Stack: 1, Locals: 2\n" +
38827 		"  B(Value param);\n" +
38828 		"     0  aload_0 [this]\n" +
38829 		"     1  invokespecial java.lang.Object() [12]\n" +
38830 		"     4  getstatic B.CONST : Value [15]\n" +
38831 		"     7  pop\n" +
38832 		"     8  getstatic B.CONST : Value [15]\n" +
38833 		"    11  pop\n" +
38834 		"    12  getstatic B.CONST : Value [15]\n" +
38835 		"    15  getfield Value.NAME : java.lang.String [19]\n" +
38836 		"    18  pop\n" +
38837 		"    19  getstatic I.CONST : Value [25]\n" +
38838 		"    22  pop\n" +
38839 		"    23  getstatic B.CONST : Value [15]\n" +
38840 		"    26  pop\n" +
38841 		"    27  return\n" +
38842 		"      Line numbers:\n" +
38843 		"        [pc: 0, line: 8]\n" +
38844 		"        [pc: 4, line: 9]\n" +
38845 		"        [pc: 8, line: 10]\n" +
38846 		"        [pc: 12, line: 11]\n" +
38847 		"        [pc: 19, line: 12]\n" +
38848 		"        [pc: 23, line: 13]\n" +
38849 		"        [pc: 27, line: 14]\n" +
38850 		"      Local variable table:\n" +
38851 		"        [pc: 0, pc: 28] local: this index: 0 type: B\n" +
38852 		"        [pc: 0, pc: 28] local: param index: 1 type: Value\n" +
38853 		"      Local variable type table:\n" +
38854 		"        [pc: 0, pc: 28] local: this index: 0 type: B<V>\n" +
38855 		"        [pc: 0, pc: 28] local: param index: 1 type: Value<java.lang.String>\n";
38856 
38857 	File f = new File(OUTPUT_DIR + File.separator + "B.class");
38858 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
38859 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
38860 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
38861 	int index = result.indexOf(expectedOutput);
38862 	if (index == -1 || expectedOutput.length() == 0) {
38863 		System.out.println(Util.displayString(result, 3));
38864 	}
38865 	if (index == -1) {
38866 		assertEquals("Wrong contents", expectedOutput, result);
38867 	}
38868 }
38869 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=177715
38870 public void test1118() {
38871 	String source = "import java.util.List;\n" +
38872 			"\n" +
38873 			"public class X {\n" +
38874 			"	X() {\n" +
38875 			"		Class<? extends List<?>> cls = null;\n" +
38876 			"		foo(cls);\n" +
38877 			"	}\n" +
38878 			"\n" +
38879 			"	<I, T extends List<I>> T foo(Class<T> pClass) {\n" +
38880 			"		return null;\n" +
38881 			"	}\n" +
38882 			"}\n";
38883 	if (this.complianceLevel < ClassFileConstants.JDK1_8) {
38884 		runConformTest(
38885 				new String[] { "X.java", source },
38886 				JavacTestOptions.EclipseHasABug.EclipseBug177715 /* javac test options */);
38887 	} else {
38888 		runNegativeTest(
38889 			new String[] { "X.java", source },
38890 			"----------\n" +
38891 			"1. ERROR in X.java (at line 6)\n" +
38892 			"	foo(cls);\n" +
38893 			"	^^^\n" +
38894 			"The method foo(Class<T>) in the type X is not applicable for the arguments (Class<capture#1-of ? extends List<?>>)\n" +
38895 			"----------\n");
38896 	}
38897 }
38898 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=169728
38899 public void test1119() {
38900 	this.runNegativeTest(
38901 		new String[] {
38902 			"X.java",
38903 			"public class X<T extends Comparable<T> & Runnable> {\n" +
38904 			"	T get() {\n" +
38905 			"		return null;\n" +
38906 			"	}\n" +
38907 			"	public static void main(String[] args) {\n" +
38908 			"		\n" +
38909 			"		X<OnlyRunnable> x1 = null; // error\n" +
38910 			"		X<OnlyComparable> x2 = null; // error\n" +
38911 			"		X<ComparableRunnable> x3 = null; // ok\n" +
38912 			"		X<ComparableRunnableThrowable> x4 = null; // ok\n" +
38913 			"		\n" +
38914 			"		foo1(x1); // ok\n" +
38915 			"		foo1(x2); // ok\n" +
38916 			"		foo1(x3); // ok\n" +
38917 			"		foo1(x4); // ok\n" +
38918 			"\n" +
38919 			"		foo2(x1); // error\n" +
38920 			"		foo2(x2); // error\n" +
38921 			"		foo2(x3); // error\n" +
38922 			"		foo2(x4); // ok\n" +
38923 			"	}\n" +
38924 			"	\n" +
38925 			"	static void foo1(X<?> x) {\n" +
38926 			"		x.get().run(); // ok\n" +
38927 			"		x.get().compareTo(null); // ok\n" +
38928 			"		x.get().compareTo(x.get()); // error\n" +
38929 			"	}\n" +
38930 			"	static void foo2(X<? extends Throwable> x) {\n" +
38931 			"		x.get().run(); // ok\n" +
38932 			"		x.get().compareTo(null); // ok\n" +
38933 			"		x.get().compareTo(x.get()); // error\n" +
38934 			"	}	\n" +
38935 			"}\n" +
38936 			"\n" +
38937 			"abstract class OnlyRunnable implements Runnable {}\n" +
38938 			"abstract class OnlyComparable implements Comparable<OnlyComparable> {}\n" +
38939 			"abstract class ComparableRunnable implements Comparable<ComparableRunnable>, Runnable {}\n" +
38940 			"abstract class ComparableRunnableThrowable extends Throwable implements Comparable<ComparableRunnable>, Runnable {\n" +
38941 			"	private static final long serialVersionUID = 1L;\n" +
38942 			"}", // =================
38943 		},
38944 		"----------\n" +
38945 		"1. ERROR in X.java (at line 7)\n" +
38946 		"	X<OnlyRunnable> x1 = null; // error\n" +
38947 		"	  ^^^^^^^^^^^^\n" +
38948 		"Bound mismatch: The type OnlyRunnable is not a valid substitute for the bounded parameter <T extends Comparable<T> & Runnable> of the type X<T>\n" +
38949 		"----------\n" +
38950 		"2. ERROR in X.java (at line 8)\n" +
38951 		"	X<OnlyComparable> x2 = null; // error\n" +
38952 		"	  ^^^^^^^^^^^^^^\n" +
38953 		"Bound mismatch: The type OnlyComparable is not a valid substitute for the bounded parameter <T extends Comparable<T> & Runnable> of the type X<T>\n" +
38954 		"----------\n" +
38955 		"3. ERROR in X.java (at line 10)\n" +
38956 		"	X<ComparableRunnableThrowable> x4 = null; // ok\n" +
38957 		"	  ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
38958 		"Bound mismatch: The type ComparableRunnableThrowable is not a valid substitute for the bounded parameter <T extends Comparable<T> & Runnable> of the type X<T>\n" +
38959 		"----------\n" +
38960 		"4. ERROR in X.java (at line 17)\n" +
38961 		"	foo2(x1); // error\n" +
38962 		"	^^^^\n" +
38963 		"The method foo2(X<? extends Throwable>) in the type X<T> is not applicable for the arguments (X<OnlyRunnable>)\n" +
38964 		"----------\n" +
38965 		"5. ERROR in X.java (at line 18)\n" +
38966 		"	foo2(x2); // error\n" +
38967 		"	^^^^\n" +
38968 		"The method foo2(X<? extends Throwable>) in the type X<T> is not applicable for the arguments (X<OnlyComparable>)\n" +
38969 		"----------\n" +
38970 		"6. ERROR in X.java (at line 19)\n" +
38971 		"	foo2(x3); // error\n" +
38972 		"	^^^^\n" +
38973 		"The method foo2(X<? extends Throwable>) in the type X<T> is not applicable for the arguments (X<ComparableRunnable>)\n" +
38974 		"----------\n" +
38975 		"7. ERROR in X.java (at line 26)\n" +
38976 		"	x.get().compareTo(x.get()); // error\n" +
38977 		"	        ^^^^^^^^^\n" +
38978 		"The method compareTo(capture#3-of ?) in the type Comparable<capture#3-of ?> is not applicable for the arguments (capture#4-of ?)\n" +
38979 		"----------\n" +
38980 		"8. ERROR in X.java (at line 31)\n" +
38981 		"	x.get().compareTo(x.get()); // error\n" +
38982 		"	        ^^^^^^^^^\n" +
38983 		"The method compareTo(capture#7-of ? extends Throwable) in the type Comparable<capture#7-of ? extends Throwable> is not applicable for the arguments (capture#8-of ? extends Throwable)\n" +
38984 		"----------\n");
38985 }
38986 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=166963
38987 public void test1120() {
38988 	this.runNegativeTest(
38989 		new String[] {
38990 			"X.java",
38991 			"public class X {\n" +
38992 			"	public X() {\n" +
38993 			"		System.out.println();\n" +
38994 			"		this(zork);\n" +
38995 			"		Zork.this.this();\n" +
38996 			"		<Zork>this();\n" +
38997 			"	}\n" +
38998 			"}", // =================
38999 		},
39000 		"----------\n" +
39001 		"1. ERROR in X.java (at line 4)\n" +
39002 		"	this(zork);\n" +
39003 		"	^^^^^^^^^^^\n" +
39004 		"Constructor call must be the first statement in a constructor\n" +
39005 		"----------\n" +
39006 		"2. ERROR in X.java (at line 4)\n" +
39007 		"	this(zork);\n" +
39008 		"	     ^^^^\n" +
39009 		"zork cannot be resolved to a variable\n" +
39010 		"----------\n" +
39011 		"3. ERROR in X.java (at line 5)\n" +
39012 		"	Zork.this.this();\n" +
39013 		"	^^^^^^^^^^^^^^^^^\n" +
39014 		"Constructor call must be the first statement in a constructor\n" +
39015 		"----------\n" +
39016 		"4. ERROR in X.java (at line 5)\n" +
39017 		"	Zork.this.this();\n" +
39018 		"	^^^^\n" +
39019 		"Zork cannot be resolved to a type\n" +
39020 		"----------\n" +
39021 		"5. ERROR in X.java (at line 6)\n" +
39022 		"	<Zork>this();\n" +
39023 		"	 ^^^^\n" +
39024 		"Zork cannot be resolved to a type\n" +
39025 		"----------\n" +
39026 		"6. ERROR in X.java (at line 6)\n" +
39027 		"	<Zork>this();\n" +
39028 		"	      ^^^^^^^\n" +
39029 		"Constructor call must be the first statement in a constructor\n" +
39030 		"----------\n");
39031 }
39032 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=181270
39033 public void test1121() {
39034 	this.runNegativeTest(
39035 		new String[] {
39036 			"X.java",
39037 			"public class X<T> {\n" +
39038 			"	void foo() {\n" +
39039 			"		System.out.println(T[].class);\n" +
39040 			"	}\n" +
39041 			"}", // =================
39042 		},
39043 		"----------\n" +
39044 		"1. ERROR in X.java (at line 3)\n" +
39045 		"	System.out.println(T[].class);\n" +
39046 		"	                   ^^^^^^^^^\n" +
39047 		"Illegal class literal for the type parameter T\n" +
39048 		"----------\n");
39049 }
39050 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=181270
39051 public void test1122() {
39052 	this.runNegativeTest(
39053 		new String[] {
39054 			"X.java",
39055 			"public class X {\n" +
39056 			"	<T> void foo() {\n" +
39057 			"		System.out.println(T[].class);\n" +
39058 			"	}\n" +
39059 			"}", // =================
39060 		},
39061 		"----------\n" +
39062 		"1. ERROR in X.java (at line 3)\n" +
39063 		"	System.out.println(T[].class);\n" +
39064 		"	                   ^^^^^^^^^\n" +
39065 		"Illegal class literal for the type parameter T\n" +
39066 		"----------\n");
39067 }
39068 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=181270 - variation
39069 public void test1123() {
39070 	this.runNegativeTest(
39071 		new String[] {
39072 			"X.java",
39073 			"public class X {\n" +
39074 			"	void foo() {\n" +
39075 			"		Class<Integer> c1 = int.class;\n" +
39076 			"		Class<Integer> c2 = Integer.class;\n" +
39077 			"		Class<Integer[]> c3 = int[].class;\n" +
39078 			"		Class<int[]> c4 = int[].class;\n" +
39079 			"		Class<Void> c5 = void.class;\n" +
39080 			"		Class<void[]> c6 = void[].class;\n" +
39081 			"	}\n" +
39082 			"}", // =================
39083 		},
39084 		"----------\n" +
39085 		"1. ERROR in X.java (at line 5)\n" +
39086 		"	Class<Integer[]> c3 = int[].class;\n" +
39087 		"	                      ^^^^^^^^^^^\n" +
39088 		"Type mismatch: cannot convert from Class<int[]> to Class<Integer[]>\n" +
39089 		"----------\n" +
39090 		"2. ERROR in X.java (at line 8)\n" +
39091 		"	Class<void[]> c6 = void[].class;\n" +
39092 		"	      ^^^^^^\n" +
39093 		"void[] is an invalid type\n" +
39094 		"----------\n" +
39095 		"3. ERROR in X.java (at line 8)\n" +
39096 		"	Class<void[]> c6 = void[].class;\n" +
39097 		"	                   ^^^^^^\n" +
39098 		"void[] is an invalid type\n" +
39099 		"----------\n");
39100 }
39101 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=182192
39102 public void test1124() {
39103 	String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ?
39104 			"----------\n" +
39105 			"1. WARNING in X.java (at line 13)\n" +
39106 			"	public static class InnerClassThatShowsBug extends X {\n" +
39107 			"	                                                   ^\n" +
39108 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
39109 			"----------\n" +
39110 			"2. WARNING in X.java (at line 15)\n" +
39111 			"	super(null);\n" +
39112 			"	^^^^^^^^^^^^\n" +
39113 			"Type safety: The constructor X(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
39114 			"----------\n" +
39115 			"3. ERROR in X.java (at line 19)\n" +
39116 			"	for (Map.Entry<String, String> entry : myMap().entrySet()) {\n" +
39117 			"	                                       ^^^^^^^^^^^^^^^^^^\n" +
39118 			"Type mismatch: cannot convert from element type Object to Map.Entry<String,String>\n" +
39119 			"----------\n"
39120 			:
39121 			"----------\n" +
39122 			"1. WARNING in X.java (at line 13)\n" +
39123 			"	public static class InnerClassThatShowsBug extends X {\n" +
39124 			"	                                                   ^\n" +
39125 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
39126 			"----------\n" +
39127 			"2. WARNING in X.java (at line 15)\n" +
39128 			"	super(null);\n" +
39129 			"	^^^^^^^^^^^^\n" +
39130 			"Type safety: The constructor X(Object) belongs to the raw type X. References to generic type X<T> should be parameterized\n" +
39131 			"----------\n" +
39132 			"3. WARNING in X.java (at line 15)\n" +
39133 			"	super(null);\n" +
39134 			"	^^^^^^^^^^^^\n" +
39135 			"Access to enclosing constructor X<T>(T) is emulated by a synthetic accessor method\n" +
39136 			"----------\n" +
39137 			"4. ERROR in X.java (at line 19)\n" +
39138 			"	for (Map.Entry<String, String> entry : myMap().entrySet()) {\n" +
39139 			"	                                       ^^^^^^^^^^^^^^^^^^\n" +
39140 			"Type mismatch: cannot convert from element type Object to Map.Entry<String,String>\n" +
39141 			"----------\n";
39142 	this.runNegativeTest(
39143 		new String[] {
39144 			"X.java",
39145 			"import java.util.HashMap;\n" +
39146 			"import java.util.Map;\n" +
39147 			"\n" +
39148 			"public class X<T> {\n" +
39149 			"\n" +
39150 			"	static protected final Map<String, String> myMap = new HashMap<String, String>();\n" +
39151 			"	private final T theGenericThing;\n" +
39152 			"\n" +
39153 			"	private X(T something) {\n" +
39154 			"		this.theGenericThing = something;\n" +
39155 			"	}\n" +
39156 			"\n" +
39157 			"	public static class InnerClassThatShowsBug extends X {\n" +
39158 			"		public InnerClassThatShowsBug() {\n" +
39159 			"			super(null);\n" +
39160 			"		}\n" +
39161 			"\n" +
39162 			"		public void printMap() {\n" +
39163 			"			for (Map.Entry<String, String> entry : myMap().entrySet()) {\n" +
39164 			"				System.out.println(entry.getKey() + \" => \" + entry.getValue());\n" +
39165 			"			}\n" +
39166 			"		}\n" +
39167 			"		protected Map<String, String> myMap2() {\n" +
39168 			"			return myMap;\n" +
39169 			"		}\n" +
39170 			"		public void printMap2() {\n" +
39171 			"			for (Map.Entry<String, String> entry : myMap2().entrySet()) {\n" +
39172 			"				System.out.println(entry.getKey() + \" => \" + entry.getValue());\n" +
39173 			"			}\n" +
39174 			"		}\n" +
39175 			"	}\n" +
39176 			"\n" +
39177 			"	protected Map<String, String> myMap() {\n" +
39178 			"		return myMap;\n" +
39179 			"	}\n" +
39180 			"}", // =================
39181 		}, errMessage);
39182 }
39183 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=183216
39184 public void test1125() {
39185 	this.runNegativeTest(
39186 		new String[] {
39187 			"X.java",
39188 			"class A {\n" +
39189 			"    class B<T> {\n" +
39190 			"        T t;\n" +
39191 			"        T getValue() {\n" +
39192 			"            return t;\n" +
39193 			"        }\n" +
39194 			"    }\n" +
39195 			"}\n" +
39196 			"\n" +
39197 			"class C<T> extends A {\n" +
39198 			"	Zork z;\n" +
39199 			"}\n" +
39200 			"\n" +
39201 			"public class X {\n" +
39202 			"    static C.B<Double> c = new C().new B<Double>();\n" +
39203 			"\n" +
39204 			"    public static void main(String[] args) {\n" +
39205 			"        C.B<String> temp = new C().new B<String>();\n" +
39206 			"        String s = temp.getValue();\n" +
39207 			"        System.out.println(s);\n" +
39208 			"        foo(bar());\n" +
39209 			"    }\n" +
39210 			"\n" +
39211 			"    static C.B<? extends Number> bar() {\n" +
39212 			"        return new C().new B<Integer>();\n" +
39213 			"    }\n" +
39214 			"\n" +
39215 			"    static void foo(C.B<?> arg) {\n" +
39216 			"        Object o = arg.getValue();\n" +
39217 			"        Double d = c.getValue();\n" +
39218 			"        System.out.println(o);\n" +
39219 			"        System.out.println(d);\n" +
39220 			"    }\n" +
39221 			"}\n", // =================
39222 		},
39223 		"----------\n" +
39224 		"1. ERROR in X.java (at line 11)\n" +
39225 		"	Zork z;\n" +
39226 		"	^^^^\n" +
39227 		"Zork cannot be resolved to a type\n" +
39228 		"----------\n" +
39229 		"2. WARNING in X.java (at line 15)\n" +
39230 		"	static C.B<Double> c = new C().new B<Double>();\n" +
39231 		"	                           ^\n" +
39232 		"C is a raw type. References to generic type C<T> should be parameterized\n" +
39233 		"----------\n" +
39234 		"3. WARNING in X.java (at line 18)\n" +
39235 		"	C.B<String> temp = new C().new B<String>();\n" +
39236 		"	                       ^\n" +
39237 		"C is a raw type. References to generic type C<T> should be parameterized\n" +
39238 		"----------\n" +
39239 		"4. WARNING in X.java (at line 25)\n" +
39240 		"	return new C().new B<Integer>();\n" +
39241 		"	           ^\n" +
39242 		"C is a raw type. References to generic type C<T> should be parameterized\n" +
39243 		"----------\n");
39244 }
39245 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=183216 - variation
39246 public void test1126() {
39247 	this.runConformTest(
39248 		new String[] {
39249 			"X.java",
39250 			"class A {\n" +
39251 			"    class B<T> {\n" +
39252 			"        T t;\n" +
39253 			"        T getValue() {\n" +
39254 			"            return t;\n" +
39255 			"        }\n" +
39256 			"    }\n" +
39257 			"}\n" +
39258 			"\n" +
39259 			"public class X {\n" +
39260 			"    static A.B<Double> c = new A().new B<Double>();\n" +
39261 			"\n" +
39262 			"    public static void main(String[] args) {\n" +
39263 			"        A.B<String> temp = new A().new B<String>();\n" +
39264 			"        String s = temp.getValue();\n" +
39265 			"        System.out.print(s);\n" +
39266 			"        foo(bar());\n" +
39267 			"    }\n" +
39268 			"\n" +
39269 			"    static A.B<? extends Number> bar() {\n" +
39270 			"        return new A().new B<Integer>();\n" +
39271 			"    }\n" +
39272 			"\n" +
39273 			"    static void foo(A.B<?> arg) {\n" +
39274 			"        Object o = arg.getValue();\n" +
39275 			"        Double d = c.getValue();\n" +
39276 			"        System.out.print(o);\n" +
39277 			"        System.out.print(d);\n" +
39278 			"    }\n" +
39279 			"}\n", // =================
39280 		},
39281 		"nullnullnull");
39282 }
39283 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=183216 - variation
39284 public void test1127() {
39285 	this.runNegativeTest(
39286 		new String[] {
39287 			"X.java",
39288 			"class A<E> {\n" +
39289 			"    class B<T> {\n" +
39290 			"        T t;\n" +
39291 			"        T getValue() {\n" +
39292 			"            return t;\n" +
39293 			"        }\n" +
39294 			"    }\n" +
39295 			"}\n" +
39296 			"\n" +
39297 			"class C<T> extends A<T> {\n" +
39298 			"}\n" +
39299 			"\n" +
39300 			"public class X {\n" +
39301 			"    static C.B<Double> c = new C().new B<Double>();\n" +
39302 			"\n" +
39303 			"    public static void main(String[] args) {\n" +
39304 			"        C.B<String> temp = new C().new B<String>();\n" +
39305 			"        String s = temp.getValue();\n" +
39306 			"        System.out.println(s);\n" +
39307 			"        foo(bar());\n" +
39308 			"    }\n" +
39309 			"\n" +
39310 			"    static C.B<? extends Number> bar() {\n" +
39311 			"        return new C().new B<Integer>();\n" +
39312 			"    }\n" +
39313 			"\n" +
39314 			"    static void foo(C.B<?> arg) {\n" +
39315 			"        Object o = arg.getValue();\n" +
39316 			"        Double d = c.getValue();\n" +
39317 			"        System.out.println(o);\n" +
39318 			"        System.out.println(d);\n" +
39319 			"    }\n" +
39320 			"}\n", // =================
39321 		},
39322 		"----------\n" +
39323 		"1. ERROR in X.java (at line 14)\n" +
39324 		"	static C.B<Double> c = new C().new B<Double>();\n" +
39325 		"	       ^^^\n" +
39326 		"The member type A.B<Double> must be qualified with a parameterized type, since it is not static\n" +
39327 		"----------\n" +
39328 		"2. WARNING in X.java (at line 14)\n" +
39329 		"	static C.B<Double> c = new C().new B<Double>();\n" +
39330 		"	                           ^\n" +
39331 		"C is a raw type. References to generic type C<T> should be parameterized\n" +
39332 		"----------\n" +
39333 		"3. ERROR in X.java (at line 14)\n" +
39334 		"	static C.B<Double> c = new C().new B<Double>();\n" +
39335 		"	                                   ^\n" +
39336 		"The member type A.B<Double> must be qualified with a parameterized type, since it is not static\n" +
39337 		"----------\n" +
39338 		"4. ERROR in X.java (at line 17)\n" +
39339 		"	C.B<String> temp = new C().new B<String>();\n" +
39340 		"	^^^\n" +
39341 		"The member type A.B<String> must be qualified with a parameterized type, since it is not static\n" +
39342 		"----------\n" +
39343 		"5. WARNING in X.java (at line 17)\n" +
39344 		"	C.B<String> temp = new C().new B<String>();\n" +
39345 		"	                       ^\n" +
39346 		"C is a raw type. References to generic type C<T> should be parameterized\n" +
39347 		"----------\n" +
39348 		"6. ERROR in X.java (at line 17)\n" +
39349 		"	C.B<String> temp = new C().new B<String>();\n" +
39350 		"	                               ^\n" +
39351 		"The member type A.B<String> must be qualified with a parameterized type, since it is not static\n" +
39352 		"----------\n" +
39353 		"7. ERROR in X.java (at line 23)\n" +
39354 		"	static C.B<? extends Number> bar() {\n" +
39355 		"	       ^^^\n" +
39356 		"The member type A.B<? extends Number> must be qualified with a parameterized type, since it is not static\n" +
39357 		"----------\n" +
39358 		"8. WARNING in X.java (at line 24)\n" +
39359 		"	return new C().new B<Integer>();\n" +
39360 		"	           ^\n" +
39361 		"C is a raw type. References to generic type C<T> should be parameterized\n" +
39362 		"----------\n" +
39363 		"9. ERROR in X.java (at line 24)\n" +
39364 		"	return new C().new B<Integer>();\n" +
39365 		"	                   ^\n" +
39366 		"The member type A.B<Integer> must be qualified with a parameterized type, since it is not static\n" +
39367 		"----------\n" +
39368 		"10. ERROR in X.java (at line 27)\n" +
39369 		"	static void foo(C.B<?> arg) {\n" +
39370 		"	                ^^^\n" +
39371 		"The member type A.B<?> must be qualified with a parameterized type, since it is not static\n" +
39372 		"----------\n");
39373 }
39374 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=183216 - variation
39375 public void test1128() {
39376 	this.runNegativeTest(
39377 		new String[] {
39378 			"X.java",
39379 			"class A<T> {\n" +
39380 			"	class Member<U> {}\n" +
39381 			"}\n" +
39382 			"\n" +
39383 			"public class X extends A {\n" +
39384 			"	void foo() {\n" +
39385 			"		new Member<String>();\n" +
39386 			"		new X().new Member<String>();\n" +
39387 			"	}\n" +
39388 			"}\n", // =================
39389 		},
39390 		"----------\n" +
39391 		"1. WARNING in X.java (at line 5)\n" +
39392 		"	public class X extends A {\n" +
39393 		"	                       ^\n" +
39394 		"A is a raw type. References to generic type A<T> should be parameterized\n" +
39395 		"----------\n" +
39396 		"2. ERROR in X.java (at line 7)\n" +
39397 		"	new Member<String>();\n" +
39398 		"	    ^^^^^^\n" +
39399 		"The member type A.Member<String> must be qualified with a parameterized type, since it is not static\n" +
39400 		"----------\n" +
39401 		"3. ERROR in X.java (at line 8)\n" +
39402 		"	new X().new Member<String>();\n" +
39403 		"	            ^^^^^^\n" +
39404 		"The member type A.Member<String> must be qualified with a parameterized type, since it is not static\n" +
39405 		"----------\n");
39406 }
39407 public void test1129() {
39408 	this.runNegativeTest(
39409 		new String[] {
39410 			"X.java",
39411 			"import java.io.Serializable;\n" +
39412 			"\n" +
39413 			"abstract class Arg1 implements Comparable<Arg1>, Serializable {\n" +
39414 			"	private static final long serialVersionUID = 1L;\n" +
39415 			"}\n" +
39416 			"abstract class Arg2 implements Serializable, Comparable<Arg2> {\n" +
39417 			"	private static final long serialVersionUID = 1L;\n" +
39418 			"}\n" +
39419 			"\n" +
39420 			"interface IX<T> {}\n" +
39421 			"\n" +
39422 			"public class X {\n" +
39423 			"	void foo1(boolean b, IX<String> arg2) {\n" +
39424 			"		IX<String> o = b ? null : arg2;\n" +
39425 			"		IX<String> o2 = b ? arg2 : null;\n" +
39426 			"	}\n" +
39427 			"	void foo2(boolean b, IX<String> arg1, IX<? extends Object> arg2) {\n" +
39428 			"		String s = b ? arg1 : arg2;\n" +
39429 			"	}\n" +
39430 			"	void foo3(boolean b, Arg1 arg1, Arg2 arg2) {\n" +
39431 			"		String s = b ? arg1 : arg2;\n" +
39432 			"	}\n" +
39433 			"}  ", // =================
39434 		},
39435 		this.complianceLevel < ClassFileConstants.JDK1_8 ?
39436 		"----------\n" +
39437 		"1. ERROR in X.java (at line 18)\n" +
39438 		"	String s = b ? arg1 : arg2;\n" +
39439 		"	           ^^^^^^^^^^^^^^^\n" +
39440 		"Type mismatch: cannot convert from IX<capture#2-of ? extends Object> to String\n" +
39441 		"----------\n" +
39442 		"2. ERROR in X.java (at line 21)\n" +
39443 		"	String s = b ? arg1 : arg2;\n" +
39444 		"	           ^^^^^^^^^^^^^^^\n" +
39445 		"Type mismatch: cannot convert from Object&Comparable<?>&Serializable to String\n" +
39446 		"----------\n" :
39447 			"----------\n" +
39448 			"1. ERROR in X.java (at line 18)\n" +
39449 			"	String s = b ? arg1 : arg2;\n" +
39450 			"	               ^^^^\n" +
39451 			"Type mismatch: cannot convert from IX<String> to String\n" +
39452 			"----------\n" +
39453 			"2. ERROR in X.java (at line 18)\n" +
39454 			"	String s = b ? arg1 : arg2;\n" +
39455 			"	                      ^^^^\n" +
39456 			"Type mismatch: cannot convert from IX<capture#1-of ? extends Object> to String\n" +
39457 			"----------\n" +
39458 			"3. ERROR in X.java (at line 21)\n" +
39459 			"	String s = b ? arg1 : arg2;\n" +
39460 			"	               ^^^^\n" +
39461 			"Type mismatch: cannot convert from Arg1 to String\n" +
39462 			"----------\n" +
39463 			"4. ERROR in X.java (at line 21)\n" +
39464 			"	String s = b ? arg1 : arg2;\n" +
39465 			"	                      ^^^^\n" +
39466 			"Type mismatch: cannot convert from Arg2 to String\n" +
39467 			"----------\n");
39468 }
39469 public void test1130() {
39470 	this.runNegativeTest(
39471 		new String[] {
39472 			"X.java",
39473 			"import java.io.Serializable;\n" +
39474 			"import java.util.List;\n" +
39475 			"\n" +
39476 			"interface IX<T extends Comparable<T>&Serializable> {}\n" +
39477 			"\n" +
39478 			"public class X<T extends Comparable<T>&Serializable> {\n" +
39479 			"	void foo4(boolean b, List<? extends T> l1, List<? extends Comparable<T>> l2) {\n" +
39480 			"		String s = b ? l1.get(0) : l2.get(0);\n" +
39481 			"	}\n" +
39482 			"}\n", // =================
39483 		},
39484 		this.complianceLevel < ClassFileConstants.JDK1_8 ?
39485 			"----------\n" +
39486 			"1. ERROR in X.java (at line 8)\n" +
39487 			"	String s = b ? l1.get(0) : l2.get(0);\n" +
39488 			"	           ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
39489 			"Type mismatch: cannot convert from Comparable<T> to String\n" +
39490 			"----------\n" :
39491 				"----------\n" +
39492 				"1. ERROR in X.java (at line 8)\n" +
39493 				"	String s = b ? l1.get(0) : l2.get(0);\n" +
39494 				"	               ^^^^^^^^^\n" +
39495 				"Type mismatch: cannot convert from capture#1-of ? extends T to String\n" +
39496 				"----------\n" +
39497 				"2. ERROR in X.java (at line 8)\n" +
39498 				"	String s = b ? l1.get(0) : l2.get(0);\n" +
39499 				"	                           ^^^^^^^^^\n" +
39500 				"Type mismatch: cannot convert from capture#2-of ? extends Comparable<T> to String\n" +
39501 				"----------\n");
39502 }
39503 public void test1131() {
39504 	this.runNegativeTest(
39505 		new String[] {
39506 			"X.java",
39507 			"import java.io.Serializable;\n" +
39508 			"import java.util.List;\n" +
39509 			"\n" +
39510 			"public class X<T extends Comparable<T>&Serializable> {\n" +
39511 			"	<V extends T> void foo4(boolean b, List<? extends V> l1, List<? extends Comparable<V>> l2) {\n" +
39512 			"		String s = b ? l1.get(0) : l2.get(0);\n" +
39513 			"	}\n" +
39514 			"} \n", // =================
39515 		},
39516 		this.complianceLevel < ClassFileConstants.JDK1_8 ?
39517 			"----------\n" +
39518 			"1. ERROR in X.java (at line 6)\n" +
39519 			"	String s = b ? l1.get(0) : l2.get(0);\n" +
39520 			"	           ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
39521 			"Type mismatch: cannot convert from Comparable<capture#3-of ? extends T> to String\n" +
39522 			"----------\n" :
39523 				"----------\n" +
39524 				"1. ERROR in X.java (at line 6)\n" +
39525 				"	String s = b ? l1.get(0) : l2.get(0);\n" +
39526 				"	               ^^^^^^^^^\n" +
39527 				"Type mismatch: cannot convert from capture#1-of ? extends V to String\n" +
39528 				"----------\n" +
39529 				"2. ERROR in X.java (at line 6)\n" +
39530 				"	String s = b ? l1.get(0) : l2.get(0);\n" +
39531 				"	                           ^^^^^^^^^\n" +
39532 				"Type mismatch: cannot convert from capture#2-of ? extends Comparable<V> to String\n" +
39533 				"----------\n");
39534 }
39535 public void test1132() {
39536 	this.runNegativeTest(
39537 		new String[] {
39538 			"X.java",
39539 			"import java.util.*;\n" +
39540 			"\n" +
39541 			"public class X<T> {\n" +
39542 			"\n" +
39543 			"	public void thisDoesntCompile() {\n" +
39544 			"		X myThing = new X<Object>();\n" +
39545 			"		Integer i = myThing.getList().get(0); // Type Mismatch error - Since\n" +
39546 			"												// myThing is unbounded, return\n" +
39547 			"												// type List<Integer> becomes unbounded\n" +
39548 			"	}\n" +
39549 			"\n" +
39550 			"	public List<Integer> getList() {\n" +
39551 			"		ArrayList<Integer> l = new ArrayList<Integer>();\n" +
39552 			"		l.add(Integer.valueOf(0));\n" +
39553 			"		return l;\n" +
39554 			"	}\n" +
39555 			"\n" +
39556 			"	public void thisMethodCompilesOk() {\n" +
39557 			"		X<Object> myThing = new X<Object>();\n" +
39558 			"		Integer i = myThing.getList().get(0);\n" +
39559 			"	}\n" +
39560 			"\n" +
39561 			"	public void thisMethodAlsoCompilesOk() {\n" +
39562 			"		X myThing = new X<Object>();\n" +
39563 			"		List<Integer> l = myThing.getList();\n" +
39564 			"		Integer i = l.get(0);\n" +
39565 			"	}\n" +
39566 			"}\n", // =================
39567 		},
39568 		"----------\n" +
39569 		"1. WARNING in X.java (at line 6)\n" +
39570 		"	X myThing = new X<Object>();\n" +
39571 		"	^\n" +
39572 		"X is a raw type. References to generic type X<T> should be parameterized\n" +
39573 		"----------\n" +
39574 		"2. ERROR in X.java (at line 7)\n" +
39575 		"	Integer i = myThing.getList().get(0); // Type Mismatch error - Since\n" +
39576 		"	            ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
39577 		"Type mismatch: cannot convert from Object to Integer\n" +
39578 		"----------\n" +
39579 		"3. WARNING in X.java (at line 24)\n" +
39580 		"	X myThing = new X<Object>();\n" +
39581 		"	^\n" +
39582 		"X is a raw type. References to generic type X<T> should be parameterized\n" +
39583 		"----------\n" +
39584 		"4. WARNING in X.java (at line 25)\n" +
39585 		"	List<Integer> l = myThing.getList();\n" +
39586 		"	                  ^^^^^^^^^^^^^^^^^\n" +
39587 		"Type safety: The expression of type List needs unchecked conversion to conform to List<Integer>\n" +
39588 		"----------\n");
39589 }
39590 public void test1133() {
39591 	this.runNegativeTest(
39592 		new String[] {
39593 			"X.java",
39594 			"import java.util.*;\n" +
39595 			"\n" +
39596 			"class Y {\n" +
39597 			"	List<String> foo() { return null; }\n" +
39598 			"}\n" +
39599 			"\n" +
39600 			"public class X<T> extends Y {\n" +
39601 			"	List<String> bar() { return null; }\n" +
39602 			"	\n" +
39603 			"	void m(X x) {\n" +
39604 			"		List<Object> l1 = x.foo();\n" +
39605 			"		List<Object> l2 = x.bar();\n" +
39606 			"	}\n" +
39607 			"}\n", // =================
39608 		},
39609 		"----------\n" +
39610 		"1. WARNING in X.java (at line 10)\n" +
39611 		"	void m(X x) {\n" +
39612 		"	       ^\n" +
39613 		"X is a raw type. References to generic type X<T> should be parameterized\n" +
39614 		"----------\n" +
39615 		"2. ERROR in X.java (at line 11)\n" +
39616 		"	List<Object> l1 = x.foo();\n" +
39617 		"	                  ^^^^^^^\n" +
39618 		"Type mismatch: cannot convert from List<String> to List<Object>\n" +
39619 		"----------\n" +
39620 		"3. WARNING in X.java (at line 12)\n" +
39621 		"	List<Object> l2 = x.bar();\n" +
39622 		"	                  ^^^^^^^\n" +
39623 		"Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
39624 		"----------\n");
39625 }
39626 public void test1134() {
39627 	this.runNegativeTest(
39628 		new String[] {
39629 			"X.java",
39630 			"import java.util.*;\n" +
39631 			"\n" +
39632 			"class Y<U> {\n" +
39633 			"	List<String> foo() { return null; }\n" +
39634 			"}\n" +
39635 			"\n" +
39636 			"public class X<T> extends Y<T> {\n" +
39637 			"	List<String> bar() { return null; }\n" +
39638 			"	\n" +
39639 			"	void m(X x) {\n" +
39640 			"		List<Object> l1 = x.foo();\n" +
39641 			"		List<Object> l2 = x.bar();\n" +
39642 			"		Zork z;\n" +
39643 			"	}\n" +
39644 			"}\n", // =================
39645 		},
39646 		"----------\n" +
39647 		"1. WARNING in X.java (at line 10)\n" +
39648 		"	void m(X x) {\n" +
39649 		"	       ^\n" +
39650 		"X is a raw type. References to generic type X<T> should be parameterized\n" +
39651 		"----------\n" +
39652 		"2. WARNING in X.java (at line 11)\n" +
39653 		"	List<Object> l1 = x.foo();\n" +
39654 		"	                  ^^^^^^^\n" +
39655 		"Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
39656 		"----------\n" +
39657 		"3. WARNING in X.java (at line 12)\n" +
39658 		"	List<Object> l2 = x.bar();\n" +
39659 		"	                  ^^^^^^^\n" +
39660 		"Type safety: The expression of type List needs unchecked conversion to conform to List<Object>\n" +
39661 		"----------\n" +
39662 		"4. ERROR in X.java (at line 13)\n" +
39663 		"	Zork z;\n" +
39664 		"	^^^^\n" +
39665 		"Zork cannot be resolved to a type\n" +
39666 		"----------\n");
39667 }
39668 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=185422
39669 public void test1135() {
39670 	runNegativeTest(
39671 		new String[] { /* test files */
39672 			"X.java",
39673 			"class Foo <T>{\n" +
39674 			"    private T myT;\n" +
39675 			"\n" +
39676 			"    public T getT() {\n" +
39677 			"        return myT;\n" +
39678 			"    }\n" +
39679 			"\n" +
39680 			"    public void setT(T aT) {\n" +
39681 			"        myT = aT;\n" +
39682 			"    }\n" +
39683 			"}\n" +
39684 			"\n" +
39685 			"public class X extends Foo<X.Baz> {\n" +
39686 			"	X.Baz baz;\n" +
39687 			"    public static void main(String[] args) {\n" +
39688 			"        X myBar = new X();\n" +
39689 			"        myBar.setT(new Baz());\n" +
39690 			"        System.out.println(myBar.getT().toString());\n" +
39691 			"    }\n" +
39692 			"\n" +
39693 			"    private static class Baz {\n" +
39694 			"        @Override\n" +
39695 			"        public String toString() {\n" +
39696 			"            return \"Baz\";\n" +
39697 			"        }\n" +
39698 			"    }    \n" +
39699 			"}\n", // =================
39700 		},
39701 		"----------\n" +
39702 		"1. ERROR in X.java (at line 13)\n" +
39703 		"	public class X extends Foo<X.Baz> {\n" +
39704 		"	                           ^^^^^\n" +
39705 		"The type X.Baz is not visible\n" +
39706 		"----------\n");
39707 }
39708 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=154029
39709 public void test1136() {
39710 	Map options = getCompilerOptions();
39711 	options.put(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION, JavaCore.IGNORE);
39712 	String xSource =
39713 			"import java.util.*;\n" +
39714 			"public class X {\n" +
39715 			"	public static void main(String[] args) {\n" +
39716 			"		List<Object>  l1 = Arrays.asList(1, \"X\");\n" +
39717 			"		\n" +
39718 			"		B<String> b = null;\n" +
39719 			"		C<String>c = null;\n" +
39720 			"		List<Object>  l2 = Arrays.asList(b, c);\n" +
39721 			"	}\n" +
39722 			"}\n" +
39723 			"class A<T> {}\n" +
39724 			"interface I {}\n" +
39725 			"class B<T> extends A<T> implements I {}\n" +
39726 			"class C<T> extends A<T> implements I {}\n";
39727 	if (this.complianceLevel < ClassFileConstants.JDK1_8) {
39728 		this.runNegativeTest(
39729 			new String[] {
39730 				"X.java",
39731 				xSource,
39732 			},
39733 			"----------\n" +
39734 			"1. ERROR in X.java (at line 4)\n" +
39735 			"	List<Object>  l1 = Arrays.asList(1, \"X\");\n" +
39736 			"	                   ^^^^^^^^^^^^^^^^^^^^^\n" +
39737 			"Type mismatch: cannot convert from List<Object&"+ intersection("Comparable<?>") +"&Serializable> to List<Object>\n" +
39738 			"----------\n" +
39739 			"2. ERROR in X.java (at line 8)\n" +
39740 			"	List<Object>  l2 = Arrays.asList(b, c);\n" +
39741 			"	                   ^^^^^^^^^^^^^^^^^^^\n" +
39742 			"Type mismatch: cannot convert from List<A<String>&I> to List<Object>\n" +
39743 			"----------\n",
39744 			null,
39745 			true,
39746 			options);
39747 	} else {
39748 		runConformTest(new String[] { "X.java", xSource }, options);
39749 	}
39750 }
39751 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=154267
39752 public void test1137() {
39753 	this.runNegativeTest(
39754 		new String[] {
39755 			"X.java",
39756 			"import java.awt.Container;\n" +
39757 			"import java.util.Collection;\n" +
39758 			"\n" +
39759 			"abstract class Kollection<T extends Container> implements Collection<T> {}\n" +
39760 			"abstract class Kontainer extends Container {\n" +
39761 			"	private static final long serialVersionUID = 1L;\n" +
39762 			"}\n" +
39763 			"\n" +
39764 			"public class X {\n" +
39765 			"	private <T extends Container> Collection<T> foo() {\n" +
39766 			"		return null;\n" +
39767 			"	}\n" +
39768 			"	private <T extends Container> Kollection<T> bar() {\n" +
39769 			"		return null;\n" +
39770 			"	}\n" +
39771 			"\n" +
39772 			"	private void showProblem() {\n" +
39773 			"		Collection<?> result = foo();\n" +
39774 			"		Collection<? extends Container> result1 = foo();\n" +
39775 			"		\n" +
39776 			"		Collection<?> result2 = (Collection<Container>)foo();\n" +
39777 			"		String result3 = foo();\n" +
39778 			"		String result4 = (String) foo();		\n" +
39779 			"\n" +
39780 			"		Kollection<?> result5 = bar();\n" +
39781 			"		Kollection<? extends Kontainer> result6 = bar();\n" +
39782 			"	}\n" +
39783 			"}\n", // =================
39784 		},
39785 		"----------\n" +
39786 		"1. WARNING in X.java (at line 21)\n" +
39787 		"	Collection<?> result2 = (Collection<Container>)foo();\n" +
39788 		"	                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
39789 		"Unnecessary cast from Collection<Container> to Collection<Container>\n" +
39790 		"----------\n" +
39791 		"2. ERROR in X.java (at line 22)\n" +
39792 		"	String result3 = foo();\n" +
39793 		"	                 ^^^^^\n" +
39794 		"Type mismatch: cannot convert from Collection<Container> to String\n" +
39795 		"----------\n" +
39796 		"3. ERROR in X.java (at line 23)\n" +
39797 		"	String result4 = (String) foo();		\n" +
39798 		"	                 ^^^^^^^^^^^^^^\n" +
39799 		"Cannot cast from Collection<Container> to String\n" +
39800 		"----------\n");
39801 }
39802 public void test1138() {
39803 	// binary prerequisite
39804 	this.runConformTest(
39805 		new String[] {
39806 			"p/E.java",
39807 			"package p;\n" +
39808 			"public enum E {\n" +
39809 			"}\n", // =================
39810 		},
39811 		"");
39812 	this.runConformTest(
39813 			new String[] {
39814 				"X.java",
39815 				"import static p.E.*;\n" +
39816 				"public class X implements java.io.Serializable {\n" +
39817 				"}\n", // =================
39818 			},
39819 			"",
39820 			null, // use default class-path
39821 			false, // do not flush previous output dir content
39822 			null); // no special vm args		);
39823 }
39824 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=186833
39825 public void test1139() {
39826 	this.runNegativeTest(
39827 		new String[] {
39828 			"p/X.java",
39829 			"package p;\n" +
39830 			"import p.X.Super;\n" +
39831 			"import static p.Top.*;\n" +
39832 			"\n" +
39833 			"class Top<T> {\n" +
39834 			"	static class A<U> {}\n" +
39835 			"}\n" +
39836 			"\n" +
39837 			"public class X extends Super<A<X>> {\n" +
39838 			"	static class Super<T> extends Top<T>{\n" +
39839 			"	}\n" +
39840 			"}", // =================
39841 		},
39842 		"----------\n" +
39843 		"1. ERROR in p\\X.java (at line 9)\n" +
39844 		"	public class X extends Super<A<X>> {\n" +
39845 		"	                       ^^^^^\n" +
39846 		"Cycle detected: the type X cannot extend/implement itself or one of its own member types\n" +
39847 		"----------\n"
39848 	);
39849 }
39850 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=186788
39851 public void test1140() {
39852 	this.runNegativeTest(
39853 		new String[] {
39854 			"p/X.java",
39855 			"package p;\n" +
39856 			"import static p.X.Super;\n" +
39857 			"import static p.Top.*;\n" +
39858 			"\n" +
39859 			"class Top<T> {\n" +
39860 			"        static class A<U> {}\n" +
39861 			"}\n" +
39862 			"\n" +
39863 			"public class X extends Super<A<X>> {\n" +
39864 			"        class Super<T> extends Top<T>{\n" +
39865 			"        }\n" +
39866 			"}", // =================
39867 		},
39868 		"----------\n" +
39869 		"1. ERROR in p\\X.java (at line 2)\n" +
39870 		"	import static p.X.Super;\n" +
39871 		"	              ^^^^^^^^^\n" +
39872 		"The import p.X.Super cannot be resolved\n" +
39873 		"----------\n" +
39874 		"2. ERROR in p\\X.java (at line 9)\n" +
39875 		"	public class X extends Super<A<X>> {\n" +
39876 		"	                       ^^^^^\n" +
39877 		"Super cannot be resolved to a type\n" +
39878 		"----------\n");
39879 }
39880 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=186833 - variation
39881 public void test1141() {
39882 	this.runNegativeTest(
39883 		new String[] {
39884 			"p/X.java",
39885 			"package p;\n" +
39886 			"import static p.Top.*;\n" +
39887 			"\n" +
39888 			"class Top<T> {\n" +
39889 			"	static class A<U> {}\n" +
39890 			"}\n" +
39891 			"\n" +
39892 			"public class X extends p.X.Super<A<X>> {\n" +
39893 			"	static class Super<T> extends Top<T>{\n" +
39894 			"	}\n" +
39895 			"}", // =================
39896 		},
39897 		"----------\n" +
39898 		"1. ERROR in p\\X.java (at line 8)\n" +
39899 		"	public class X extends p.X.Super<A<X>> {\n" +
39900 		"	                       ^^^^^^^^^\n" +
39901 		"Cycle detected: the type X cannot extend/implement itself or one of its own member types\n" +
39902 		"----------\n");
39903 }
39904 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=190945
39905 public void test1142() {
39906 	runNegativeTest(
39907 		// test directory preparation
39908 		new String[] { /* test files */
39909 			"X.java",
39910 			"import java.util.Comparator;\n" +
39911 			"import java.util.List;\n" +
39912 			"public class X {\n" +
39913 			"  public static <T> Comparator<T> compound(Comparator<? super T> a, Comparator<? super T> b) {\n" +
39914 			"	  return compound(asList(a, b));\n" +
39915 			"  }\n" +
39916 			"\n" +
39917 			"  public static <T> Comparator<T> compound(Iterable<? extends Comparator<? super T>> comparators) {\n" +
39918 			"    return null;\n" +
39919 			"  }\n" +
39920 			"  public static <E> List<E> asList(E a, E b) {\n" +
39921 			"    return null;\n" +
39922 			"  }\n" +
39923 			"}\n", // =================
39924 		},
39925 		// compiler results
39926 		"----------\n" + /* expected compiler log */
39927 		"1. ERROR in X.java (at line 5)\n" +
39928 		"	return compound(asList(a, b));\n" +
39929 		"	       ^^^^^^^^\n" +
39930 		"The method compound(Iterable<? extends Comparator<? super T>>) in the type X is not applicable for the arguments (List<Comparator<? extends Object>>)\n" +
39931 		"----------\n",
39932 		// javac options
39933 		JavacTestOptions.JavacHasABug.JavacBug6573446 /* javac test options */);
39934 }
39935 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=190945 - variation
39936 public void test1143() {
39937 	this.runNegativeTest(
39938 		new String[] {
39939 			"X.java",
39940 			"import java.util.Comparator;\n" +
39941 			"import java.util.List;\n" +
39942 			"public class X {\n" +
39943 			"  public static <T> Comparator<T> compound(Comparator<? super T> a, Comparator<? super T> b) {\n" +
39944 			"	  int i = asList(a, b);\n" +
39945 			"  }\n" +
39946 			"\n" +
39947 			"  public static <T> Comparator<T> compound(Iterable<? extends Comparator<? super T>> comparators) {\n" +
39948 			"    return null;\n" +
39949 			"  }\n" +
39950 			"  public static <E> List<E> asList(E a, E b) {\n" +
39951 			"    return null;\n" +
39952 			"  }\n" +
39953 			"}\n", // =================
39954 		},
39955 		"----------\n" +
39956 		"1. ERROR in X.java (at line 5)\n" +
39957 		"	int i = asList(a, b);\n" +
39958 		"	        ^^^^^^^^^^^^\n" +
39959 		"Type mismatch: cannot convert from List<Comparator<? extends Object>> to int\n" +
39960 		"----------\n");
39961 }
39962 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=190945 - variation
39963 public void test1144() {
39964 	this.runNegativeTest(
39965 		new String[] {
39966 			"X.java",
39967 			"import java.util.Comparator;\n" +
39968 			"import java.util.List;\n" +
39969 			"public class X {\n" +
39970 			"  Iterable<Comparator<? extends Object>> itc1;\n" +
39971 			"  Iterable<? extends Comparator<? super Object>> itc2 = itc1;\n" +
39972 			"}\n", // =================
39973 		},
39974 		"----------\n" +
39975 		"1. ERROR in X.java (at line 5)\n" +
39976 		"	Iterable<? extends Comparator<? super Object>> itc2 = itc1;\n" +
39977 		"	                                                      ^^^^\n" +
39978 		"Type mismatch: cannot convert from Iterable<Comparator<? extends Object>> to Iterable<? extends Comparator<? super Object>>\n" +
39979 		"----------\n");
39980 }
39981 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=190945 - variation
39982 public void test1145() {
39983 	this.runConformTest(
39984 		new String[] {
39985 			"X.java",
39986 			"import java.util.*;\n" +
39987 			"\n" +
39988 			"public class X {\n" +
39989 			"	<T> Comparator<T> compound(Comparator<? super T> a, Comparator<? super T> b) {\n" +
39990 			"		return compound(asList(a));\n" +
39991 			"	}\n" +
39992 			"	<T> Comparator<T> compound(Iterable<? extends Comparator<? super T>> c) {\n" +
39993 			"		return null;\n" +
39994 			"	}\n" +
39995 			"	<E> List<E> asList(E a) {\n" +
39996 			"		return null;\n" +
39997 			"	}\n" +
39998 			"}\n", // =================
39999 		},
40000 		"");
40001 }
40002 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=190945 - variation
40003 public void test1146() {
40004 	this.runNegativeTest(
40005 		new String[] {
40006 			"X.java",
40007 			"import java.util.*;\n" +
40008 			"public class X {\n" +
40009 			"	public static <T> Comparator<T> compound(\n" +
40010 			"			Comparator<? super T> a,\n" +
40011 			"			Comparator<? super T> b, \n" +
40012 			"			Comparator<? super T>... rest) {\n" +
40013 			"		int i = asList(a, b, rest);\n" +
40014 			"		int j = asList2(a, b);\n" +
40015 			"		return compound(asList(a, b, rest));\n" +
40016 			"	}\n" +
40017 			"	public static <U> Comparator<U> compound(Iterable<? extends Comparator<? super U>> comparators) {\n" +
40018 			"		return null;\n" +
40019 			"	}\n" +
40020 			"	public static <E> List<E> asList(E a, E b, E... rest) {\n" +
40021 			"		return null;\n" +
40022 			"	}\n" +
40023 			"	public static <E> List<E> asList2(E a, E b) {\n" +
40024 			"		return null;\n" +
40025 			"	}	\n" +
40026 			"}\n", // =================
40027 		},
40028 		this.complianceLevel < ClassFileConstants.JDK1_7 ?
40029 		"----------\n" +
40030 		"1. ERROR in X.java (at line 7)\n" +
40031 		"	int i = asList(a, b, rest);\n" +
40032 		"	        ^^^^^^^^^^^^^^^^^^\n" +
40033 		"Type mismatch: cannot convert from List<Comparator<?>> to int\n" +
40034 		"----------\n" +
40035 		"2. ERROR in X.java (at line 8)\n" +
40036 		"	int j = asList2(a, b);\n" +
40037 		"	        ^^^^^^^^^^^^^\n" +
40038 		"Type mismatch: cannot convert from List<Comparator<? extends Object>> to int\n" +
40039 		"----------\n" +
40040 		"3. ERROR in X.java (at line 9)\n" +
40041 		"	return compound(asList(a, b, rest));\n" +
40042 		"	       ^^^^^^^^\n" +
40043 		"The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
40044 		"----------\n":
40045 		(this.complianceLevel == ClassFileConstants.JDK1_7 ?
40046 			"----------\n" +
40047 			"1. WARNING in X.java (at line 6)\n" +
40048 			"	Comparator<? super T>... rest) {\n" +
40049 			"	                         ^^^^\n" +
40050 			"Type safety: Potential heap pollution via varargs parameter rest\n" +
40051 			"----------\n" +
40052 			"2. ERROR in X.java (at line 7)\n" +
40053 			"	int i = asList(a, b, rest);\n" +
40054 			"	        ^^^^^^^^^^^^^^^^^^\n" +
40055 			"Type mismatch: cannot convert from List<Comparator<?>> to int\n" +
40056 			"----------\n" +
40057 			"3. ERROR in X.java (at line 8)\n" +
40058 			"	int j = asList2(a, b);\n" +
40059 			"	        ^^^^^^^^^^^^^\n" +
40060 			"Type mismatch: cannot convert from List<Comparator<? extends Object>> to int\n" +
40061 			"----------\n" +
40062 			"4. ERROR in X.java (at line 9)\n" +
40063 			"	return compound(asList(a, b, rest));\n" +
40064 			"	       ^^^^^^^^\n" +
40065 			"The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
40066 			"----------\n" +
40067 			"5. WARNING in X.java (at line 14)\n" +
40068 			"	public static <E> List<E> asList(E a, E b, E... rest) {\n" +
40069 			"	                                                ^^^^\n" +
40070 			"Type safety: Potential heap pollution via varargs parameter rest\n" +
40071 			"----------\n"
40072 			: // 1.8 : one fewer error due to better type inference:
40073 			"----------\n" +
40074 			"1. WARNING in X.java (at line 6)\n" +
40075 			"	Comparator<? super T>... rest) {\n" +
40076 			"	                         ^^^^\n" +
40077 			"Type safety: Potential heap pollution via varargs parameter rest\n" +
40078 			"----------\n" +
40079 			"2. ERROR in X.java (at line 7)\n" +
40080 			"	int i = asList(a, b, rest);\n" +
40081 			"	        ^^^^^^^^^^^^^^^^^^\n" +
40082 			"Type mismatch: cannot convert from List<Comparator<? super T>> to int\n" +
40083 			"----------\n" +
40084 			"3. ERROR in X.java (at line 8)\n" +
40085 			"	int j = asList2(a, b);\n" +
40086 			"	        ^^^^^^^^^^^^^\n" +
40087 			"Type mismatch: cannot convert from List<Comparator<? extends Object>> to int\n" +
40088 			"----------\n" +
40089 			"4. WARNING in X.java (at line 14)\n" +
40090 			"	public static <E> List<E> asList(E a, E b, E... rest) {\n" +
40091 			"	                                                ^^^^\n" +
40092 			"Type safety: Potential heap pollution via varargs parameter rest\n" +
40093 			"----------\n"));
40094 }
40095 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=190945 - variation
40096 public void test1147() {
40097 	this.runNegativeTest(
40098 		new String[] {
40099 			"X.java",
40100 			"import java.util.*;\n" +
40101 			"public class X {\n" +
40102 			"	void foo(Comparator<? super X> cx, Comparator<? super X>[] cxs) {\n" +
40103 			"		int i = cx;\n" +
40104 			"		int j = cxs;\n" +
40105 			"		int k = cxs[0];\n" +
40106 			"		int l = asList2(cxs[0], cxs[1]);\n" +
40107 			"	}\n" +
40108 			"	public static <E> List<E> asList2(E a, E b) {\n" +
40109 			"		return null;\n" +
40110 			"	}	\n" +
40111 			"}\n", // =================
40112 		},
40113 		"----------\n" +
40114 		"1. ERROR in X.java (at line 4)\n" +
40115 		"	int i = cx;\n" +
40116 		"	        ^^\n" +
40117 		"Type mismatch: cannot convert from Comparator<capture#1-of ? super X> to int\n" +
40118 		"----------\n" +
40119 		"2. ERROR in X.java (at line 5)\n" +
40120 		"	int j = cxs;\n" +
40121 		"	        ^^^\n" +
40122 		"Type mismatch: cannot convert from Comparator<? super X>[] to int\n" +
40123 		"----------\n" +
40124 		"3. ERROR in X.java (at line 6)\n" +
40125 		"	int k = cxs[0];\n" +
40126 		"	        ^^^^^^\n" +
40127 		"Type mismatch: cannot convert from Comparator<capture#2-of ? super X> to int\n" +
40128 		"----------\n" +
40129 		"4. ERROR in X.java (at line 7)\n" +
40130 		"	int l = asList2(cxs[0], cxs[1]);\n" +
40131 		"	        ^^^^^^^^^^^^^^^^^^^^^^^\n" +
40132 		"Type mismatch: cannot convert from List<Comparator<? extends Object>> to int\n" +
40133 		"----------\n");
40134 }
40135 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=190945 - variation
40136 // FAIL ERRMSG
40137 public void test1148() {
40138 	if (this.complianceLevel >= ClassFileConstants.JDK1_8)
40139 		return;
40140 	this.runNegativeTest(
40141 		new String[] {
40142 			"X.java",
40143 			"import java.util.*;\n" +
40144 			"public class X {\n" +
40145 			"	public static <T> Comparator<T> compound(Comparator<? super T> a, Comparator<? super T> b, Comparator<? super T>... rest) {\n" +
40146 			"		int i = asList(a, b, rest);\n" +
40147 			"		int j = compound(asList(a, b, rest));\n" +
40148 			"		compound(asList(a, b, rest));\n" +
40149 			"		if (true) return compound(asList(a, b, rest));\n" +
40150 			"		\n" +
40151 			"		List<Comparator<?>> c = null;\n" +
40152 			"		compound(c);\n" +
40153 			"		return compound(c);\n" +
40154 			"	}\n" +
40155 			"	public static <U> Comparator<U> compound(Iterable<? extends Comparator<? super U>> comparators) {\n" +
40156 			"		return null;\n" +
40157 			"	}\n" +
40158 			"	public static <E> List<E> asList(E a, E b, E... rest) {\n" +
40159 			"		return null;\n" +
40160 			"	}\n" +
40161 			"}\n", // =================
40162 		},
40163 		this.complianceLevel < ClassFileConstants.JDK1_7 ?
40164 		"----------\n" +
40165 		"1. ERROR in X.java (at line 4)\n" +
40166 		"	int i = asList(a, b, rest);\n" +
40167 		"	        ^^^^^^^^^^^^^^^^^^\n" +
40168 		"Type mismatch: cannot convert from List<Comparator<?>> to int\n" +
40169 		"----------\n" +
40170 		"2. ERROR in X.java (at line 5)\n" +
40171 		"	int j = compound(asList(a, b, rest));\n" +
40172 		"	        ^^^^^^^^\n" +
40173 		"The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
40174 		"----------\n" +
40175 		"3. ERROR in X.java (at line 6)\n" +
40176 		"	compound(asList(a, b, rest));\n" +
40177 		"	^^^^^^^^\n" +
40178 		"The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
40179 		"----------\n" +
40180 		"4. ERROR in X.java (at line 7)\n" +
40181 		"	if (true) return compound(asList(a, b, rest));\n" +
40182 		"	                 ^^^^^^^^\n" +
40183 		"The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
40184 		"----------\n" +
40185 		"5. ERROR in X.java (at line 10)\n" +
40186 		"	compound(c);\n" +
40187 		"	^^^^^^^^\n" +
40188 		"The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
40189 		"----------\n" +
40190 		"6. ERROR in X.java (at line 11)\n" +
40191 		"	return compound(c);\n" +
40192 		"	       ^^^^^^^^\n" +
40193 		"The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
40194 		"----------\n":
40195 		this.complianceLevel == ClassFileConstants.JDK1_7 ?
40196 			"----------\n" +
40197 			"1. WARNING in X.java (at line 3)\n" +
40198 			"	public static <T> Comparator<T> compound(Comparator<? super T> a, Comparator<? super T> b, Comparator<? super T>... rest) {\n" +
40199 			"	                                                                                                                    ^^^^\n" +
40200 			"Type safety: Potential heap pollution via varargs parameter rest\n" +
40201 			"----------\n" +
40202 			"2. ERROR in X.java (at line 4)\n" +
40203 			"	int i = asList(a, b, rest);\n" +
40204 			"	        ^^^^^^^^^^^^^^^^^^\n" +
40205 			"Type mismatch: cannot convert from List<Comparator<?>> to int\n" +
40206 			"----------\n" +
40207 			"3. ERROR in X.java (at line 5)\n" +
40208 			"	int j = compound(asList(a, b, rest));\n" +
40209 			"	        ^^^^^^^^\n" +
40210 			"The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
40211 			"----------\n" +
40212 			"4. ERROR in X.java (at line 6)\n" +
40213 			"	compound(asList(a, b, rest));\n" +
40214 			"	^^^^^^^^\n" +
40215 			"The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
40216 			"----------\n" +
40217 			"5. ERROR in X.java (at line 7)\n" +
40218 			"	if (true) return compound(asList(a, b, rest));\n" +
40219 			"	                 ^^^^^^^^\n" +
40220 			"The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
40221 			"----------\n" +
40222 			"6. ERROR in X.java (at line 10)\n" +
40223 			"	compound(c);\n" +
40224 			"	^^^^^^^^\n" +
40225 			"The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
40226 			"----------\n" +
40227 			"7. ERROR in X.java (at line 11)\n" +
40228 			"	return compound(c);\n" +
40229 			"	       ^^^^^^^^\n" +
40230 			"The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
40231 			"----------\n" +
40232 			"8. WARNING in X.java (at line 16)\n" +
40233 			"	public static <E> List<E> asList(E a, E b, E... rest) {\n" +
40234 			"	                                                ^^^^\n" +
40235 			"Type safety: Potential heap pollution via varargs parameter rest\n" +
40236 			"----------\n"
40237 		: // fewer errors in 1.8+:
40238 			"----------\n" +
40239 			"1. WARNING in X.java (at line 3)\n" +
40240 			"	public static <T> Comparator<T> compound(Comparator<? super T> a, Comparator<? super T> b, Comparator<? super T>... rest) {\n" +
40241 			"	                                                                                                                    ^^^^\n" +
40242 			"Type safety: Potential heap pollution via varargs parameter rest\n" +
40243 			"----------\n" +
40244 			"2. ERROR in X.java (at line 4)\n" +
40245 			"	int i = asList(a, b, rest);\n" +
40246 			"	        ^^^^^^^^^^^^^^^^^^\n" +
40247 			"Type mismatch: cannot convert from List<Comparator<?>> to int\n" +
40248 			"----------\n" +
40249 			"3. ERROR in X.java (at line 5)\n" +
40250 			"	int j = compound(asList(a, b, rest));\n" +
40251 			"	        ^^^^^^^^\n" +
40252 			"The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
40253 			"----------\n" +
40254 			"4. ERROR in X.java (at line 10)\n" +
40255 			"	compound(c);\n" +
40256 			"	^^^^^^^^\n" +
40257 			"The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
40258 			"----------\n" +
40259 			"5. ERROR in X.java (at line 11)\n" +
40260 			"	return compound(c);\n" +
40261 			"	       ^^^^^^^^\n" +
40262 			"The method compound(Iterable<? extends Comparator<? super U>>) in the type X is not applicable for the arguments (List<Comparator<?>>)\n" +
40263 			"----------\n" +
40264 			"6. WARNING in X.java (at line 16)\n" +
40265 			"	public static <E> List<E> asList(E a, E b, E... rest) {\n" +
40266 			"	                                                ^^^^\n" +
40267 			"Type safety: Potential heap pollution via varargs parameter rest\n" +
40268 			"----------\n");
40269 }
40270 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=198051
40271 public void test1149() {
40272 	String bSource =
40273 		"public class B {\n" +
40274 		"    	void b() throws ClassNotFoundException {\n" +
40275 		"	    new<ClassNotFoundException> A();\n" +
40276 		"    }\n" +
40277 		"}\n";
40278 	runConformTest(
40279 		// test directory preparation
40280 		new String[] { /* test files */
40281 			"A.java",
40282 			"public class A {\n" +
40283 			"    <T extends Throwable> A() throws T {}\n" +
40284 			"    void a() throws ClassNotFoundException {\n" +
40285 			"	    new<ClassNotFoundException> A();\n" +
40286 			"    }\n" +
40287 			"}\n",
40288 			"B.java",
40289 			bSource
40290 		},
40291 		// javac options
40292 		JavacTestOptions.EclipseJustification.EclipseBug234815 /* javac test options */);
40293 	runConformTest(
40294 		// test directory preparation
40295 		false /* do not flush output directory */,
40296 		new String[] { /* test files */
40297 			"B.java",
40298 			bSource
40299 		},
40300 		// compiler results
40301 		"" /* expected compiler log */,
40302 		// runtime results
40303 		"" /* expected output string */,
40304 		"" /* expected error string */,
40305 		// javac options
40306 		JavacTestOptions.EclipseJustification.EclipseBug234815 /* javac test options */);
40307 }
40308 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=234815 (invalid)
40309 public void test1149b() {
40310 	runConformTest(
40311 		new String[] {
40312 			"A.java",
40313 			"public class A {\n" +
40314 			"    <T extends Throwable> void foo() throws T {}\n" +
40315 			"    void a() throws ClassNotFoundException {\n" +
40316 			"	   new A().<ClassNotFoundException>foo();\n" +
40317 			"    }\n" +
40318 			"}\n",
40319 		},
40320 		""
40321 	);
40322 }
40323 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=189158
40324 public void test1150() throws Exception {
40325 	this.runConformTest(
40326 		new String[] {
40327 			"X.java",
40328 			"import java.lang.ref.Reference;\n"+
40329 			"public class X<T> {\n" +
40330 			"	static class Rather {\n" +
40331 			"		static class Deeply {\n" +
40332 			"			static class Inside {\n" +
40333 			"			}\n" +
40334 			"		}\n" +
40335 			"	}\n" +
40336 			"	Reference<X.Rather.Deeply> x;\n" +
40337 			"	Reference<X.Rather> y;	\n" +
40338 			"	Reference<X.Rather.Deeply.Inside> z;	\n" +
40339 			"\n" +
40340 			"	public static void main(String[] args) throws Exception {\n" +
40341 			"		System.out.print(X.class.getDeclaredField(\"x\").getGenericType());\n" +
40342 			"		System.out.print(\"##\");\n" +
40343 			"		System.out.print(X.class.getDeclaredField(\"y\").getGenericType());\n" +
40344 			"		System.out.print(\"##\");\n" +
40345 			"		System.out.print(X.class.getDeclaredField(\"z\").getGenericType());\n" +
40346 			"		System.out.println();\n" +
40347 			"	}\n" +
40348 			"}\n"
40349 		},
40350 		"java.lang.ref.Reference<X$Rather$Deeply>##java.lang.ref.Reference<X$Rather>##java.lang.ref.Reference<X$Rather$Deeply$Inside>"
40351 	);
40352 	String expectedOutput =
40353 		"  // Field descriptor #6 Ljava/lang/ref/Reference;\n" +
40354 		"  // Signature: Ljava/lang/ref/Reference<LX$Rather$Deeply;>;\n" +
40355 		"  java.lang.ref.Reference x;\n" +
40356 		"  \n" +
40357 		"  // Field descriptor #6 Ljava/lang/ref/Reference;\n" +
40358 		"  // Signature: Ljava/lang/ref/Reference<LX$Rather;>;\n" +
40359 		"  java.lang.ref.Reference y;\n" +
40360 		"  \n" +
40361 		"  // Field descriptor #6 Ljava/lang/ref/Reference;\n" +
40362 		"  // Signature: Ljava/lang/ref/Reference<LX$Rather$Deeply$Inside;>;\n" +
40363 		"  java.lang.ref.Reference z;\n";
40364 
40365 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
40366 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
40367 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
40368 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
40369 	int index = result.indexOf(expectedOutput);
40370 	if (index == -1 || expectedOutput.length() == 0) {
40371 		System.out.println(Util.displayString(result, 3));
40372 	}
40373 	if (index == -1) {
40374 		assertEquals("Wrong contents", expectedOutput, result);
40375 	}
40376 
40377 }
40378 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=189158 - variation
40379 public void test1151() throws Exception {
40380 	this.runConformTest(
40381 		new String[] {
40382 			"X.java",
40383 			"import java.lang.ref.Reference;\n"+
40384 			"public class X<T> {\n" +
40385 			"	class Other<U> {\n" +
40386 			"		class Deeply {\n" +
40387 			"			class Inside<V> {\n" +
40388 			"			}			\n" +
40389 			"		}\n" +
40390 			"	}\n" +
40391 			"	Reference<X<String>.Other<Thread>.Deeply> t;\n" +
40392 			"	Reference<X<String>.Other<Thread>.Deeply.Inside<Number>> u;\n" +
40393 			"\n" +
40394 			"	public static void main(String[] args) throws Exception {\n" +
40395 			"		System.out.print(X.class.getDeclaredField(\"t\").getGenericType());\n" +
40396 			"		//System.out.print(\"##\");\n" +
40397 			"		//System.out.print(X.class.getDeclaredField(\"u\").getGenericType());\n" + // TODO disabled due to bug in libs (unable to re-read the generated signature)
40398 			"		System.out.println();\n" +
40399 			"	}\n" +
40400 			"}\n"
40401 		},
40402 		//"java.lang.ref.Reference<X<java.lang.String>.Other<java.lang.Thread>.Deeply>##java.lang.ref.Reference<X<java.lang.String>.Other<java.lang.Thread>.Deeply$Inside<java.lang.Number>>"
40403 		(reflectNestedClassUseDollar
40404 		? "java.lang.ref.Reference<X<java.lang.String>$Other<java.lang.Thread>$Deeply>"
40405 		: "java.lang.ref.Reference<X<java.lang.String>.Other<java.lang.Thread>.Deeply>")
40406 	);
40407 	String expectedOutput =
40408 		"  // Field descriptor #6 Ljava/lang/ref/Reference;\n" +
40409 		"  // Signature: Ljava/lang/ref/Reference<LX<Ljava/lang/String;>.Other<Ljava/lang/Thread;>.Deeply;>;\n" +
40410 		"  java.lang.ref.Reference t;\n" +
40411 		"  \n" +
40412 		"  // Field descriptor #6 Ljava/lang/ref/Reference;\n" +
40413 		"  // Signature: Ljava/lang/ref/Reference<LX<Ljava/lang/String;>.Other<Ljava/lang/Thread;>.Deeply.Inside<Ljava/lang/Number;>;>;\n" +
40414 		"  java.lang.ref.Reference u;\n";
40415 
40416 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
40417 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
40418 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
40419 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
40420 	int index = result.indexOf(expectedOutput);
40421 	if (index == -1 || expectedOutput.length() == 0) {
40422 		System.out.println(Util.displayString(result, 3));
40423 	}
40424 	if (index == -1) {
40425 		assertEquals("Wrong contents", expectedOutput, result);
40426 	}
40427 }
40428 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=189158 - variation
40429 public void test1152() {
40430 	this.runNegativeTest(
40431 		new String[] {
40432 			"X.java",
40433 			"import java.lang.ref.Reference;\n"+
40434 			"public class X<T> {\n" +
40435 			"	class Other<U> {\n" +
40436 			"		class Deeply {\n" +
40437 			"			class Inside<V> {\n" +
40438 			"			}			\n" +
40439 			"		}\n" +
40440 			"	}\n" +
40441 			"	Reference<X<String>.Other<Thread>.Deeply.Inside> u;\n" +
40442 			"\n" +
40443 			"	public static void main(String[] args) throws Exception {\n" +
40444 			"		System.out.print(X.class.getDeclaredField(\"u\").getGenericType());\n" +
40445 			"		System.out.println();\n" +
40446 			"	}\n" +
40447 			"}\n"
40448 		},
40449 		"----------\n" +
40450 		"1. ERROR in X.java (at line 9)\n" +
40451 		"	Reference<X<String>.Other<Thread>.Deeply.Inside> u;\n" +
40452 		"	          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
40453 		"The member type X<String>.Other<Thread>.Deeply.Inside must be parameterized, since it is qualified with a parameterized type\n" +
40454 		"----------\n"	);
40455 }
40456 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=189158 - variation
40457 public void test1153() {
40458 	// check proper decoding of binary signatures, by compiling against generated binary
40459 	this.runConformTest(
40460 		new String[] {
40461 			"p/X.java",
40462 			"package p;\n" +
40463 			"import java.lang.ref.Reference;\n" +
40464 			"public class X<T> {\n" +
40465 			"	public static class Rather {\n" +
40466 			"		public static class Deeply {\n" +
40467 			"			public static class Inside {\n" +
40468 			"			}\n" +
40469 			"		}\n" +
40470 			"	}\n" +
40471 			"	public class Other<U> {\n" +
40472 			"		public class Deeply {\n" +
40473 			"			public class Inside<V> {\n" +
40474 			"			}			\n" +
40475 			"		}\n" +
40476 			"	}\n" +
40477 			"	public Reference<X.Rather.Deeply> x;\n" +
40478 			"	public Reference<X.Rather> y;	\n" +
40479 			"	public Reference<X.Rather.Deeply.Inside> z;	\n" +
40480 			"	public Reference<X<String>.Other<Thread>.Deeply> t;\n" +
40481 			"	public Reference<X<String>.Other<Thread>.Deeply.Inside<Number>> u;\n" +
40482 			"}\n",
40483 		},
40484 		""
40485 	);
40486 	this.runConformTest(
40487 		new String[] {
40488 			"Y.java",
40489 			"import java.lang.ref.Reference;\n" +
40490 			"import p.X;\n" +
40491 			"public class Y {\n" +
40492 			"	Reference<X.Rather.Deeply> x;\n" +
40493 			"	Reference<X.Rather> y;	\n" +
40494 			"	Reference<X.Rather.Deeply.Inside> z;	\n" +
40495 			"	Reference<X<String>.Other<Thread>.Deeply> t;\n" +
40496 			"	Reference<X<String>.Other<Thread>.Deeply.Inside<Number>> u;\n" +
40497 			"	Y(X someX) {\n" +
40498 			"		this.x = someX.x;\n" +
40499 			"		this. y = someX.y;	\n" +
40500 			"		this.z = someX.z;	\n" +
40501 			"		this.t = someX.t;\n" +
40502 			"		this.u = someX.u;		\n" +
40503 			"	}\n" +
40504 			"	public static void main(String[] args) throws Exception {\n" +
40505 			"		System.out.print(Y.class.getDeclaredField(\"x\").getGenericType());\n" +
40506 			"		System.out.print(\"##\");\n" +
40507 			"		System.out.print(Y.class.getDeclaredField(\"y\").getGenericType());\n" +
40508 			"		System.out.print(\"##\");\n" +
40509 			"		System.out.print(Y.class.getDeclaredField(\"z\").getGenericType());\n" +
40510 			"		System.out.print(\"##\");\n" +
40511 			"		System.out.print(Y.class.getDeclaredField(\"t\").getGenericType());\n" +
40512 			"		//System.out.print(\"##\");\n" +
40513 			"		//System.out.print(Y.class.getDeclaredField(\"u\").getGenericType());\n" + // TODO disabled due to bug in libs (unable to re-read the generated signature)
40514 			"		System.out.println();\n" +
40515 			"	}\n" +
40516 			"}\n"
40517 		},
40518 		"java.lang.ref.Reference<p.X$Rather$Deeply>##java.lang.ref.Reference<p.X$Rather>##java.lang.ref.Reference<p.X$Rather$Deeply$Inside>##"+
40519 		(reflectNestedClassUseDollar
40520 		? "java.lang.ref.Reference<p.X<java.lang.String>$Other<java.lang.Thread>$Deeply>"
40521 		: "java.lang.ref.Reference<p.X<java.lang.String>.Other<java.lang.Thread>.Deeply>"),
40522 		null,
40523 		false, // do not flush output
40524 		null);
40525 }
40526 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=189158 - variation
40527 public void test1154() throws Exception {
40528 	this.runConformTest(
40529 		new String[] {
40530 			"X.java",
40531 			"import java.lang.ref.Reference;\n" +
40532 			"public class X {\n" +
40533 			"	class Other<U> {\n" +
40534 			"		class Deeply {\n" +
40535 			"			class Deeper {\n" +
40536 			"				class Inside<V> {\n" +
40537 			"				}			\n" +
40538 			"			}\n" +
40539 			"		}\n" +
40540 			"	}\n" +
40541 			"	Reference<X.Other<Thread>.Deeply> t;\n" +
40542 			"	Reference<X.Other<Thread>.Deeply.Deeper.Inside<Number>> u;\n" +
40543 			"\n" +
40544 			"	public static void main(String[] args) throws Exception {\n" +
40545 			"		//System.out.print(X.class.getDeclaredField(\"t\").getGenericType());\n" +  // TODO disabled due to bug in libs (unable to re-read the generated signature)
40546 			"		//System.out.print(\"##\");\n" +
40547 			"		//System.out.print(X.class.getDeclaredField(\"u\").getGenericType());\n" + // TODO disabled due to bug in libs (unable to re-read the generated signature)
40548 			"		System.out.println();\n" +
40549 			"	}\n" +
40550 			"}\n"
40551 		},
40552 		"");
40553 
40554 	String expectedOutput =
40555 		"  // Field descriptor #6 Ljava/lang/ref/Reference;\n" +
40556 		"  // Signature: Ljava/lang/ref/Reference<LX$Other<Ljava/lang/Thread;>.Deeply;>;\n" +
40557 		"  java.lang.ref.Reference t;\n" +
40558 		"  \n" +
40559 		"  // Field descriptor #6 Ljava/lang/ref/Reference;\n" +
40560 		"  // Signature: Ljava/lang/ref/Reference<LX$Other<Ljava/lang/Thread;>.Deeply.Deeper.Inside<Ljava/lang/Number;>;>;\n" +
40561 		"  java.lang.ref.Reference u;\n";
40562 
40563 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
40564 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
40565 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
40566 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
40567 	int index = result.indexOf(expectedOutput);
40568 	if (index == -1 || expectedOutput.length() == 0) {
40569 		System.out.println(Util.displayString(result, 3));
40570 	}
40571 	if (index == -1) {
40572 		assertEquals("Wrong contents", expectedOutput, result);
40573 	}
40574 }
40575 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=189158 - variation
40576 public void test1155() throws Exception {
40577 	this.runConformTest(
40578 		new String[] {
40579 			"X.java",
40580 			"import java.lang.ref.Reference;\n" +
40581 			"public class X<T> {\n" +
40582 			"	class Other<U> {\n" +
40583 			"		class Deeply {\n" +
40584 			"			class Deeper {\n" +
40585 			"				class Inside<V> {\n" +
40586 			"				}			\n" +
40587 			"			}\n" +
40588 			"		}\n" +
40589 			"	}\n" +
40590 			"	Reference<X<String>.Other<Thread>.Deeply> t;\n" +
40591 			"	Reference<X<String>.Other<Thread>.Deeply.Deeper.Inside<Number>> u;\n" +
40592 			"\n" +
40593 			"	public static void main(String[] args) throws Exception {\n" +
40594 			"		System.out.print(X.class.getDeclaredField(\"t\").getGenericType());\n" +
40595 			"		//System.out.print(\"##\");\n" +
40596 			"		//System.out.print(X.class.getDeclaredField(\"u\").getGenericType());\n" + // TODO disabled due to bug in libs (unable to re-read the generated signature)
40597 			"		System.out.println();\n" +
40598 			"	}\n" +
40599 			"}\n"
40600 		},
40601 		(reflectNestedClassUseDollar
40602 		? "java.lang.ref.Reference<X<java.lang.String>$Other<java.lang.Thread>$Deeply>"
40603 		: "java.lang.ref.Reference<X<java.lang.String>.Other<java.lang.Thread>.Deeply>")	);
40604 
40605 	String expectedOutput =
40606 		"  // Field descriptor #6 Ljava/lang/ref/Reference;\n" +
40607 		"  // Signature: Ljava/lang/ref/Reference<LX<Ljava/lang/String;>.Other<Ljava/lang/Thread;>.Deeply;>;\n" +
40608 		"  java.lang.ref.Reference t;\n" +
40609 		"  \n" +
40610 		"  // Field descriptor #6 Ljava/lang/ref/Reference;\n" +
40611 		"  // Signature: Ljava/lang/ref/Reference<LX<Ljava/lang/String;>.Other<Ljava/lang/Thread;>.Deeply.Deeper.Inside<Ljava/lang/Number;>;>;\n" +
40612 		"  java.lang.ref.Reference u;\n";
40613 
40614 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
40615 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
40616 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
40617 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
40618 	int index = result.indexOf(expectedOutput);
40619 	if (index == -1 || expectedOutput.length() == 0) {
40620 		System.out.println(Util.displayString(result, 3));
40621 	}
40622 	if (index == -1) {
40623 		assertEquals("Wrong contents", expectedOutput, result);
40624 	}
40625 }
40626 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=196253
40627 public void test1156() {
40628 	this.runConformTest(
40629 		new String[] {
40630 			"C.java",
40631 			"public class C {\n" +
40632 			"	R<X.N<X.N<?>>> xx = D.r;\n" +
40633 			"}",
40634 			"D.java",
40635 			"public class D {\n" +
40636 			"	public static R<X.N<X.N<?>>> r;\n" +
40637 			"}",
40638 			"R.java",
40639 			"public class R<T> {}",
40640 			"X.java",
40641 			"public class X<T> {\n" +
40642 			"	public static class N<U> {}\n" +
40643 			"}"
40644 		},
40645 		""
40646 	);
40647 	this.runConformTest(
40648 		new String[] {
40649 			"C.java",
40650 			"public class C {\n" +
40651 			"	R<X.N<X.N<?>>> xx = D.r;\n" +
40652 			"}",
40653 		},
40654 		"",
40655 		null,
40656 		false, // do not flush output
40657 		null
40658 	);
40659 }
40660 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=202624
40661 public void test1157() {
40662 	this.runNegativeTest(
40663 		new String[] {
40664 			"X.java",
40665 			"public class X {\n" +
40666 			"        public <A, B> void func(Class<? extends XX<A,B>> cls) {}\n" +
40667 			"        public void func() {\n" +
40668 			"                func(XX.class);\n" +
40669 			"                \n" +
40670 			"                Class<? extends XX<String,String>> c = XX.class;\n" +
40671 			"        }\n" +
40672 			"        class XX<A, B> {}\n" +
40673 			"}\n", // =================
40674 		},
40675 		"----------\n" +
40676 		"1. ERROR in X.java (at line 4)\n" +
40677 		"	func(XX.class);\n" +
40678 		"	^^^^\n" +
40679 		"The method func(Class<? extends X.XX<A,B>>) in the type X is not applicable for the arguments (Class<X.XX>)\n" +
40680 		"----------\n" +
40681 		"2. ERROR in X.java (at line 6)\n" +
40682 		"	Class<? extends XX<String,String>> c = XX.class;\n" +
40683 		"	                                       ^^^^^^^^\n" +
40684 		"Type mismatch: cannot convert from Class<X.XX> to Class<? extends X.XX<String,String>>\n" +
40685 		"----------\n");
40686 }
40687 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=202404
40688 public void test1158() {
40689 	this.runNegativeTest(
40690 		new String[] {
40691 			"X.java",
40692 			" class A {}\n" +
40693 			" class B extends A {}\n" +
40694 			" class C extends A{}\n" +
40695 			" \n" +
40696 			" class D<U extends A, V extends U> {}\n" +
40697 			"\n" +
40698 			"public class X {\n" +
40699 			"	void foo() {\n" +
40700 			"		D<?, ? super A> d1 = null;\n" +
40701 			"		D<?, ? extends A> d2 = null;\n" +
40702 			"		D<B, C> d3 = null;\n" +
40703 			"		D<?, ?> d4 = null;\n" +
40704 			"	}\n" +
40705 			"}\n", // =================
40706 		},
40707 		"----------\n" +
40708 		"1. ERROR in X.java (at line 11)\n" +
40709 		"	D<B, C> d3 = null;\n" +
40710 		"	     ^\n" +
40711 		"Bound mismatch: The type C is not a valid substitute for the bounded parameter <V extends U> of the type D<U,V>\n" +
40712 		"----------\n"
40713 		);
40714 }
40715 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=202404 - variation
40716 public void test1159() {
40717 	this.runConformTest(
40718 		new String[] {
40719 			"X.java",
40720 			"class Y<U extends Y<U>> {}\n" +
40721 			"public class X<V extends X<V>> extends Y<V>{\n" +
40722 			"	void foo(X<? extends V> x) {}\n" +
40723 			"}\n", // =================
40724 		},
40725 		"");
40726 }
40727 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=202404 - variation
40728 public void test1160() {
40729 	this.runNegativeTest(
40730 		new String[] {
40731 			"X.java",
40732 			"class Y<T extends Y<T>> {}\n" +
40733 			"class Z<U extends Y<U>> {}\n" +
40734 			"public class X<V extends Z<V>> extends Z<V>{\n" +
40735 			"	void foo(X<? extends V> x) {}\n" +
40736 			"}\n", // =================
40737 		},
40738 		"----------\n" +
40739 		"1. ERROR in X.java (at line 3)\n" +
40740 		"	public class X<V extends Z<V>> extends Z<V>{\n" +
40741 		"	                           ^\n" +
40742 		"Bound mismatch: The type V is not a valid substitute for the bounded parameter <U extends Y<U>> of the type Z<U>\n" +
40743 		"----------\n" +
40744 		"2. ERROR in X.java (at line 3)\n" +
40745 		"	public class X<V extends Z<V>> extends Z<V>{\n" +
40746 		"	                                         ^\n" +
40747 		"Bound mismatch: The type V is not a valid substitute for the bounded parameter <U extends Y<U>> of the type Z<U>\n" +
40748 		"----------\n");
40749 }
40750 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=202404 - variation
40751 public void test1161() {
40752 	this.runConformTest(
40753 		new String[] {
40754 			"X.java",
40755 			"class Y<T extends Y<T>> {}\n" +
40756 			"class Z<U extends Y<U>> extends Y<U> {}\n" +
40757 			"public class X<V extends Z<V>> extends Z<V> {\n" +
40758 			"	void foo(X<? extends V> x) {}\n" +
40759 			"}\n", // =================
40760 		},
40761 		"");
40762 }
40763 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=202404 - variation
40764 public void test1162() {
40765 	this.runConformTest(
40766 		new String[] {
40767 			"X.java",
40768 			"class Y<T extends Y<T>> {}\n" +
40769 			"class Z<U extends Z<U>> extends Y<U> {}\n" +
40770 			"public class X<V extends X<V>> extends Z<V>{\n" +
40771 			"	void foo(Y<? extends V> y) {}\n" +
40772 			"}\n", // =================
40773 		},
40774 		"");
40775 }
40776 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=203061 - variation
40777 public void test1163() {
40778 	String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ?
40779 			"----------\n" +
40780 			"1. ERROR in X.java (at line 5)\n" +
40781 			"	Object o1 = mObj;\n" +
40782 			"	            ^^^^\n" +
40783 			"The blank final field mObj may not have been initialized\n" +
40784 			"----------\n" +
40785 			"2. ERROR in X.java (at line 7)\n" +
40786 			"	Object o2 = mObj;\n" +
40787 			"	            ^^^^\n" +
40788 			"The blank final field mObj may not have been initialized\n" +
40789 			"----------\n"
40790 			:
40791 			"----------\n" +
40792 			"1. WARNING in X.java (at line 5)\n" +
40793 			"	Object o1 = mObj;\n" +
40794 			"	            ^^^^\n" +
40795 			"Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
40796 			"----------\n" +
40797 			"2. ERROR in X.java (at line 5)\n" +
40798 			"	Object o1 = mObj;\n" +
40799 			"	            ^^^^\n" +
40800 			"The blank final field mObj may not have been initialized\n" +
40801 			"----------\n" +
40802 			"3. WARNING in X.java (at line 7)\n" +
40803 			"	Object o2 = mObj;\n" +
40804 			"	            ^^^^\n" +
40805 			"Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
40806 			"----------\n" +
40807 			"4. ERROR in X.java (at line 7)\n" +
40808 			"	Object o2 = mObj;\n" +
40809 			"	            ^^^^\n" +
40810 			"The blank final field mObj may not have been initialized\n" +
40811 			"----------\n" +
40812 			"5. WARNING in X.java (at line 9)\n" +
40813 			"	Object o3 = mObj;\n" +
40814 			"	            ^^^^\n" +
40815 			"Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
40816 			"----------\n";
40817 	this.runNegativeTest(
40818 		new String[] {
40819 			"X.java",
40820 			"public final class X<T> {\n" +
40821 			"	private final Object mObj;\n" +
40822 			"	private final Object mDependent = new Object() {\n" +
40823 			"		{\n" +
40824 			"			Object o1 = mObj;\n" +
40825 			"		}\n" +
40826 			"		Object o2 = mObj;\n" +
40827 			"		void foo() {\n" +
40828 			"			Object o3 = mObj;\n" +
40829 			"		}\n" +
40830 			"	};\n" +
40831 			"	public X() {\n" +
40832 			"		mObj = \"\";\n" +
40833 			"	}\n" +
40834 			"}\n", // =================
40835 		},
40836 		errMessage);
40837 }
40838 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=203061 - variation
40839 public void test1164() {
40840 	String errMessage = isMinimumCompliant(ClassFileConstants.JDK11) ?
40841 			"----------\n" +
40842 			"1. ERROR in X.java (at line 5)\n" +
40843 			"	Object o1 = mObj;\n" +
40844 			"	            ^^^^\n" +
40845 			"The blank final field mObj may not have been initialized\n" +
40846 			"----------\n" +
40847 			"2. ERROR in X.java (at line 6)\n" +
40848 			"	mObj = \"1\";\n" +
40849 			"	^^^^\n" +
40850 			"The final field X<T>.mObj cannot be assigned\n" +
40851 			"----------\n" +
40852 			"3. ERROR in X.java (at line 8)\n" +
40853 			"	Object o2 = mObj = \"2\";\n" +
40854 			"	            ^^^^\n" +
40855 			"The final field X<T>.mObj cannot be assigned\n" +
40856 			"----------\n" +
40857 			"4. ERROR in X.java (at line 11)\n" +
40858 			"	mObj = \"3\";\n" +
40859 			"	^^^^\n" +
40860 			"The final field X<T>.mObj cannot be assigned\n" +
40861 			"----------\n"
40862 			:
40863 			"----------\n" +
40864 			"1. WARNING in X.java (at line 5)\n" +
40865 			"	Object o1 = mObj;\n" +
40866 			"	            ^^^^\n" +
40867 			"Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
40868 			"----------\n" +
40869 			"2. ERROR in X.java (at line 5)\n" +
40870 			"	Object o1 = mObj;\n" +
40871 			"	            ^^^^\n" +
40872 			"The blank final field mObj may not have been initialized\n" +
40873 			"----------\n" +
40874 			"3. WARNING in X.java (at line 6)\n" +
40875 			"	mObj = \"1\";\n" +
40876 			"	^^^^\n" +
40877 			"Write access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
40878 			"----------\n" +
40879 			"4. ERROR in X.java (at line 6)\n" +
40880 			"	mObj = \"1\";\n" +
40881 			"	^^^^\n" +
40882 			"The final field X<T>.mObj cannot be assigned\n" +
40883 			"----------\n" +
40884 			"5. WARNING in X.java (at line 8)\n" +
40885 			"	Object o2 = mObj = \"2\";\n" +
40886 			"	            ^^^^\n" +
40887 			"Write access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
40888 			"----------\n" +
40889 			"6. ERROR in X.java (at line 8)\n" +
40890 			"	Object o2 = mObj = \"2\";\n" +
40891 			"	            ^^^^\n" +
40892 			"The final field X<T>.mObj cannot be assigned\n" +
40893 			"----------\n" +
40894 			"7. WARNING in X.java (at line 10)\n" +
40895 			"	Object o3 = mObj;\n" +
40896 			"	            ^^^^\n" +
40897 			"Read access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
40898 			"----------\n" +
40899 			"8. WARNING in X.java (at line 11)\n" +
40900 			"	mObj = \"3\";\n" +
40901 			"	^^^^\n" +
40902 			"Write access to enclosing field X<T>.mObj is emulated by a synthetic accessor method\n" +
40903 			"----------\n" +
40904 			"9. ERROR in X.java (at line 11)\n" +
40905 			"	mObj = \"3\";\n" +
40906 			"	^^^^\n" +
40907 			"The final field X<T>.mObj cannot be assigned\n" +
40908 			"----------\n";	this.runNegativeTest(
40909 		new String[] {
40910 			"X.java",
40911 			"public final class X<T> {\n" +
40912 			"	private final Object mObj;\n" +
40913 			"	private final Object mDependent = new Object() {\n" +
40914 			"		{\n" +
40915 			"			Object o1 = mObj;\n" +
40916 			"			mObj = \"1\";\n" +
40917 			"		}\n" +
40918 			"		Object o2 = mObj = \"2\";\n" +
40919 			"		void foo() {\n" +
40920 			"			Object o3 = mObj;\n" +
40921 			"			mObj = \"3\";\n" +
40922 			"		}\n" +
40923 			"	};\n" +
40924 			"	public X() {\n" +
40925 			"		mObj = \"\";\n" +
40926 			"	}\n" +
40927 			"}\n"
40928 		}, errMessage);
40929 }
40930 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=202404 - variation
40931 public void test1165() {
40932 	this.runNegativeTest(
40933 		new String[] {
40934 			"X.java",
40935 			" interface A {}\n" +
40936 			" class B implements A {}\n" +
40937 			" class C implements A{}\n" +
40938 			" \n" +
40939 			" class D<U extends A, V extends U> {}\n" +
40940 			"\n" +
40941 			"public class X {\n" +
40942 			"	void foo() {\n" +
40943 			"		D<?, ? super A> d1 = null;\n" +
40944 			"		D<?, ? extends A> d2 = null;\n" +
40945 			"		D<B, C> d3 = null;\n" +
40946 			"		D<?, ?> d4 = null;\n" +
40947 			"	}\n" +
40948 			"}\n", // =================
40949 		},
40950 		"----------\n" +
40951 		"1. ERROR in X.java (at line 11)\n" +
40952 		"	D<B, C> d3 = null;\n" +
40953 		"	     ^\n" +
40954 		"Bound mismatch: The type C is not a valid substitute for the bounded parameter <V extends U> of the type D<U,V>\n" +
40955 		"----------\n"
40956 		);
40957 }
40958 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=203318
40959 public void test1166() {
40960 	this.runConformTest(
40961 		new String[] {
40962 			"X.java",
40963 			"public class X<T extends Number> {\n" +
40964 			"	T get() {	return null; };\n" +
40965 			"    void foo(X<? extends Object> x) {\n" +
40966 			"		x.get().intValue();    	\n" +
40967 			"    }\n" +
40968 			"}\n", // =================
40969 		},
40970 		"");
40971 }
40972 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=179902
40973 public void test1167() {
40974 	this.runNegativeTest(
40975 		new String[] {
40976 			"Foo.java",
40977 			"public class Foo<F extends Enum<F>> {\n" +
40978 			"  class Bar<B> {\n" +
40979 			"    Bar(Foo<? extends B> bar) {}\n" +
40980 			"  }\n" +
40981 			"}\n", // =================
40982 		},
40983 		"----------\n" +
40984 	"1. ERROR in Foo.java (at line 3)\n" +
40985 	"	Bar(Foo<? extends B> bar) {}\n" +
40986 	"	        ^^^^^^^^^^^\n" +
40987 	"Bound mismatch: The type ? extends B is not a valid substitute for the bounded parameter <F extends Enum<F>> of the type Foo<F>\n" +
40988 	"----------\n");
40989 }
40990 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=169049
40991 public void test1168() {
40992 	this.runNegativeTest(
40993 		new String[] {
40994 			"example/Container.java",
40995 			"package example;\n" +
40996 			"class A<E> {}\n" +
40997 			"class B<E> extends A<E> {}\n" +
40998 			"\n" +
40999 			"public interface Container<T, U extends T, V extends A<T>> {\n" +
41000 			"	<T1, U1 extends T1, V1 extends A<T1>> void f(\n" +
41001 			"			Container<?, ?, ?> a, \n" +
41002 			"			Container<?, ? extends T1, ?> b, \n" +
41003 			"			Container<T1, U1, V1> c, \n" +
41004 			"			Container<? extends T1, ? extends U1, ? extends V1> d, \n" +
41005 			"			Container<T1, ? extends U1, ? extends V1> e, \n" +
41006 			"			Container<T1, ? extends U1, A<T>> f, \n" +
41007 			"			Container<T1, U1, A<U1>> g,\n" +
41008 			"			Container<T1, U1, A<T1>> h);\n" +
41009 			"}\n", // =================
41010 		},
41011 		"----------\n" +
41012 		"1. ERROR in example\\Container.java (at line 12)\n" +
41013 		"	Container<T1, ? extends U1, A<T>> f, \n" +
41014 		"	                            ^\n" +
41015 		"Bound mismatch: The type A<T> is not a valid substitute for the bounded parameter <V extends A<T>> of the type Container<T,U,V>\n" +
41016 		"----------\n" +
41017 		"2. ERROR in example\\Container.java (at line 13)\n" +
41018 		"	Container<T1, U1, A<U1>> g,\n" +
41019 		"	                  ^\n" +
41020 		"Bound mismatch: The type A<U1> is not a valid substitute for the bounded parameter <V extends A<T>> of the type Container<T,U,V>\n" +
41021 		"----------\n");
41022 }
41023 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=169049 - variation
41024 public void test1169() {
41025 	this.runNegativeTest(
41026 		new String[] {
41027 			"example/Container2.java",
41028 			"package example;\n" +
41029 			"class A<E> {}\n" +
41030 			"class B<E> extends A<E> {}\n" +
41031 			"\n" +
41032 			"public interface Container2<T, U extends T, V extends A<? extends T>> {\n" +
41033 			"	<T1, U1 extends T1, V1 extends A<? extends T1>> void g(\n" +
41034 			"			Container2<?, ?, ?> a, \n" +
41035 			"			Container2<?, ? extends T1, ?> b, \n" +
41036 			"			Container2<T1, U1, V1> c, \n" +
41037 			"			Container2<? extends T1, ? extends U1, ? extends V1> d, \n" +
41038 			"			Container2<T1, ? extends U1, ? extends V1> e, \n" +
41039 			"			Container2<T1, ? extends U1, A<T>> f, \n" +
41040 			"			Container2<T1, U1, A<U1>> g, \n" +
41041 			"			Container2<? extends T1, U1, ? extends V1> h);\n" +
41042 			"\n" +
41043 			"}\n", // =================
41044 		},
41045 		"----------\n" +
41046 		"1. ERROR in example\\Container2.java (at line 12)\n" +
41047 		"	Container2<T1, ? extends U1, A<T>> f, \n" +
41048 		"	                             ^\n" +
41049 		"Bound mismatch: The type A<T> is not a valid substitute for the bounded parameter <V extends A<? extends T>> of the type Container2<T,U,V>\n" +
41050 		"----------\n");
41051 }
41052 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=169049 - variation
41053 public void test1170() {
41054 	this.runNegativeTest(
41055 		new String[] {
41056 			"example/Container3.java",
41057 			"package example;\n" +
41058 			"class A<E> {}\n" +
41059 			"class B<E> extends A<E> {}\n" +
41060 			"\n" +
41061 			"public interface Container3<T, U extends T, V extends A<? super T>> {\n" +
41062 			"	<T1, U1 extends T1, V1 extends A<? super T1>> void g(\n" +
41063 			"			Container3<?, ?, ?> a, \n" +
41064 			"			Container3<?, ? extends T1, ?> b, \n" +
41065 			"			Container3<T1, U1, V1> c, \n" +
41066 			"			Container3<? extends T1, ? extends U1, ? extends V1> d, \n" +
41067 			"			Container3<T1, ? extends U1, ? extends V1> e, \n" +
41068 			"			Container3<T1, ? extends U1, A<T>> f, \n" +
41069 			"			Container3<T1, U1, A<U1>> g, \n" +
41070 			"			Container3<? extends T1, U1, ? extends V1> h, \n" +
41071 			"			Container3<T1, ? extends U1, A<? super T>> i, \n" +
41072 			"			Container3<T1, ? extends U1, A> j);\n" +
41073 			"\n" +
41074 			"	<T1, U1 extends T1, V1 extends B<? super T1>> void h(\n" +
41075 			"			Container3<?, ?, ?> a, \n" +
41076 			"			Container3<?, ? extends T1, ?> b, \n" +
41077 			"			Container3<T1, U1, V1> c, \n" +
41078 			"			Container3<? extends T1, ? extends U1, ? extends V1> d, \n" +
41079 			"			Container3<T1, ? extends U1, ? extends V1> e, \n" +
41080 			"			Container3<T1, ? extends U1, B<T>> f, \n" +
41081 			"			Container3<T1, U1, B<U1>> g, \n" +
41082 			"			Container3<? extends T1, U1, ? extends V1> h, \n" +
41083 			"			Container3<T1, ? extends U1, B<? super T>> i, \n" +
41084 			"			Container3<T1, ? extends U1, B> j);\n" +
41085 			"}\n", // =================
41086 		},
41087 		"----------\n" +
41088 		"1. ERROR in example\\Container3.java (at line 12)\n" +
41089 		"	Container3<T1, ? extends U1, A<T>> f, \n" +
41090 		"	                             ^\n" +
41091 		"Bound mismatch: The type A<T> is not a valid substitute for the bounded parameter <V extends A<? super T>> of the type Container3<T,U,V>\n" +
41092 		"----------\n" +
41093 		"2. ERROR in example\\Container3.java (at line 13)\n" +
41094 		"	Container3<T1, U1, A<U1>> g, \n" +
41095 		"	                   ^\n" +
41096 		"Bound mismatch: The type A<U1> is not a valid substitute for the bounded parameter <V extends A<? super T>> of the type Container3<T,U,V>\n" +
41097 		"----------\n" +
41098 		"3. ERROR in example\\Container3.java (at line 15)\n" +
41099 		"	Container3<T1, ? extends U1, A<? super T>> i, \n" +
41100 		"	                             ^\n" +
41101 		"Bound mismatch: The type A<? super T> is not a valid substitute for the bounded parameter <V extends A<? super T>> of the type Container3<T,U,V>\n" +
41102 		"----------\n" +
41103 		"4. WARNING in example\\Container3.java (at line 16)\n" +
41104 		"	Container3<T1, ? extends U1, A> j);\n" +
41105 		"	                             ^\n" +
41106 		"A is a raw type. References to generic type A<E> should be parameterized\n" +
41107 		"----------\n" +
41108 		"5. ERROR in example\\Container3.java (at line 16)\n" +
41109 		"	Container3<T1, ? extends U1, A> j);\n" +
41110 		"	                             ^\n" +
41111 		"Bound mismatch: The type A is not a valid substitute for the bounded parameter <V extends A<? super T>> of the type Container3<T,U,V>\n" +
41112 		"----------\n" +
41113 		"6. ERROR in example\\Container3.java (at line 24)\n" +
41114 		"	Container3<T1, ? extends U1, B<T>> f, \n" +
41115 		"	                             ^\n" +
41116 		"Bound mismatch: The type B<T> is not a valid substitute for the bounded parameter <V extends A<? super T>> of the type Container3<T,U,V>\n" +
41117 		"----------\n" +
41118 		"7. ERROR in example\\Container3.java (at line 25)\n" +
41119 		"	Container3<T1, U1, B<U1>> g, \n" +
41120 		"	                   ^\n" +
41121 		"Bound mismatch: The type B<U1> is not a valid substitute for the bounded parameter <V extends A<? super T>> of the type Container3<T,U,V>\n" +
41122 		"----------\n" +
41123 		"8. ERROR in example\\Container3.java (at line 27)\n" +
41124 		"	Container3<T1, ? extends U1, B<? super T>> i, \n" +
41125 		"	                             ^\n" +
41126 		"Bound mismatch: The type B<? super T> is not a valid substitute for the bounded parameter <V extends A<? super T>> of the type Container3<T,U,V>\n" +
41127 		"----------\n" +
41128 		"9. WARNING in example\\Container3.java (at line 28)\n" +
41129 		"	Container3<T1, ? extends U1, B> j);\n" +
41130 		"	                             ^\n" +
41131 		"B is a raw type. References to generic type B<E> should be parameterized\n" +
41132 		"----------\n" +
41133 		"10. ERROR in example\\Container3.java (at line 28)\n" +
41134 		"	Container3<T1, ? extends U1, B> j);\n" +
41135 		"	                             ^\n" +
41136 		"Bound mismatch: The type B is not a valid substitute for the bounded parameter <V extends A<? super T>> of the type Container3<T,U,V>\n" +
41137 		"----------\n");
41138 }
41139 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=203905
41140 public void test1171() {
41141 	this.runConformTest(
41142 		new String[] {
41143 			"Function.java",
41144 			"public abstract class Function<A, B> {\n" +
41145 			"        public abstract B apply(A a);\n" +
41146 			"\n" +
41147 			"        /** (f andThen g)(x) = g(f(x)) */\n" +
41148 			"        public <C1> Function<A, C1> andThen(final Function<B, C1> g) {\n" +
41149 			"                return new Function<A, C1>() {\n" +
41150 			"                		@Override\n" +
41151 			"                        public C1 apply(A a) {\n" +
41152 			"                                return g.apply(Function.this.apply(a));\n" +
41153 			"                        }\n" +
41154 			"                };\n" +
41155 			"        }\n" +
41156 			"\n" +
41157 			"        /** (f compose g)(x) = f(g(x)) */\n" +
41158 			"        public <C2> Function<C2, B> compose(final Function<C2, A> g) {\n" +
41159 			"                return g.andThen(this);\n" +
41160 			"        }\n" +
41161 			"}\n", // =================
41162 		},
41163 		"");
41164 }
41165 public void test1172() {
41166 	this.runNegativeTest(
41167 		new String[] {
41168 			"X.java",
41169 			"public class X<T> {\n" +
41170 			"	T field;\n" +
41171 			"	void foo(X<String> xs, X<Number> xn, boolean b) {\n" +
41172 			"		(b ? xs : xn).field = xs.field;\n" +
41173 			"	}\n" +
41174 			"}\n", // =================
41175 		},
41176 		"----------\n" +
41177 		"1. ERROR in X.java (at line 4)\n" +
41178 		"	(b ? xs : xn).field = xs.field;\n" +
41179 		"	                      ^^^^^^^^\n" +
41180 		"Type mismatch: cannot convert from String to capture#1-of ? extends Serializable\n" +
41181 		"----------\n");
41182 }
41183 public void test1173() {
41184 	this.runNegativeTest(
41185 		new String[] {
41186 			"X.java",
41187 			"public class X<T> {\n" +
41188 			"	T field;\n" +
41189 			"	void foo(X<Integer> x1, X<Long> x2, boolean b) {\n" +
41190 			"		(b ? x1 : x2).field = x1.field;\n" +
41191 			"	}\n" +
41192 			"}\n", // =================
41193 		},
41194 		"----------\n" +
41195 		"1. ERROR in X.java (at line 4)\n" +
41196 		"	(b ? x1 : x2).field = x1.field;\n" +
41197 		"	                      ^^^^^^^^\n" +
41198 		"Type mismatch: cannot convert from Integer to capture#1-of ? extends "+intersection("Number","Comparable<?>")+"\n" +
41199 		"----------\n");
41200 }
41201 public void test1174() {
41202 	this.runNegativeTest(
41203 		new String[] {
41204 			"X.java",
41205 			"public class X<T> {\n" +
41206 			"	T field;\n" +
41207 			"	void foo(X<Integer> x1, X<Long> x2, boolean b) {\n" +
41208 			"		(b ? x1 : x2).field = (b ? x1 : x2).field;\n" +
41209 			"	}\n" +
41210 			"}\n", // =================
41211 		},
41212 		"----------\n" +
41213 		"1. ERROR in X.java (at line 4)\n" +
41214 		"	(b ? x1 : x2).field = (b ? x1 : x2).field;\n" +
41215 		"	                      ^^^^^^^^^^^^^^^^^^^\n" +
41216 		"Type mismatch: cannot convert from capture#2-of ? extends "+intersection("Number","Comparable<?>")+" to capture#1-of ? extends "+intersection("Number","Comparable<?>")+"\n" +
41217 		"----------\n");
41218 }
41219 public void test1175() {
41220 	this.runNegativeTest(
41221 		new String[] {
41222 			"X.java",
41223 			"public class X<T extends A & B> {\n" +
41224 			"	T field;\n" +
41225 			"	void foo(X<? extends C> x1, X<? extends C> x2, boolean b) {\n" +
41226 			"		(b ? x1 : x2).field = new C();\n" +
41227 			"	}\n" +
41228 			"}\n" +
41229 			"class A {}\n" +
41230 			"interface B {}\n" +
41231 			"class C extends A implements B {}\n", // =================
41232 		},
41233 		"----------\n" +
41234 		"1. ERROR in X.java (at line 4)\n" +
41235 		"	(b ? x1 : x2).field = new C();\n" +
41236 		"	                      ^^^^^^^\n" +
41237 		"Type mismatch: cannot convert from C to capture#3-of ? extends C\n" +
41238 		"----------\n");
41239 }
41240 public void test1176() {
41241 	runConformTest(
41242 		// test directory preparation
41243 		new String[] { /* test files */
41244 			"X.java",
41245 			"public class X<T extends Foo & Bar> {\n" +
41246 			"	T get() { return null; }\n" +
41247 			"	void method(X<? extends C> x1, X<? extends C> x2, boolean b) {\n" +
41248 			"		(b ? x1 : x2).get().foo();\n" +
41249 			"		(b ? x1 : x2).get().bar();\n" +
41250 			"	}\n" +
41251 			"}\n" +
41252 			"class Foo {\n" +
41253 			"	void foo() {/**/}\n" +
41254 			"}\n" +
41255 			"interface Bar {\n" +
41256 			"	void bar();\n" +
41257 			"}\n" +
41258 			"abstract class C extends Foo implements Bar {/**/}\n" +
41259 			"\n", // =================
41260 		},
41261 		// javac options
41262 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
41263 }
41264 public void test1177() {
41265 	runConformTest(
41266 		// test directory preparation
41267 		new String[] { /* test files */
41268 			"X.java",
41269 			"public class X<T extends Foo & Bar> {\n" +
41270 			"	T get() { return null; }\n" +
41271 			"	void method(X<? extends Runnable> x1, X<? extends java.io.Serializable> x2, boolean b) {\n" +
41272 			"		(b ? x1 : x2).get().foo();\n" +
41273 			"		(b ? x1 : x2).get().bar();\n" +
41274 			"	}\n" +
41275 			"}\n" +
41276 			"class Foo {\n" +
41277 			"	void foo() {/**/}\n" +
41278 			"}\n" +
41279 			"interface Bar {\n" +
41280 			"	void bar();\n" +
41281 			"}\n" +
41282 			"\n", // =================
41283 		},
41284 		// javac options
41285 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
41286 }
41287 public void test1178() {
41288 	runConformTest(
41289 		// test directory preparation
41290 		new String[] { /* test files */
41291 			"X.java",
41292 			"public class X<T extends Foo & Bar> {\n" +
41293 			"	T get() { return null; }\n" +
41294 			"	void method(X<? extends C> x1, X<? extends D> x2, boolean b) {\n" +
41295 			"		(b ? x1 : x2).get().baz();\n" +
41296 			"	}\n" +
41297 			"}\n" +
41298 			"class Foo {\n" +
41299 			"	void foo() {/**/}\n" +
41300 			"}\n" +
41301 			"interface Bar {\n" +
41302 			"	void bar();\n" +
41303 			"}\n" +
41304 			"abstract class C extends Foo implements Bar {\n" +
41305 			"	void baz() {/**/}\n" +
41306 			"}\n" +
41307 			"abstract class D extends C {/**/}\n" +
41308 			"abstract class E extends C {/**/}\n" +
41309 			"\n", // =================
41310 		},
41311 		// javac options
41312 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
41313 }
41314 public void test1179() {
41315 	this.runNegativeTest(
41316 		new String[] {
41317 			"X.java",
41318 			"public class X<T extends Object&V, V> {}\n" +
41319 			"\n", // =================
41320 		},
41321 		"----------\n" +
41322 		"1. ERROR in X.java (at line 1)\n" +
41323 		"	public class X<T extends Object&V, V> {}\n" +
41324 		"	                                ^\n" +
41325 		"The type V is not an interface; it cannot be specified as a bounded parameter\n" +
41326 		"----------\n");
41327 }
41328 public void test1180() {
41329 	this.runNegativeTest(
41330 		new String[] {
41331 			"X.java",
41332 			"public class X {\n" +
41333 			"	public static <S, T extends Comparable<S>, R extends S & T> R max1(T arg1, S arg2) {\n" +
41334 			"		return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
41335 			"	}\n" +
41336 			"\n" +
41337 			"	public static <T extends Comparable<S>, S, R extends S & Comparable<S>> R max2(T arg1, S arg2) {\n" +
41338 			"		return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
41339 			"	}\n" +
41340 			"\n" +
41341 			"	public static <T extends Comparable<S>, S, R extends Comparable<S>> R max3(T arg1, S arg2) {\n" +
41342 			"		return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
41343 			"	}\n" +
41344 			"\n" +
41345 			"	public static void main(String[] args) {\n" +
41346 			"	}\n" +
41347 			"}\n", // =================
41348 		},
41349 		"----------\n" +
41350 		"1. ERROR in X.java (at line 2)\n" +
41351 		"	public static <S, T extends Comparable<S>, R extends S & T> R max1(T arg1, S arg2) {\n" +
41352 		"	                                                         ^\n" +
41353 		"Cannot specify any additional bound T when first bound is a type parameter\n" +
41354 		"----------\n" +
41355 		"2. WARNING in X.java (at line 3)\n" +
41356 		"	return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
41357 		"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
41358 		"Type safety: Unchecked cast from Object to R\n" +
41359 		"----------\n" +
41360 		"3. ERROR in X.java (at line 6)\n" +
41361 		"	public static <T extends Comparable<S>, S, R extends S & Comparable<S>> R max2(T arg1, S arg2) {\n" +
41362 		"	                                                         ^^^^^^^^^^\n" +
41363 		"Cannot specify any additional bound Comparable<S> when first bound is a type parameter\n" +
41364 		"----------\n" +
41365 		"4. WARNING in X.java (at line 7)\n" +
41366 		"	return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
41367 		"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
41368 		"Type safety: Unchecked cast from Object to R\n" +
41369 		"----------\n" +
41370 		"5. WARNING in X.java (at line 11)\n" +
41371 		"	return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
41372 		"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
41373 		"Type safety: Unchecked cast from Object to R\n" +
41374 		"----------\n");
41375 }
41376 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=204534
41377 public void test1181() {
41378 	// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6182950
41379 	String expectedCompilerLog = (this.complianceLevel == ClassFileConstants.JDK1_6)?
41380 			"----------\n" +
41381 			"1. ERROR in X.java (at line 2)\n" +
41382 			"	public static <S, T extends Comparable<S>, R extends S & T> R max(T arg1, S arg2) {\n" +
41383 			"	                                                         ^\n" +
41384 			"Cannot specify any additional bound T when first bound is a type parameter\n" +
41385 			"----------\n" +
41386 			"2. ERROR in X.java (at line 2)\n" +
41387 			"	public static <S, T extends Comparable<S>, R extends S & T> R max(T arg1, S arg2) {\n" +
41388 			"	                                                              ^^^^^^^^^^^^^^^^^^^\n" +
41389 			"Erasure of method max(T, S) is the same as another method in type X\n" +
41390 			"----------\n" +
41391 			"3. WARNING in X.java (at line 3)\n" +
41392 			"	return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
41393 			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
41394 			"Type safety: Unchecked cast from Object to R\n" +
41395 			"----------\n" +
41396 			"4. ERROR in X.java (at line 5)\n" +
41397 			"	public static <T extends Comparable<S>, S, R extends S & Comparable<S>> R max(T arg1, S arg2) {\n" +
41398 			"	                                                         ^^^^^^^^^^\n" +
41399 			"Cannot specify any additional bound Comparable<S> when first bound is a type parameter\n" +
41400 			"----------\n" +
41401 			"5. ERROR in X.java (at line 5)\n" +
41402 			"	public static <T extends Comparable<S>, S, R extends S & Comparable<S>> R max(T arg1, S arg2) {\n" +
41403 			"	                                                                          ^^^^^^^^^^^^^^^^^^^\n" +
41404 			"Erasure of method max(T, S) is the same as another method in type X\n" +
41405 			"----------\n" +
41406 			"6. WARNING in X.java (at line 6)\n" +
41407 			"	return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
41408 			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
41409 			"Type safety: Unchecked cast from Object to R\n" +
41410 			"----------\n" +
41411 			"7. WARNING in X.java (at line 8)\n" +
41412 			"	public static <T extends Comparable<S>, S, R extends Comparable<S>> R max(T arg1, S arg2) {\n" +
41413 			"	                                                                      ^^^^^^^^^^^^^^^^^^^\n" +
41414 			"Erasure of method max(T, S) is the same as another method in type X\n" +
41415 			"----------\n" +
41416 			"8. WARNING in X.java (at line 9)\n" +
41417 			"	return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
41418 			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
41419 			"Type safety: Unchecked cast from Object to R\n" +
41420 			"----------\n":
41421 				"----------\n" +
41422 				"1. ERROR in X.java (at line 2)\n" +
41423 				"	public static <S, T extends Comparable<S>, R extends S & T> R max(T arg1, S arg2) {\n" +
41424 				"	                                                         ^\n" +
41425 				"Cannot specify any additional bound T when first bound is a type parameter\n" +
41426 				"----------\n" +
41427 				"2. ERROR in X.java (at line 2)\n" +
41428 				"	public static <S, T extends Comparable<S>, R extends S & T> R max(T arg1, S arg2) {\n" +
41429 				"	                                                              ^^^^^^^^^^^^^^^^^^^\n" +
41430 				"Erasure of method max(T, S) is the same as another method in type X\n" +
41431 				"----------\n" +
41432 				"3. WARNING in X.java (at line 3)\n" +
41433 				"	return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
41434 				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
41435 				"Type safety: Unchecked cast from Object to R\n" +
41436 				"----------\n" +
41437 				"4. ERROR in X.java (at line 5)\n" +
41438 				"	public static <T extends Comparable<S>, S, R extends S & Comparable<S>> R max(T arg1, S arg2) {\n" +
41439 				"	                                                         ^^^^^^^^^^\n" +
41440 				"Cannot specify any additional bound Comparable<S> when first bound is a type parameter\n" +
41441 				"----------\n" +
41442 				"5. ERROR in X.java (at line 5)\n" +
41443 				"	public static <T extends Comparable<S>, S, R extends S & Comparable<S>> R max(T arg1, S arg2) {\n" +
41444 				"	                                                                          ^^^^^^^^^^^^^^^^^^^\n" +
41445 				"Erasure of method max(T, S) is the same as another method in type X\n" +
41446 				"----------\n" +
41447 				"6. WARNING in X.java (at line 6)\n" +
41448 				"	return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
41449 				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
41450 				"Type safety: Unchecked cast from Object to R\n" +
41451 				"----------\n" +
41452 				"7. ERROR in X.java (at line 8)\n" +
41453 				"	public static <T extends Comparable<S>, S, R extends Comparable<S>> R max(T arg1, S arg2) {\n" +
41454 				"	                                                                      ^^^^^^^^^^^^^^^^^^^\n" +
41455 				"Erasure of method max(T, S) is the same as another method in type X\n" +
41456 				"----------\n" +
41457 				"8. WARNING in X.java (at line 9)\n" +
41458 				"	return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
41459 				"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
41460 				"Type safety: Unchecked cast from Object to R\n" +
41461 				"----------\n";
41462 	this.runNegativeTest(
41463 		new String[] {
41464 			"X.java",
41465 			"public class X {\n" +
41466 			"	public static <S, T extends Comparable<S>, R extends S & T> R max(T arg1, S arg2) {\n" +
41467 			"		return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
41468 			"	}\n" +
41469 			"	public static <T extends Comparable<S>, S, R extends S & Comparable<S>> R max(T arg1, S arg2) {\n" +
41470 			"		return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
41471 			"	}\n" +
41472 			"	public static <T extends Comparable<S>, S, R extends Comparable<S>> R max(T arg1, S arg2) {\n" +
41473 			"		return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);\n" +
41474 			"	}\n" +
41475 			"	public static void main(String[] args) {}\n" +
41476 			"}\n", // =================
41477 		},
41478 		expectedCompilerLog
41479 	);
41480 /*
41481 X.java:2: a type variable may not be followed by other bounds
41482         public static <S, T extends Comparable<S>, R extends S & T> R max(T arg1, S arg2) {
41483                                                                  ^
41484 X.java:5: a type variable may not be followed by other bounds
41485         public static <T extends Comparable<S>, S, R extends S & Comparable<S>>
41486 R max(T arg1, S arg2) {
41487                                                                            ^
41488 X.java:5: name clash: <T#1,S#2,R#3>max(T#1,S#2) and <S#4,T#5,R#6>max(T#5,S#4) have the same erasure
41489         public static <T extends Comparable<S>, S, R extends S & Comparable<S>>
41490 R max(T arg1, S arg2) {
41491 
41492   ^
41493   where T#1,S#2,R#3,S#4,T#5,R#6 are type-variables:
41494     T#1 extends Comparable<S#2> declared in method <T#1,S#2,R#3>max(T#1,S#2)
41495     S#2 extends Object declared in method <T#1,S#2,R#3>max(T#1,S#2)
41496     R#3 extends S#2 declared in method <T#1,S#2,R#3>max(T#1,S#2)
41497     S#4 extends Object declared in method <S#4,T#5,R#6>max(T#5,S#4)
41498     T#5 extends Comparable<S#4> declared in method <S#4,T#5,R#6>max(T#5,S#4)
41499     R#6 extends S#4 declared in method <S#4,T#5,R#6>max(T#5,S#4)
41500 X.java:8: name clash: <T#1,S#2,R#3>max(T#1,S#2) and <S#4,T#5,R#6>max(T#5,S#4) have the same erasure
41501         public static <T extends Comparable<S>, S, R extends Comparable<S>> R max(T arg1, S arg2) {
41502                                                                               ^
41503   where T#1,S#2,R#3,S#4,T#5,R#6 are type-variables:
41504     T#1 extends Comparable<S#2> declared in method <T#1,S#2,R#3>max(T#1,S#2)
41505     S#2 extends Object declared in method <T#1,S#2,R#3>max(T#1,S#2)
41506     R#3 extends Comparable<S#2> declared in method <T#1,S#2,R#3>max(T#1,S#2)
41507     S#4 extends Object declared in method <S#4,T#5,R#6>max(T#5,S#4)
41508     T#5 extends Comparable<S#4> declared in method <S#4,T#5,R#6>max(T#5,S#4)
41509     R#6 extends S#4 declared in method <S#4,T#5,R#6>max(T#5,S#4)
41510 X.java:3: warning: [unchecked] unchecked cast
41511                 return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);
41512                            ^
41513   required: R
41514   found:    Object
41515   where R,S,T are type-variables:
41516     R extends S declared in method <S,T,R>max(T,S)
41517     S extends Object declared in method <S,T,R>max(T,S)
41518     T extends Comparable<S> declared in method <S,T,R>max(T,S)
41519 X.java:6: warning: [unchecked] unchecked cast
41520                 return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);
41521                            ^
41522   required: R
41523   found:    Object
41524   where R,T,S are type-variables:
41525     R extends S declared in method <T,S,R>max(T,S)
41526     T extends Comparable<S> declared in method <T,S,R>max(T,S)
41527     S extends Object declared in method <T,S,R>max(T,S)
41528 X.java:9: warning: [unchecked] unchecked cast
41529                 return (R) ((arg1.compareTo(arg2) > 0) ? arg1 : arg2);
41530                            ^
41531   required: R
41532   found:    Object
41533   where R,T,S are type-variables:
41534     R extends Comparable<S> declared in method <T,S,R>max(T,S)
41535     T extends Comparable<S> declared in method <T,S,R>max(T,S)
41536     S extends Object declared in method <T,S,R>max(T,S)
41537 4 errors
41538 3 warnings
41539  */
41540 }
41541 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=204536
41542 public void test1182() {
41543 	this.runNegativeTest(
41544 		new String[] {
41545 			"X.java",
41546 			"public class X<T extends Zork & Zork & Object> {\n" +
41547 			"}\n", // =================
41548 		},
41549 		"----------\n" +
41550 		"1. ERROR in X.java (at line 1)\n" +
41551 		"	public class X<T extends Zork & Zork & Object> {\n" +
41552 		"	                         ^^^^\n" +
41553 		"Zork cannot be resolved to a type\n" +
41554 		"----------\n" +
41555 		"2. ERROR in X.java (at line 1)\n" +
41556 		"	public class X<T extends Zork & Zork & Object> {\n" +
41557 		"	                                ^^^^\n" +
41558 		"Zork cannot be resolved to a type\n" +
41559 		"----------\n" +
41560 		"3. ERROR in X.java (at line 1)\n" +
41561 		"	public class X<T extends Zork & Zork & Object> {\n" +
41562 		"	                                       ^^^^^^\n" +
41563 		"The type Object is not an interface; it cannot be specified as a bounded parameter\n" +
41564 		"----------\n");
41565 }
41566 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=204536 - variation
41567 public void test1183() {
41568 	this.runNegativeTest(
41569 		new String[] {
41570 			"X.java",
41571 			"public class X<T extends Zork & Runnable> {\n" +
41572 			"	void foo(T t) {\n" +
41573 			"		t.run();\n" +
41574 			"	}\n" +
41575 			"	\n" +
41576 			"}\n", // =================
41577 		},
41578 		"----------\n" +
41579 		"1. ERROR in X.java (at line 1)\n" +
41580 		"	public class X<T extends Zork & Runnable> {\n" +
41581 		"	                         ^^^^\n" +
41582 		"Zork cannot be resolved to a type\n" +
41583 		"----------\n");
41584 }
41585 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=204536 - variation
41586 public void test1184() {
41587 	// check that unresolved first bound got erased into Object (and not Runnable)
41588 	this.runNegativeTest(
41589 		new String[] {
41590 			"X.java",
41591 			"public class X<T extends Zork & Runnable> {\n" +
41592 			"	T get() { return null; }\n" +
41593 			"	void foo(X x) {\n" +
41594 			"		Runnable r = x.get();\n" +
41595 			"	}\n" +
41596 			"	\n" +
41597 			"}\n", // =================
41598 		},
41599 		"----------\n" +
41600 		"1. ERROR in X.java (at line 1)\n" +
41601 		"	public class X<T extends Zork & Runnable> {\n" +
41602 		"	                         ^^^^\n" +
41603 		"Zork cannot be resolved to a type\n" +
41604 		"----------\n" +
41605 		"2. WARNING in X.java (at line 3)\n" +
41606 		"	void foo(X x) {\n" +
41607 		"	         ^\n" +
41608 		"X is a raw type. References to generic type X<T> should be parameterized\n" +
41609 		"----------\n" +
41610 		"3. ERROR in X.java (at line 4)\n" +
41611 		"	Runnable r = x.get();\n" +
41612 		"	               ^^^\n" +
41613 		"The method get() from the type X refers to the missing type Zork\n" +
41614 		"----------\n");
41615 }
41616 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=203587
41617 public void test1185() {
41618 	this.runNegativeTest(
41619 		new String[] {
41620 			"X.java",
41621 			"public class X<U, V> {\n" +
41622 			"	<T> void foo(Class<X> c) {};\n" +
41623 			"	<A, B> void foo(Class<X<A, B>> c) {}\n" +
41624 			"	void foo2(Class<X<U, V>> c) {};\n" +
41625 			"	<A, B> void foo2(Class<X<U, V>> c) {}\n" +
41626 			"}"
41627 		},
41628 		"----------\n" +
41629 		"1. ERROR in X.java (at line 2)\n" +
41630 		"	<T> void foo(Class<X> c) {};\n" +
41631 		"	         ^^^^^^^^^^^^^^^\n" +
41632 		"Erasure of method foo(Class<X>) is the same as another method in type X<U,V>\n" +
41633 		"----------\n" +
41634 		"2. WARNING in X.java (at line 2)\n" +
41635 		"	<T> void foo(Class<X> c) {};\n" +
41636 		"	                   ^\n" +
41637 		"X is a raw type. References to generic type X<U,V> should be parameterized\n" +
41638 		"----------\n" +
41639 		"3. ERROR in X.java (at line 3)\n" +
41640 		"	<A, B> void foo(Class<X<A, B>> c) {}\n" +
41641 		"	            ^^^^^^^^^^^^^^^^^^^^^\n" +
41642 		"Erasure of method foo(Class<X<A,B>>) is the same as another method in type X<U,V>\n" +
41643 		"----------\n" +
41644 		"4. ERROR in X.java (at line 4)\n" +
41645 		"	void foo2(Class<X<U, V>> c) {};\n" +
41646 		"	     ^^^^^^^^^^^^^^^^^^^^^^\n" +
41647 		"Duplicate method foo2(Class<X<U,V>>) in type X<U,V>\n" +
41648 		"----------\n" +
41649 		"5. ERROR in X.java (at line 5)\n" +
41650 		"	<A, B> void foo2(Class<X<U, V>> c) {}\n" +
41651 		"	            ^^^^^^^^^^^^^^^^^^^^^^\n" +
41652 		"Duplicate method foo2(Class<X<U,V>>) in type X<U,V>\n" +
41653 		"----------\n");
41654 }
41655 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=158870 - variation
41656 public void test1186() {
41657 	this.runNegativeTest(
41658 		new String[] {
41659 			"X.java",
41660 			"import java.io.Serializable;\n" +
41661 			"\n" +
41662 			"public class X<T> {\n" +
41663 			"	void foo1(X<? extends String> x1, X<? extends Number> x2) {\n" +
41664 			"		x1 = (X<? extends String>) x2;\n" +
41665 			"	}\n" +
41666 			"	void foo2(X<? extends String> x1, X<? extends Runnable> x2) {\n" +
41667 			"		x1 = (X<? extends String>) x2;\n" +
41668 			"	}	\n" +
41669 			"}\n", // =================
41670 		},
41671 		"----------\n" +
41672 		"1. ERROR in X.java (at line 5)\n" +
41673 		"	x1 = (X<? extends String>) x2;\n" +
41674 		"	     ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
41675 		"Cannot cast from X<capture#2-of ? extends Number> to X<? extends String>\n" +
41676 		"----------\n" +
41677 		"2. ERROR in X.java (at line 8)\n" +
41678 		"	x1 = (X<? extends String>) x2;\n" +
41679 		"	     ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
41680 		"Cannot cast from X<capture#5-of ? extends Runnable> to X<? extends String>\n" +
41681 		"----------\n");
41682 }
41683 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=158870 - variation
41684 public void test1187() {
41685 	this.runNegativeTest(
41686 		new String[] {
41687 			"X.java",
41688 			"import java.io.Serializable;\n" +
41689 			"public class X<T> {\n" +
41690 			"	void foo3(X<? extends Serializable> x1, X<? extends Runnable> x2) {\n" +
41691 			"		x1 = (X<? extends Serializable>) x2;\n" +
41692 			"	}	\n" +
41693 			"	void foo4(X<? extends Runnable> x1, X<? extends String> x2) {\n" +
41694 			"		x1 = (X<? extends Runnable>) x2;\n" +
41695 			"	}	\n" +
41696 			"}\n", // =================
41697 		},
41698 		"----------\n" +
41699 		"1. WARNING in X.java (at line 4)\n" +
41700 		"	x1 = (X<? extends Serializable>) x2;\n" +
41701 		"	     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
41702 		"Type safety: Unchecked cast from X<capture#2-of ? extends Runnable> to X<? extends Serializable>\n" +
41703 		"----------\n" +
41704 		"2. ERROR in X.java (at line 7)\n" +
41705 		"	x1 = (X<? extends Runnable>) x2;\n" +
41706 		"	     ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
41707 		"Cannot cast from X<capture#5-of ? extends String> to X<? extends Runnable>\n" +
41708 		"----------\n");
41709 }
41710 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=158870 - variation
41711 public void test1188() {
41712 	this.runNegativeTest(
41713 		new String[] {
41714 			"X.java",
41715 			"public class X {\n" +
41716 			"	<T extends String, S extends Comparable<T>> void foo(Integer i) {\n" +
41717 			"        S a = (S) i; // error?\n" +
41718 			"	}\n" +
41719 			"	<U extends Comparable<U>> void bar(Integer i) {\n" +
41720 			"        U a = (U) i; // unchecked?\n" +
41721 			"	}\n" +
41722 			"}\n", // =================
41723 		},
41724 		"----------\n" +
41725 		"1. WARNING in X.java (at line 2)\n" +
41726 		"	<T extends String, S extends Comparable<T>> void foo(Integer i) {\n" +
41727 		"	           ^^^^^^\n" +
41728 		"The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
41729 		"----------\n" +
41730 		"2. ERROR in X.java (at line 3)\n" +
41731 		"	S a = (S) i; // error?\n" +
41732 		"	      ^^^^^\n" +
41733 		"Cannot cast from Integer to S\n" +
41734 		"----------\n" +
41735 		"3. WARNING in X.java (at line 6)\n" +
41736 		"	U a = (U) i; // unchecked?\n" +
41737 		"	      ^^^^^\n" +
41738 		"Type safety: Unchecked cast from Integer to U\n" +
41739 		"----------\n");
41740 }
41741 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=158870 - variation
41742 public void test1189() {
41743 	this.runNegativeTest(
41744 		new String[] {
41745 			"X.java",
41746 			"public class X {\n" +
41747 			"	<T extends String, S extends Comparable<T>> void foo(Number n) {\n" +
41748 			"        S a = (S) n; // unchecked?\n" +
41749 			"	}\n" +
41750 			"	<U extends Comparable<U>> void bar(Number n) {\n" +
41751 			"        U a = (U) n; // unchecked?\n" +
41752 			"	}\n" +
41753 			"}\n", // =================
41754 		},
41755 		"----------\n" +
41756 		"1. WARNING in X.java (at line 2)\n" +
41757 		"	<T extends String, S extends Comparable<T>> void foo(Number n) {\n" +
41758 		"	           ^^^^^^\n" +
41759 		"The type parameter T should not be bounded by the final type String. Final types cannot be further extended\n" +
41760 		"----------\n" +
41761 		"2. WARNING in X.java (at line 3)\n" +
41762 		"	S a = (S) n; // unchecked?\n" +
41763 		"	      ^^^^^\n" +
41764 		"Type safety: Unchecked cast from Number to S\n" +
41765 		"----------\n" +
41766 		"3. WARNING in X.java (at line 6)\n" +
41767 		"	U a = (U) n; // unchecked?\n" +
41768 		"	      ^^^^^\n" +
41769 		"Type safety: Unchecked cast from Number to U\n" +
41770 		"----------\n");
41771 }
41772 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=158870 - variation
41773 public void test1190() {
41774 	this.runNegativeTest(
41775 		new String[] {
41776 			"X.java",
41777 			"public class X {\n" +
41778 			"	<U extends Integer, T extends U, S extends Comparable<T>> void foo2(Integer i) {\n" +
41779 			"        S a = (S) i; // unchecked1?\n" +
41780 			"        Comparable<T> b = (Comparable<T>) i; // unchecked2?\n" +
41781 			"	}		\n" +
41782 			"	<U extends String, T extends U, S extends Comparable<T>> void foo3(Integer i) {\n" +
41783 			"        S a = (S) i; // error?\n" +
41784 			"        Comparable<T> b = (Comparable<T>) i; // error3?\n" +
41785 			"	}	\n" +
41786 			"}\n", // =================
41787 		},
41788 		"----------\n" +
41789 		"1. WARNING in X.java (at line 2)\n" +
41790 		"	<U extends Integer, T extends U, S extends Comparable<T>> void foo2(Integer i) {\n" +
41791 		"	           ^^^^^^^\n" +
41792 		"The type parameter U should not be bounded by the final type Integer. Final types cannot be further extended\n" +
41793 		"----------\n" +
41794 		"2. WARNING in X.java (at line 3)\n" +
41795 		"	S a = (S) i; // unchecked1?\n" +
41796 		"	      ^^^^^\n" +
41797 		"Type safety: Unchecked cast from Integer to S\n" +
41798 		"----------\n" +
41799 		"3. WARNING in X.java (at line 4)\n" +
41800 		"	Comparable<T> b = (Comparable<T>) i; // unchecked2?\n" +
41801 		"	                  ^^^^^^^^^^^^^^^^^\n" +
41802 		"Type safety: Unchecked cast from Integer to Comparable<T>\n" +
41803 		"----------\n" +
41804 		"4. WARNING in X.java (at line 6)\n" +
41805 		"	<U extends String, T extends U, S extends Comparable<T>> void foo3(Integer i) {\n" +
41806 		"	           ^^^^^^\n" +
41807 		"The type parameter U should not be bounded by the final type String. Final types cannot be further extended\n" +
41808 		"----------\n" +
41809 		"5. ERROR in X.java (at line 7)\n" +
41810 		"	S a = (S) i; // error?\n" +
41811 		"	      ^^^^^\n" +
41812 		"Cannot cast from Integer to S\n" +
41813 		"----------\n" +
41814 		"6. ERROR in X.java (at line 8)\n" +
41815 		"	Comparable<T> b = (Comparable<T>) i; // error3?\n" +
41816 		"	                  ^^^^^^^^^^^^^^^^^\n" +
41817 		"Cannot cast from Integer to Comparable<T>\n" +
41818 		"----------\n");
41819 }
41820 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=158870 - variation
41821 public void test1191() {
41822 	this.runNegativeTest(
41823 		new String[] {
41824 			"X.java",
41825 			"public class X {\n" +
41826 			"	void foo(SomeEnum en) {\n" +
41827 			"		Enum<?> myvar = en;\n" +
41828 			"		SomeEnum en2 = (SomeEnum) myvar;\n" +
41829 			"		if (myvar instanceof SomeEnum) {\n" +
41830 			"			return;\n" +
41831 			"		}\n" +
41832 			"	}\n" +
41833 			"	Zork z;\n" +
41834 			"}\n" +
41835 			"enum SomeEnum {\n" +
41836 			"}\n", // =================
41837 		},
41838 		"----------\n" +
41839 		"1. ERROR in X.java (at line 9)\n" +
41840 		"	Zork z;\n" +
41841 		"	^^^^\n" +
41842 		"Zork cannot be resolved to a type\n" +
41843 		"----------\n");
41844 }
41845 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=165352
41846 public void test1192() {
41847 	this.runNegativeTest(
41848 		new String[] {
41849 			"X.java",
41850 			"import java.util.*;\n" +
41851 			"public class X {\n" +
41852 			"        void foo(ArrayList<Object> a) {\n" +
41853 			"                Object o = (List<? extends String>) a; // ko\n" +
41854 			"        }\n" +
41855 			"        void bar(List<Object> a) {\n" +
41856 			"                Object o = (ArrayList<? extends String>) a; // ko\n" +
41857 			"        }\n" +
41858 			"}\n", // =================
41859 		},
41860 		"----------\n" +
41861 		"1. ERROR in X.java (at line 4)\n" +
41862 		"	Object o = (List<? extends String>) a; // ko\n" +
41863 		"	           ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
41864 		"Cannot cast from ArrayList<Object> to List<? extends String>\n" +
41865 		"----------\n" +
41866 		"2. WARNING in X.java (at line 4)\n" +
41867 		"	Object o = (List<? extends String>) a; // ko\n" +
41868 		"	           ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
41869 		"Unnecessary cast from ArrayList<Object> to List<? extends String>\n" +
41870 		"----------\n" +
41871 		"3. ERROR in X.java (at line 7)\n" +
41872 		"	Object o = (ArrayList<? extends String>) a; // ko\n" +
41873 		"	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
41874 		"Cannot cast from List<Object> to ArrayList<? extends String>\n" +
41875 		"----------\n" +
41876 		"4. WARNING in X.java (at line 7)\n" +
41877 		"	Object o = (ArrayList<? extends String>) a; // ko\n" +
41878 		"	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
41879 		"Unnecessary cast from List<Object> to ArrayList<? extends String>\n" +
41880 		"----------\n");
41881 }
41882 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=148046 - variation
41883 public void test1193() {
41884 	this.runNegativeTest(
41885 		new String[] {
41886 			"X.java",
41887 			"class A {}\n" +
41888 			"class B extends A {}\n" +
41889 			"public class X<T> {\n" +
41890 			"        public void foo(X<? super A> param) {\n" +
41891 			"                X<B> bar = (X<B>) param; // unchecked warning vs error\n" +
41892 			"        }\n" +
41893 			"}\n", // =================
41894 		},
41895 		"----------\n" +
41896 		"1. ERROR in X.java (at line 5)\n" +
41897 		"	X<B> bar = (X<B>) param; // unchecked warning vs error\n" +
41898 		"	           ^^^^^^^^^^^^\n" +
41899 		"Cannot cast from X<capture#1-of ? super A> to X<B>\n" +
41900 		"----------\n");
41901 }
41902 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=120088
41903 public void test1194() {
41904 	this.runNegativeTest(
41905 		new String[] {
41906 			"X.java",
41907 			"public class X {\n" +
41908 			"	public static void main(String[] args) {\n" +
41909 			"		X t = new X();\n" +
41910 			"		if (t.getClass() == Object.class)\n" +
41911 			"			System.out.println(\"OK\");\n" +
41912 			"	}\n" +
41913 			"}\n", // =================
41914 		},
41915 		"----------\n" +
41916 		"1. ERROR in X.java (at line 4)\n" +
41917 		"	if (t.getClass() == Object.class)\n" +
41918 		"	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
41919 		"Incompatible operand types Class<capture#1-of ? extends X> and Class<Object>\n" +
41920 		"----------\n");
41921 }
41922 public void test1195() {
41923 	this.runConformTest(
41924 		new String[] {
41925 			"java/lang/Class.java",
41926 			"package java.lang;\n" +
41927 			"public class Class<T> {\n" +
41928 			"	Class<? super T> getSuperclass() { return null; }\n" +
41929 			"	void foo() {\n" +
41930 			"		boolean foo = getSuperclass() == Enum.class;\n" +
41931 			"	}\n" +
41932 			"}\n", // =================
41933 		},
41934 		"");
41935 }
41936 public void test1196() {
41937 	runConformTest(
41938 		// test directory preparation
41939 		new String[] { /* test files */
41940 			"X.java",
41941 			"public class X<T> {\n" +
41942 			"	Class<? super T> getSuperclass() { return null; }\n" +
41943 			"	void foo() {\n" +
41944 			"		boolean foo = getSuperclass() == Enum.class;\n" +
41945 			"	}\n" +
41946 			"}\n" +
41947 			"class Y {\n" +
41948 			"	void bar() {\n" +
41949 			"		boolean bar = this.getClass().getSuperclass() == Enum.class;\n" +
41950 			"	}		\n" +
41951 			"}\n", // =================
41952 		},
41953 		// javac options
41954 		JavacTestOptions.JavacHasABug.JavacBugFixed_6_10 /* javac test options */);
41955 }
41956 public void test1197() {
41957 	this.runNegativeTest(
41958 		new String[] {
41959 			"X.java",
41960 			"public class X {\n" +
41961 			"	void test() {\n" +
41962 			"		B b = new C();\n" +
41963 			"		Class<? extends B> cb = C.class;\n" +
41964 			"		YYY<C> y = new XXX();\n" +
41965 			"		Class<? extends YYY<C>> cy = XXX.class;\n" +
41966 			"		YYY<? extends B> yb = new XXX();\n" +
41967 			"		Class<? extends YYY<? extends B>> ybc = XXX.class;\n" +
41968 			"		Class<? extends YYY> ybb = yb.getClass();\n" +
41969 			"		Class<? extends YYY<?>> ybb2 = yb.getClass();\n" +
41970 			"		Class<? extends YYY<? extends B>> ybb3 = yb.getClass();\n" +
41971 			"	}\n" +
41972 			"}\n" +
41973 			"\n" +
41974 			"class Obj {}\n" +
41975 			"class B extends Obj {}\n" +
41976 			"class C extends B {}\n" +
41977 			"class ZZZ<T extends Obj> {}\n" +
41978 			"class YYY<T extends B> extends ZZZ<T> {}\n" +
41979 			"class XXX extends YYY<C> {} \n", // =================
41980 		},
41981 		"----------\n" +
41982 		"1. WARNING in X.java (at line 9)\n" +
41983 		"	Class<? extends YYY> ybb = yb.getClass();\n" +
41984 		"	                ^^^\n" +
41985 		"YYY is a raw type. References to generic type YYY<T> should be parameterized\n" +
41986 		"----------\n" +
41987 		"2. ERROR in X.java (at line 10)\n" +
41988 		"	Class<? extends YYY<?>> ybb2 = yb.getClass();\n" +
41989 		"	                               ^^^^^^^^^^^^^\n" +
41990 		"Type mismatch: cannot convert from Class<capture#4-of ? extends YYY> to Class<? extends YYY<?>>\n" +
41991 		"----------\n" +
41992 		"3. ERROR in X.java (at line 11)\n" +
41993 		"	Class<? extends YYY<? extends B>> ybb3 = yb.getClass();\n" +
41994 		"	                                         ^^^^^^^^^^^^^\n" +
41995 		"Type mismatch: cannot convert from Class<capture#6-of ? extends YYY> to Class<? extends YYY<? extends B>>\n" +
41996 		"----------\n");
41997 }
41998 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=121024 - variation
41999 public void test1198() {
42000 	this.runConformTest(
42001 		new String[] {
42002 			"X.java",
42003 			"public class X {\n" +
42004 			"    interface Listener {}\n" +
42005 			"    interface ErrorListener {}  \n" +
42006 			"    static Object createParser(Listener l) {\n" +
42007 			"    	System.out.println(\"FAILED\");\n" +
42008 			"      return null;\n" +
42009 			"    }\n" +
42010 			"    static <L extends Object & Listener & ErrorListener> Object createParser(L l) {\n" +
42011 			"    	System.out.println(\"SUCCESS\");\n" +
42012 			"      return null;\n" +
42013 			"    }\n" +
42014 			"    public static void main(String[] args) {\n" +
42015 			"      class A implements Listener, ErrorListener {\n" +
42016 			"      }\n" +
42017 			"      createParser(new A()); // error here\n" +
42018 			"    }\n" +
42019 			"}\n", // =================
42020 		},
42021 		"SUCCESS");
42022 }
42023 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=121024 - variation
42024 public void test1198a() {
42025 	this.runConformTest(
42026 		new String[] {
42027 			"X.java",
42028 			"public class X {\n" +
42029 			"    interface Listener {}\n" +
42030 			"    interface ErrorListener {}  \n" +
42031 			"    static Object createParser(Listener l) {\n" +
42032 			"    	System.out.println(\"FAILED\");\n" +
42033 			"      return null;\n" +
42034 			"    }\n" +
42035 			"    static <L extends Object & ErrorListener & Listener> Object createParser(L l) {\n" +
42036 			"    	System.out.println(\"SUCCESS\");\n" +
42037 			"      return null;\n" +
42038 			"    }\n" +
42039 			"    public static void main(String[] args) {\n" +
42040 			"      class A implements Listener, ErrorListener {\n" +
42041 			"      }\n" +
42042 			"      createParser(new A()); // error here\n" +
42043 			"    }\n" +
42044 			"}\n", // =================
42045 		},
42046 		"SUCCESS");
42047 }
42048 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=121024 - variation
42049 public void test1199() {
42050 	this.runConformTest(
42051 		new String[] {
42052 			"X.java",
42053 			"public class X {\n" +
42054 			"    interface Listener {}\n" +
42055 			"    interface ErrorListener {}  \n" +
42056 			"    static Object createParser(Listener l) {\n" +
42057 			"    	System.out.println(\"SUCCESS\");\n" +
42058 			"      return null;\n" +
42059 			"    }\n" +
42060 			"    static <L extends ErrorListener & Listener> Object createParser(L l) {\n" +
42061 			"    	System.out.println(\"FAILED\");\n" +
42062 			"      return null;\n" +
42063 			"    }\n" +
42064 			"    public static void main(String[] args) {\n" +
42065 			"      class A implements Listener {\n" +
42066 			"      }\n" +
42067 			"      createParser(new A()); // error here\n" +
42068 			"    }\n" +
42069 			"}\n", // =================
42070 		},
42071 		"SUCCESS");
42072 }
42073 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=205594
42074 public void test1200() {
42075 	this.runNegativeTest(
42076 		new String[] {
42077 			"X.java",
42078 			"public class X {\n" +
42079 			"	public class Map<T1, T2> {\n" +
42080 			"	}\n" +
42081 			"\n" +
42082 			"	public <K, V> Map<K, V> make(K key, V value) {\n" +
42083 			"		return null;\n" +
42084 			"	}\n" +
42085 			"\n" +
42086 			"	public Map<Class<?>, X> method1() {\n" +
42087 			"		X value = new X();\n" +
42088 			"		Class<?> type = X.class;\n" +
42089 			"		return make(type, value);//1\n" +
42090 			"	}\n" +
42091 			"	public Map<Class<?>, X> method2() {\n" +
42092 			"		X value = new X();\n" +
42093 			"		Class<?> type = X.class;\n" +
42094 			"		return (Map<Class<?>, X>) make(type, value);//2\n" +
42095 			"	}\n" +
42096 			"	public Map<Class<?>, X> method3() {\n" +
42097 			"		X value = new X();\n" +
42098 			"		return make(X.class, value);//3\n" +
42099 			"	}\n" +
42100 			"	public Map<Class<?>, X> method4() {\n" +
42101 			"		X value = new X();\n" +
42102 			"		return (Map<Class<?>, X>) make(X.class, value);//4\n" +
42103 			"	}	\n" +
42104 			"}\n", // =================
42105 		},
42106 		(this.complianceLevel < ClassFileConstants.JDK1_8 ?
42107 		"----------\n" +
42108 		"1. ERROR in X.java (at line 12)\n" +
42109 		"	return make(type, value);//1\n" +
42110 		"	       ^^^^^^^^^^^^^^^^^\n" +
42111 		"Type mismatch: cannot convert from X.Map<Class<capture#1-of ?>,X> to X.Map<Class<?>,X>\n" +
42112 		"----------\n" +
42113 		"2. ERROR in X.java (at line 17)\n" +
42114 		"	return (Map<Class<?>, X>) make(type, value);//2\n" +
42115 		"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
42116 		"Cannot cast from X.Map<Class<capture#2-of ?>,X> to X.Map<Class<?>,X>\n" +
42117 		"----------\n" +
42118 		"3. ERROR in X.java (at line 21)\n" +
42119 		"	return make(X.class, value);//3\n" +
42120 		"	       ^^^^^^^^^^^^^^^^^^^^\n" +
42121 		"Type mismatch: cannot convert from X.Map<Class<X>,X> to X.Map<Class<?>,X>\n" +
42122 		"----------\n" +
42123 		"4. ERROR in X.java (at line 25)\n" +
42124 		"	return (Map<Class<?>, X>) make(X.class, value);//4\n" +
42125 		"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
42126 		"Cannot cast from X.Map<Class<X>,X> to X.Map<Class<?>,X>\n" +
42127 		"----------\n"
42128 		: // fewer errors in 1.8+:
42129 			"----------\n" +
42130 			"1. ERROR in X.java (at line 17)\n" +
42131 			"	return (Map<Class<?>, X>) make(type, value);//2\n" +
42132 			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
42133 			"Cannot cast from X.Map<Class<capture#2-of ?>,X> to X.Map<Class<?>,X>\n" + // FIXME: javac8 only reports a warning here
42134 			"----------\n" +
42135 			"2. ERROR in X.java (at line 25)\n" +
42136 			"	return (Map<Class<?>, X>) make(X.class, value);//4\n" +
42137 			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
42138 			"Cannot cast from X.Map<Class<X>,X> to X.Map<Class<?>,X>\n" +
42139 			"----------\n"));
42140 }
42141 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=174282
42142 public void test1201() {
42143 	this.runConformTest(
42144 		new String[] {
42145 			"X.java",
42146 			"public class X {\n" +
42147 			"    public MyClass f() {\n" +
42148 			"        SuperClass<? extends SuperDataModel> val = null;\n" +
42149 			"        return (MyClass) val;\n" +
42150 			"    }\n" +
42151 			"}\n" +
42152 			"class MyClass extends SuperClass<MyDataModel> {\n" +
42153 			"}\n" +
42154 			"class MyDataModel extends SuperDataModel {\n" +
42155 			"}\n" +
42156 			"class SuperClass<A extends SuperDataModel> {\n" +
42157 			"}\n" +
42158 			"class SuperDataModel {\n" +
42159 			"}\n", // =================
42160 		},
42161 		"");
42162 }
42163 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=168230
42164 public void test1202() {
42165 	String expectedOutput = this.complianceLevel < ClassFileConstants.JDK1_7
42166 		? 	"----------\n" +
42167 			"1. ERROR in X.java (at line 4)\n" +
42168 			"	X.<String>foo();\n" +
42169 			"	          ^^^\n" +
42170 			"The method foo() of type X is not generic; it cannot be parameterized with arguments <String>\n" +
42171 			"----------\n" +
42172 			"2. ERROR in X.java (at line 5)\n" +
42173 			"	X.<Zork>foo();\n" +
42174 			"	   ^^^^\n" +
42175 			"Zork cannot be resolved to a type\n" +
42176 			"----------\n" +
42177 			"3. ERROR in X.java (at line 5)\n" +
42178 			"	X.<Zork>foo();\n" +
42179 			"	        ^^^\n" +
42180 			"The method foo() of type X is not generic; it cannot be parameterized with arguments <Zork>\n" +
42181 			"----------\n"
42182 		: 	"----------\n" +
42183 			"1. WARNING in X.java (at line 4)\n" +
42184 			"	X.<String>foo();\n" +
42185 			"	   ^^^^^^\n" +
42186 			"Unused type arguments for the non generic method foo() of type X; it should not be parameterized with arguments <String>\n" +
42187 			"----------\n" +
42188 			"2. ERROR in X.java (at line 5)\n" +
42189 			"	X.<Zork>foo();\n" +
42190 			"	   ^^^^\n" +
42191 			"Zork cannot be resolved to a type\n" +
42192 			"----------\n" +
42193 			"3. WARNING in X.java (at line 5)\n" +
42194 			"	X.<Zork>foo();\n" +
42195 			"	   ^^^^\n" +
42196 			"Unused type arguments for the non generic method foo() of type X; it should not be parameterized with arguments <Zork>\n" +
42197 			"----------\n";
42198 
42199 	this.runNegativeTest(
42200 		new String[] {
42201 			"X.java",
42202 			"public class X {\n" +
42203 			"    public static void foo() {}\n" +
42204 			"    public static void bar() {\n" +
42205 			"        X.<String>foo();\n" +
42206 			"        X.<Zork>foo();\n" +
42207 			"    }\n" +
42208 			"}\n", // =================
42209 		},
42210 		expectedOutput);
42211 }
42212 
42213 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=168230 - variation
42214 // split because of https://bugs.eclipse.org/bugs/show_bug.cgi?id=207935
42215 public void test1203a() {
42216 	String[] sources =
42217 		new String[] {
42218 			"X.java",
42219 			"public class X {\n" +
42220 			"  public static String foo(String one, String two) {\n" +
42221 			"    return X.<String>foo(one, two);\n" +
42222 			"  }\n" +
42223 			"  public String bar(String one, String two) {\n" +
42224 			"    return this.<String>bar(one, two);\n" +
42225 			"  }\n" +
42226 			"}\n", // =================
42227 		};
42228 	if (this.complianceLevel < ClassFileConstants.JDK1_7) {
42229 		runNegativeTest(
42230 			sources,
42231 			"----------\n" +
42232 			"1. ERROR in X.java (at line 3)\n" +
42233 			"	return X.<String>foo(one, two);\n" +
42234 			"	                 ^^^\n" +
42235 			"The method foo(String, String) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
42236 			"----------\n" +
42237 			"2. ERROR in X.java (at line 6)\n" +
42238 			"	return this.<String>bar(one, two);\n" +
42239 			"	                    ^^^\n" +
42240 			"The method bar(String, String) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
42241 			"----------\n");
42242 	} else {
42243 		runConformTest(
42244 			true,
42245 			sources,
42246 			"----------\n" +
42247 			"1. WARNING in X.java (at line 3)\n" +
42248 			"	return X.<String>foo(one, two);\n" +
42249 			"	          ^^^^^^\n" +
42250 			"Unused type arguments for the non generic method foo(String, String) of type X; it should not be parameterized with arguments <String>\n" +
42251 			"----------\n" +
42252 			"2. WARNING in X.java (at line 6)\n" +
42253 			"	return this.<String>bar(one, two);\n" +
42254 			"	             ^^^^^^\n" +
42255 			"Unused type arguments for the non generic method bar(String, String) of type X; it should not be parameterized with arguments <String>\n" +
42256 			"----------\n",
42257 			null, null,
42258 			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
42259 	}
42260 }
42261 
42262 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=207935
42263 // this case is not solved as expected in 1.5 and 1.6 mode; keeping the 1.7 mode
42264 // activated test in all modes so we can track any changes
42265 public void test1203b() {
42266 	String expectedOutput = this.complianceLevel < ClassFileConstants.JDK1_7
42267 		? 	"----------\n" +
42268 			"1. WARNING in X.java (at line 4)\n" +
42269 			"	return this.<String>foobar(one, two);\n" +
42270 			"	             ^^^^^^\n" +
42271 			"Unused type arguments for the non generic method foobar(String, String) of type X; it should not be parameterized with arguments <String>\n" +
42272 			"----------\n" +
42273 			"2. ERROR in X.java (at line 8)\n" +
42274 			"	return this.<String>foobar2(one, two);// silenced\n" +
42275 			"	                    ^^^^^^^\n" +
42276 			"The method foobar2(String, String) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
42277 			"----------\n" +
42278 			"3. ERROR in X.java (at line 16)\n" +
42279 			"	this.<String,String>foobar(one, two);\n" +
42280 			"	                    ^^^^^^\n" +
42281 			"Incorrect number of type arguments for generic method <T>foobar(String, String) of type Y; it cannot be parameterized with arguments <String, String>\n" +
42282 			"----------\n"
42283 		: 	"----------\n" +
42284 			"1. WARNING in X.java (at line 4)\n" +
42285 			"	return this.<String>foobar(one, two);\n" +
42286 			"	             ^^^^^^\n" +
42287 			"Unused type arguments for the non generic method foobar(String, String) of type X; it should not be parameterized with arguments <String>\n" +
42288 			"----------\n" +
42289 			"2. ERROR in X.java (at line 16)\n" +
42290 			"	this.<String,String>foobar(one, two);\n" +
42291 			"	                    ^^^^^^\n" +
42292 			"Incorrect number of type arguments for generic method <T>foobar(String, String) of type Y; it cannot be parameterized with arguments <String, String>\n" +
42293 			"----------\n";
42294 
42295 	this.runNegativeTest(
42296 		new String[] {
42297 			"X.java",
42298 			"public class X extends Y {\n" +
42299 			"  @Override\n" +
42300 			"  public String foobar(String one, String two) {\n" +
42301 			"    return this.<String>foobar(one, two);\n" +
42302 			"  }\n" +
42303 			"	@SuppressWarnings(\"unused\")\n" +
42304 			"  public String foobar2(String one, String two) {\n" +
42305 			"    return this.<String>foobar2(one, two);// silenced\n" +
42306 			"  }\n" +
42307 			"}\n" +
42308 			"class Y {\n" +
42309 			"  public <T> String foobar(String one, String two) {\n" +
42310 			"    return null;\n" +
42311 			"  }\n" +
42312 			"  void test(String one, String two) {\n" +
42313 			"	  this.<String,String>foobar(one, two);\n" +
42314 			"  }\n" +
42315 			"}\n", // =================
42316 		},
42317 		expectedOutput);
42318 }
42319 
42320 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=207935
42321 public void test1203c() {
42322 	String[] sources =
42323 		new String[] {
42324 			"X.java",
42325 			"public class X extends Y {\n" +
42326 			"	public static void main(String[] args) {\n" +
42327 			"		String s = \"\";\n" +
42328 			"		new X().<String> a(s);\n" + // fails before 7
42329 			"		new X().<String> b(s, s);\n" + // fails before 7
42330 			"		new X().<String> c(s, s);\n" + // works in 1.5, 6.0 & 7.0
42331 			"		new X().<String> d(s, s);\n" + // works in 1.5, 6.0 & 7.0
42332 			"	}\n" +
42333 			"	@Override void a(String one) {}\n" +
42334 			"	void b(String one, Object two) {}\n" +
42335 			"	@Override void c(String one, String two) {}\n" +
42336 			"	@Override void d(String one, Object two) {}\n" +
42337 			"}\n" +
42338 			"class Y extends Z {\n" +
42339 			"	void a(String one) {}\n" +
42340 			"	<U> void b(String one) {}\n" +
42341 			"	@Override void c(String one, String two) {}\n" +
42342 			"}\n" +
42343 			"class Z {\n" +
42344 			"	<U> void c(String one, String two) {}\n" +
42345 			"	<U> void d(String one, U u) {}\n" +
42346 			"}"
42347 		};
42348 	if (this.complianceLevel < ClassFileConstants.JDK1_7) {
42349 		runNegativeTest(
42350 			sources,
42351 			"----------\n" +
42352 			"1. ERROR in X.java (at line 4)\n" +
42353 			"	new X().<String> a(s);\n" +
42354 			"	                 ^\n" +
42355 			"The method a(String) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
42356 			"----------\n" +
42357 			"2. ERROR in X.java (at line 5)\n" +
42358 			"	new X().<String> b(s, s);\n" +
42359 			"	                 ^\n" +
42360 			"The method b(String, Object) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
42361 			"----------\n" +
42362 			"3. WARNING in X.java (at line 6)\n" +
42363 			"	new X().<String> c(s, s);\n" +
42364 			"	         ^^^^^^\n" +
42365 			"Unused type arguments for the non generic method c(String, String) of type X; it should not be parameterized with arguments <String>\n" +
42366 			"----------\n" +
42367 			"4. WARNING in X.java (at line 7)\n" +
42368 			"	new X().<String> d(s, s);\n" +
42369 			"	         ^^^^^^\n" +
42370 			"Unused type arguments for the non generic method d(String, Object) of type X; it should not be parameterized with arguments <String>\n" +
42371 			"----------\n");
42372 	} else {
42373 		runConformTest(
42374 			true,
42375 			sources,
42376 			"----------\n" +
42377 			"1. WARNING in X.java (at line 4)\n" +
42378 			"	new X().<String> a(s);\n" +
42379 			"	         ^^^^^^\n" +
42380 			"Unused type arguments for the non generic method a(String) of type X; it should not be parameterized with arguments <String>\n" +
42381 			"----------\n" +
42382 			"2. WARNING in X.java (at line 5)\n" +
42383 			"	new X().<String> b(s, s);\n" +
42384 			"	         ^^^^^^\n" +
42385 			"Unused type arguments for the non generic method b(String, Object) of type X; it should not be parameterized with arguments <String>\n" +
42386 			"----------\n" +
42387 			"3. WARNING in X.java (at line 6)\n" +
42388 			"	new X().<String> c(s, s);\n" +
42389 			"	         ^^^^^^\n" +
42390 			"Unused type arguments for the non generic method c(String, String) of type X; it should not be parameterized with arguments <String>\n" +
42391 			"----------\n" +
42392 			"4. WARNING in X.java (at line 7)\n" +
42393 			"	new X().<String> d(s, s);\n" +
42394 			"	         ^^^^^^\n" +
42395 			"Unused type arguments for the non generic method d(String, Object) of type X; it should not be parameterized with arguments <String>\n" +
42396 			"----------\n",
42397 			null, null,
42398 			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
42399 	}
42400 }
42401 
42402 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=207935
42403 public void test1203d() {
42404 	String[] sources =
42405 		new String[] {
42406 			"X.java",
42407 			"public class X implements I {\n" +
42408 			"	public static void main(String[] args) {\n" +
42409 			"		String s = \"\";\n" +
42410 			"		new X().<String> a(s);\n" + // fails before 7
42411 			"		new X().<String> b(s, s);\n" + // fails before 7
42412 			"		new X().<String> c(s, s);\n" + // fails before 7
42413 			"		new X().<String> d(s, s);\n" + // fails before 7
42414 			"	}\n" +
42415 			"	public void a(String one) {}\n" +
42416 			"	public void b(String one, Object two) {}\n" +
42417 			"	public void c(String one, String two) {}\n" +
42418 			"	public void d(String one, Object two) {}\n" +
42419 			"}\n" +
42420 			"interface I extends J {\n" +
42421 			"	void a(String one);\n" +
42422 			"	void c(String one, String two);\n" +
42423 			"}\n" +
42424 			"interface J {\n" +
42425 			"	<U> void c(String one, String two);\n" +
42426 			"	<U> void d(String one, U u);\n" +
42427 			"}"
42428 		};
42429 	if (this.complianceLevel < ClassFileConstants.JDK1_7) {
42430 		runNegativeTest(
42431 			sources,
42432 			"----------\n" +
42433 			"1. ERROR in X.java (at line 4)\n" +
42434 			"	new X().<String> a(s);\n" +
42435 			"	                 ^\n" +
42436 			"The method a(String) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
42437 			"----------\n" +
42438 			"2. ERROR in X.java (at line 5)\n" +
42439 			"	new X().<String> b(s, s);\n" +
42440 			"	                 ^\n" +
42441 			"The method b(String, Object) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
42442 			"----------\n" +
42443 			"3. ERROR in X.java (at line 6)\n" +
42444 			"	new X().<String> c(s, s);\n" +
42445 			"	                 ^\n" +
42446 			"The method c(String, String) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
42447 			"----------\n" +
42448 			"4. ERROR in X.java (at line 7)\n" +
42449 			"	new X().<String> d(s, s);\n" +
42450 			"	                 ^\n" +
42451 			"The method d(String, Object) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
42452 			"----------\n");
42453 	} else {
42454 		runConformTest(
42455 			true,
42456 			sources,
42457 			"----------\n" +
42458 			"1. WARNING in X.java (at line 4)\n" +
42459 			"	new X().<String> a(s);\n" +
42460 			"	         ^^^^^^\n" +
42461 			"Unused type arguments for the non generic method a(String) of type X; it should not be parameterized with arguments <String>\n" +
42462 			"----------\n" +
42463 			"2. WARNING in X.java (at line 5)\n" +
42464 			"	new X().<String> b(s, s);\n" +
42465 			"	         ^^^^^^\n" +
42466 			"Unused type arguments for the non generic method b(String, Object) of type X; it should not be parameterized with arguments <String>\n" +
42467 			"----------\n" +
42468 			"3. WARNING in X.java (at line 6)\n" +
42469 			"	new X().<String> c(s, s);\n" +
42470 			"	         ^^^^^^\n" +
42471 			"Unused type arguments for the non generic method c(String, String) of type X; it should not be parameterized with arguments <String>\n" +
42472 			"----------\n" +
42473 			"4. WARNING in X.java (at line 7)\n" +
42474 			"	new X().<String> d(s, s);\n" +
42475 			"	         ^^^^^^\n" +
42476 			"Unused type arguments for the non generic method d(String, Object) of type X; it should not be parameterized with arguments <String>\n" +
42477 			"----------\n",
42478 			null, null,
42479 			JavacTestOptions.Excuse.EclipseHasSomeMoreWarnings);
42480 	}
42481 }
42482 
42483 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=207299
42484 public void test1204() {
42485 	this.runConformTest(
42486 		new String[] {
42487 			"ExpressionGraph.java",
42488 			"import java.util.*;\n" +
42489 			"public class ExpressionGraph<G extends ExpressionGraph<G, V>, V extends IVertex<G, V>> {\n" +
42490 			"	void foo(Set<V> set, Collection<? extends V> col) {\n" +
42491 			"		if (set == col) return;\n" +
42492 			"	}\n" +
42493 			"}\n" +
42494 			"interface IVertex<G extends ExpressionGraph<G, V>, V extends IVertex<G, V>> {	\n" +
42495 			"	// empty\n" +
42496 			"}\n", // =================
42497 		},
42498 		"");
42499 }
42500 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=207299 - variation
42501 public void test1205() {
42502 	this.runConformTest(
42503 		new String[] {
42504 			"ExpressionGraph.java",
42505 			"import java.util.*;\n" +
42506 			"\n" +
42507 			"public class ExpressionGraph<G extends ExpressionGraph<G, V, L>, V extends ExpressionVertex<G, V, L>, L> extends AbstractGraph<G, V> {\n" +
42508 			"	void foo(Set<V> set, Collection<? extends V> col) {\n" +
42509 			"		if (set == col) return;\n" +
42510 			"	}\n" +
42511 			"\n" +
42512 			"	interface IVertex<G extends ExpressionGraph<G, V, L>, V extends IVertex<G, V, L>, L> extends ExpressionVertex<G, V, L> {	\n" +
42513 			"		// empty\n" +
42514 			"	}\n" +
42515 			"	static abstract class Vertex<G extends ExpressionGraph<G, V, L>, V extends IVertex<G, V, L>, L> /*extends TaggableVertex<G, V>*/ implements IVertex<G, V, L> {	\n" +
42516 			"		// empty\n" +
42517 			"	}\n" +
42518 			"}\n" +
42519 			"\n" +
42520 			"abstract class AbstractGraph<G extends AbstractGraph<G,V>, V extends Vertex<G,V>> implements Graph<G,V> {\n" +
42521 			"	// empty\n" +
42522 			"}\n" +
42523 			"interface Graph<G extends Graph<G,V>, V extends Vertex<G,V>> {	\n" +
42524 			"	// empty\n" +
42525 			"}\n" +
42526 			"interface Vertex<G extends Graph<G,V>, V extends Vertex<G,V>> {\n" +
42527 			"	// empty\n" +
42528 			"}\n" +
42529 			"interface ExpressionVertex<G extends Graph<G,V>, V extends ExpressionVertex<G,V,L>, L> extends Vertex<G,V> {\n" +
42530 			"	// empty\n" +
42531 			"}\n", // =================
42532 		},
42533 		"");
42534 }
42535 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=207573
42536 public void test1206() {
42537 	this.runConformTest(
42538 		new String[] {
42539 			"X.java",
42540 			"public class X {\n" +
42541 			"	public final <E extends Exception> E throwE(E ex, Object... args) throws E {\n" +
42542 			"		Object[] oar = new Object[0];\n" +
42543 			"		return throwE(oar, ex, args);\n" +
42544 			"	}\n" +
42545 			"\n" +
42546 			"	public final <E extends Exception> E throwE(Object[] oar, E ex, Object... args) throws E {\n" +
42547 			"		throw ex;\n" +
42548 			"	}\n" +
42549 			"}", // =================
42550 		},
42551 		"");
42552 }
42553 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=207573 - variation
42554 public void test1207() {
42555 	this.runNegativeTest(
42556 		new String[] {
42557 			"X.java",
42558 			"public class X {\n" +
42559 			"    public final <E extends Exception> E throwE (E ex) throws E {\n" +
42560 			"    	throw ex;\n" +
42561 			"    }\n" +
42562 			"    void foo(Object[] objs) {\n" +
42563 			"    	throwE(objs);\n" +
42564 			"    }\n" +
42565 			"}\n", // =================
42566 		},
42567 		this.complianceLevel < ClassFileConstants.JDK1_8 ?
42568 		"----------\n" +
42569 		"1. ERROR in X.java (at line 6)\n" +
42570 		"	throwE(objs);\n" +
42571 		"	^^^^^^\n" +
42572 		"Bound mismatch: The generic method throwE(E) of type X is not applicable for the arguments (Object[]). The inferred type Object[] is not a valid substitute for the bounded parameter <E extends Exception>\n" +
42573 		"----------\n" :
42574 			"----------\n" +
42575 			"1. ERROR in X.java (at line 6)\n" +
42576 			"	throwE(objs);\n" +
42577 			"	^^^^^^\n" +
42578 			"The method throwE(E) in the type X is not applicable for the arguments (Object[])\n" +
42579 			"----------\n");
42580 }
42581 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=207573 - variation
42582 public void test1208() {
42583 	this.runConformTest(
42584 		new String[] {
42585 			"X.java",
42586 			"public class X {\n" +
42587 			"	public final <E extends Exception> E throwE2(E ex, Object... args) throws E {\n" +
42588 			"		Object[] oar = new Object[0];\n" +
42589 			"		return throwE(oar, ex, args);\n" +
42590 			"	}\n" +
42591 			"\n" +
42592 			"	public final <E extends Exception> E throwE(Object[] oar, E ex, Object... args) throws E {\n" +
42593 			"		throw ex;\n" +
42594 			"	}\n" +
42595 			"}", // =================
42596 		},
42597 		"");
42598 }
42599 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=207573 - variation
42600 public void test1209() {
42601 	this.runNegativeTest(
42602 		new String[] {
42603 			"X.java",
42604 			"public class X {\n" +
42605 			"    public final <E extends Exception> E throwE (E ex, Object ... args) throws E {\n" +
42606 			"    	throw ex;\n" +
42607 			"    }\n" +
42608 			"    void foo(Object[] objs) {\n" +
42609 			"    	throwE(objs);\n" +
42610 			"    }\n" +
42611 			"}", // =================
42612 		},
42613 		this.complianceLevel < ClassFileConstants.JDK1_8 ?
42614 		"----------\n" +
42615 		"1. ERROR in X.java (at line 6)\n" +
42616 		"	throwE(objs);\n" +
42617 		"	^^^^^^\n" +
42618 		"Bound mismatch: The generic method throwE(E, Object...) of type X is not applicable for the arguments (Object[]). The inferred type Object[] is not a valid substitute for the bounded parameter <E extends Exception>\n" +
42619 		"----------\n" :
42620 			"----------\n" +
42621 			"1. ERROR in X.java (at line 6)\n" +
42622 			"	throwE(objs);\n" +
42623 			"	^^^^^^\n" +
42624 			"The method throwE(E, Object...) in the type X is not applicable for the arguments (Object[])\n" +
42625 			"----------\n");
42626 }
42627 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=207573 - variation
42628 // FAIL ERRMSG
42629 public void test1210() {
42630 	this.runNegativeTest(
42631 		new String[] {
42632 			"X.java",
42633 			"public class X {\n" +
42634 			"    public final <E extends Exception> E throwE (Object ... args) throws E {\n" +
42635 			"    	return null;\n" +
42636 			"    }\n" +
42637 			"    void foo(Object[] objs) {\n" +
42638 			"    	Object[] o  = throwE(objs);\n" +
42639 			"    }\n" +
42640 			"}\n", // =================
42641 		},
42642 		(this.complianceLevel < ClassFileConstants.JDK1_8 ?
42643 		"----------\n" +
42644 		"1. ERROR in X.java (at line 6)\n" +
42645 		"	Object[] o  = throwE(objs);\n" +
42646 		"	              ^^^^^^\n" +
42647 		"Bound mismatch: The generic method throwE(Object...) of type X is not applicable for the arguments (Object[]). The inferred type Object[]&Exception is not a valid substitute for the bounded parameter <E extends Exception>\n" +
42648 		"----------\n" +
42649 		"2. ERROR in X.java (at line 6)\n" +
42650 		"	Object[] o  = throwE(objs);\n" +
42651 		"	              ^^^^^^^^^^^^\n" +
42652 		"Type mismatch: cannot convert from Object[]&Exception to Object[]\n" +
42653 		"----------\n"
42654 		:
42655 		"----------\n" +
42656 		"1. ERROR in X.java (at line 6)\n" +
42657 		"	Object[] o  = throwE(objs);\n" +
42658 		"	              ^^^^^^^^^^^^\n" +
42659 		"Type mismatch: cannot convert from RuntimeException to Object[]\n" +
42660 		"----------\n"));
42661 }
42662 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=208030
42663 public void test1211() {
42664 	if (this.complianceLevel < ClassFileConstants.JDK1_7) {
42665 		this.runNegativeTest(
42666 			new String[] {
42667 				"X.java",
42668 				"public class X {\n" +
42669 				"	public X(String t){\n" +
42670 				"		System.out.println(t);\n" +
42671 				"		Zork z;\n" +
42672 				"	}\n" +
42673 				"	public static void main(String[] args) {\n" +
42674 				"		class Local extends X {\n" +
42675 				"			Local() {\n" +
42676 				"				<String>super(\"FAILED\");\n" +
42677 				"			}\n" +
42678 				"		};\n" +
42679 				"		new <String>Local();\n" +
42680 				"		new <String>Local(){};\n" +
42681 				"	}\n" +
42682 				"}\n",
42683 			},
42684 			"----------\n" +
42685 			"1. ERROR in X.java (at line 4)\n" +
42686 			"	Zork z;\n" +
42687 			"	^^^^\n" +
42688 			"Zork cannot be resolved to a type\n" +
42689 			"----------\n" +
42690 			"2. ERROR in X.java (at line 9)\n" +
42691 			"	<String>super(\"FAILED\");\n" +
42692 			"	        ^^^^^^^^^^^^^^^^\n" +
42693 			"The constructor X(String) of type X is not generic; it cannot be parameterized with arguments <String>\n" +
42694 			"----------\n" +
42695 			"3. ERROR in X.java (at line 12)\n" +
42696 			"	new <String>Local();\n" +
42697 			"	^^^^^^^^^^^^^^^^^^^\n" +
42698 			"The constructor Local() of type Local is not generic; it cannot be parameterized with arguments <String>\n" +
42699 			"----------\n" +
42700 			"4. ERROR in X.java (at line 13)\n" +
42701 			"	new <String>Local(){};\n" +
42702 			"	^^^^^^^^^^^^^^^^^^^^^\n" +
42703 			"The constructor Local() of type Local is not generic; it cannot be parameterized with arguments <String>\n" +
42704 			"----------\n");
42705 		return;
42706 	}
42707 	this.runNegativeTest(
42708 			new String[] {
42709 				"X.java",
42710 				"public class X {\n" +
42711 				"	public X(String t){\n" +
42712 				"		System.out.println(t);\n" +
42713 				"		Zork z;\n" +
42714 				"	}\n" +
42715 				"	public static void main(String[] args) {\n" +
42716 				"		class Local extends X {\n" +
42717 				"			Local() {\n" +
42718 				"				<String>super(\"FAILED\");\n" +
42719 				"			}\n" +
42720 				"		};\n" +
42721 				"		new <String>Local();\n" +
42722 				"		new <String>Local(){};\n" +
42723 				"	}\n" +
42724 				"}\n",
42725 			},
42726 			"----------\n" +
42727 			"1. ERROR in X.java (at line 4)\n" +
42728 			"	Zork z;\n" +
42729 			"	^^^^\n" +
42730 			"Zork cannot be resolved to a type\n" +
42731 			"----------\n" +
42732 			"2. WARNING in X.java (at line 9)\n" +
42733 			"	<String>super(\"FAILED\");\n" +
42734 			"	 ^^^^^^\n" +
42735 			"Unused type arguments for the non generic constructor X(String) of type X; it should not be parameterized with arguments <String>\n" +
42736 			"----------\n" +
42737 			"3. WARNING in X.java (at line 12)\n" +
42738 			"	new <String>Local();\n" +
42739 			"	     ^^^^^^\n" +
42740 			"Unused type arguments for the non generic constructor Local() of type Local; it should not be parameterized with arguments <String>\n" +
42741 			"----------\n" +
42742 			"4. WARNING in X.java (at line 13)\n" +
42743 			"	new <String>Local(){};\n" +
42744 			"	     ^^^^^^\n" +
42745 			"Unused type arguments for the non generic constructor Local() of type Local; it should not be parameterized with arguments <String>\n" +
42746 			"----------\n");
42747 }
42748 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=77918
42749 // generic variants
42750 public void test1212() {
42751 	Map customOptions = getCompilerOptions();
42752 	customOptions.put(CompilerOptions.OPTION_ReportRedundantSuperinterface,  CompilerOptions.ERROR);
42753 	runNegativeTest(
42754 		// test directory preparation
42755 		true /* flush output directory */,
42756 		new String[] { /* test files */
42757 			"X.java",
42758 			"public class X<T> implements I<T> {}\n" +
42759 			"class Y<T extends Z> extends X<T> implements I<T>, J {}\n" +
42760 			"class Z {}" +
42761 			"interface I <T> {}\n" +
42762 			"interface J {}\n"
42763 		},
42764 		// compiler options
42765 		null /* no class libraries */,
42766 		customOptions /* custom options */,
42767 		// compiler results
42768 		"----------\n" + /* expected compiler log */
42769 		"1. ERROR in X.java (at line 2)\n" +
42770 		"	class Y<T extends Z> extends X<T> implements I<T>, J {}\n" +
42771 		"	                                             ^\n" +
42772 		"Redundant superinterface I<T> for the type Y<T>, already defined by X<T>\n" +
42773 		"----------\n",
42774 		// javac options
42775 		JavacTestOptions.SKIP /* skip javac tests - configured eclipse specific warning as error */);
42776 }
42777 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=77918
42778 // generic variants - the 'different arguments' error overrides the
42779 // redundant error
42780 public void test1213() {
42781 	Map customOptions = getCompilerOptions();
42782 	customOptions.put(CompilerOptions.OPTION_ReportRedundantSuperinterface, CompilerOptions.ERROR);
42783 	this.runNegativeTest(
42784 		new String[] {
42785 			"X.java",
42786 			"public class X<T> implements I<T> {}\n" +
42787 			"class Y<T extends Z, U extends T> extends X<T> implements I<U>, J {}\n" +
42788 			"class Z {}" +
42789 			"interface I <T> {}\n" +
42790 			"interface J {}\n"
42791 		},
42792 		"----------\n" +
42793 		"1. ERROR in X.java (at line 2)\n" +
42794 		"	class Y<T extends Z, U extends T> extends X<T> implements I<U>, J {}\n" +
42795 		"	      ^\n" +
42796 		"The interface I cannot be implemented more than once with different arguments: I<T> and I<U>\n" +
42797 		"----------\n",
42798 		null /* no extra class libraries */,
42799 		true /* flush output directory */,
42800 		customOptions);
42801 }
42802 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=208873
42803 public void test1214() {
42804 	runConformTest(
42805 		// test directory preparation
42806 		true /* flush output directory */,
42807 		new String[] { /* test files */
42808 			"X.java",
42809 			"public class X {\n" +
42810 			"	public interface Loader {\n" +
42811 			"		public <T extends Integer, K extends String> T load(final K key);\n" +
42812 			"	}\n" +
42813 			"	Loader loader;\n" +
42814 			"	public <K extends String, T extends Integer> T get(final K key) {\n" +
42815 			"		T data = this.loader.load(key);\n" +
42816 			"		return null;\n" +
42817 			"	}\n" +
42818 			"}\n", // =================
42819 		},
42820 		// compiler results
42821 		null /* do not check compiler log */,
42822 		// runtime results
42823 		"" /* expected output string */,
42824 		"" /* expected error string */,
42825 		// javac options
42826 		JavacTestOptions.JavacHasABug.JavacBug5042462 /* javac test options */);
42827 }
42828 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=208873 - variation
42829 public void test1215() {
42830 	runConformTest(
42831 		// test directory preparation
42832 		new String[] { /* test files */
42833 			"X.java",
42834 			"public class X {\n" +
42835 			"    <T, U extends T, V extends T> T cond1(boolean z, U x1, V x2) {\n" +
42836 			"        return (z? x1: x2);\n" +
42837 			"    }\n" +
42838 			"}\n",
42839 		},
42840 		// javac options
42841 		JavacTestOptions.JavacHasABug.JavacBug5042462 /* javac test options */);
42842 }
42843 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=209153
42844 public void test1216() {
42845 	this.runNegativeTest(
42846 		new String[] {
42847 			"X.java",
42848 			"public class X {\n" +
42849 			"	public static void main(String[] args) {\n" +
42850 			"		p.A myA = new p.A();\n" +
42851 			"		myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" +
42852 			"		Object o = myA.box.get(); // ok, since no generic cast actually inserted\n" +
42853 			"		myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" +
42854 			"		myA.p = myA.box.t;// [qName] generic cast to P -> error\n" +
42855 			"		int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" +
42856 			"	}\n" +
42857 			"}\n",
42858 			"p/A.java",
42859 			"package p;\n" +
42860 			"public class A {\n" +
42861 			"	public static class Box<T> {\n" +
42862 			"		public T t;\n" +
42863 			"		public void set(T t) { this.t = t; }\n" +
42864 			"		public T get()	{ return this.t; }\n" +
42865 			"	}\n" +
42866 			"	private class P {\n" +
42867 			"		public int pval;\n" +
42868 			"	}\n" +
42869 			"	public P p;\n" +
42870 			"	public Box<P> box;\n" +
42871 			"	public Box<P> getBox() { return this.box; }\n" +
42872 			"	public A next;\n" +
42873 			"	public A getNext() { return this;} \n" +
42874 			"	public A() {\n" +
42875 			"		this.box = new Box<P>();\n" +
42876 			"		this.box.set(new P());\n" +
42877 			"	}\n" +
42878 			"}\n"
42879 		},
42880 		"----------\n" +
42881 		"1. ERROR in X.java (at line 4)\n" +
42882 		"	myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" +
42883 		"	        ^^^^^^^^^^^^^\n" +
42884 		"The type A.P is not visible\n" +
42885 		"----------\n" +
42886 		"2. ERROR in X.java (at line 6)\n" +
42887 		"	myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" +
42888 		"	        ^^^^^^^^^^^^^^\n" +
42889 		"The type A.P is not visible\n" +
42890 		"----------\n" +
42891 		"3. ERROR in X.java (at line 7)\n" +
42892 		"	myA.p = myA.box.t;// [qName] generic cast to P -> error\n" +
42893 		"	        ^^^\n" +
42894 		"The type A.P is not visible\n" +
42895 		"----------\n" +
42896 		"4. ERROR in X.java (at line 8)\n" +
42897 		"	int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" +
42898 		"	           ^^^^^^^^^\n" +
42899 		"The type A.P is not visible\n" +
42900 		"----------\n" +
42901 		(isMinimumCompliant(ClassFileConstants.JDK11) ? "" :
42902 		"----------\n" +
42903 		"1. WARNING in p\\A.java (at line 18)\n" +
42904 		"	this.box.set(new P());\n" +
42905 		"	             ^^^^^^^\n" +
42906 		"Access to enclosing constructor A.P() is emulated by a synthetic accessor method\n" +
42907 		"----------\n"));
42908 }
42909 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=209153 - variation
42910 public void test1217() {
42911 	this.runNegativeTest(
42912 		new String[] {
42913 			"X.java",
42914 			"public class X {\n" +
42915 			"	public static void main(String[] args) {\n" +
42916 			"		p.A myA = new p.A();\n" +
42917 			"		myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" +
42918 			"		Object o = myA.box.get(); // ok, since no generic cast actually inserted\n" +
42919 			"		myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" +
42920 			"		myA.p = myA.box.t;// [qName] generic cast to P -> error\n" +
42921 			"		int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" +
42922 			"	}\n" +
42923 			"}\n",
42924 			"p/A.java",
42925 			"package p;\n" +
42926 			"public class A {\n" +
42927 			"	public static class Box<T> {\n" +
42928 			"		public T t;\n" +
42929 			"		public void set(T t) { this.t = t; }\n" +
42930 			"		public T get()	{ return this.t; }\n" +
42931 			"	}\n" +
42932 			"	protected class P {\n" +
42933 			"		public int pval;\n" +
42934 			"	}\n" +
42935 			"	public P p;\n" +
42936 			"	public Box<P> box;\n" +
42937 			"	public Box<P> getBox() { return this.box; }\n" +
42938 			"	public A next;\n" +
42939 			"	public A getNext() { return this;} \n" +
42940 			"	public A() {\n" +
42941 			"		this.box = new Box<P>();\n" +
42942 			"		this.box.set(new P());\n" +
42943 			"	}\n" +
42944 			"}\n"
42945 		},
42946 		"----------\n" +
42947 		"1. ERROR in X.java (at line 4)\n" +
42948 		"	myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" +
42949 		"	        ^^^^^^^^^^^^^\n" +
42950 		"The type A.P is not visible\n" +
42951 		"----------\n" +
42952 		"2. ERROR in X.java (at line 6)\n" +
42953 		"	myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" +
42954 		"	        ^^^^^^^^^^^^^^\n" +
42955 		"The type A.P is not visible\n" +
42956 		"----------\n" +
42957 		"3. ERROR in X.java (at line 7)\n" +
42958 		"	myA.p = myA.box.t;// [qName] generic cast to P -> error\n" +
42959 		"	        ^^^\n" +
42960 		"The type A.P is not visible\n" +
42961 		"----------\n" +
42962 		"4. ERROR in X.java (at line 8)\n" +
42963 		"	int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" +
42964 		"	           ^^^^^^^^^\n" +
42965 		"The type A.P is not visible\n" +
42966 		"----------\n");
42967 }
42968 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=209153 - variation
42969 public void test1218() {
42970 	this.runNegativeTest(
42971 		new String[] {
42972 			"X.java",
42973 			"public class X {\n" +
42974 			"	public static void main(String[] args) {\n" +
42975 			"		p.A myA = new p.A();\n" +
42976 			"		myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" +
42977 			"		Object o = myA.box.get(); // ok, since no generic cast actually inserted\n" +
42978 			"		myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" +
42979 			"		myA.p = myA.box.t;// [qName] generic cast to P -> error\n" +
42980 			"		int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" +
42981 			"	}\n" +
42982 			"}\n",
42983 			"p/A.java",
42984 			"package p;\n" +
42985 			"public class A {\n" +
42986 			"	public static class Box<T> {\n" +
42987 			"		public T t;\n" +
42988 			"		public void set(T t) { this.t = t; }\n" +
42989 			"		public T get()	{ return this.t; }\n" +
42990 			"	}\n" +
42991 			"	class P {\n" +
42992 			"		public int pval;\n" +
42993 			"	}\n" +
42994 			"	public P p;\n" +
42995 			"	public Box<P> box;\n" +
42996 			"	public Box<P> getBox() { return this.box; }\n" +
42997 			"	public A next;\n" +
42998 			"	public A getNext() { return this;} \n" +
42999 			"	public A() {\n" +
43000 			"		this.box = new Box<P>();\n" +
43001 			"		this.box.set(new P());\n" +
43002 			"	}\n" +
43003 			"}\n"
43004 		},
43005 		"----------\n" +
43006 		"1. ERROR in X.java (at line 4)\n" +
43007 		"	myA.p = myA.box.get(); // [msgSend] generic cast to P -> error\n" +
43008 		"	        ^^^^^^^^^^^^^\n" +
43009 		"The type A.P is not visible\n" +
43010 		"----------\n" +
43011 		"2. ERROR in X.java (at line 6)\n" +
43012 		"	myA.p = myA.getBox().t;// [fieldRef] generic cast to P -> error\n" +
43013 		"	        ^^^^^^^^^^^^^^\n" +
43014 		"The type A.P is not visible\n" +
43015 		"----------\n" +
43016 		"3. ERROR in X.java (at line 7)\n" +
43017 		"	myA.p = myA.box.t;// [qName] generic cast to P -> error\n" +
43018 		"	        ^^^\n" +
43019 		"The type A.P is not visible\n" +
43020 		"----------\n" +
43021 		"4. ERROR in X.java (at line 8)\n" +
43022 		"	int pval = myA.box.t.pval;// intermediate access through P already flagged as error\n" +
43023 		"	           ^^^^^^^^^\n" +
43024 		"The type A.P is not visible\n" +
43025 		"----------\n");
43026 }
43027 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=209779
43028 public void test1219() {
43029 	runConformTest(
43030 		// test directory preparation
43031 		true /* flush output directory */,
43032 		new String[] { /* test files */
43033 			"X.java",
43034 			"import java.util.ArrayList;\n" +
43035 			"import java.util.List;\n" +
43036 			"\n" +
43037 			"public class X {\n" +
43038 			"	public static void main(String[] args) {\n" +
43039 			"		final List<String> stringList = new ArrayList<String>();\n" +
43040 			"		stringList.add(\"test1\");\n" +
43041 			"		stringList.add(\"test2\");\n" +
43042 			"		((List) stringList).add(new Integer(1000));\n" +
43043 			"		try {\n" +
43044 			"			Object o = stringList.get(2);\n" +
43045 			"		} catch (ClassCastException e) {\n" +
43046 			"			System.out.print(\"[ClassCastException1]\");\n" +
43047 			"		}\n" +
43048 			"		try {\n" +
43049 			"			String s = stringList.get(2);\n" +
43050 			"		} catch (ClassCastException e) {\n" +
43051 			"			System.out.print(\"[ClassCastException2]\");\n" +
43052 			"		}		\n" +
43053 			"		try {\n" +
43054 			"			for (Object obj : stringList) {\n" +
43055 			"				System.out.print(obj);\n" +
43056 			"			}\n" +
43057 			"		} catch (ClassCastException e) {\n" +
43058 			"			System.out.print(\"[ClassCastException3]\");\n" +
43059 			"		}		\n" +
43060 			"		try {\n" +
43061 			"			for (String str : stringList) {\n" +
43062 			"				System.out.print(str);\n" +
43063 			"			}\n" +
43064 			"		} catch (ClassCastException e) {\n" +
43065 			"			System.out.print(\"[ClassCastException4]\");\n" +
43066 			"		}\n" +
43067 			"		System.out.println();\n" +
43068 			"	}\n" +
43069 			"}\n"
43070 		},
43071 		// compiler results
43072 		null /* do not check compiler log */,
43073 		// runtime results
43074 		"[ClassCastException2]test1test21000test1test2[ClassCastException4]" /* expected output string */,
43075 		"" /* expected error string */,
43076 		// javac options
43077 		JavacTestOptions.JavacHasABug.JavacBug6500701 /* javac test options */);
43078 }
43079 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=209152
43080 public void test1220() {
43081 	this.runNegativeTest(
43082 		new String[] {
43083 			"X.java",
43084 			"import java.util.List;\n" +
43085 			"\n" +
43086 			"public class X {\n" +
43087 			"        public static void doIt(List<?> list) {\n" +
43088 			"                list.add(list.remove(0));\n" +
43089 			"        }\n" +
43090 			"}\n"
43091 		},
43092 		"----------\n" +
43093 		"1. ERROR in X.java (at line 5)\n" +
43094 		"	list.add(list.remove(0));\n" +
43095 		"	     ^^^\n" +
43096 		"The method add(capture#1-of ?) in the type List<capture#1-of ?> is not applicable for the arguments (capture#2-of ?)\n" +
43097 		"----------\n");
43098 }
43099 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=209071
43100 public void test1221() {
43101 	this.runNegativeTest(
43102 		new String[] {
43103 			"X.java",
43104 			"import java.util.*;\n" +
43105 			"public class X {\n" +
43106 			"	void foo() {\n" +
43107 			"		Set<List> listSet = new HashSet<List>();\n" +
43108 			"		Set<List> otherListSet = new HashSet<List>();\n" +
43109 			"		otherListSet.add((List) listSet);		\n" +
43110 			"	}\n" +
43111 			"	void bar() {\n" +
43112 			"		Set<String> stringSet = new HashSet<String>();\n" +
43113 			"		Set<String> otherStringSet = new HashSet<String>();\n" +
43114 			"		otherStringSet.add((String) stringSet);		\n" +
43115 			"	}\n" +
43116 			"	public static void main(String[] args) {\n" +
43117 			"		new X().foo();\n" +
43118 			"		new X().bar();\n" +
43119 			"	}\n" +
43120 			"}	\n"
43121 		},
43122 		"----------\n" +
43123 		"1. WARNING in X.java (at line 4)\n" +
43124 		"	Set<List> listSet = new HashSet<List>();\n" +
43125 		"	    ^^^^\n" +
43126 		"List is a raw type. References to generic type List<E> should be parameterized\n" +
43127 		"----------\n" +
43128 		"2. WARNING in X.java (at line 4)\n" +
43129 		"	Set<List> listSet = new HashSet<List>();\n" +
43130 		"	                                ^^^^\n" +
43131 		"List is a raw type. References to generic type List<E> should be parameterized\n" +
43132 		"----------\n" +
43133 		"3. WARNING in X.java (at line 5)\n" +
43134 		"	Set<List> otherListSet = new HashSet<List>();\n" +
43135 		"	    ^^^^\n" +
43136 		"List is a raw type. References to generic type List<E> should be parameterized\n" +
43137 		"----------\n" +
43138 		"4. WARNING in X.java (at line 5)\n" +
43139 		"	Set<List> otherListSet = new HashSet<List>();\n" +
43140 		"	                                     ^^^^\n" +
43141 		"List is a raw type. References to generic type List<E> should be parameterized\n" +
43142 		"----------\n" +
43143 		"5. WARNING in X.java (at line 6)\n" +
43144 		"	otherListSet.add((List) listSet);		\n" +
43145 		"	                  ^^^^\n" +
43146 		"List is a raw type. References to generic type List<E> should be parameterized\n" +
43147 		"----------\n" +
43148 		"6. ERROR in X.java (at line 11)\n" +
43149 		"	otherStringSet.add((String) stringSet);		\n" +
43150 		"	                   ^^^^^^^^^^^^^^^^^^\n" +
43151 		"Cannot cast from Set<String> to String\n" +
43152 		"----------\n");
43153 }
43154 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=207959
43155 public void test1222() {
43156 	this.runNegativeTest(
43157 		new String[] {
43158 			"X.java",
43159 			"public class X<T extends Zork & Runnable> {\n" +
43160 			"  T get() { return null; }\n" +
43161 			"  void foo2(X<T> x2) {\n" +
43162 			"	    Runnable r = x2.get();\n" +
43163 			"	  }  \n" +
43164 			"}\n"
43165 		},
43166 		"----------\n" +
43167 		"1. ERROR in X.java (at line 1)\n" +
43168 		"	public class X<T extends Zork & Runnable> {\n" +
43169 		"	                         ^^^^\n" +
43170 		"Zork cannot be resolved to a type\n" +
43171 		"----------\n");
43172 }
43173 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=211718
43174 public void test1223() {
43175 	this.runNegativeTest(
43176 		new String[] {
43177 			"X.java",
43178 			"import java.util.Arrays;\n" +
43179 			"import java.util.List;\n" +
43180 			"public class X<E> {\n" +
43181 			"    public static enum IsABug {\n" +
43182 			"        TRUE,\n" +
43183 			"        FALSE;\n" +
43184 			"    }   \n" +
43185 			"    public List<IsABug> getPossibleBugStates() {\n" +
43186 			"    	String s1 = IsABug.values();\n" +
43187 			"    	String s2 = IsABug.valueOf(s1);\n" +
43188 			"        return Arrays.asList(IsABug.values());\n" +
43189 			"    }\n" +
43190 			"}\n"
43191 		},
43192 		"----------\n" +
43193 		"1. ERROR in X.java (at line 9)\n" +
43194 		"	String s1 = IsABug.values();\n" +
43195 		"	            ^^^^^^^^^^^^^^^\n" +
43196 		"Type mismatch: cannot convert from X.IsABug[] to String\n" +
43197 		"----------\n" +
43198 		"2. ERROR in X.java (at line 10)\n" +
43199 		"	String s2 = IsABug.valueOf(s1);\n" +
43200 		"	            ^^^^^^^^^^^^^^^^^^\n" +
43201 		"Type mismatch: cannot convert from X.IsABug to String\n" +
43202 		"----------\n");
43203 }
43204 public void test1224() {
43205 	this.runConformTest(
43206 		new String[] {
43207 			"X.java",
43208 			"import java.util.Collection;\n" +
43209 			"import java.util.Collections;\n" +
43210 			"public class X {\n" +
43211 			"	class Request<R extends Request<R, V>,V> {}\n" +
43212 			"	class RequestMap {\n" +
43213 			"		public <R extends Request<R, W>,W> R intersection (Collection<R> c) {\n" +
43214 			"			return null;\n" +
43215 			"		}\n" +
43216 			"	}\n" +
43217 			"	class DeltaRequest extends Request<DeltaRequest,double[]> {}\n" +
43218 			"	public void test () {\n" +
43219 			"		RequestMap m = new RequestMap ();\n" +
43220 			"		Collection<DeltaRequest> c = Collections.singleton (new DeltaRequest ());\n" +
43221 			"		DeltaRequest o = m.intersection (c);\n" +
43222 			"	}\n" +
43223 			"}\n"
43224 		},
43225 		"");
43226 }
43227 public void test1225() {
43228 	runConformTest(
43229 		// test directory preparation
43230 		new String[] { /* test files */
43231 			"X.java",
43232 			"import java.util.Collection;\n" +
43233 			"import java.util.List;\n" +
43234 			"public class X {\n" +
43235 			"   static <B> void m(List<? super B> list, Collection<? super B> coll) {\n" +
43236 			"     m(list, coll);\n" +
43237 			"   }\n" +
43238 			"}\n"
43239 		},
43240 		// javac options
43241 		JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
43242 }
43243 public void test1226() {
43244 	this.runNegativeTest(
43245 		new String[] {
43246 			"X.java",
43247 			"public class X<T> {\n" +
43248 			"	class M {\n" +
43249 			"		X<T> foo() { return null; }\n" +
43250 			"	}\n" +
43251 			"	void bar(M m) {\n" +
43252 			"		X<T> xt = m.foo();\n" + // no unchecked warning
43253 			"		Zork z;\n" +
43254 			"	}\n" +
43255 			"}\n"
43256 		},
43257 		"----------\n" +
43258 		"1. ERROR in X.java (at line 7)\n" +
43259 		"	Zork z;\n" +
43260 		"	^^^^\n" +
43261 		"Zork cannot be resolved to a type\n" +
43262 		"----------\n");
43263 }
43264 public void test1227() {
43265 	if (this.complianceLevel >= ClassFileConstants.JDK1_7) return;
43266 	this.runNegativeTest(
43267 		new String[] {
43268 			"X.java",
43269 			"import java.util.Arrays;\n" +
43270 			"public class  X {\n" +
43271 			"	void foo() {\n" +
43272 			"		Arrays.asList(String.class, Integer.class);\n" +
43273 			"	}\n" +
43274 			"	Zork z;\n" +
43275 			"}\n"
43276 		},
43277 		"----------\n" +
43278 		"1. WARNING in X.java (at line 4)\n" +
43279 		"	Arrays.asList(String.class, Integer.class);\n" +
43280 		"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
43281 		"Type safety: A generic array of Class<? extends Object&Serializable&"+ intersection("Comparable<?>") +"> is created for a varargs parameter\n" +
43282 		"----------\n" +
43283 		"2. ERROR in X.java (at line 6)\n" +
43284 		"	Zork z;\n" +
43285 		"	^^^^\n" +
43286 		"Zork cannot be resolved to a type\n" +
43287 		"----------\n");
43288 }
43289 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=214972
43290 public void test1228()  throws Exception {
43291 	this.runConformTest(
43292 		new String[] {
43293 			"X.java",
43294 			"public class X<U extends Class> {\n" +
43295 			"	public <Y> X(Y b1, U b2) {\n" +
43296 			"	}\n" +
43297 			"	public class Binner {\n" +
43298 			"		public class BinnerInner<I> {\n" +
43299 			"			public <J> BinnerInner<J> $new$() {\n" +
43300 			"				return new BinnerInner<J>();\n" +
43301 			"			}\n" +
43302 			"		}\n" +
43303 			"	}\n" +
43304 			"}\n"
43305 		},
43306 		"");
43307 	// check $new$ method generic signature
43308 	String expectedOutput =
43309 		"  // Method descriptor #22 ()LX$Binner$BinnerInner;\n" +
43310 		"  // Signature: <J:Ljava/lang/Object;>()LX<TU;>.Binner.BinnerInner<TJ;>;\n" +
43311 		"  // Stack: 3, Locals: 1\n" +
43312 		"  public X.Binner.BinnerInner $new$();\n" +
43313 		"     0  new X$Binner$BinnerInner [1]\n" +
43314 		"     3  dup\n" +
43315 		"     4  aload_0 [this]\n" +
43316 		"     5  getfield X$Binner$BinnerInner.this$1 : X.Binner [10]\n" +
43317 		"     8  invokespecial X$Binner$BinnerInner(X$Binner) [25]\n" +
43318 		"    11  areturn\n" +
43319 		"      Line numbers:\n" +
43320 		"        [pc: 0, line: 7]\n" +
43321 		"      Local variable table:\n" +
43322 		"        [pc: 0, pc: 12] local: this index: 0 type: X.Binner.BinnerInner\n" +
43323 		"      Local variable type table:\n" +
43324 		"        [pc: 0, pc: 12] local: this index: 0 type: X<U>.Binner.BinnerInner<I>\n";
43325 
43326 	File f = new File(OUTPUT_DIR + File.separator + "X$Binner$BinnerInner.class");
43327 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
43328 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
43329 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
43330 	int index = result.indexOf(expectedOutput);
43331 	if (index == -1 || expectedOutput.length() == 0) {
43332 		System.out.println(Util.displayString(result, 3));
43333 	}
43334 	if (index == -1) {
43335 		assertEquals("Wrong contents", expectedOutput, result);
43336 	}
43337 }
43338 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=214972 - variation
43339 public void test1229() {
43340 	this.runNegativeTest(
43341 		new String[] {
43342 			"X.java",
43343 			"public class X<U extends Class> {\n" +
43344 			"	public <Y> X(Y b1, U b2) {\n" +
43345 			"	}\n" +
43346 			"	public class Binner {\n" +
43347 			"		public class BinnerInner<I> {\n" +
43348 			"			public <J> BinnerInner<J> $new$() {\n" +
43349 			"				return new BinnerInner<J>();\n" +
43350 			"			}\n" +
43351 			"			X<U> root() {\n" +
43352 			"				return X.this;\n" +
43353 			"			}\n" +
43354 			"		}\n" +
43355 			"	}\n" +
43356 			"}\n",
43357 			"Z.java",
43358 			"public class Z {\n" +
43359 			"	public static void main(String[] args) {\n" +
43360 			"		X<Class>.Binner.BinnerInner<String> binString = new X<Class>(null, null).new Binner().new BinnerInner<String>();\n" +
43361 			"		String s = binString.$new$().root();\n" +
43362 			"	}\n" +
43363 			"}\n"
43364 		},
43365 		"----------\n" +
43366 		"1. WARNING in X.java (at line 1)\n" +
43367 		"	public class X<U extends Class> {\n" +
43368 		"	                         ^^^^^\n" +
43369 		"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
43370 		"----------\n" +
43371 		"2. WARNING in X.java (at line 1)\n" +
43372 		"	public class X<U extends Class> {\n" +
43373 		"	                         ^^^^^\n" +
43374 		"The type parameter U should not be bounded by the final type Class. Final types cannot be further extended\n" +
43375 		"----------\n" +
43376 		"----------\n" +
43377 		"1. WARNING in Z.java (at line 3)\n" +
43378 		"	X<Class>.Binner.BinnerInner<String> binString = new X<Class>(null, null).new Binner().new BinnerInner<String>();\n" +
43379 		"	  ^^^^^\n" +
43380 		"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
43381 		"----------\n" +
43382 		"2. WARNING in Z.java (at line 3)\n" +
43383 		"	X<Class>.Binner.BinnerInner<String> binString = new X<Class>(null, null).new Binner().new BinnerInner<String>();\n" +
43384 		"	                                                      ^^^^^\n" +
43385 		"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
43386 		"----------\n" +
43387 		"3. ERROR in Z.java (at line 4)\n" +
43388 		"	String s = binString.$new$().root();\n" +
43389 		"	           ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
43390 		"Type mismatch: cannot convert from X<Class> to String\n" +
43391 		"----------\n");
43392 }
43393 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=214972 - variation
43394 public void test1230() {
43395 	this.runConformTest(
43396 		new String[] {
43397 			"X.java",
43398 			"public class X<U extends Class> {\n" +
43399 			"	public <Y> X(Y b1, U b2) {\n" +
43400 			"	}\n" +
43401 			"	public class Binner {\n" +
43402 			"		public class BinnerInner<I> {\n" +
43403 			"			public <J> BinnerInner<J> $new$() {\n" +
43404 			"				return new BinnerInner<J>();\n" +
43405 			"			}\n" +
43406 			"			X<U> root() {\n" +
43407 			"				return X.this;\n" +
43408 			"			}\n" +
43409 			"		}\n" +
43410 			"	}\n" +
43411 			"}\n",
43412 		},
43413 		"");
43414 	this.runNegativeTest(
43415 			new String[] {
43416 				"Z.java",
43417 				"public class Z {\n" +
43418 				"	public static void main(String[] args) {\n" +
43419 				"		X<Class>.Binner.BinnerInner<String> binString = new X<Class>(null, null).new Binner().new BinnerInner<String>();\n" +
43420 				"		String s = binString.$new$().root();\n" +
43421 				"	}\n" +
43422 				"}\n"
43423 			},
43424 			"----------\n" +
43425 			"1. WARNING in Z.java (at line 3)\n" +
43426 			"	X<Class>.Binner.BinnerInner<String> binString = new X<Class>(null, null).new Binner().new BinnerInner<String>();\n" +
43427 			"	  ^^^^^\n" +
43428 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
43429 			"----------\n" +
43430 			"2. WARNING in Z.java (at line 3)\n" +
43431 			"	X<Class>.Binner.BinnerInner<String> binString = new X<Class>(null, null).new Binner().new BinnerInner<String>();\n" +
43432 			"	                                                      ^^^^^\n" +
43433 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
43434 			"----------\n" +
43435 			"3. ERROR in Z.java (at line 4)\n" +
43436 			"	String s = binString.$new$().root();\n" +
43437 			"	           ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
43438 			"Type mismatch: cannot convert from X<Class> to String\n" +
43439 			"----------\n",
43440 			null,
43441 			false,
43442 			null);
43443 }
43444 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=214972 - variation
43445 public void test1231() {
43446 	this.runConformTest(
43447 		new String[] {
43448 			"X.java",
43449 			"public class X<U extends Class> {\n" +
43450 			"	public <Y> X(Y b1, U b2) {\n" +
43451 			"	}\n" +
43452 			"	public class Binner {\n" +
43453 			"		public class BinnerInner<I> {\n" +
43454 			"			public <J> BinnerInner<J> $new$() {\n" +
43455 			"				return new BinnerInner<J>();\n" +
43456 			"			}\n" +
43457 			"			X<U> root() {\n" +
43458 			"				return X.this;\n" +
43459 			"			}\n" +
43460 			"		}\n" +
43461 			"	}\n" +
43462 			"}\n",
43463 		},
43464 		"");
43465 	this.runConformTest(
43466 			new String[] {
43467 				"Z.java",
43468 				"public class Z {\n" +
43469 				"	public static void main(String[] args) {\n" +
43470 				"		X<Class>.Binner.BinnerInner<String> binString = new X<Class>(null, null).new Binner().new BinnerInner<String>();\n" +
43471 				"		X<Class>.Binner.BinnerInner<Number> binNumber = binString.$new$();\n" +
43472 				"	}\n" +
43473 				"}\n"
43474 			},
43475 			"",
43476 			null,
43477 			false,
43478 			null);
43479 }
43480 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=215843
43481 public void test1232() {
43482 	this.runConformTest(
43483 		new String[] {
43484 			"X.java",
43485 			"public class X {\n" +
43486 			"	public static void testCovariant(SubInterface sub1, SubInterface sub2) {\n" +
43487 			"		SubInterface sub3 = sub1.and(sub2);\n" +
43488 			"	}\n" +
43489 			"	public interface SuperInterface<E> {\n" +
43490 			"		public Number getNumber();\n" +
43491 			"		public SuperInterface<E> and(SuperInterface<E> a);\n" +
43492 			"	}\n" +
43493 			"	public interface SubInterface extends SuperInterface {\n" +
43494 			"		public Integer getNumber();\n" +
43495 			"		public SubInterface and(SuperInterface s);\n" +
43496 			"	}\n" +
43497 			"}\n",
43498 		},
43499 		"");
43500 
43501 }
43502 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=215843 - variation
43503 public void test1233() {
43504 	this.runConformTest(
43505 		new String[] {
43506 			"X.java",
43507 			"public class X {\n" +
43508 			"	public static void testCovariant(SubInterface<String> sub1, SubInterface<String> sub2) {\n" +
43509 			"		SubInterface<String> sub3 = sub1.and(sub2);\n" +
43510 			"	}\n" +
43511 			"	public interface SuperInterface<E> {\n" +
43512 			"		public Number getNumber();\n" +
43513 			"		public SuperInterface<E> and(SuperInterface<E> a);\n" +
43514 			"	}\n" +
43515 			"	public interface SubInterface<F> extends SuperInterface<F> {\n" +
43516 			"		public Integer getNumber();\n" +
43517 			"		public SubInterface<F> and(SuperInterface<F> s);\n" +
43518 			"	}\n" +
43519 			"}\n",
43520 		},
43521 		"");
43522 }
43523 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=215843 - variation
43524 public void test1234() {
43525 	this.runNegativeTest(
43526 		false /* skipJavac */,
43527 		JavacTestOptions.EclipseHasABug.EclipseBug427719,
43528 		new String[] {
43529 			"X.java",
43530 			"public class X { \n" +
43531 			"	void a3(G x) {} \n" +
43532 			"	<T extends F<X>> void a3(T x) {}\n" +
43533 			"\n" +
43534 			"	public static void ambiguousCases() { \n" +
43535 			"		H<X> hx = null;\n" +
43536 			"		H hraw = null;\n" +
43537 			"		new X().a3(hx);\n" +
43538 			"		new X().a3(hraw);\n" +
43539 			"	} \n" +
43540 			"}\n" +
43541 			"class F<T1> {}  \n" +
43542 			"class G<T2> extends F<T2> {}\n" +
43543 			"class H<T3> extends G<T3> {}\n",
43544 		},
43545 		"----------\n" +
43546 		"1. WARNING in X.java (at line 2)\n" +
43547 		"	void a3(G x) {} \n" +
43548 		"	        ^\n" +
43549 		"G is a raw type. References to generic type G<T2> should be parameterized\n" +
43550 		"----------\n" +
43551 		"2. WARNING in X.java (at line 7)\n" +
43552 		"	H hraw = null;\n" +
43553 		"	^\n" +
43554 		"H is a raw type. References to generic type H<T3> should be parameterized\n" +
43555 		"----------\n" +
43556 		(this.complianceLevel < ClassFileConstants.JDK1_8 ?
43557 		"3. ERROR in X.java (at line 8)\n" +
43558 		"	new X().a3(hx);\n" +
43559 		"	        ^^\n" +
43560 		"The method a3(G) is ambiguous for the type X\n" +
43561 		"----------\n" +
43562 		"4. ERROR in X.java (at line 9)\n" +
43563 		"	new X().a3(hraw);\n" +
43564 		"	        ^^\n" +
43565 		"The method a3(G) is ambiguous for the type X\n" +
43566 		"----------\n"
43567 		: // not ambiguous in 1.8
43568 		""));
43569 }
43570 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=215843 - variation
43571 public void test1235() {
43572 	this.runConformTest(
43573 		new String[] {
43574 			"X.java",
43575 			"public class X { \n" +
43576 			"	<T extends G<X>> void a3(T x) {}\n" +
43577 			"	<T extends F<X>> void a3(T x) {}\n" +
43578 			"\n" +
43579 			"	public static void ambiguousCases() { \n" +
43580 			"		H<X> hx = null;\n" +
43581 			"		H hraw = null;\n" +
43582 			"		new X().a3(hx);\n" +
43583 			"		new X().a3(hraw);\n" +
43584 			"	} \n" +
43585 			"}\n" +
43586 			"class F<T1> {}  \n" +
43587 			"class G<T2> extends F<T2> {}\n" +
43588 			"class H<T3> extends G<T3> {}\n",
43589 		},
43590 		"");
43591 }
43592 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=215843 - variation
43593 public void test1236() {
43594 	this.runConformTest(
43595 		new String[] {
43596 			"X.java",
43597 			"public class X {\n" +
43598 			"	public static void testCovariant(SubInterface sub1, SubInterface sub2) {\n" +
43599 			"		SubInterface sub3 = sub1.and(sub2);\n" +
43600 			"	}\n" +
43601 			"	public interface SuperInterface<E> {\n" +
43602 			"		public Number getNumber();\n" +
43603 			"		public SuperInterface<E> and(SuperInterface<E> a);\n" +
43604 			"	}\n" +
43605 			"	public interface SubInterface extends SuperInterface, OtherSubInterface {\n" +
43606 			"		public Integer getNumber();\n" +
43607 			"		public SubInterface and(SuperInterface s);\n" +
43608 			"	}\n" +
43609 			"	public interface OtherSubInterface<U> extends SuperInterface<U> {\n" +
43610 			"		public OtherSubInterface<U> and(SuperInterface<U> a);\n" +
43611 			"	}\n" +
43612 			"}\n",
43613 		},
43614 		"");
43615 }
43616 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=215843 - variation
43617 public void test1237() {
43618 	this.runNegativeTest(
43619 		new String[] {
43620 			"X.java",
43621 			"public class X {\n" +
43622 			"	public static void testCovariant(SubInterface sub1, SubInterface sub2) {\n" +
43623 			"		SubInterface sub3 = sub1.and(sub2);\n" +
43624 			"	}\n" +
43625 			"	public interface SuperInterface<E> {\n" +
43626 			"		public Number getNumber();\n" +
43627 			"		public SuperInterface<E> and(SuperInterface<E> a);\n" +
43628 			"	}\n" +
43629 			"	public interface SubInterface extends SuperInterface, OtherSubInterface {\n" +
43630 			"	}\n" +
43631 			"	public interface OtherSubInterface<U> extends SuperInterface<U> {\n" +
43632 			"		public OtherSubInterface<U> and(SuperInterface<U> a);\n" +
43633 			"	}\n" +
43634 			"}\n",
43635 		},
43636 		"----------\n" +
43637 		"1. WARNING in X.java (at line 3)\n" +
43638 		"	SubInterface sub3 = sub1.and(sub2);\n" +
43639 		"	                    ^^^^^^^^^^^^^^\n" +
43640 		"Type safety: The method and(X.SuperInterface) belongs to the raw type X.OtherSubInterface. References to generic type X.OtherSubInterface<U> should be parameterized\n" +
43641 		"----------\n" +
43642 		"2. ERROR in X.java (at line 3)\n" +
43643 		"	SubInterface sub3 = sub1.and(sub2);\n" +
43644 		"	                    ^^^^^^^^^^^^^^\n" +
43645 		"Type mismatch: cannot convert from X.OtherSubInterface to X.SubInterface\n" +
43646 		"----------\n" +
43647 		"3. WARNING in X.java (at line 9)\n" +
43648 		"	public interface SubInterface extends SuperInterface, OtherSubInterface {\n" +
43649 		"	                                      ^^^^^^^^^^^^^^\n" +
43650 		"X.SuperInterface is a raw type. References to generic type X.SuperInterface<E> should be parameterized\n" +
43651 		"----------\n" +
43652 		"4. WARNING in X.java (at line 9)\n" +
43653 		"	public interface SubInterface extends SuperInterface, OtherSubInterface {\n" +
43654 		"	                                                      ^^^^^^^^^^^^^^^^^\n" +
43655 		"X.OtherSubInterface is a raw type. References to generic type X.OtherSubInterface<U> should be parameterized\n" +
43656 		"----------\n");
43657 }
43658 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=215843 - variation
43659 public void test1238() {
43660 	this.runNegativeTest(
43661 		new String[] {
43662 			"X.java",
43663 			"public class X {\n" +
43664 			"	public static void testCovariant(SubInterface sub1, SubInterface sub2) {\n" +
43665 			"		SubInterface sub3 = sub1.and(sub2);\n" +
43666 			"	}\n" +
43667 			"	public interface SuperInterface<E> {\n" +
43668 			"		public Number getNumber();\n" +
43669 			"		public SuperInterface<E> and(SuperInterface<E> a);\n" +
43670 			"	}\n" +
43671 			"	public interface SubInterface extends SuperInterface, OtherSubInterface {\n" +
43672 			"	}\n" +
43673 			"	public interface OtherSubInterface extends SuperInterface {\n" +
43674 			"		public OtherSubInterface and(SuperInterface a);\n" +
43675 			"	}\n" +
43676 			"}\n",
43677 		},
43678 		"----------\n" +
43679 		"1. ERROR in X.java (at line 3)\n" +
43680 		"	SubInterface sub3 = sub1.and(sub2);\n" +
43681 		"	                    ^^^^^^^^^^^^^^\n" +
43682 		"Type mismatch: cannot convert from X.OtherSubInterface to X.SubInterface\n" +
43683 		"----------\n" +
43684 		"2. WARNING in X.java (at line 9)\n" +
43685 		"	public interface SubInterface extends SuperInterface, OtherSubInterface {\n" +
43686 		"	                                      ^^^^^^^^^^^^^^\n" +
43687 		"X.SuperInterface is a raw type. References to generic type X.SuperInterface<E> should be parameterized\n" +
43688 		"----------\n" +
43689 		"3. WARNING in X.java (at line 11)\n" +
43690 		"	public interface OtherSubInterface extends SuperInterface {\n" +
43691 		"	                                           ^^^^^^^^^^^^^^\n" +
43692 		"X.SuperInterface is a raw type. References to generic type X.SuperInterface<E> should be parameterized\n" +
43693 		"----------\n" +
43694 		"4. WARNING in X.java (at line 12)\n" +
43695 		"	public OtherSubInterface and(SuperInterface a);\n" +
43696 		"	                             ^^^^^^^^^^^^^^\n" +
43697 		"X.SuperInterface is a raw type. References to generic type X.SuperInterface<E> should be parameterized\n" +
43698 		"----------\n");
43699 }
43700 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=215843 - variation
43701 public void test1239() {
43702 	this.runNegativeTest(
43703 		new String[] {
43704 			"X.java",
43705 			"public class X {\n" +
43706 			"	public static void testCovariant(CombinedSubInterface sub1, SubInterface sub2) {\n" +
43707 			"		SubInterface sub3 = sub1.and(sub2);\n" +
43708 			"	}\n" +
43709 			"	public interface SuperInterface<E> {\n" +
43710 			"		public Number getNumber();\n" +
43711 			"		public SuperInterface<E> and(SuperInterface<E> a);\n" +
43712 			"	}\n" +
43713 			"	public interface SubInterface extends SuperInterface {\n" +
43714 			"		public Integer getNumber();\n" +
43715 			"		public SubInterface and(SuperInterface s);\n" +
43716 			"	}\n" +
43717 			"	public interface CombinedSubInterface extends SubInterface, OtherSubInterface {}\n" +
43718 			"	\n" +
43719 			"	public interface OtherSubInterface extends SuperInterface {\n" +
43720 			"		public OtherSubInterface and(SuperInterface a);\n" +
43721 			"	}\n" +
43722 			"}\n",
43723 		},
43724 		"----------\n" +
43725 		"1. ERROR in X.java (at line 3)\n" +
43726 		"	SubInterface sub3 = sub1.and(sub2);\n" +
43727 		"	                         ^^^\n" +
43728 		"The method and(X.SuperInterface) is ambiguous for the type X.CombinedSubInterface\n" +
43729 		"----------\n" +
43730 		"2. WARNING in X.java (at line 9)\n" +
43731 		"	public interface SubInterface extends SuperInterface {\n" +
43732 		"	                                      ^^^^^^^^^^^^^^\n" +
43733 		"X.SuperInterface is a raw type. References to generic type X.SuperInterface<E> should be parameterized\n" +
43734 		"----------\n" +
43735 		"3. WARNING in X.java (at line 11)\n" +
43736 		"	public SubInterface and(SuperInterface s);\n" +
43737 		"	                        ^^^^^^^^^^^^^^\n" +
43738 		"X.SuperInterface is a raw type. References to generic type X.SuperInterface<E> should be parameterized\n" +
43739 		"----------\n" +
43740 		"4. ERROR in X.java (at line 13)\n" +
43741 		"	public interface CombinedSubInterface extends SubInterface, OtherSubInterface {}\n" +
43742 		"	                 ^^^^^^^^^^^^^^^^^^^^\n" +
43743 		"The return types are incompatible for the inherited methods X.SubInterface.and(X.SuperInterface), X.OtherSubInterface.and(X.SuperInterface)\n" +
43744 		"----------\n" +
43745 		"5. WARNING in X.java (at line 15)\n" +
43746 		"	public interface OtherSubInterface extends SuperInterface {\n" +
43747 		"	                                           ^^^^^^^^^^^^^^\n" +
43748 		"X.SuperInterface is a raw type. References to generic type X.SuperInterface<E> should be parameterized\n" +
43749 		"----------\n" +
43750 		"6. WARNING in X.java (at line 16)\n" +
43751 		"	public OtherSubInterface and(SuperInterface a);\n" +
43752 		"	                             ^^^^^^^^^^^^^^\n" +
43753 		"X.SuperInterface is a raw type. References to generic type X.SuperInterface<E> should be parameterized\n" +
43754 		"----------\n");
43755 }
43756 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=215843 - variation
43757 public void test1240() {
43758 	this.runConformTest(
43759 		new String[] {
43760 			"X.java",
43761 			"public class X {\n" +
43762 			"	public static void testCovariant(CombinedSubInterface sub1, SubInterface sub2) {\n" +
43763 			"		SubInterface sub3 = sub1.and(sub2);\n" +
43764 			"	}\n" +
43765 			"	public interface SuperInterface<E> {\n" +
43766 			"		public Number getNumber();\n" +
43767 			"		public SuperInterface<E> and(SuperInterface<E> a);\n" +
43768 			"	}\n" +
43769 			"	public interface SubInterface extends SuperInterface {\n" +
43770 			"		public Integer getNumber();\n" +
43771 			"		public SubInterface and(SuperInterface s);\n" +
43772 			"	}\n" +
43773 			"	public interface OtherSubInterface extends SubInterface {\n" +
43774 			"		public OtherSubInterface and(SuperInterface a);\n" +
43775 			"	}\n" +
43776 			"	public interface CombinedSubInterface extends OtherSubInterface {}\n" +
43777 			"}\n",
43778 		},
43779 		"");
43780 }
43781 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=215843 - variation
43782 public void test1241() {
43783 	this.runConformTest(
43784 		new String[] {
43785 			"X.java",
43786 			"public class X {\n" +
43787 			"	public static void testCovariant(CombinedSubInterface sub1, SubInterface sub2) {\n" +
43788 			"		CombinedSubInterface sub3 = sub1.and(sub2);\n" +
43789 			"	}\n" +
43790 			"	public interface SuperInterface<E> {\n" +
43791 			"		public SuperInterface<E> and(SuperInterface<E> a);\n" +
43792 			"	}\n" +
43793 			"	public interface SubInterface extends SuperInterface {\n" +
43794 			"	}\n" +
43795 			"	public interface OtherSubInterface extends SuperInterface {\n" +
43796 			"		public CombinedSubInterface and(SuperInterface a);\n" +
43797 			"	}\n" +
43798 			"	public interface CombinedSubInterface extends SubInterface, OtherSubInterface {}\n" +
43799 			"}\n",
43800 		},
43801 		"");
43802 }
43803 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=164665
43804 public void test1242() {
43805 	runConformTest(
43806 		// test directory preparation
43807 		new String[] { /* test files */
43808 			"X.java",
43809 			"import java.util.LinkedList;\n" +
43810 			"import java.util.List;\n" +
43811 			"\n" +
43812 			"public class X {\n" +
43813 			"	public void testCase() {\n" +
43814 			"		TypedCollection<SuperTypeAbstractClass> collection = TypedCollectionFactory.createTypedCollection(SubTypeClass.class);\n" +
43815 			"		collection.add(new SubTypeClass());\n" +
43816 			"		List<SuperTypeAbstractClass> list = collection.list();\n" +
43817 			"		assert (list.size() > 0);\n" +
43818 			"	}\n" +
43819 			"}\n" +
43820 			"\n" +
43821 			"abstract class SuperTypeAbstractClass {\n" +
43822 			"}\n" +
43823 			"\n" +
43824 			"class SubTypeClass extends SuperTypeAbstractClass {\n" +
43825 			"}\n" +
43826 			"\n" +
43827 			"interface TypedCollection<T> {\n" +
43828 			"	TypedCollection<T> add(T object);\n" +
43829 			"	List<T> list();\n" +
43830 			"}\n" +
43831 			"\n" +
43832 			"class TypedCollectionFactory {\n" +
43833 			"	public static <T, U extends T> TypedCollection<T> createTypedCollection(Class<U> c) {\n" +
43834 			"		return new TypedCollectionImpl<T>();\n" +
43835 			"	}\n" +
43836 			"}\n" +
43837 			"\n" +
43838 			"class TypedCollectionImpl<T> implements TypedCollection<T> {\n" +
43839 			"	private List<T> list = new LinkedList<T>();\n" +
43840 			"	public TypedCollection<T> add(T object) {\n" +
43841 			"		list.add(object);\n" +
43842 			"		return (this);\n" +
43843 			"	}\n" +
43844 			"	public List<T> list() {\n" +
43845 			"		return list;\n" +
43846 			"	}\n" +
43847 			"}\n", // =================
43848 		},
43849 		// javac options
43850 		JavacTestOptions.JavacHasABug.JavacBugFixed_7 /* javac test options */);
43851 }
43852 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216100
43853 public void test1243() {
43854 	this.runConformTest(
43855 		new String[] {
43856 			"eclipse/modifier/impl/EclipseModifierBug.java",
43857 			"package eclipse.modifier.impl;\n" +
43858 			"import eclipse.modifier.Pool;\n" +
43859 			"public class EclipseModifierBug {\n" +
43860 			"  static class MyEntry extends Pool.AbstractEntry<MyEntry> { }  \n" +
43861 			"  static final Pool<MyEntry> pool=new Pool<MyEntry>() {\n" +
43862 			"    @Override\n" +
43863 			"    protected MyEntry delegate() {\n" +
43864 			"      return new MyEntry();\n" +
43865 			"    }  \n" +
43866 			"  };\n" +
43867 			"  public static void main(String[] args) {\n" +
43868 			"    MyEntry entry=pool.m();  \n" +
43869 			"  }\n" +
43870 			"}", // =================
43871 			"eclipse/modifier/Pool.java",
43872 			"package eclipse.modifier;\n" +
43873 			"public abstract class Pool<E extends Pool.Entry<E>> {\n" +
43874 			"    static abstract class Entry<E extends Entry<E>> {\n" +
43875 			"        E next;\n" +
43876 			"    }\n" +
43877 			"    static public class AbstractEntry<E extends AbstractEntry<E>> extends Entry<E> {\n" +
43878 			"    }\n" +
43879 			"    public E m() {\n" +
43880 			"      return delegate();\n" +
43881 			"    }\n" +
43882 			"    protected abstract E delegate();\n" +
43883 			"  }\n" +
43884 			"\n", // =================
43885 		},
43886 		"");
43887 }
43888 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216100 - variation
43889 public void test1244() {
43890 	runNegativeTest(
43891 		new String[] { /* test files */
43892 			"X.java",
43893 			"public class X {\n" +
43894 			"  static class MyEntry extends Pool.AbstractEntry<MyEntry> { }  \n" +
43895 			"  static final Pool<MyEntry> pool=new Pool<MyEntry>() {\n" +
43896 			"    @Override\n" +
43897 			"    protected MyEntry delegate() {\n" +
43898 			"      return new MyEntry();\n" +
43899 			"    }  \n" +
43900 			"  };\n" +
43901 			"  public static void main(String[] args) {\n" +
43902 			"    MyEntry entry=pool.m();\n" +
43903 			"  }\n" +
43904 			"}\n" +
43905 			"\n" +
43906 			"abstract class Pool<E extends Pool.Entry<E>> {\n" +
43907 			"    private static abstract class Entry<E extends Entry<E>> {\n" +
43908 			"        E next;\n" +
43909 			"    }\n" +
43910 			"    static public class AbstractEntry<E extends AbstractEntry<E>> extends Entry<E> {\n" +
43911 			"    }\n" +
43912 			"    public E m() {\n" +
43913 			"        System.out.println(\"SUCCESS\");\n" +
43914 			"      return delegate();\n" +
43915 			"    }\n" +
43916 			"    protected abstract E delegate();\n" +
43917 			"}\n", // =================
43918 		},
43919 		"----------\n" +
43920 		"1. ERROR in X.java (at line 14)\n" +
43921 		"	abstract class Pool<E extends Pool.Entry<E>> {\n" +
43922 		"	                              ^^^^^^^^^^\n" +
43923 		"The type Pool.Entry is not visible\n" +
43924 		"----------\n");
43925 }
43926 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216100 - variation
43927 public void test1245() {
43928 	this.runNegativeTest(
43929 		new String[] {
43930 				"X.java",
43931 				"public class X<T extends Secondary.Private> {\n" +
43932 				"}\n" +
43933 				"class Secondary {\n" +
43934 				"	static private class Private {}\n" +
43935 				"}\n", // =================
43936 		},
43937 		"----------\n" +
43938 		"1. ERROR in X.java (at line 1)\n" +
43939 		"	public class X<T extends Secondary.Private> {\n" +
43940 		"	                         ^^^^^^^^^^^^^^^^^\n" +
43941 		"The type Secondary.Private is not visible\n" +
43942 		"----------\n");
43943 }
43944 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216100 - variation
43945 public void test1246() {
43946 	runNegativeTest(
43947 		new String[] { /* test files */
43948 			"X.java",
43949 			"public class X<T extends X.Private> {\n" +
43950 			"	static private class Private {}\n" +
43951 			"	<U extends X.Private> void foo(U u) {}\n" +
43952 			"}\n", // =================
43953 		},
43954 		"----------\n" +
43955 		"1. ERROR in X.java (at line 1)\n" +
43956 		"	public class X<T extends X.Private> {\n" +
43957 		"	                         ^^^^^^^^^\n" +
43958 		"The type X.Private is not visible\n" +
43959 		"----------\n");
43960 }
43961 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216558
43962 public void test1247() {
43963 	String xSource =
43964 				"public class X {\n" +
43965 				"\n" +
43966 				"	public static void test() {\n" +
43967 				"		Foo<?, ?> foo = null;\n" +
43968 				"		eval(foo); // fails\n" +
43969 				"		X.<Foo<?, ?>> eval(foo);\n" +
43970 				"	}\n" +
43971 				"\n" +
43972 				"	public static <T extends Iterable<T>> void eval(T x) {\n" +
43973 				"	}\n" +
43974 				"	public static interface Foo<S, T> extends Iterable<Foo<?, ?>> {\n" +
43975 				"	}\n" +
43976 				"}";
43977 	if (this.complianceLevel < ClassFileConstants.JDK1_8) {
43978 		this.runNegativeTest(
43979 			new String[] {
43980 				"X.java",
43981 				xSource,
43982 			},
43983 			"----------\n" +
43984 			"1. ERROR in X.java (at line 5)\n" +
43985 			"	eval(foo); // fails\n" +
43986 			"	^^^^\n" +
43987 			"Bound mismatch: The generic method eval(T) of type X is not applicable for the arguments (X.Foo<capture#1-of ?,capture#2-of ?>). The inferred type X.Foo<capture#1-of ?,capture#2-of ?> is not a valid substitute for the bounded parameter <T extends Iterable<T>>\n" +
43988 			"----------\n");
43989 	} else {
43990 		runConformTest(new String[] { "X.java", xSource });
43991 	}
43992 }
43993 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216558 - variation
43994 public void test1248() {
43995 	runConformTest(
43996  		// test directory preparation
43997 		new String[] { /* test files */
43998 			"X.java",
43999 			"public class X {\n" +
44000 			"\n" +
44001 			"	public static void test() {\n" +
44002 			"		Foo<?, ?> foo = null;\n" +
44003 			"		eval(foo); // fails\n" +
44004 			"		X.<Foo<?, ?>> eval(foo);\n" +
44005 			"	}\n" +
44006 			"\n" +
44007 			"	public static <T extends Iterable<T>> void eval(T x) {\n" +
44008 			"	}\n" +
44009 			"	public static interface Foo<S, T> extends Iterable<Foo<S,T>> {\n" +
44010 			"	}\n" +
44011 			"}", // =================
44012 		},
44013 		// javac options
44014 		JavacTestOptions.EclipseHasABug.EclipseBug216558 /* javac test options */);
44015 }
44016 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216558 - variation
44017 public void test1249() {
44018 	this.runConformTest(
44019 		new String[] {
44020 				"X.java",
44021 				"public class X {\n" +
44022 				"	public static void test() {\n" +
44023 				"		Foo<?, ?> foo = null;\n" +
44024 				"		eval(foo, foo);\n" +
44025 				"		X.<Foo<?, ?>> eval(foo, foo);\n" +
44026 				"	}\n" +
44027 				"	public static <T extends Iterable<T>> void eval(T t1, T t2) {\n" +
44028 				"	}\n" +
44029 				"	public static interface Foo<S, T> extends Iterable<Foo<?, ?>> {\n" +
44030 				"	}\n" +
44031 				"}", // =================
44032 		},
44033 		"");
44034 }
44035 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216565
44036 public void test1250() {
44037 	this.runConformTest(
44038 		new String[] {
44039 				"X.java",
44040 				"import java.util.List;\n" +
44041 				"public class X {\n" +
44042 				"    static <T> List<T> asList(T[] x) { return null; }\n" +
44043 				"    static interface Foo<T> {\n" +
44044 				"        static interface Sub<T> extends Foo<T> {\n" +
44045 				"            static List<Sub<?>> LIST = asList(ARRAY); \n" +
44046 				"       }\n" +
44047 				"        static Sub<?>[] ARRAY = new Sub[] { };\n" +
44048 				"    }\n" +
44049 				"}", // =================
44050 		},
44051 		"");
44052 }
44053 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216565 - variation
44054 public void test1251() {
44055 	this.runConformTest(
44056 		new String[] {
44057 				"X.java",
44058 				"public class X {\n" +
44059 				"    static <T> T asList(T[] x) { return null; }\n" +
44060 				"    static interface Foo<T> {\n" +
44061 				"        static interface Sub<T> extends Foo<T> {\n" +
44062 				"            static Sub<?> LIST = asList(ARRAY); \n" +
44063 				"       }\n" +
44064 				"        static Sub<?>[] ARRAY = new Sub[] { };\n" +
44065 				"    }\n" +
44066 				"}\n", // =================
44067 		},
44068 		"");
44069 }
44070 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216608
44071 public void test1252() {
44072 	this.runNegativeTest(
44073 		new String[] {
44074 				"X.java",
44075 				"public class X {\n" +
44076 				"	Zork z;\n" +
44077 				"	@SuppressWarnings({\"unchecked\", \"rawtypes\"})\n" +
44078 				"	public B getB() {\n" +
44079 				"		return new B<Object>();\n" +
44080 				"	}\n" +
44081 				"\n" +
44082 				"	@SuppressWarnings(\"unused\")\n" +
44083 				"	public void test() {\n" +
44084 				"		C<String> c = getB().getC();\n" +
44085 				"		String s = getB().toString();\n" +
44086 				"	}\n" +
44087 				"}\n" +
44088 				"class B<S> {\n" +
44089 				"	public C<String> getC() {\n" +
44090 				"		return new C<String>();\n" +
44091 				"	}\n" +
44092 				"}\n" +
44093 				"class C<T> {\n" +
44094 				"}\n", // =================
44095 		},
44096 		"----------\n" +
44097 		"1. ERROR in X.java (at line 2)\n" +
44098 		"	Zork z;\n" +
44099 		"	^^^^\n" +
44100 		"Zork cannot be resolved to a type\n" +
44101 		"----------\n" +
44102 		"2. WARNING in X.java (at line 10)\n" +
44103 		"	C<String> c = getB().getC();\n" +
44104 		"	              ^^^^^^^^^^^^^\n" +
44105 		"Type safety: The expression of type C needs unchecked conversion to conform to C<String>\n" +
44106 		"----------\n");
44107 }
44108 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216608 - variation
44109 public void test1253() {
44110 	this.runNegativeTest(
44111 		new String[] {
44112 				"X.java",
44113 				"public class X {\n" +
44114 				"	Zork z;\n" +
44115 				"	@SuppressWarnings(\"unchecked\")\n" +
44116 				"	public B<?> getB() {\n" +
44117 				"		return new B<Object>();\n" +
44118 				"	}\n" +
44119 				"\n" +
44120 				"	@SuppressWarnings(\"unused\")\n" +
44121 				"	public void test() {\n" +
44122 				"		C<String> c = getB().getC();\n" +
44123 				"		String s = getB().toString();\n" +
44124 				"	}\n" +
44125 				"}\n" +
44126 				"class B<S> {\n" +
44127 				"	public C<String> getC() {\n" +
44128 				"		return new C<String>();\n" +
44129 				"	}\n" +
44130 				"}\n" +
44131 				"class C<T> {\n" +
44132 				"}\n", // =================
44133 		},
44134 		"----------\n" +
44135 		"1. ERROR in X.java (at line 2)\n" +
44136 		"	Zork z;\n" +
44137 		"	^^^^\n" +
44138 		"Zork cannot be resolved to a type\n" +
44139 		"----------\n");
44140 }
44141 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216565 - variation
44142 public void test1254() {
44143 	this.runConformTest(
44144 		new String[] {
44145 				"X.java",
44146 				" import java.util.List;\n" +
44147 				"\n" +
44148 				"public class X {\n" +
44149 				"    static <T> XList<T> asList(T[] x) { return null; }\n" +
44150 				"    static interface Foo<T> {\n" +
44151 				"        static interface Sub<T> extends Foo<T> {\n" +
44152 				"            static XList<Sub<String>> LIST = asList(ARRAY); \n" +
44153 				"       }\n" +
44154 				"        static Sub<String>[] ARRAY = new Sub[] { };\n" +
44155 				"    }\n" +
44156 				"}\n" +
44157 				"\n" +
44158 				"class XList<T> {\n" +
44159 				"}\n", // =================
44160 		},
44161 		"");
44162 }
44163 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216565 - variation
44164 public void test1255() {
44165 	String xSource =
44166 				" import java.util.List;\n" +
44167 				"\n" +
44168 				"public class X {\n" +
44169 				"    static <T> XList<T> asList(T x) { return null; }\n" +
44170 				"    static interface Foo<T> {\n" +
44171 				"        static interface Sub<T> extends Foo<T> {\n" +
44172 				"            static XList<Sub<?>> LIST = asList(ARRAY); \n" +
44173 				"       }\n" +
44174 				"        @SuppressWarnings(\"rawtypes\")\n" +
44175 				"        static Sub<?> ARRAY = new Sub() { };\n" +
44176 				"    }\n" +
44177 				"}\n" +
44178 				"\n" +
44179 				"class XList<T> {\n" +
44180 				"}\n";
44181 	if (this.complianceLevel < ClassFileConstants.JDK1_8) {
44182 		this.runNegativeTest(
44183 			new String[] {
44184 				"X.java",
44185 				xSource,
44186 			},
44187 			"----------\n" +
44188 			"1. ERROR in X.java (at line 7)\n" +
44189 			"	static XList<Sub<?>> LIST = asList(ARRAY); \n" +
44190 			"	                            ^^^^^^^^^^^^^\n" +
44191 			"Type mismatch: cannot convert from XList<X.Foo.Sub<capture#1-of ?>> to XList<X.Foo.Sub<?>>\n" +
44192 			"----------\n");
44193 	} else {
44194 		runConformTest(new String[]{ "X.java", xSource });
44195 	}
44196 }
44197 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216565 - variation
44198 public void test1256() {
44199 	this.runConformTest(
44200 		new String[] {
44201 				"X.java",
44202 				"public class X {\n" +
44203 				"    static <T> XList<T> asList(T[] x) { return null; }\n" +
44204 				"    static interface Foo<T> {\n" +
44205 				"        static interface Sub<T> extends Foo<T> {\n" +
44206 				"            static XList<Sub<? extends Object>> LIST = asList(ARRAY); \n" +
44207 				"       }\n" +
44208 				"        static Sub<?>[] ARRAY = new Sub[] { };\n" +
44209 				"    }\n" +
44210 				"}\n" +
44211 				"\n" +
44212 				"class XList<T> {\n" +
44213 				"}\n", // =================
44214 		},
44215 		"");
44216 }
44217 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216565 - variation
44218 public void test1257() {
44219 	this.runNegativeTest(
44220 		new String[] {
44221 				"X.java",
44222 				"public class X {\n" +
44223 				"    static <T> XList<T> asList(T[] x) { return null; }\n" +
44224 				"    static interface Foo<T> {\n" +
44225 				"        static interface Sub<T> extends Foo<T> {\n" +
44226 				"            static XList<Sub<? extends Object>> LIST = asList(ARRAY); \n" +
44227 				"       }\n" +
44228 				"        static Sub<? extends Object>[] ARRAY = new Sub[] { };\n" +
44229 				"    }\n" +
44230 				"}\n" +
44231 				"\n" +
44232 				"class XList<T> {\n" +
44233 				"	Zork z;\n" +
44234 				"}\n", // =================
44235 		},
44236 		"----------\n" +
44237 		"1. WARNING in X.java (at line 7)\n" +
44238 		"	static Sub<? extends Object>[] ARRAY = new Sub[] { };\n" +
44239 		"	                                       ^^^^^^^^^^^^^\n" +
44240 		"Type safety: The expression of type X.Foo.Sub[] needs unchecked conversion to conform to X.Foo.Sub<? extends Object>[]\n" +
44241 		"----------\n" +
44242 		"2. ERROR in X.java (at line 12)\n" +
44243 		"	Zork z;\n" +
44244 		"	^^^^\n" +
44245 		"Zork cannot be resolved to a type\n" +
44246 		"----------\n");
44247 }
44248 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216565 - variation
44249 public void test1258() {
44250 	this.runConformTest(
44251 		new String[] {
44252 				"X.java",
44253 				"public class X {\n" +
44254 				"    static <T> XList<T> asList(T[] x) { return null; }\n" +
44255 				"    static interface Foo<T> {\n" +
44256 				"        static interface Sub<T> extends Foo<T> {\n" +
44257 				"            static XList<Sub<? extends Number>> LIST = asList(ARRAY); \n" +
44258 				"       }\n" +
44259 				"        static Sub<? extends Number>[] ARRAY = new Sub[] { };\n" +
44260 				"    }\n" +
44261 				"}\n" +
44262 				"\n" +
44263 				"class XList<T> {\n" +
44264 				"}\n", // =================
44265 		},
44266 		"");
44267 }
44268 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216565 - variation
44269 public void test1259() {
44270 	String xSource =
44271 				"public class X {\n" +
44272 				"    static <T> XList<T> asList(T[] x) { return null; }\n" +
44273 				"    static interface Foo<T> {\n" +
44274 				"        static interface Sub<T> extends Foo<T> {\n" +
44275 				"            static XList<Sub<? extends Number>> LIST = asList(ARRAY); \n" +
44276 				"       }\n" +
44277 				"        @SuppressWarnings(\"rawtypes\")\n" +
44278 				"        static Sub<? extends Integer>[] ARRAY = new Sub[] { };\n" +
44279 				"    }\n" +
44280 				"}\n" +
44281 				"\n" +
44282 				"class XList<T> {\n" +
44283 				"}\n";
44284 	if (this.complianceLevel < ClassFileConstants.JDK1_8) {
44285 		this.runNegativeTest(
44286 			new String[] {
44287 				"X.java",
44288 				xSource,
44289 			},
44290 			"----------\n" +
44291 			"1. ERROR in X.java (at line 5)\n" +
44292 			"	static XList<Sub<? extends Number>> LIST = asList(ARRAY); \n" +
44293 			"	                                           ^^^^^^^^^^^^^\n" +
44294 			"Type mismatch: cannot convert from XList<X.Foo.Sub<? extends Integer>> to XList<X.Foo.Sub<? extends Number>>\n" +
44295 			"----------\n" +
44296 			"2. WARNING in X.java (at line 8)\n" +
44297 			"	static Sub<? extends Integer>[] ARRAY = new Sub[] { };\n" +
44298 			"	                                        ^^^^^^^^^^^^^\n" +
44299 			"Type safety: The expression of type X.Foo.Sub[] needs unchecked conversion to conform to X.Foo.Sub<? extends Integer>[]\n" +
44300 			"----------\n");
44301 	} else {
44302 		runConformTest(new String[]{ "X.java", xSource });
44303 	}
44304 }
44305 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216565 - variation
44306 public void test1260() {
44307 	this.runConformTest(
44308 		new String[] {
44309 				"X.java",
44310 				"public class X {\n" +
44311 				"    static <T> XList<T> asList(T[] x) { return null; }\n" +
44312 				"    static interface Foo<T> {\n" +
44313 				"        static interface Sub<T> extends Foo<T> {\n" +
44314 				"            static XList<Sub<? super Number>> LIST = asList(ARRAY); \n" +
44315 				"       }\n" +
44316 				"        static Sub<? super Number>[] ARRAY = new Sub[] { };\n" +
44317 				"    }\n" +
44318 				"}\n" +
44319 				"\n" +
44320 				"class XList<T> {\n" +
44321 				"}\n", // =================
44322 		},
44323 		"");
44324 }
44325 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216565 - variation
44326 public void test1261() {
44327 	String xSource =
44328 				"public class X {\n" +
44329 				"    static <T> XList<T> asList(T[] x) { return null; }\n" +
44330 				"    static interface Foo<T> {\n" +
44331 				"        static interface Sub<T> extends Foo<T> {\n" +
44332 				"            static XList<Sub<?>> LIST = asList(ARRAY); \n" +
44333 				"       }\n" +
44334 				"        static Sub<? super Number>[] ARRAY = new Sub[] { };\n" +
44335 				"    }\n" +
44336 				"}\n" +
44337 				"\n" +
44338 				"class XList<T> {\n" +
44339 				"}\n";
44340 	if (this.complianceLevel < ClassFileConstants.JDK1_8) {
44341 		this.runNegativeTest(
44342 			new String[] {
44343 				"X.java",
44344 				xSource,
44345 			},
44346 			"----------\n" +
44347 			"1. ERROR in X.java (at line 5)\n" +
44348 			"	static XList<Sub<?>> LIST = asList(ARRAY); \n" +
44349 			"	                            ^^^^^^^^^^^^^\n" +
44350 			"Type mismatch: cannot convert from XList<X.Foo.Sub<? super Number>> to XList<X.Foo.Sub<?>>\n" +
44351 			"----------\n" +
44352 			"2. WARNING in X.java (at line 7)\n" +
44353 			"	static Sub<? super Number>[] ARRAY = new Sub[] { };\n" +
44354 			"	                                     ^^^^^^^^^^^^^\n" +
44355 			"Type safety: The expression of type X.Foo.Sub[] needs unchecked conversion to conform to X.Foo.Sub<? super Number>[]\n" +
44356 			"----------\n");
44357 	} else {
44358 		runConformTest(new String[]{ "X.java", xSource });
44359 	}
44360 }
44361 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216565 - variation
44362 public void test1262() {
44363 	this.runNegativeTest(
44364 		new String[] {
44365 				"X.java",
44366 				"public class X {\n" +
44367 				"    static <T> XList<T> asList(T[] x) { return null; }\n" +
44368 				"    static interface Foo<T> {\n" +
44369 				"        static interface Sub<T> extends Foo<T> {\n" +
44370 				"            static XList<Sub<? super Number>> LIST = asList(ARRAY); \n" +
44371 				"       }\n" +
44372 				"        static Sub<?>[] ARRAY = new Sub[] { };\n" +
44373 				"    }\n" +
44374 				"}\n" +
44375 				"\n" +
44376 				"class XList<T> {\n" +
44377 				"}\n", // =================
44378 		},
44379 		"----------\n" +
44380 		"1. ERROR in X.java (at line 5)\n" +
44381 		"	static XList<Sub<? super Number>> LIST = asList(ARRAY); \n" +
44382 		"	                                         ^^^^^^^^^^^^^\n" +
44383 		"Type mismatch: cannot convert from XList<X.Foo.Sub<?>> to XList<X.Foo.Sub<? super Number>>\n" +
44384 		"----------\n");
44385 }
44386 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216565 - variation
44387 public void test1263() {
44388 	String xSource =
44389 				"public class X {\n" +
44390 				"    static <T> XList<T> asList(T[] x) { return null; }\n" +
44391 				"    static interface Foo<T> {\n" +
44392 				"        static interface Sub<T> extends Foo<T> {\n" +
44393 				"            static XList<Sub<?>> LIST = asList(ARRAY); \n" +
44394 				"       }\n" +
44395 				"        @SuppressWarnings(\"rawtypes\")\n" +
44396 				"        static Sub<? super Object>[] ARRAY = new Sub[] { };\n" +
44397 				"    }\n" +
44398 				"}\n" +
44399 				"\n" +
44400 				"class XList<T> {\n" +
44401 				"}\n";
44402 	if (this.complianceLevel < ClassFileConstants.JDK1_8) {
44403 		this.runNegativeTest(
44404 			new String[] {
44405 				"X.java",
44406 				xSource,
44407 			},
44408 			"----------\n" +
44409 			"1. ERROR in X.java (at line 5)\n" +
44410 			"	static XList<Sub<?>> LIST = asList(ARRAY); \n" +
44411 			"	                            ^^^^^^^^^^^^^\n" +
44412 			"Type mismatch: cannot convert from XList<X.Foo.Sub<? super Object>> to XList<X.Foo.Sub<?>>\n" +
44413 			"----------\n" +
44414 			"2. WARNING in X.java (at line 8)\n" +
44415 			"	static Sub<? super Object>[] ARRAY = new Sub[] { };\n" +
44416 			"	                                     ^^^^^^^^^^^^^\n" +
44417 			"Type safety: The expression of type X.Foo.Sub[] needs unchecked conversion to conform to X.Foo.Sub<? super Object>[]\n" +
44418 			"----------\n");
44419 	} else {
44420 		runConformTest(new String[]{ "X.java", xSource });
44421 	}
44422 }
44423 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216565 - variation
44424 public void test1264() {
44425 	this.runConformTest(
44426 		new String[] {
44427 				"X.java",
44428 				"import java.util.List;\n" +
44429 				"public class X {\n" +
44430 				"    static <T> List<T> asList(T[] x) { return null; }\n" +
44431 				"    static interface Foo<T> {\n" +
44432 				"        static interface Sub<T> extends Foo<T> {\n" +
44433 				"            static List<X.Foo.Sub<?>> LIST = asList(ARRAY); \n" +
44434 				"       }\n" +
44435 				"        static X.Foo.Sub<?>[] ARRAY = new Sub[] { };\n" +
44436 				"    }\n" +
44437 				"}", // =================
44438 		},
44439 		"");
44440 }
44441 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216565 - variation
44442 public void test1265() {
44443 	this.runConformTest(
44444 			new String[] {
44445 					"X.java",
44446 					"import java.util.List;\n" +
44447 					"public class X {\n" +
44448 					"    static <T> List<T> asList(T[] x) { return null; }\n" +
44449 					"    static interface Foo<T> {\n" +
44450 					"        static interface Sub<T> extends Foo<T> {\n" +
44451 					"            static List<Foo.Sub<?>> LIST = asList(ARRAY); \n" +
44452 					"       }\n" +
44453 					"        static Sub<?>[] ARRAY = new Sub[] { };\n" +
44454 					"    }\n" +
44455 					"}", // =================
44456 			},
44457 			"");
44458 }
44459 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216565 - variation
44460 public void test1266() {
44461 	this.runConformTest(
44462 			new String[] {
44463 					"X.java",
44464 					"import java.util.List;\n" +
44465 					"public class X {\n" +
44466 					"    static <T> List<T> asList(T[] x) { return null; }\n" +
44467 					"    static interface Foo<T> {\n" +
44468 					"        static interface Sub<T> extends Foo<T> {\n" +
44469 					"            static List<Sub<?>> LIST = asList(ARRAY); \n" +
44470 					"       }\n" +
44471 					"        static Foo.Sub<?>[] ARRAY = new Sub[] { };\n" +
44472 					"    }\n" +
44473 					"}", // =================
44474 			},
44475 			"");
44476 }
44477 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216705
44478 public void test1267() {
44479 	this.runConformTest(
44480 			new String[] {
44481 					"X.java",
44482 					"import java.util.List;\n" +
44483 					"public class X {\n" +
44484 					"	static interface Foo {\n" +
44485 					"	}\n" +
44486 					"	static interface SubFoo extends Foo {\n" +
44487 					"	}\n" +
44488 					"	static abstract class AbstractTest<T extends Foo> {\n" +
44489 					"		protected static class Bar<T extends Foo> {\n" +
44490 					"		}\n" +
44491 					"		protected abstract List<Bar<? extends T>> get();\n" +
44492 					"	}\n" +
44493 					"	static class Test extends AbstractTest<SubFoo> {\n" +
44494 					"		@Override\n" +
44495 					"		protected List<Bar<? extends SubFoo>> get() {\n" +
44496 					"			return null;\n" +
44497 					"		}\n" +
44498 					"	}\n" +
44499 					"}", // =================
44500 			},
44501 			"");
44502 }
44503 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216692
44504 public void test1268() {
44505 	this.runConformTest(
44506 			new String[] {
44507 					"pkg1/Foo.java",
44508 					"package pkg1;\n" +
44509 					"import java.util.Map;\n" +
44510 					"public class Foo<T> {\n" +
44511 					"    protected final Map<String, Field> fields = null;\n" +
44512 					"    protected static class Field { }\n" +
44513 					"}\n",
44514 					"pkg2/SubFoo.java",
44515 					"package pkg2;\n" +
44516 					"import pkg1.Foo;\n" +
44517 					"public class SubFoo<T> extends Foo<T> {\n" +
44518 					"    private Field field = null;\n" +
44519 					"    private void test() {\n" +
44520 					"        Field field = fields.get(\"test\");\n" +
44521 					"    }\n" +
44522 					"}\n", // =================
44523 			},
44524 			"");
44525 }
44526 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216686
44527 public void test1269() {
44528 	this.runConformTest(
44529 			new String[] {
44530 					"X.java",
44531 					"public class X {\n" +
44532 					"	// some functor and functor instances definitions\n" +
44533 					"	static interface OO<T, E> { \n" +
44534 					"		public T eval(E x);\n" +
44535 					"	}\n" +
44536 					"	static interface TO<T> extends OO<String, T> {\n" +
44537 					"		public String eval(T x);\n" +
44538 					"	}\n" +
44539 					"	static interface TT extends TO<String> {\n" +
44540 					"		public String eval(String x);\n" +
44541 					"	}\n" +
44542 					"	static final TO<Object> FUNC1 = null;\n" +
44543 					"	static final TT FUNC2 = null;\n" +
44544 					"\n" +
44545 					"	// some functor combinators\n" +
44546 					"	static <E> TO<E> combine(final TT x, final TO<? super E> y) { // # 1\n" +
44547 					"		System.out.println(\"#1#\");\n" +
44548 					"		return new TO<E>() { public String eval(E o) { return x.eval(y.eval(o)); } }; \n" +
44549 					"	}\n" +
44550 					"	// body of the test\n" +
44551 					"	static <E> void put(Class<E> type, TO<? super E> func) {\n" +
44552 					"	}\n" +
44553 					"	public static void main(String[] args) {\n" +
44554 					"		put(Integer.class, combine(FUNC2, FUNC1));\n" +
44555 					"	}\n" +
44556 					"}\n", // =================
44557 			},
44558 			"#1#");
44559 }
44560 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216686 - variation
44561 public void test1270() {
44562 	this.runConformTest(
44563 			new String[] {
44564 					"X.java",
44565 					"public class X {\n" +
44566 					"	// some functor and functor instances definitions\n" +
44567 					"	static interface OO<T, E> { \n" +
44568 					"		public T eval(E x);\n" +
44569 					"	}\n" +
44570 					"	static interface TO<T> extends OO<String, T> {\n" +
44571 					"		public String eval(T x);\n" +
44572 					"	}\n" +
44573 					"	static interface TT extends TO<String> {\n" +
44574 					"		public String eval(String x);\n" +
44575 					"	}\n" +
44576 					"	static final TO<Object> FUNC1 = null;\n" +
44577 					"	static final TT FUNC2 = null;\n" +
44578 					"\n" +
44579 					"	// some functor combinators\n" +
44580 					"	static <E, T> TO<T> combine(final TO<? super E> x, final OO<E, T> y) { // # 2\n" +
44581 					"		System.out.println(\"#2#\");\n" +
44582 					"		return new TO<T>() { public String eval(T o) { return x.eval(y.eval(o)); } }; \n" +
44583 					"	}\n" +
44584 					"	// body of the test\n" +
44585 					"	static <E> void put(Class<E> type, TO<? super E> func) {\n" +
44586 					"	}\n" +
44587 					"	public static void main(String[] args) {\n" +
44588 					"		put(Integer.class, combine(FUNC2, FUNC1));\n" +
44589 					"	}\n" +
44590 					"}\n", // =================
44591 			},
44592 			"#2#");
44593 }
44594 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216686 - variation
44595 public void test1271() {
44596 	this.runNegativeTest(
44597 			new String[] {
44598 					"X.java",
44599 					"public class X {\n" +
44600 					"	// some functor and functor instances definitions\n" +
44601 					"	static interface OO<T, E> { \n" +
44602 					"		public T eval(E x);\n" +
44603 					"	}\n" +
44604 					"	static interface TO<T> extends OO<String, T> {\n" +
44605 					"		public String eval(T x);\n" +
44606 					"	}\n" +
44607 					"	static interface TT extends TO<String> {\n" +
44608 					"		public String eval(String x);\n" +
44609 					"	}\n" +
44610 					"	static final TO<Object> FUNC1 = null;\n" +
44611 					"	static final TT FUNC2 = null;\n" +
44612 					"\n" +
44613 					"	// some functor combinators\n" +
44614 					"	static <E, T, V> OO<E, V> combine(final OO<E, ? super T> x, final OO<T, V> y) { // # 3\n" +
44615 					"		System.out.println(\"#3#\");\n" +
44616 					"		return new OO<E, V>() { public E eval(V o) { return x.eval(y.eval(o)); } };\n" +
44617 					"	}\n" +
44618 					"	// body of the test\n" +
44619 					"	static <E> void put(Class<E> type, TO<? super E> func) {\n" +
44620 					"	}\n" +
44621 					"	public static void main(String[] args) {\n" +
44622 					"		put(Integer.class, combine(FUNC2, FUNC1));\n" +
44623 					"	}\n" +
44624 					"}\n", // =================
44625 			},
44626 			this.complianceLevel < ClassFileConstants.JDK1_8 ?
44627 			"----------\n" +
44628 			"1. ERROR in X.java (at line 24)\n" +
44629 			"	put(Integer.class, combine(FUNC2, FUNC1));\n" +
44630 			"	^^^\n" +
44631 			"The method put(Class<E>, X.TO<? super E>) in the type X is not applicable for the arguments (Class<Integer>, X.OO<String,Object>)\n" +
44632 			"----------\n"
44633 			: // ATM, in 1.8+ we generate an extra error due to inner poly expression resolution after the target type is known.
44634 			"----------\n" +
44635 			"1. ERROR in X.java (at line 24)\n" +
44636 			"	put(Integer.class, combine(FUNC2, FUNC1));\n" +
44637 			"	^^^\n" +
44638 			"The method put(Class<E>, X.TO<? super E>) in the type X is not applicable for the arguments (Class<Integer>, X.OO<String,Object>)\n" +
44639 			"----------\n" +
44640 			"2. ERROR in X.java (at line 24)\n" +
44641 			"	put(Integer.class, combine(FUNC2, FUNC1));\n" +
44642 			"	                   ^^^^^^^^^^^^^^^^^^^^^\n" +
44643 			"Type mismatch: cannot convert from X.OO<String,Object> to X.TO<? super E>\n" +
44644 			"----------\n");
44645 }
44646 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216686 - variation
44647 public void test1272() {
44648 	this.runConformTest(
44649 			new String[] {
44650 					"X.java",
44651 					"public class X {\n" +
44652 					"	// some functor and functor instances definitions\n" +
44653 					"	static interface OO<T, E> { \n" +
44654 					"		public T eval(E x);\n" +
44655 					"	}\n" +
44656 					"	static interface TO<T> extends OO<String, T> {\n" +
44657 					"		public String eval(T x);\n" +
44658 					"	}\n" +
44659 					"	static interface TT extends TO<String> {\n" +
44660 					"		public String eval(String x);\n" +
44661 					"	}\n" +
44662 					"	static final TO<Object> FUNC1 = null;\n" +
44663 					"	static final TT FUNC2 = null;\n" +
44664 					"\n" +
44665 					"	// some functor combinators\n" +
44666 					"	static <E, T, V> OO<E, V> combine(final OO<E, ? super T> x, final OO<T, V> y) { // # 3\n" +
44667 					"		System.out.print(\"#3#\");\n" +
44668 					"		return new OO<E, V>() { public E eval(V o) { return x.eval(y.eval(o)); } };\n" +
44669 					"	}\n" +
44670 					"	// body of the test\n" +
44671 					"	static <E> void put(Class<E> type, TO<? super E> func) {\n" +
44672 					"	}\n" +
44673 					"	public static void main(String[] args) {\n" +
44674 					"      try {\n" +
44675 					"		   put(Integer.class, (TO<Object>)combine(FUNC2, FUNC1));\n" +
44676 					"      } catch(ClassCastException e) {\n" +
44677 					"		   System.out.println(\"#CLASSCAST#\");\n" +
44678 					"		}\n" +
44679 					"	}\n" +
44680 					"}\n", // =================
44681 			},
44682 			"#3##CLASSCAST#");
44683 }
44684 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216686 - variation
44685 public void test1273() {
44686 	String sourceX =
44687 			"public class X {\n" +
44688 			"	// some functor and functor instances definitions\n" +
44689 			"	static interface OO<T, E> { \n" +
44690 			"		public T eval(E x);\n" +
44691 			"	}\n" +
44692 			"	static interface TO<T> extends OO<String, T> {\n" +
44693 			"		public String eval(T x);\n" +
44694 			"	}\n" +
44695 			"	static interface TT extends TO<String> {\n" +
44696 			"		public String eval(String x);\n" +
44697 			"	}\n" +
44698 			"	static final TO<Object> FUNC1 = null;\n" +
44699 			"	static final TT FUNC2 = null;\n" +
44700 			"\n" +
44701 			"	// some functor combinators\n" +
44702 			"	static <E> TO<E> combine(final TT x, final TO<? super E> y) { // # 1\n" +
44703 			"		System.out.println(\"#1#\");\n" +
44704 			"		return new TO<E>() { public String eval(E o) { return x.eval(y.eval(o)); } }; \n" +
44705 			"	}\n" +
44706 			"	static <E, T> TO<T> combine(final TO<? super E> x, final OO<E, T> y) { // # 2\n" +
44707 			"		System.out.println(\"#2#\");\n" +
44708 			"		return new TO<T>() { public String eval(T o) { return x.eval(y.eval(o)); } }; \n" +
44709 			"	}\n" +
44710 			"	// body of the test\n" +
44711 			"	static <E> void put(Class<E> type, TO<? super E> func) {\n" +
44712 			"	}\n" +
44713 			"	public static void main(String[] args) {\n" +
44714 			"		put(Integer.class, combine(FUNC2, FUNC1));\n" +
44715 			"	}\n" +
44716 			"}\n";
44717 	if (this.complianceLevel < ClassFileConstants.JDK1_8) {
44718 		this.runConformTest(
44719 			new String[] {
44720 				"X.java",
44721 				sourceX,
44722 			},
44723 			"#1#");
44724 	} else {
44725 		runNegativeTest(
44726 			new String[] {
44727 				"X.java",
44728 				sourceX
44729 			},
44730 			"----------\n" +
44731 			"1. ERROR in X.java (at line 28)\n" +
44732 			"	put(Integer.class, combine(FUNC2, FUNC1));\n" +
44733 			"	                   ^^^^^^^\n" +
44734 			"The method combine(X.TT, X.TO<? super Object>) is ambiguous for the type X\n" +
44735 			"----------\n" );
44736 	}
44737 }
44738 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216686 - variation
44739 public void test1274() {
44740 	this.runConformTest(
44741 			new String[] {
44742 					"X.java",
44743 					"public class X {\n" +
44744 					"	// some functor and functor instances definitions\n" +
44745 					"	static interface OO<T, E> { \n" +
44746 					"		public T eval(E x);\n" +
44747 					"	}\n" +
44748 					"	static interface TO<T> extends OO<String, T> {\n" +
44749 					"		public String eval(T x);\n" +
44750 					"	}\n" +
44751 					"	static interface TT extends TO<String> {\n" +
44752 					"		public String eval(String x);\n" +
44753 					"	}\n" +
44754 					"	static final TO<Object> FUNC1 = null;\n" +
44755 					"	static final TT FUNC2 = null;\n" +
44756 					"\n" +
44757 					"	// some functor combinators\n" +
44758 					"	static <E> TO<E> combine(final TT x, final TO<? super E> y) { // # 1\n" +
44759 					"		System.out.println(\"#1#\");\n" +
44760 					"		return new TO<E>() { public String eval(E o) { return x.eval(y.eval(o)); } }; \n" +
44761 					"	}\n" +
44762 					"	static <E, T> TO<T> combine(final TO<? super E> x, final OO<E, T> y) { // # 2\n" +
44763 					"		System.out.println(\"#2#\");\n" +
44764 					"		return new TO<T>() { public String eval(T o) { return x.eval(y.eval(o)); } }; \n" +
44765 					"	}\n" +
44766 					"	// body of the test\n" +
44767 					"	static <E> void put(Class<E> type, TO<? super E> func) {\n" +
44768 					"	}\n" +
44769 					"	public static void main(String[] args) {\n" +
44770 					"		put(Integer.class, X.<Object>combine(FUNC2, FUNC1));\n" +
44771 					"	}\n" +
44772 					"}\n", // =================
44773 			},
44774 			"#1#");
44775 }
44776 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216686 - variation
44777 public void test1275() {
44778 	String[] input =
44779 			new String[] {
44780 					"X.java",
44781 					"public class X {\n" +
44782 					"	// some functor and functor instances definitions\n" +
44783 					"	static interface OO<T, E> { \n" +
44784 					"		public T eval(E x);\n" +
44785 					"	}\n" +
44786 					"	static interface TO<T> extends OO<String, T> {\n" +
44787 					"		public String eval(T x);\n" +
44788 					"	}\n" +
44789 					"	static interface TT extends TO<String> {\n" +
44790 					"		public String eval(String x);\n" +
44791 					"	}\n" +
44792 					"	static final TO<Object> FUNC1 = null;\n" +
44793 					"	static final TT FUNC2 = null;\n" +
44794 					"\n" +
44795 					"	// some functor combinators\n" +
44796 					"	static <E> TO<E> combine(final TT x, final TO<? super E> y) { // # 1\n" +
44797 					"		System.out.println(\"#1#\");\n" +
44798 					"		return new TO<E>() { public String eval(E o) { return x.eval(y.eval(o)); } }; \n" +
44799 					"	}\n" +
44800 					"	static <E, T, V> OO<E, V> combine(final OO<E, ? super T> x, final OO<T, V> y) { // # 3\n" +
44801 					"		System.out.println(\"#3#\");\n" +
44802 					"		return new OO<E, V>() { public E eval(V o) { return x.eval(y.eval(o)); } };\n" +
44803 					"	}\n" +
44804 					"	// body of the test\n" +
44805 					"	static <E> void put(Class<E> type, TO<? super E> func) {\n" +
44806 					"	}\n" +
44807 					"	public static void main(String[] args) {\n" +
44808 					"		put(Integer.class, combine(FUNC2, FUNC1));\n" +
44809 					"	}\n" +
44810 					"}\n", // =================
44811 			};
44812 	if (this.complianceLevel < ClassFileConstants.JDK1_8) {
44813 		runConformTest(
44814 			input,
44815 			"#1#");
44816 	} else {
44817 		runNegativeTest(
44818 			input,
44819 			"----------\n" +
44820 			"1. ERROR in X.java (at line 28)\n" +
44821 			"	put(Integer.class, combine(FUNC2, FUNC1));\n" +
44822 			"	                   ^^^^^^^\n" +
44823 			"The method combine(X.TT, X.TO<? super Object>) is ambiguous for the type X\n" +
44824 			"----------\n");
44825 	}
44826 }
44827 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216686 - variation
44828 public void test1276() {
44829 	this.runConformTest(
44830 			new String[] {
44831 					"X.java",
44832 					"public class X {\n" +
44833 					"	// some functor and functor instances definitions\n" +
44834 					"	static interface OO<T, E> { \n" +
44835 					"		public T eval(E x);\n" +
44836 					"	}\n" +
44837 					"	static interface TO<T> extends OO<String, T> {\n" +
44838 					"		public String eval(T x);\n" +
44839 					"	}\n" +
44840 					"	static interface TT extends TO<String> {\n" +
44841 					"		public String eval(String x);\n" +
44842 					"	}\n" +
44843 					"	static final TO<Object> FUNC1 = null;\n" +
44844 					"	static final TT FUNC2 = null;\n" +
44845 					"\n" +
44846 					"	// some functor combinators\n" +
44847 					"	static <E> TO<E> combine(final TT x, final TO<? super E> y) { // # 1\n" +
44848 					"		System.out.println(\"#1#\");\n" +
44849 					"		return new TO<E>() { public String eval(E o) { return x.eval(y.eval(o)); } }; \n" +
44850 					"	}\n" +
44851 					"	static <E, T, V> OO<E, V> combine(final OO<E, ? super T> x, final OO<T, V> y) { // # 3\n" +
44852 					"		System.out.println(\"#3#\");\n" +
44853 					"		return new OO<E, V>() { public E eval(V o) { return x.eval(y.eval(o)); } };\n" +
44854 					"	}\n" +
44855 					"	// body of the test\n" +
44856 					"	static <E> void put(Class<E> type, TO<? super E> func) {\n" +
44857 					"	}\n" +
44858 					"	public static void main(String[] args) {\n" +
44859 					"		put(Integer.class, X.<Object>combine(FUNC2, FUNC1));\n" +
44860 					"	}\n" +
44861 					"}\n", // =================
44862 			},
44863 			"#1#");
44864 }
44865 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216686 - variation
44866 public void test1277() {
44867 	this.runConformTest(
44868 			new String[] {
44869 					"X.java",
44870 					"public class X {\n" +
44871 					"	// some functor and functor instances definitions\n" +
44872 					"	static interface OO<T, E> { \n" +
44873 					"		public T eval(E x);\n" +
44874 					"	}\n" +
44875 					"	static interface TO<T> extends OO<String, T> {\n" +
44876 					"		public String eval(T x);\n" +
44877 					"	}\n" +
44878 					"	static interface TT extends TO<String> {\n" +
44879 					"		public String eval(String x);\n" +
44880 					"	}\n" +
44881 					"	static final TO<Object> FUNC1 = null;\n" +
44882 					"	static final TT FUNC2 = null;\n" +
44883 					"\n" +
44884 					"	// some functor combinators\n" +
44885 					"	static <E, T> TO<T> combine(final TO<? super E> x, final OO<E, T> y) { // # 2\n" +
44886 					"		System.out.println(\"#2#\");\n" +
44887 					"		return new TO<T>() { public String eval(T o) { return x.eval(y.eval(o)); } }; \n" +
44888 					"	}\n" +
44889 					"	static <E, T, V> OO<E, V> combine(final OO<E, ? super T> x, final OO<T, V> y) { // # 3\n" +
44890 					"		System.out.println(\"#3#\");\n" +
44891 					"		return new OO<E, V>() { public E eval(V o) { return x.eval(y.eval(o)); } };\n" +
44892 					"	}\n" +
44893 					"	// body of the test\n" +
44894 					"	static <E> void put(Class<E> type, TO<? super E> func) {\n" +
44895 					"	}\n" +
44896 					"	public static void main(String[] args) {\n" +
44897 					"		put(Integer.class, combine(FUNC2, FUNC1));\n" +
44898 					"	}\n" +
44899 					"}\n", // =================
44900 			},
44901 			"#2#");
44902 }
44903 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216686 - variation
44904 public void test1278() {
44905 	String[] input =
44906 			new String[] {
44907 					"X.java",
44908 					"public class X {\n" +
44909 					"	// some functor and functor instances definitions\n" +
44910 					"	static interface OO<T, E> { \n" +
44911 					"		public T eval(E x);\n" +
44912 					"	}\n" +
44913 					"	static interface TO<T> extends OO<String, T> {\n" +
44914 					"		public String eval(T x);\n" +
44915 					"	}\n" +
44916 					"	static interface TT extends TO<String> {\n" +
44917 					"		public String eval(String x);\n" +
44918 					"	}\n" +
44919 					"	static final TO<Object> FUNC1 = null;\n" +
44920 					"	static final TT FUNC2 = null;\n" +
44921 					"\n" +
44922 					"	// some functor combinators\n" +
44923 					"	static <E> TO<E> combine(final TT x, final TO<? super E> y) { // # 1\n" +
44924 					"		System.out.println(\"#1#\");\n" +
44925 					"		return new TO<E>() { public String eval(E o) { return x.eval(y.eval(o)); } }; \n" +
44926 					"	}\n" +
44927 					"	static <E, T> TO<T> combine(final TO<? super E> x, final OO<E, T> y) { // # 2\n" +
44928 					"		System.out.println(\"#2#\");\n" +
44929 					"		return new TO<T>() { public String eval(T o) { return x.eval(y.eval(o)); } }; \n" +
44930 					"	}\n" +
44931 					"	static <E, T, V> OO<E, V> combine(final OO<E, ? super T> x, final OO<T, V> y) { // # 3\n" +
44932 					"		System.out.println(\"#3#\");\n" +
44933 					"		return new OO<E, V>() { public E eval(V o) { return x.eval(y.eval(o)); } };\n" +
44934 					"	}\n" +
44935 					"	// body of the test\n" +
44936 					"	static <E> void put(Class<E> type, TO<? super E> func) {\n" +
44937 					"	}\n" +
44938 					"	public static void main(String[] args) {\n" +
44939 					"		put(Integer.class, combine(FUNC2, FUNC1));\n" +
44940 					"	}\n" +
44941 					"}\n", // =================
44942 			};
44943 	if (this.complianceLevel < ClassFileConstants.JDK1_8) {
44944 		runConformTest(
44945 			input,
44946 			"#1#");
44947 	} else {
44948 		runNegativeTest(
44949 			input,
44950 			"----------\n" +
44951 			"1. ERROR in X.java (at line 32)\n" +
44952 			"	put(Integer.class, combine(FUNC2, FUNC1));\n" +
44953 			"	                   ^^^^^^^\n" +
44954 			"The method combine(X.TT, X.TO<? super Object>) is ambiguous for the type X\n" +
44955 			"----------\n");
44956 	}
44957 }
44958 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216686 - variation
44959 public void test1279() {
44960 	this.runConformTest(
44961 			new String[] {
44962 					"X.java",
44963 					"public class X {\n" +
44964 					"	// some functor and functor instances definitions\n" +
44965 					"	static interface OO<T, E> { \n" +
44966 					"		public T eval(E x);\n" +
44967 					"	}\n" +
44968 					"	static interface TO<T> extends OO<String, T> {\n" +
44969 					"		public String eval(T x);\n" +
44970 					"	}\n" +
44971 					"	static interface TT extends TO<String> {\n" +
44972 					"		public String eval(String x);\n" +
44973 					"	}\n" +
44974 					"	static final TO<Object> FUNC1 = null;\n" +
44975 					"	static final TT FUNC2 = null;\n" +
44976 					"\n" +
44977 					"	// some functor combinators\n" +
44978 					"	static <E> TO<E> combine(final TT x, final TO<? super E> y) { // # 1\n" +
44979 					"		System.out.println(\"#1#\");\n" +
44980 					"		return new TO<E>() { public String eval(E o) { return x.eval(y.eval(o)); } }; \n" +
44981 					"	}\n" +
44982 					"	static <E, T> TO<T> combine(final TO<? super E> x, final OO<E, T> y) { // # 2\n" +
44983 					"		System.out.println(\"#2#\");\n" +
44984 					"		return new TO<T>() { public String eval(T o) { return x.eval(y.eval(o)); } }; \n" +
44985 					"	}\n" +
44986 					"	static <E, T, V> OO<E, V> combine(final OO<E, ? super T> x, final OO<T, V> y) { // # 3\n" +
44987 					"		System.out.println(\"#3#\");\n" +
44988 					"		return new OO<E, V>() { public E eval(V o) { return x.eval(y.eval(o)); } };\n" +
44989 					"	}\n" +
44990 					"	// body of the test\n" +
44991 					"	static <E> void put(Class<E> type, TO<? super E> func) {\n" +
44992 					"	}\n" +
44993 					"	public static void main(String[] args) {\n" +
44994 					"		put(Integer.class, X.<Object>combine(FUNC2, FUNC1));\n" +
44995 					"	}\n" +
44996 					"}\n", // =================
44997 			},
44998 			"#1#");
44999 }
45000 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216686 - variation
45001 public void test1280() {
45002 	this.runConformTest(
45003 			new String[] {
45004 					"X.java",
45005 					"interface OO<T,E> {}\n" +
45006 					"interface TO<T> extends OO<String,T> {}\n" +
45007 					"interface TT extends TO<String> {}\n" +
45008 					"\n" +
45009 					"public class X {\n" +
45010 					"	<E, T> TO<T> combine(final TO<? super E> x, final OO<E, T> y) { return null; }\n" +
45011 					"  void foo(TT tt, TO<? super Object> too) {\n" +
45012 					"     combine(tt, too);\n" +
45013 					"  }\n" +
45014 					"}", // =================
45015 			},
45016 			"");
45017 }
45018 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216686 - variation
45019 // FAIL EXTRA ERR, see http://mail.openjdk.java.net/pipermail/lambda-spec-experts/2013-December/000444.html
45020 public void test1281() {
45021 	if (this.complianceLevel >= ClassFileConstants.JDK1_8)
45022 		return;
45023 	this.runConformTest(
45024 			new String[] {
45025 					"X.java",
45026 					"interface OO<T,E> {}\n" +
45027 					"interface TO<T> extends OO<String,T> {}\n" +
45028 					"interface TT extends TO<String> {}\n" +
45029 					"\n" +
45030 					"public class X {\n" +
45031 					"	<E, T> TO<T> combine(final TO<? super E> x, final OO<E, T>[] y) { return null; }\n" +
45032 					"  void foo(TT tt, TO<? super Object>[] too) {\n" +
45033 					"     combine(tt, too);\n" +
45034 					"  }\n" +
45035 					"}", // =================
45036 			},
45037 			"");
45038 }
45039 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216686 - variation
45040 public void test1282() {
45041 	this.runNegativeTest(
45042 			new String[] {
45043 					"X.java",
45044 					"public class X {\n" +
45045 					"	static interface OO<T,E> {}\n" +
45046 					"	static interface TO<T> extends OO<String,T> {}\n" +
45047 					"	static interface TT extends TO<String> {}\n" +
45048 					"	\n" +
45049 					"	<E, T> TO<T> combine(TT x, TO<? super E> y) { return null; }\n" +
45050 					"	void foo(TO<? super String> too, OO<String,Object> oo) {\n" +
45051 					"		combine(too, oo);\n" +
45052 					"	}\n" +
45053 					"}", // =================
45054 			},
45055 			"----------\n" +
45056 			"1. ERROR in X.java (at line 8)\n" +
45057 			"	combine(too, oo);\n" +
45058 			"	^^^^^^^\n" +
45059 			"The method combine(X.TT, X.TO<? super E>) in the type X is not applicable for the arguments (X.TO<capture#1-of ? super String>, X.OO<String,Object>)\n" +
45060 			"----------\n");
45061 }
45062 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=216686 - variation
45063 public void test1283() {
45064 	this.runNegativeTest(
45065 			new String[] {
45066 					"X.java",
45067 					"public class X {\n" +
45068 					"	static interface OO<T,E> {}\n" +
45069 					"	static interface TO<T> extends OO<String,T> {}\n" +
45070 					"	static interface TT extends TO<String> {}\n" +
45071 					"	\n" +
45072 					"	<E, T> TO<T> combine(TT[] x, TO<? super E>[] y) { return null; }\n" +
45073 					"	void foo(TO<? super String>[] too, OO<String,Object>[] oo) {\n" +
45074 					"		combine(too, oo);\n" +
45075 					"	}\n" +
45076 					"}", // =================
45077 			},
45078 			"----------\n" +
45079 			"1. ERROR in X.java (at line 8)\n" +
45080 			"	combine(too, oo);\n" +
45081 			"	^^^^^^^\n" +
45082 			"The method combine(X.TT[], X.TO<? super E>[]) in the type X is not applicable for the arguments (X.TO<? super String>[], X.OO<String,Object>[])\n" +
45083 			"----------\n");
45084 }
45085 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=210425
45086 public void test1284() {
45087 	this.runNegativeTest(
45088 			new String[] {
45089 					"X.java",
45090 					"public class X {\n" +
45091 					"	public static void main(String[] args) {\n" +
45092 					"		Thread th = Thread.currentThread();\n" +
45093 					"		Z<String, Thread> z1 = new Z<String, Thread>(th);\n" +
45094 					"		Z<String, Exception> z2 = new Z<String, Exception>(new Exception());\n" +
45095 					"		Y<String, Thread> y = new Y<String, Thread>() {};\n" +
45096 					"		y.foo(z1).get().getThreadGroup();\n" +
45097 					"		y.foo(z2).get().getThreadGroup(); // heap pollution: we get a CCE because we return a U2\n" +
45098 					"		Zork z;\n" +
45099 					"	}\n" +
45100 					"}\n" +
45101 					"abstract class Y<T, U> {\n" +
45102 					"	I2<T, U> foo(I1<T> i) {\n" +
45103 					"		return (I2<T, U>) i;\n" +
45104 					"	}\n" +
45105 					"}\n" +
45106 					"interface I1<T> {\n" +
45107 					"}\n" +
45108 					"interface I2<T, U> extends I1<T> {\n" +
45109 					"	U get();\n" +
45110 					"}\n" +
45111 					"class Z<V, W> implements I2<V, W> {\n" +
45112 					"	W w;\n" +
45113 					"	Z(W w) {\n" +
45114 					"		this.w = w;\n" +
45115 					"	}\n" +
45116 					"	public W get() {\n" +
45117 					"		return this.w;\n" +
45118 					"	}\n" +
45119 					"}\n", // =================
45120 			},
45121 			"----------\n" +
45122 			"1. ERROR in X.java (at line 9)\n" +
45123 			"	Zork z;\n" +
45124 			"	^^^^\n" +
45125 			"Zork cannot be resolved to a type\n" +
45126 			"----------\n" +
45127 			"2. WARNING in X.java (at line 14)\n" +
45128 			"	return (I2<T, U>) i;\n" +
45129 			"	       ^^^^^^^^^^^^\n" +
45130 			"Type safety: Unchecked cast from I1<T> to I2<T,U>\n" +
45131 			"----------\n");
45132 }
45133 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=210425 - variation
45134 public void test1285() {
45135 	this.runNegativeTest(
45136 			new String[] {
45137 					"X.java",
45138 					"public class X {\n" +
45139 					"	public static void main(String[] args) {\n" +
45140 					"		Thread th = Thread.currentThread();\n" +
45141 					"		Z<String, Thread> z1 = new Z<String, Thread>(th);\n" +
45142 					"		Z<String, Exception> z2 = new Z<String, Exception>(new Exception());\n" +
45143 					"		Y<String, Thread> y = new Y<String, Thread>() {};\n" +
45144 					"		y.foo(z1).get().getThreadGroup();\n" +
45145 					"		y.foo(z2).get().getThreadGroup();\n" +
45146 					"	}\n" +
45147 					"}\n" +
45148 					"abstract class Y<T, U> {\n" +
45149 					"	I2<T, U> foo(I1<T,U> i) {\n" +
45150 					"		return (I2<T, U>) i;\n" +
45151 					"	}\n" +
45152 					"}\n" +
45153 					"interface I1<T, U> {\n" +
45154 					"}\n" +
45155 					"interface I2<T, U> extends I1<T,U> {\n" +
45156 					"	U get();\n" +
45157 					"}\n" +
45158 					"class Z<V, W> implements I2<V, W> {\n" +
45159 					"	W w;\n" +
45160 					"	Z(W w) {\n" +
45161 					"		this.w = w;\n" +
45162 					"	}\n" +
45163 					"	public W get() {\n" +
45164 					"		return this.w;\n" +
45165 					"	}\n" +
45166 					"}\n", // =================
45167 			},
45168 			"----------\n" +
45169 			"1. ERROR in X.java (at line 8)\n" +
45170 			"	y.foo(z2).get().getThreadGroup();\n" +
45171 			"	  ^^^\n" +
45172 			"The method foo(I1<String,Thread>) in the type Y<String,Thread> is not applicable for the arguments (Z<String,Exception>)\n" +
45173 			"----------\n");
45174 }
45175 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=210425 - variation
45176 public void test1286() {
45177 	this.runNegativeTest(
45178 			new String[] {
45179 					"X.java",
45180 					"public class X {\n" +
45181 					"	public static void main(String[] args) {\n" +
45182 					"		Thread th = Thread.currentThread();\n" +
45183 					"		Z<String, Thread> z1 = new Z<String, Thread>(th);\n" +
45184 					"		Z<String, Exception> z2 = new Z<String, Exception>(new Exception());\n" +
45185 					"		Y<String, Thread> y = new Y<String, Thread>() {};\n" +
45186 					"		y.foo(z1).get().getThreadGroup();\n" +
45187 					"		y.foo(z2).get().getThreadGroup(); // heap pollution: we get a CCE because we return a U2\n" +
45188 					"		Zork z;\n" +
45189 					"	}\n" +
45190 					"}\n" +
45191 					"abstract class Y<T, U> {\n" +
45192 					"	I2<U> foo(I1 i) {\n" +
45193 					"		return (I2<U>) i;\n" +
45194 					"	}\n" +
45195 					"}\n" +
45196 					"interface I1 {}\n" +
45197 					"interface I2<U> extends I1 {\n" +
45198 					"	U get();\n" +
45199 					"}\n" +
45200 					"class Z<V, W> implements I2<W> {\n" +
45201 					"	W w;\n" +
45202 					"	Z(W w) {\n" +
45203 					"		this.w = w;\n" +
45204 					"	}\n" +
45205 					"	public W get() {\n" +
45206 					"		return this.w;\n" +
45207 					"	}\n" +
45208 					"}\n", // =================
45209 			},
45210 			"----------\n" +
45211 			"1. ERROR in X.java (at line 9)\n" +
45212 			"	Zork z;\n" +
45213 			"	^^^^\n" +
45214 			"Zork cannot be resolved to a type\n" +
45215 			"----------\n" +
45216 			"2. WARNING in X.java (at line 14)\n" +
45217 			"	return (I2<U>) i;\n" +
45218 			"	       ^^^^^^^^^\n" +
45219 			"Type safety: Unchecked cast from I1 to I2<U>\n" +
45220 			"----------\n");
45221 }
45222 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=210425 - variation
45223 public void test1287() {
45224 	this.runNegativeTest(
45225 			new String[] {
45226 					"X.java",
45227 					"public class X {\n" +
45228 					"	public static void main(String[] args) {\n" +
45229 					"		Thread th = Thread.currentThread();\n" +
45230 					"		Z<String, Thread> z1 = new Z<String, Thread>(th);\n" +
45231 					"		Z<String, Exception> z2 = new Z<String, Exception>(new Exception());\n" +
45232 					"		Y<String, Thread> y = new Y<String, Thread>() {};\n" +
45233 					"		y.foo(z1).get().getThreadGroup();\n" +
45234 					"		y.foo(z2).get().getThreadGroup(); // heap pollution: we get a CCE because we return a U2\n" +
45235 					"		Zork z;\n" +
45236 					"	}\n" +
45237 					"}\n" +
45238 					"abstract class Y<T, U> {\n" +
45239 					"	I2<T,U> foo(I1<T,T> i) {\n" +
45240 					"		return (I2<T,U>) i;\n" +
45241 					"	}\n" +
45242 					"}\n" +
45243 					"interface I1<D,E> {}\n" +
45244 					"interface I2<F,G> extends I1<F,F> {\n" +
45245 					"	G get();\n" +
45246 					"}\n" +
45247 					"class Z<V, W> implements I2<V,W> {\n" +
45248 					"	W w;\n" +
45249 					"	Z(W w) {\n" +
45250 					"		this.w = w;\n" +
45251 					"	}\n" +
45252 					"	public W get() {\n" +
45253 					"		return this.w;\n" +
45254 					"	}\n" +
45255 					"}\n", // =================
45256 			},
45257 			"----------\n" +
45258 			"1. ERROR in X.java (at line 9)\n" +
45259 			"	Zork z;\n" +
45260 			"	^^^^\n" +
45261 			"Zork cannot be resolved to a type\n" +
45262 			"----------\n" +
45263 			"2. WARNING in X.java (at line 14)\n" +
45264 			"	return (I2<T,U>) i;\n" +
45265 			"	       ^^^^^^^^^^^\n" +
45266 			"Type safety: Unchecked cast from I1<T,T> to I2<T,U>\n" +
45267 			"----------\n");
45268 }
45269 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=210425 - variation
45270 public void test1288() {
45271 	this.runNegativeTest(
45272 			new String[] {
45273 					"X.java",
45274 					"import java.util.Map;\n" +
45275 					"public class X {\n" +
45276 					"	public static void main(String[] args) {\n" +
45277 					"		Thread th = Thread.currentThread();\n" +
45278 					"		Z<String, Thread> z1 = new Z<String, Thread>(th);\n" +
45279 					"		Z<String, Exception> z2 = new Z<String, Exception>(new Exception());\n" +
45280 					"		Y<String, Thread> y = new Y<String, Thread>() {};\n" +
45281 					"		y.foo(z1).get().getThreadGroup();\n" +
45282 					"		y.foo(z2).get().getThreadGroup(); // heap pollution: we get a CCE because we return a U2\n" +
45283 					"		Zork z;\n" +
45284 					"	}\n" +
45285 					"}\n" +
45286 					"abstract class Y<T, U> {\n" +
45287 					"	I2<T,U> foo(I1<Map<T,T>> i) {\n" +
45288 					"		return (I2<T,U>) i;\n" +
45289 					"	}\n" +
45290 					"}\n" +
45291 					"interface I1<D> {}\n" +
45292 					"interface I2<F,G> extends I1<Map<F,F>> {\n" +
45293 					"	G get();\n" +
45294 					"}\n" +
45295 					"class Z<V, W> implements I2<V,W> {\n" +
45296 					"	W w;\n" +
45297 					"	Z(W w) {\n" +
45298 					"		this.w = w;\n" +
45299 					"	}\n" +
45300 					"	public W get() {\n" +
45301 					"		return this.w;\n" +
45302 					"	}\n" +
45303 					"}", // =================
45304 			},
45305 			"----------\n" +
45306 			"1. ERROR in X.java (at line 10)\n" +
45307 			"	Zork z;\n" +
45308 			"	^^^^\n" +
45309 			"Zork cannot be resolved to a type\n" +
45310 			"----------\n" +
45311 			"2. WARNING in X.java (at line 15)\n" +
45312 			"	return (I2<T,U>) i;\n" +
45313 			"	       ^^^^^^^^^^^\n" +
45314 			"Type safety: Unchecked cast from I1<Map<T,T>> to I2<T,U>\n" +
45315 			"----------\n");
45316 }
45317 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=210425 - variation
45318 public void test1289() {
45319 	this.runNegativeTest(
45320 			new String[] {
45321 					"X.java",
45322 					"import java.util.Map;\n" +
45323 					"public class X {\n" +
45324 					"	public static void main(String[] args) {\n" +
45325 					"		Thread th = Thread.currentThread();\n" +
45326 					"		Z<String, Thread> z1 = new Z<String, Thread>(th);\n" +
45327 					"		Z<String, Exception> z2 = new Z<String, Exception>(new Exception());\n" +
45328 					"		Y<String, Thread> y = new Y<String, Thread>() {};\n" +
45329 					"		y.foo(z1).get().getThreadGroup();\n" +
45330 					"		y.foo(z2).get().getThreadGroup(); // heap pollution: we get a CCE because we return a U2\n" +
45331 					"		Zork z;\n" +
45332 					"	}\n" +
45333 					"}\n" +
45334 					"abstract class Y<T, U> {\n" +
45335 					"	I2<T,U> foo(I1<Map<T,T>> i) {\n" +
45336 					"		return (I2<T,U>) i;\n" +
45337 					"	}\n" +
45338 					"}\n" +
45339 					"interface I1<D> {}\n" +
45340 					"interface I2<F,G> extends I1<Map<F,G>> {\n" +
45341 					"	G get();\n" +
45342 					"}\n" +
45343 					"class Z<V, W> implements I2<V,W> {\n" +
45344 					"	W w;\n" +
45345 					"	Z(W w) {\n" +
45346 					"		this.w = w;\n" +
45347 					"	}\n" +
45348 					"	public W get() {\n" +
45349 					"		return this.w;\n" +
45350 					"	}\n" +
45351 					"}", // =================
45352 			},
45353 			"----------\n" +
45354 			"1. ERROR in X.java (at line 8)\n" +
45355 			"	y.foo(z1).get().getThreadGroup();\n" +
45356 			"	  ^^^\n" +
45357 			"The method foo(I1<Map<String,String>>) in the type Y<String,Thread> is not applicable for the arguments (Z<String,Thread>)\n" +
45358 			"----------\n" +
45359 			"2. ERROR in X.java (at line 9)\n" +
45360 			"	y.foo(z2).get().getThreadGroup(); // heap pollution: we get a CCE because we return a U2\n" +
45361 			"	  ^^^\n" +
45362 			"The method foo(I1<Map<String,String>>) in the type Y<String,Thread> is not applicable for the arguments (Z<String,Exception>)\n" +
45363 			"----------\n" +
45364 			"3. ERROR in X.java (at line 10)\n" +
45365 			"	Zork z;\n" +
45366 			"	^^^^\n" +
45367 			"Zork cannot be resolved to a type\n" +
45368 			"----------\n" +
45369 			"4. ERROR in X.java (at line 15)\n" +
45370 			"	return (I2<T,U>) i;\n" +
45371 			"	       ^^^^^^^^^^^\n" +
45372 			"Cannot cast from I1<Map<T,T>> to I2<T,U>\n" +
45373 			"----------\n");
45374 }
45375 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=210425 - variation
45376 public void test1290() {
45377 	this.runNegativeTest(
45378 			new String[] {
45379 					"X.java",
45380 					"public class X <T, U> {\n" +
45381 					"  K<T> foo(I<T> i) {\n" +
45382 					"        return (K<T>) i;\n" +
45383 					"  }\n" +
45384 					"  Zork z;\n" +
45385 					"}\n" +
45386 					"interface I<T> {\n" +
45387 					"}\n" +
45388 					"interface J<T, U> extends I<T> {\n" +
45389 					"}\n" +
45390 					"interface K<T> extends J<T, String> {\n" +
45391 					"}", // =================
45392 			},
45393 			"----------\n" +
45394 			"1. ERROR in X.java (at line 5)\n" +
45395 			"	Zork z;\n" +
45396 			"	^^^^\n" +
45397 			"Zork cannot be resolved to a type\n" +
45398 			"----------\n");
45399 }
45400 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=218677
45401 // FAIL ERRMSG
45402 public void test1291() {
45403 	if (this.complianceLevel >= ClassFileConstants.JDK1_8)
45404 		return;
45405 	this.runNegativeTest(
45406 			new String[] {
45407 					"X.java",
45408 					"import java.util.ArrayList;\n" +
45409 					"import java.util.List;\n" +
45410 					"public class X {\n" +
45411 					"    public static <D, E extends D> List<D> moreGeneric(List<E> list) {\n" +
45412 					"        List<D> result = new ArrayList<D>();\n" +
45413 					"        result.addAll( list );\n" +
45414 					"        return result;\n" +
45415 					"    }\n" +
45416 					"    class A {}\n" +
45417 					"    class B extends A {}\n" +
45418 					"    class C extends B {}\n" +
45419 					"    public static void main( String[] args ) {\n" +
45420 					"        List<B> b = new ArrayList<B>();\n" +
45421 					"        List<A> a = moreGeneric(b);\n" +
45422 					"        List<C> c = moreGeneric(b);\n" +
45423 					"    }\n" +
45424 					"}\n", // =================
45425 			},
45426 			"----------\n" +
45427 			"1. ERROR in X.java (at line 15)\n" +
45428 			"	List<C> c = moreGeneric(b);\n" +
45429 			"	            ^^^^^^^^^^^\n" +
45430 			"Bound mismatch: The generic method moreGeneric(List<E>) of type X is not applicable for the arguments (List<X.B>). The inferred type X.B is not a valid substitute for the bounded parameter <E extends D>\n" +
45431 			"----------\n",
45432 			JavacTestOptions.EclipseJustification.EclipseBug218677);
45433 }
45434 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=218677 - variation
45435 // FAIL ERRMSG
45436 public void test1292() {
45437 	if (this.complianceLevel >= ClassFileConstants.JDK1_8)
45438 		return;
45439 	this.runNegativeTest(
45440 			new String[] {
45441 					"X.java",
45442 					"import java.util.ArrayList;\n" +
45443 					"import java.util.List;\n" +
45444 					"public class X {\n" +
45445 					"    public static <D, E extends D> List<E> moreSpecific(List<D> list) {\n" +
45446 					"        List<E> result = new ArrayList<E>();\n" +
45447 					"        result.addAll( (List<?>)list );\n" +
45448 					"        return result;\n" +
45449 					"    }\n" +
45450 					"    class A {}\n" +
45451 					"    class B extends A {}\n" +
45452 					"    class C extends B {}\n" +
45453 					"    public static void main( String[] args ) {\n" +
45454 					"        List<B> b = new ArrayList<B>();\n" +
45455 					"        List<A> a = moreSpecific(b);\n" +
45456 					"        List<C> c = moreSpecific(b);\n" +
45457 					"    }\n" +
45458 					"}\n", // =================
45459 			},
45460 			this.complianceLevel < ClassFileConstants.JDK1_8 ?
45461 			"----------\n" +
45462 			"1. ERROR in X.java (at line 6)\n" +
45463 			"	result.addAll( (List<?>)list );\n" +
45464 			"	       ^^^^^^\n" +
45465 			"The method addAll(Collection<? extends E>) in the type List<E> is not applicable for the arguments (List<capture#1-of ?>)\n" +
45466 			"----------\n" +
45467 			"2. ERROR in X.java (at line 14)\n" +
45468 			"	List<A> a = moreSpecific(b);\n" +
45469 			"	            ^^^^^^^^^^^^\n" +
45470 			"Bound mismatch: The generic method moreSpecific(List<D>) of type X is not applicable for the arguments (List<X.B>). The inferred type X.A is not a valid substitute for the bounded parameter <E extends D>\n" +
45471 			"----------\n" :
45472 				"----------\n" +
45473 				"1. ERROR in X.java (at line 6)\n" +
45474 				"	result.addAll( (List<?>)list );\n" +
45475 				"	       ^^^^^^\n" +
45476 				"The method addAll(Collection<? extends E>) in the type List<E> is not applicable for the arguments (List<capture#1-of ?>)\n" +
45477 				"----------\n" +
45478 				"2. ERROR in X.java (at line 14)\n" +
45479 				"	List<A> a = moreSpecific(b);\n" +
45480 				"	            ^^^^^^^^^^^^^^^\n" +
45481 				"Type mismatch: cannot convert from List<X.B> to List<X.A>\n" +
45482 				"----------\n");
45483 }
45484 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=220111
45485 public void test1293() {
45486 	this.runConformTest(
45487 			new String[] {
45488 					"X.java",
45489 					"public class X<Token, NodeType> {\n" +
45490 					"    class Table {\n" +
45491 					"        State<Token>   s;\n" +
45492 					"        Table() {\n" +
45493 					"            this.s = new State<Token>();\n" +
45494 					"        }\n" +
45495 					"		class State<T> {\n" +
45496 					"		}\n" +
45497 					"    }\n" +
45498 					"}\n", // =================
45499 			},
45500 			"");
45501 }
45502 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=220111 - variation
45503 public void test1294() {
45504 	this.runConformTest(
45505 			new String[] {
45506 					"X.java",
45507 					"public class X<Token, NodeType> {\n" +
45508 					"    static class Table {\n" +
45509 					"        State<String>   s;\n" +
45510 					"        Table() {\n" +
45511 					"            this.s = new State<String>();\n" +
45512 					"        }\n" +
45513 					"		class State<T> {\n" +
45514 					"		}\n" +
45515 					"    }\n" +
45516 					"}\n", // =================
45517 			},
45518 			"");
45519 }
45520 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=97303 - variation
45521 public void test1295() {
45522 	Map options = getCompilerOptions();
45523 	options.put(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION, JavaCore.IGNORE);
45524 	this.runNegativeTest(
45525 			new String[] {
45526 					"X.java",
45527 					"class Deejay {\n" +
45528 					"	class Counter<T> {}\n" +
45529 					"\n" +
45530 					"	Deejay.Counter<Song> songCounter = new Deejay.Counter<Song>();\n" +
45531 					"	Deejay.Counter<Genre> genreCounter = new Deejay.Counter<Genre>();\n" +
45532 					"\n" +
45533 					"	java.util.List<Counter<?>> list1 = java.util.Arrays.asList(songCounter, genreCounter);\n" +
45534 					"	java.util.List<Counter<? extends Object>> list2 = java.util.Arrays.asList(songCounter, genreCounter);\n" +
45535 					"	java.util.List<Counter<?>> list3 = java.util.Arrays.<Deejay.Counter<?>>asList(songCounter, genreCounter);\n" +
45536 					"	java.util.List<Counter<?>> list4 = java.util.Arrays.asList(new Deejay.Counter<?>[] {songCounter, genreCounter});\n" +
45537 					"	java.util.List<Counter<? extends String>> list5 = java.util.Arrays.asList(songCounter, genreCounter);\n" +
45538 					"}\n" +
45539 					"class Genre {}\n" +
45540 					"class Song {}\n", // =================
45541 			},
45542 			"----------\n" +
45543 			"1. ERROR in X.java (at line 11)\n" +
45544 			"	java.util.List<Counter<? extends String>> list5 = java.util.Arrays.asList(songCounter, genreCounter);\n" +
45545 			"	                                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
45546 			"Type mismatch: cannot convert from List<Deejay.Counter<? extends Object>> to List<Deejay.Counter<? extends String>>\n" +
45547 			"----------\n",
45548 			null,
45549 			true,
45550 			options);
45551 }
45552 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=220111 - variation
45553 public void test1296() {
45554 	this.runConformTest(
45555 			new String[] {
45556 					"X.java",
45557 					"public class X<Token, NodeType> {\n" +
45558 					"	class Table {\n" +
45559 					"		Table.State<Token> s;\n" +
45560 					"\n" +
45561 					"		Table() {\n" +
45562 					"			this.s = new Table.State<Token>();\n" +
45563 					"		}\n" +
45564 					"\n" +
45565 					"		class State<T> {\n" +
45566 					"		}\n" +
45567 					"	}\n" +
45568 					"}\n", // =================
45569 			},
45570 			"");
45571 }
45572 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=220111 - variation
45573 public void test1297() {
45574 	this.runConformTest(
45575 			new String[] {
45576 					"X.java",
45577 					"public class X<Token, NodeType> {\n" +
45578 					"	class Table {\n" +
45579 					"		X<Token, NodeType>.Table.State<Token> s;\n" +
45580 					"\n" +
45581 					"		Table() {\n" +
45582 					"			this.s = new X<Token, NodeType>().new Table().new State<Token>();\n" +
45583 					"		}\n" +
45584 					"\n" +
45585 					"		class State<T> {\n" +
45586 					"		}\n" +
45587 					"	}\n" +
45588 					"}\n", // =================
45589 			},
45590 			"");
45591 }
45592 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=220111 - variation
45593 public void test1298() {
45594 	this.runConformTest(
45595 			new String[] {
45596 					"X.java",
45597 					"public class X<Token, NodeType> {\n" +
45598 					"	static class Table {\n" +
45599 					"		X.Table.State<String> s;\n" +
45600 					"\n" +
45601 					"		Table() {\n" +
45602 					"			this.s = new X.Table().new State<String>();\n" +
45603 					"		}\n" +
45604 					"\n" +
45605 					"		class State<T> {\n" +
45606 					"		}\n" +
45607 					"	}\n" +
45608 					"}\n", // =================
45609 			},
45610 			"");
45611 }
45612 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=220361
45613 public void test1299() {
45614 	this.runConformTest(
45615 			new String[] {
45616 					"X.java",
45617 					"public class X<U, V> {\n" +
45618 					"	static class Table {\n" +
45619 					"		X.Table.State<String> s;\n" +
45620 					"\n" +
45621 					"		Table() {\n" +
45622 					"			this.s = new X.Table.State<String>();\n" +
45623 					"		}\n" +
45624 					"\n" +
45625 					"		static class State<T> {\n" +
45626 					"		}\n" +
45627 					"	}\n" +
45628 					"}\n", // =================
45629 			},
45630 			"");
45631 }
45632 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=220361 - variation
45633 public void test1300() {
45634 	this.runConformTest(
45635 			new String[] {
45636 					"X.java",
45637 					"public class X<U, V> {\n" +
45638 					"	static class Table {\n" +
45639 					"		State<String> s;\n" +
45640 					"\n" +
45641 					"		Table() {\n" +
45642 					"			this.s = new State<String>();\n" +
45643 					"		}\n" +
45644 					"\n" +
45645 					"		static class State<T> {\n" +
45646 					"		}\n" +
45647 					"	}\n" +
45648 					"}\n", // =================
45649 			},
45650 			"");
45651 }
45652 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=220361 - variation
45653 public void test1301() {
45654 	this.runConformTest(
45655 			new String[] {
45656 					"X.java",
45657 					"public class X<U, V> {\n" +
45658 					"	static class Table {\n" +
45659 					"		Table.State<String> s;\n" +
45660 					"\n" +
45661 					"		Table() {\n" +
45662 					"			this.s = new Table.State<String>();\n" +
45663 					"		}\n" +
45664 					"\n" +
45665 					"		static class State<T> {\n" +
45666 					"		}\n" +
45667 					"	}\n" +
45668 					"}\n", // =================
45669 			},
45670 			"");
45671 }
45672 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=220361 - variation
45673 public void test1302() {
45674 	runConformTest(
45675 		true,
45676 		new String[] {
45677 			"EMap.java",
45678 			"import java.util.ArrayList;\n" +
45679 			"import java.util.Map;\n" +
45680 			"\n" +
45681 			"public abstract class EMap<A, B> implements Map<A, B> {\n" +
45682 			"  public abstract static class Unsettable<K, V> extends EMap<K, V> {\n" +
45683 			"    protected class UnsettableEList<E extends Object & Entry<K, V>> extends EList<E> {\n" +
45684 			"    }\n" +
45685 			"  }\n" +
45686 			"  protected class EList<E extends Object & Entry<A,B>> extends ArrayList<E>{\n" +
45687 			"  }\n" +
45688 			"}\n", // =================
45689 		},
45690 		null,
45691 		"",
45692 		null,
45693 		JavacTestOptions.EclipseHasABug.EclipseBug159851);
45694 }
45695 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=219625
45696 public void test1303() {
45697 	this.runConformTest(
45698 			new String[] {
45699 					"X.java",
45700 					"public class X {\n" +
45701 					"  interface Foo<T> {\n" +
45702 					"    T getValue();\n" +
45703 					"    void doSomething(T o);\n" +
45704 					"  }\n" +
45705 					"  public static abstract class AbstractFoo<T> implements Foo<T> {\n" +
45706 					"    /**\n" +
45707 					"     * If this is removed ConcreteFoo no longer compiles.\n" +
45708 					"     */\n" +
45709 					"    public void doSomething(final String o) {\n" +
45710 					"    }\n" +
45711 					"  }\n" +
45712 					"  public static final class ConcreteFoo extends AbstractFoo<String> {\n" +
45713 					"    public String getValue() {\n" +
45714 					"      return \"I am a string\";\n" +
45715 					"    }\n" +
45716 					"  }\n" +
45717 					"  /**\n" +
45718 					"   * We lose the type infomation here so try but fail to call the doSomething(Object) method.\n" +
45719 					"   */\n" +
45720 					"  private static <T> void feedFoosValueIntoFoo(final Foo<T> foo) {\n" +
45721 					"    foo.doSomething(foo.getValue());\n" +
45722 					"  }\n" +
45723 					"  private static void testTypedString() {\n" +
45724 					"    final ConcreteFoo foo = new ConcreteFoo();\n" +
45725 					"    foo.doSomething(foo.getValue());\n" +
45726 					"  }\n" +
45727 					"  private static void testGenericString() {\n" +
45728 					"    feedFoosValueIntoFoo(new ConcreteFoo());\n" +
45729 					"  }\n" +
45730 					"  public static void main(String[] args) {\n" +
45731 					"    testTypedString();\n" +
45732 					"    testGenericString();\n" +
45733 					"    System.out.println(\"SUCCESS\");\n" +
45734 					"  }\n" +
45735 					"}\n", // =================
45736 			},
45737 			"SUCCESS");
45738 }
45739 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=219625 - variation
45740 public void test1304() {
45741 	this.runConformTest(
45742 			new String[] {
45743 					"X.java",
45744 					"interface Foo<T> {\n" +
45745 					"	T get();\n" +
45746 					"	void doSomething(T t);\n" +
45747 					"}\n" +
45748 					"abstract class XSuper implements Foo<String> {\n" +
45749 					"	public void doSomething(String s) { System.out.println(s); }\n" +
45750 					"}\n" +
45751 					"public class X extends XSuper {\n" +
45752 					"	public String get() { return \"SUCCESS\"; }\n" +
45753 					"	static <U> void doIt(Foo<U> f) {\n" +
45754 					"		f.doSomething(f.get());\n" +
45755 					"	}\n" +
45756 					"	public static void main(String[] args) {\n" +
45757 					"		doIt(new X());\n" +
45758 					"	}\n" +
45759 					"}\n", // =================
45760 			},
45761 			"SUCCESS");
45762 }
45763 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=223334
45764 public void test1305() {
45765 	this.runConformTest(
45766 			new String[] {
45767 					"bug/ConflictManager.java",// =================
45768 					"package bug;\n" +
45769 					"import java.util.*;\n" +
45770 					"public class ConflictManager<T> {\n" +
45771 					"	public List<Map.Entry<Integer, ? extends Collection<T>>> getConflictsSortedBySize() {\n" +
45772 					"		return null;\n" +
45773 					"	}\n" +
45774 					"}\n",
45775 					"bug/LayoutOrganizable.java",// =================
45776 					"package bug;\n" +
45777 					"public class LayoutOrganizable<T> {\n" +
45778 					"	private T t;\n" +
45779 					"\n" +
45780 					"	public LayoutOrganizable(T t) {\n" +
45781 					"		this.t = t;\n" +
45782 					"\n" +
45783 					"	}\n" +
45784 					"}\n",
45785 					"bug/LayoutOrganizer.java",
45786 					"package bug;\n" +
45787 					"import java.util.*;\n" +
45788 					"public class LayoutOrganizer<T> {\n" +
45789 					"	ConflictManager<LayoutOrganizable<T>> conflictManager = new ConflictManager<LayoutOrganizable<T>>();\n" +
45790 					"	private boolean optimizeEqual() {\n" +
45791 					"		List<Map.Entry<Integer, ? extends Collection<LayoutOrganizable<T>>>> list;\n" +
45792 					"		ListIterator<Map.Entry<Integer, ? extends Collection<LayoutOrganizable<T>>>> i;\n" +
45793 					"		// create sorted list of pairs\n" +
45794 					"		// (#conflicts, list of LayoutOrganizable sharing this #conflicts)\n" +
45795 					"		// Here is the problem...\n" +
45796 					"		list = conflictManager.getConflictsSortedBySize();\n" +
45797 					"		return null == list;\n" +
45798 					"	}\n" +
45799 					"}\n", // =================
45800 			},
45801 			"");
45802 	this.runConformTest(
45803 			new String[] {
45804 					"bug/LayoutOrganizer.java",
45805 					"package bug;\n" +
45806 					"import java.util.*;\n" +
45807 					"public class LayoutOrganizer<T> {\n" +
45808 					"	ConflictManager<LayoutOrganizable<T>> conflictManager = new ConflictManager<LayoutOrganizable<T>>();\n" +
45809 					"	private boolean optimizeEqual() {\n" +
45810 					"		List<Map.Entry<Integer, ? extends Collection<LayoutOrganizable<T>>>> list;\n" +
45811 					"		ListIterator<Map.Entry<Integer, ? extends Collection<LayoutOrganizable<T>>>> i;\n" +
45812 					"		// create sorted list of pairs\n" +
45813 					"		// (#conflicts, list of LayoutOrganizable sharing this #conflicts)\n" +
45814 					"		// Here is the problem...\n" +
45815 					"		list = conflictManager.getConflictsSortedBySize();\n" +
45816 					"		return null == list;\n" +
45817 					"	}\n" +
45818 					"}\n", // =================
45819 			},
45820 			"",
45821 			null,
45822 			false,
45823 			null);
45824 }
45825 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=106744 - variation
45826 public void test1306() {
45827 	runNegativeTest(
45828 		// test directory preparation
45829 		new String[] { /* test files */
45830 				"X.java",
45831 				"import java.lang.reflect.Constructor;\n" +
45832 				"import java.lang.annotation.Documented;\n" +
45833 				"import java.util.List;\n" +
45834 				"\n" +
45835 				"public class X {\n" +
45836 				"    Constructor c = null;\n" +
45837 				"    Documented d = c.getAnnotation(Documented.class);\n" +
45838 				"}\n", // =================
45839 		},
45840 		// compiler results
45841 		"----------\n" + /* expected compiler log */
45842 		"1. WARNING in X.java (at line 6)\n" +
45843 		"	Constructor c = null;\n" +
45844 		"	^^^^^^^^^^^\n" +
45845 		"Constructor is a raw type. References to generic type Constructor<T> should be parameterized\n" +
45846 		"----------\n" +
45847 		"2. WARNING in X.java (at line 7)\n" +
45848 		"	Documented d = c.getAnnotation(Documented.class);\n" +
45849 		"	               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
45850 		"Type safety: The method getAnnotation(Class) belongs to the raw type Constructor. References to generic type Constructor<T> should be parameterized\n" +
45851 		"----------\n" +
45852 		"3. ERROR in X.java (at line 7)\n" +
45853 		"	Documented d = c.getAnnotation(Documented.class);\n" +
45854 		"	               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
45855 		"Type mismatch: cannot convert from Annotation to Documented\n" +
45856 		"----------\n",
45857 		// javac options
45858 		JavacTestOptions.JavacHasABug.JavacBug6400189 /* javac test options */);
45859 }
45860 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=106744 - variation
45861 public void test1307() {
45862 	this.runNegativeTest(
45863 			new String[] {
45864 					"Y.java",
45865 					"import java.util.List;\n" +
45866 					"public class Y<T> {\n" +
45867 					"	Zork z;\n" +
45868 					"	Y<T> itself() { return this; }\n" +
45869 					"	List<String> list() { return null; }\n" +
45870 					"	Y<String> someY() { return null; }\n" +
45871 					"}\n" +
45872 					"class Z {\n" +
45873 					"	void foo(Y y) {\n" +
45874 					"		Z z = y.itself(); // Y cannot be converted to Z (itself() return type got erased)\n" +
45875 					"		List<String> l = y.list(); // unchecked conversion from List to List<String>\n" +
45876 					"		Y<String> ys = y.someY(); // unchecked conversion from Y to Y<String>\n" +
45877 					"	}\n" +
45878 					"}\n", // =================
45879 			},
45880 			"----------\n" +
45881 			"1. ERROR in Y.java (at line 3)\n" +
45882 			"	Zork z;\n" +
45883 			"	^^^^\n" +
45884 			"Zork cannot be resolved to a type\n" +
45885 			"----------\n" +
45886 			"2. WARNING in Y.java (at line 9)\n" +
45887 			"	void foo(Y y) {\n" +
45888 			"	         ^\n" +
45889 			"Y is a raw type. References to generic type Y<T> should be parameterized\n" +
45890 			"----------\n" +
45891 			"3. ERROR in Y.java (at line 10)\n" +
45892 			"	Z z = y.itself(); // Y cannot be converted to Z (itself() return type got erased)\n" +
45893 			"	      ^^^^^^^^^^\n" +
45894 			"Type mismatch: cannot convert from Y to Z\n" +
45895 			"----------\n" +
45896 			"4. WARNING in Y.java (at line 11)\n" +
45897 			"	List<String> l = y.list(); // unchecked conversion from List to List<String>\n" +
45898 			"	                 ^^^^^^^^\n" +
45899 			"Type safety: The expression of type List needs unchecked conversion to conform to List<String>\n" +
45900 			"----------\n" +
45901 			"5. WARNING in Y.java (at line 12)\n" +
45902 			"	Y<String> ys = y.someY(); // unchecked conversion from Y to Y<String>\n" +
45903 			"	               ^^^^^^^^^\n" +
45904 			"Type safety: The expression of type Y needs unchecked conversion to conform to Y<String>\n" +
45905 			"----------\n");
45906 }
45907 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=106744 - variation
45908 public void test1308() {
45909 	this.runNegativeTest(
45910 			new String[] {
45911 					"Y.java",
45912 					"@interface MyAnnotation {\n" +
45913 					"}\n" +
45914 					"class MyAccessibleObject {\n" +
45915 					"	<T extends java.lang.annotation.Annotation> Object getAnnotation(Class<T> c) {\n" +
45916 					"		return null;\n" +
45917 					"	}\n" +
45918 					"}\n" +
45919 					"class MyConstructor<V> extends MyAccessibleObject {\n" +
45920 					"	<T extends java.lang.annotation.Annotation> T getAnnotation(Class<T> c) {\n" +
45921 					"		return null;\n" +
45922 					"	}\n" +
45923 					"}\n" +
45924 					"class X {\n" +
45925 					"	void bar1(java.lang.reflect.Constructor constr, Class<MyAnnotation> ann) {\n" +
45926 					"		MyAnnotation a = constr.getAnnotation(ann); // 1\n" +
45927 					"	}\n" +
45928 					"	void bar2(MyConstructor constr, Class<MyAnnotation> ann) {\n" +
45929 					"		MyAnnotation a = constr.getAnnotation(ann); // 2\n" +
45930 					"	}\n" +
45931 					"}\n", // =================
45932 			},
45933 			"----------\n" +
45934 			"1. WARNING in Y.java (at line 9)\n" +
45935 			"	<T extends java.lang.annotation.Annotation> T getAnnotation(Class<T> c) {\n" +
45936 			"	                                              ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
45937 			"The method getAnnotation(Class<T>) of type MyConstructor<V> should be tagged with @Override since it actually overrides a superclass method\n" +
45938 			"----------\n" +
45939 			"2. WARNING in Y.java (at line 14)\n" +
45940 			"	void bar1(java.lang.reflect.Constructor constr, Class<MyAnnotation> ann) {\n" +
45941 			"	          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
45942 			"Constructor is a raw type. References to generic type Constructor<T> should be parameterized\n" +
45943 			"----------\n" +
45944 			"3. WARNING in Y.java (at line 15)\n" +
45945 			"	MyAnnotation a = constr.getAnnotation(ann); // 1\n" +
45946 			"	                 ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
45947 			"Type safety: The method getAnnotation(Class) belongs to the raw type Constructor. References to generic type Constructor<T> should be parameterized\n" +
45948 			"----------\n" +
45949 			"4. ERROR in Y.java (at line 15)\n" +
45950 			"	MyAnnotation a = constr.getAnnotation(ann); // 1\n" +
45951 			"	                 ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
45952 			"Type mismatch: cannot convert from Annotation to MyAnnotation\n" +
45953 			"----------\n" +
45954 			"5. WARNING in Y.java (at line 17)\n" +
45955 			"	void bar2(MyConstructor constr, Class<MyAnnotation> ann) {\n" +
45956 			"	          ^^^^^^^^^^^^^\n" +
45957 			"MyConstructor is a raw type. References to generic type MyConstructor<V> should be parameterized\n" +
45958 			"----------\n" +
45959 			"6. WARNING in Y.java (at line 18)\n" +
45960 			"	MyAnnotation a = constr.getAnnotation(ann); // 2\n" +
45961 			"	                 ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
45962 			"Type safety: The method getAnnotation(Class) belongs to the raw type MyConstructor. References to generic type MyConstructor<V> should be parameterized\n" +
45963 			"----------\n" +
45964 			"7. ERROR in Y.java (at line 18)\n" +
45965 			"	MyAnnotation a = constr.getAnnotation(ann); // 2\n" +
45966 			"	                 ^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
45967 			"Type mismatch: cannot convert from Annotation to MyAnnotation\n" +
45968 			"----------\n");
45969 }
45970 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=226145
45971 public void test1309() {
45972 	this.runNegativeTest(
45973 			new String[] {
45974 					"EclipseGenericBug.java",
45975 					"public class EclipseGenericBug {\n" +
45976 					"  static class ParametricClass<T> {\n" +
45977 					"    static interface NonParametricInterface {\n" +
45978 					"      static interface ParametricInterface<S> {\n" +
45979 					"      }\n" +
45980 					"    }\n" +
45981 					"  }\n" +
45982 					"  \n" +
45983 					"  static class ParametricInstance<T> extends ParametricClass<T> {\n" +
45984 					"    NonParametricInterface.ParametricInterface<T> instance = null;\n" +
45985 					"  }\n" +
45986 					"}\n", // =================
45987 			},
45988 			"");
45989 }
45990 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=224855
45991 public void test1310() {
45992 	this.runNegativeTest(
45993 			new String[] {
45994 					"X.java",
45995 					"import java.util.Set;\n" +
45996 					"public class X {\n" +
45997 					"	public void testCast(){\n" +
45998 					"		Set<Class> classes = (Set<Class>)getClasses();\n" +
45999 					"	}\n" +
46000 					"	public Set<Class<? extends Object>> getClasses() {\n" +
46001 					"		return null;\n" +
46002 					"	}\n" +
46003 					"}\n", // =================
46004 			},
46005 			"----------\n" +
46006 			"1. WARNING in X.java (at line 4)\n" +
46007 			"	Set<Class> classes = (Set<Class>)getClasses();\n" +
46008 			"	    ^^^^^\n" +
46009 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
46010 			"----------\n" +
46011 			"2. ERROR in X.java (at line 4)\n" +
46012 			"	Set<Class> classes = (Set<Class>)getClasses();\n" +
46013 			"	                     ^^^^^^^^^^^^^^^^^^^^^^^^\n" +
46014 			"Cannot cast from Set<Class<? extends Object>> to Set<Class>\n" +
46015 			"----------\n" +
46016 			"3. WARNING in X.java (at line 4)\n" +
46017 			"	Set<Class> classes = (Set<Class>)getClasses();\n" +
46018 			"	                          ^^^^^\n" +
46019 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
46020 			"----------\n");
46021 }
46022 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=209149
46023 public void test1311() {
46024 	String[] test = new String[] {
46025 		"X.java",
46026 		"class X<E, D extends E> {}\n" +
46027 		"class Y<E extends D, D> {}"
46028 	};
46029 	if (this.complianceLevel < ClassFileConstants.JDK1_7) {
46030 		this.runNegativeTest(
46031 			test,
46032 			"----------\n" +
46033 			"1. ERROR in X.java (at line 2)\n" +
46034 			"	class Y<E extends D, D> {}\n" +
46035 			"	        ^\n" +
46036 			"Illegal forward reference to type parameter D\n" +
46037 			"----------\n");
46038 	} else {
46039 		this.runConformTest(test, "");
46040 	}
46041 }
46042 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=226535
46043 public void test1312() {
46044 	this.runConformTest(
46045 			new String[] {
46046 					"X.java",
46047 					" class Tuple3f<T extends Tuple3f<T>> {\n" +
46048 					"	private float x, y, z;\n" +
46049 					"	float getX() { return this.x; }\n" +
46050 					"	float getY() { return this.y; }\n" +
46051 					"	float getZ() { return this.z; }\n" +
46052 					"	void set(float newX, float newY, float newZ) {\n" +
46053 					"		this.x = newX;\n" +
46054 					"		this.y = newY;\n" +
46055 					"		this.z = newZ;\n" +
46056 					"	}\n" +
46057 					"	public T add(Tuple3f<?> t) {\n" +
46058 					"		this.set(this.getX() + t.getX(), this.getY() + t.getY(), this.getZ() + t.getZ());\n" +
46059 					"		@SuppressWarnings(\"unchecked\")\n" +
46060 					"		T result = (T) this;\n" +
46061 					"		return result;\n" +
46062 					"	}\n" +
46063 					"}\n" +
46064 					"\n" +
46065 					"class Vector3f extends Tuple3f<Vector3f> {\n" +
46066 					"	float magnitude () {\n" +
46067 					"		float x = this.getX(), y = this.getY(), z = this.getZ();\n" +
46068 					"		return (float) Math.sqrt((x*x) + (y*y) + (z*z));\n" +
46069 					"	}\n" +
46070 					"}\n" +
46071 					"\n" +
46072 					"public class X {\n" +
46073 					"	public static void main(String[] args) {\n" +
46074 					"		Vector3f v = new Vector3f();\n" +
46075 					"		float magn = v.add(v).add(v).magnitude();\n" +
46076 					"		System.out.println((int)magn);\n" +
46077 					"	}\n" +
46078 					"}\n", // =================
46079 			},
46080 			"0");
46081 }
46082 public void test1313() {
46083 	this.runNegativeTest(
46084 			new String[] {
46085 					"X.java",
46086 					"import java.util.*;\n" +
46087 					"\n" +
46088 					"public class X {\n" +
46089 					"	public static void main(String[] args) {\n" +
46090 					"		List<?>[] l1 = new List<?>[1];\n" +
46091 					"		List<?>[] l2 = new List<? extends Object>[2];\n" +
46092 					"		List<? extends Object> l3 = new List<?>[3];\n" +
46093 					"	}\n" +
46094 					"}\n", // =================
46095 			},
46096 			"----------\n" +
46097 			"1. ERROR in X.java (at line 6)\n" +
46098 			"	List<?>[] l2 = new List<? extends Object>[2];\n" +
46099 			"	               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
46100 			"Cannot create a generic array of List<? extends Object>\n" +
46101 			"----------\n" +
46102 			"2. ERROR in X.java (at line 7)\n" +
46103 			"	List<? extends Object> l3 = new List<?>[3];\n" +
46104 			"	                            ^^^^^^^^^^^^^^\n" +
46105 			"Type mismatch: cannot convert from List<?>[] to List<? extends Object>\n" +
46106 			"----------\n");
46107 }
46108 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=230070
46109 public void test1314() {
46110 	this.runNegativeTest(
46111 			new String[] {
46112 					"X.java",
46113 					"class B {\n" +
46114 					"}\n" +
46115 					"class Y<K> {\n" +
46116 					"	Y(K k) {\n" +
46117 					"		System.out.println(k);\n" +
46118 					"	}\n" +
46119 					"}\n" +
46120 					"public class X<K> {\n" +
46121 					"	static final B b = new B();\n" +
46122 					"	Object foo(K toKey) {\n" +
46123 					"		if (false) return new Y(b);//1\n" +
46124 					"		if (false) return new Y((K) b);//2\n" +
46125 					"		return new Y((K) (Object) b);//3\n" +
46126 					"	}\n" +
46127 					"	Object bar(K toKey) {\n" +
46128 					"		if (false) return new Y<K>(b);//4\n" +
46129 					"		if (false) return new Y<K>((K) b);//5\n" +
46130 					"		return new Y<K>((K) (Object) b);//6\n" +
46131 					"	}	\n" +
46132 					"}\n", // =================
46133 			},
46134 			"----------\n" +
46135 			"1. WARNING in X.java (at line 11)\n" +
46136 			"	if (false) return new Y(b);//1\n" +
46137 			"	           ^^^^^^^^^^^^^^^^\n" +
46138 			"Dead code\n" +
46139 			"----------\n" +
46140 			"2. WARNING in X.java (at line 11)\n" +
46141 			"	if (false) return new Y(b);//1\n" +
46142 			"	                  ^^^^^^^^\n" +
46143 			"Type safety: The constructor Y(Object) belongs to the raw type Y. References to generic type Y<K> should be parameterized\n" +
46144 			"----------\n" +
46145 			"3. WARNING in X.java (at line 11)\n" +
46146 			"	if (false) return new Y(b);//1\n" +
46147 			"	                      ^\n" +
46148 			"Y is a raw type. References to generic type Y<K> should be parameterized\n" +
46149 			"----------\n" +
46150 			"4. WARNING in X.java (at line 12)\n" +
46151 			"	if (false) return new Y((K) b);//2\n" +
46152 			"	           ^^^^^^^^^^^^^^^^^^^^\n" +
46153 			"Dead code\n" +
46154 			"----------\n" +
46155 			"5. WARNING in X.java (at line 12)\n" +
46156 			"	if (false) return new Y((K) b);//2\n" +
46157 			"	                  ^^^^^^^^^^^^\n" +
46158 			"Type safety: The constructor Y(Object) belongs to the raw type Y. References to generic type Y<K> should be parameterized\n" +
46159 			"----------\n" +
46160 			"6. WARNING in X.java (at line 12)\n" +
46161 			"	if (false) return new Y((K) b);//2\n" +
46162 			"	                      ^\n" +
46163 			"Y is a raw type. References to generic type Y<K> should be parameterized\n" +
46164 			"----------\n" +
46165 			"7. WARNING in X.java (at line 12)\n" +
46166 			"	if (false) return new Y((K) b);//2\n" +
46167 			"	                        ^^^^^\n" +
46168 			"Type safety: Unchecked cast from B to K\n" +
46169 			"----------\n" +
46170 			"8. WARNING in X.java (at line 12)\n" +
46171 			"	if (false) return new Y((K) b);//2\n" +
46172 			"	                        ^^^^^\n" +
46173 			"Unnecessary cast from B to K\n" +
46174 			"----------\n" +
46175 			"9. WARNING in X.java (at line 13)\n" +
46176 			"	return new Y((K) (Object) b);//3\n" +
46177 			"	       ^^^^^^^^^^^^^^^^^^^^^\n" +
46178 			"Type safety: The constructor Y(Object) belongs to the raw type Y. References to generic type Y<K> should be parameterized\n" +
46179 			"----------\n" +
46180 			"10. WARNING in X.java (at line 13)\n" +
46181 			"	return new Y((K) (Object) b);//3\n" +
46182 			"	           ^\n" +
46183 			"Y is a raw type. References to generic type Y<K> should be parameterized\n" +
46184 			"----------\n" +
46185 			"11. WARNING in X.java (at line 13)\n" +
46186 			"	return new Y((K) (Object) b);//3\n" +
46187 			"	             ^^^^^^^^^^^^^^\n" +
46188 			"Type safety: Unchecked cast from Object to K\n" +
46189 			"----------\n" +
46190 			"12. WARNING in X.java (at line 13)\n" +
46191 			"	return new Y((K) (Object) b);//3\n" +
46192 			"	             ^^^^^^^^^^^^^^\n" +
46193 			"Unnecessary cast from Object to K\n" +
46194 			"----------\n" +
46195 			"13. WARNING in X.java (at line 13)\n" +
46196 			"	return new Y((K) (Object) b);//3\n" +
46197 			"	                 ^^^^^^^^^^\n" +
46198 			"Unnecessary cast from B to Object\n" +
46199 			"----------\n" +
46200 			"14. ERROR in X.java (at line 16)\n" +
46201 			"	if (false) return new Y<K>(b);//4\n" +
46202 			"	                  ^^^^^^^^^^^\n" +
46203 			"The constructor Y<K>(B) is undefined\n" +
46204 			"----------\n" +
46205 			"15. WARNING in X.java (at line 17)\n" +
46206 			"	if (false) return new Y<K>((K) b);//5\n" +
46207 			"	                           ^^^^^\n" +
46208 			"Type safety: Unchecked cast from B to K\n" +
46209 			"----------\n" +
46210 			"16. WARNING in X.java (at line 18)\n" +
46211 			"	return new Y<K>((K) (Object) b);//6\n" +
46212 			"	                ^^^^^^^^^^^^^^\n" +
46213 			"Type safety: Unchecked cast from Object to K\n" +
46214 			"----------\n" +
46215 			"17. WARNING in X.java (at line 18)\n" +
46216 			"	return new Y<K>((K) (Object) b);//6\n" +
46217 			"	                    ^^^^^^^^^^\n" +
46218 			"Unnecessary cast from B to Object\n" +
46219 			"----------\n");
46220 }
46221 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=228291
46222 public void test1315() {
46223 	this.runNegativeTest(
46224 			new String[] {
46225 					"X.java",
46226 					"import java.util.*;\n" +
46227 					"\n" +
46228 					"public class X<T> extends Vector<Collection<T>> {\n" +
46229 					"	private static final long serialVersionUID = 1L;\n" +
46230 					"	public Vector<T> cast(List<T> in) {\n" +
46231 					"		return (Vector<T>) in;\n" +
46232 					"	}\n" +
46233 					"	public X<T> castSilly(Vector<Collection<T>> in) {\n" +
46234 					"		return (X<T>) in;\n" +
46235 					"	}\n" +
46236 					"	public static void main(String[] args) {\n" +
46237 					"		Zork z;\n" +
46238 					"	}\n" +
46239 					"}\n", // =================
46240 			},
46241 			"----------\n" +
46242 			"1. ERROR in X.java (at line 12)\n" +
46243 			"	Zork z;\n" +
46244 			"	^^^^\n" +
46245 			"Zork cannot be resolved to a type\n" +
46246 			"----------\n");
46247 }
46248 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=230466
46249 public void test1316() {
46250 	this.runConformTest(
46251 			new String[] {
46252 					"e/AbstractClass.java", // =================
46253 					"package e;\n" +
46254 					"public abstract class AbstractClass<E> {\n" +
46255 					"        protected abstract void method1();\n" +
46256 					"}\n",
46257 					"q/AbstractTest.java", // =================
46258 					"package q;\n" +
46259 					"import java.util.Map;\n" +
46260 					"import e.AbstractClass;\n" +
46261 					"public abstract class AbstractTest<T> {\n" +
46262 					"        protected class InnerClass extends AbstractClass<InnerClass>{\n" +
46263 					"                public void innerMethod() {\n" +
46264 					"                        System.out.println(\"innerMethod\");\n" +
46265 					"                }\n" +
46266 					"                @Override\n" +
46267 					"                protected void method1() {\n" +
46268 					"                        System.out.println(\"method1\");\n" +
46269 					"                }\n" +
46270 					"        }\n" +
46271 					"        protected Map<String, InnerClass> records;\n" +
46272 					"        public abstract void method(); \n" +
46273 					"}\n",
46274 					"w/Test.java", // =================
46275 					"package w;\n" +
46276 					"import q.AbstractTest;\n" +
46277 					"public class Test extends AbstractTest<Test> {\n" +
46278 					"        @Override\n" +
46279 					"        public void method() {\n" +
46280 					"            // Error here\n" +
46281 					"                InnerClass inner = records.get(\"1\");\n" +
46282 					"        }\n" +
46283 					"}\n", // =================
46284 			},
46285 			"");
46286 }
46287 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=229928
46288 public void test1317() {
46289 	this.runNegativeTest(
46290 			new String[] {
46291 					"X.java", // =================
46292 					"public class X {\n" +
46293 					"        void foo(String name, String value) {}\n" +
46294 					"        <T extends M> void foo(String name, T value) {}\n" +
46295 					"\n" +
46296 					"        void foo2(String name, String value) {}\n" +
46297 					"        <T extends N<T>> void foo2(String name, T value) {}\n" +
46298 					"\n" +
46299 					"        <T extends N<T>> T foo3(String name, T value) {}\n" +
46300 					"}\n" +
46301 					"class M {}\n" +
46302 					"class N<T> {}\n" +
46303 					"\n" +
46304 					"class Test {\n" +
46305 					"        void test() {\n" +
46306 					"                new X().foo(\"HI\", null); // correctly report error\n" +
46307 					"                new X().foo2(\"HI\", null); // miss ambiguous error\n" +
46308 					"                \n" +
46309 					"                Thread t1 = foo3(\"HI\", null);\n" +
46310 					"                Thread t2 = (Thread)foo3(\"HI\", null);\n" +
46311 					"        }\n" +
46312 					"}\n", // =================
46313 			},
46314 			"----------\n" +
46315 			"1. ERROR in X.java (at line 8)\n" +
46316 			"	<T extends N<T>> T foo3(String name, T value) {}\n" +
46317 			"	                   ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
46318 			"This method must return a result of type T\n" +
46319 			"----------\n" +
46320 			"2. ERROR in X.java (at line 15)\n" +
46321 			"	new X().foo(\"HI\", null); // correctly report error\n" +
46322 			"	        ^^^\n" +
46323 			"The method foo(String, String) is ambiguous for the type X\n" +
46324 			"----------\n" +
46325 			"3. ERROR in X.java (at line 16)\n" +
46326 			"	new X().foo2(\"HI\", null); // miss ambiguous error\n" +
46327 			"	        ^^^^\n" +
46328 			"The method foo2(String, String) is ambiguous for the type X\n" +
46329 			"----------\n" +
46330 			"4. ERROR in X.java (at line 18)\n" +
46331 			"	Thread t1 = foo3(\"HI\", null);\n" +
46332 			"	            ^^^^\n" +
46333 			"The method foo3(String, null) is undefined for the type Test\n" +
46334 			"----------\n" +
46335 			"5. ERROR in X.java (at line 19)\n" +
46336 			"	Thread t2 = (Thread)foo3(\"HI\", null);\n" +
46337 			"	                    ^^^^\n" +
46338 			"The method foo3(String, null) is undefined for the type Test\n" +
46339 			"----------\n");
46340 }
46341 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=229928 - variation
46342 public void test1318() {
46343 	this.runNegativeTest(
46344 			new String[] {
46345 					"X.java", // =================
46346 					"public class X {\n" +
46347 					"        <T extends N<T>> void foo2(String name, T value) {}\n" +
46348 					"}\n" +
46349 					"class N<T> {}\n" +
46350 					"\n" +
46351 					"class Test {\n" +
46352 					"        void test() {\n" +
46353 					"                new X().foo2(\"HI\", null);\n" +
46354 					"                new X().<N<?>>foo2(\"HI\", null);\n" +
46355 					"                new X().<N<? extends N<?>>>foo2(\"HI\", null);\n" +
46356 					"        }\n" +
46357 					"}\n", // =================
46358 			},
46359 			"----------\n" +
46360 			"1. ERROR in X.java (at line 9)\n" +
46361 			"	new X().<N<?>>foo2(\"HI\", null);\n" +
46362 			"	              ^^^^\n" +
46363 			"Bound mismatch: The generic method foo2(String, T) of type X is not applicable for the arguments (String, null). The inferred type N<?> is not a valid substitute for the bounded parameter <T extends N<T>>\n" +
46364 			"----------\n" +
46365 			"2. ERROR in X.java (at line 10)\n" +
46366 			"	new X().<N<? extends N<?>>>foo2(\"HI\", null);\n" +
46367 			"	                           ^^^^\n" +
46368 			"Bound mismatch: The generic method foo2(String, T) of type X is not applicable for the arguments (String, null). The inferred type N<? extends N<?>> is not a valid substitute for the bounded parameter <T extends N<T>>\n" +
46369 			"----------\n");
46370 }
46371 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=229928 - variation
46372 public void test1319() {
46373 	this.runConformTest(
46374 			new String[] {
46375 					"X.java", // =================
46376 					"import java.util.List;\n" +
46377 					"public class X {\n" +
46378 					"        <T extends List<U>, U extends List<W>, W extends List<T>> void foo2(String name, U u, T t, W w) {}\n" +
46379 					"}\n" +
46380 					"\n" +
46381 					"class Test {\n" +
46382 					"        void test() {\n" +
46383 					"                new X().foo2(\"HI\", null, null, null);\n" +
46384 					"        }\n" +
46385 					"}\n", // =================
46386 			},
46387 			"");
46388 }
46389 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=229928 - variation
46390 public void test1320() {
46391 	this.runConformTest(
46392 			new String[] {
46393 					"X.java", // =================
46394 					"import java.util.List;\n" +
46395 					"public class X {\n" +
46396 					"        <T extends List<U>, U extends List<W>, W extends List<U>> void foo2(String name, U u, T t, W w) {}\n" +
46397 					"}\n" +
46398 					"\n" +
46399 					"class Test {\n" +
46400 					"        void test() {\n" +
46401 					"                new X().foo2(\"HI\", null, null, null);\n" +
46402 					"        }\n" +
46403 					"}\n", // =================
46404 			},
46405 			"");
46406 }
46407 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=229928 - variation
46408 public void test1321() {
46409 	this.runConformTest(
46410 			new String[] {
46411 					"X.java", // =================
46412 					"import java.util.List;\n" +
46413 					"public class X {\n" +
46414 					"        <T, U extends List<T>, W extends List<U>> void foo2(String name, U u, T t, W w) {}\n" +
46415 					"}\n" +
46416 					"\n" +
46417 					"class Test {\n" +
46418 					"        void test() {\n" +
46419 					"                new X().foo2(\"HI\", null, null, null);\n" +
46420 					"        }\n" +
46421 					"}\n", // =================
46422 			},
46423 			"");
46424 }
46425 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094
46426 public void test1322() {
46427 	this.runNegativeTest(
46428 			new String[] {
46429 					"X.java", // =================
46430 					"public class X {\n" +
46431 					"	public static void main(String[] args) {\n" +
46432 					"		X x = new X();\n" +
46433 					"\n" +
46434 					"		/** OK: Bob.class is correct. No idea about the Thingy */\n" +
46435 					"		x.doStuff(Bob.class, new Thingy());\n" +
46436 					"\n" +
46437 					"		/**\n" +
46438 					"		 * This line will fail when compiled with the Java 5 SDK: Test.java:25:\n" +
46439 					"		 * <T>doStuff(java.lang.Class<T>,Thingy<T>) in Test cannot be applied to\n" +
46440 					"		 * (java.lang.Class<Bill>,Thingy) test.doStuff(Bill.class, new\n" +
46441 					"		 * Thingy()); ^ Note: Test.java uses unchecked or unsafe operations.\n" +
46442 					"		 * Note: Recompile with -Xlint:unchecked for details. 1 error\n" +
46443 					"		 */\n" +
46444 					"		x.doStuff(Jim.class, new Thingy());\n" +
46445 					"	}\n" +
46446 					"	<T extends Bob> void doStuff(Class<T> klass, Thingy<T> thingy) {\n" +
46447 					"	}\n" +
46448 					"}\n" +
46449 					"class Jim {}\n" +
46450 					"class Bob {}\n" +
46451 					"class Bob2 extends Bob {}\n" +
46452 					"class Thingy<T extends Bob> {}\n", // =================
46453 			},
46454 			this.complianceLevel < ClassFileConstants.JDK1_8 ?
46455 			"----------\n" +
46456 			"1. WARNING in X.java (at line 6)\n" +
46457 			"	x.doStuff(Bob.class, new Thingy());\n" +
46458 			"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
46459 			"Type safety: Unchecked invocation doStuff(Class<Bob>, Thingy) of the generic method doStuff(Class<T>, Thingy<T>) of type X\n" +
46460 			"----------\n" +
46461 			"2. WARNING in X.java (at line 6)\n" +
46462 			"	x.doStuff(Bob.class, new Thingy());\n" +
46463 			"	                     ^^^^^^^^^^^^\n" +
46464 			"Type safety: The expression of type Thingy needs unchecked conversion to conform to Thingy<Bob>\n" +
46465 			"----------\n" +
46466 			"3. WARNING in X.java (at line 6)\n" +
46467 			"	x.doStuff(Bob.class, new Thingy());\n" +
46468 			"	                         ^^^^^^\n" +
46469 			"Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" +
46470 			"----------\n" +
46471 			"4. ERROR in X.java (at line 15)\n" +
46472 			"	x.doStuff(Jim.class, new Thingy());\n" +
46473 			"	  ^^^^^^^\n" +
46474 			"Bound mismatch: The generic method doStuff(Class<T>, Thingy<T>) of type X is not applicable for the arguments (Class<Jim>, Thingy). The inferred type Jim is not a valid substitute for the bounded parameter <T extends Bob>\n" +
46475 			"----------\n" +
46476 			"5. WARNING in X.java (at line 15)\n" +
46477 			"	x.doStuff(Jim.class, new Thingy());\n" +
46478 			"	                         ^^^^^^\n" +
46479 			"Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" +
46480 			"----------\n" :
46481 				"----------\n" +
46482 				"1. WARNING in X.java (at line 6)\n" +
46483 				"	x.doStuff(Bob.class, new Thingy());\n" +
46484 				"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
46485 				"Type safety: Unchecked invocation doStuff(Class<Bob>, Thingy) of the generic method doStuff(Class<T>, Thingy<T>) of type X\n" +
46486 				"----------\n" +
46487 				"2. WARNING in X.java (at line 6)\n" +
46488 				"	x.doStuff(Bob.class, new Thingy());\n" +
46489 				"	                     ^^^^^^^^^^^^\n" +
46490 				"Type safety: The expression of type Thingy needs unchecked conversion to conform to Thingy<Bob>\n" +
46491 				"----------\n" +
46492 				"3. WARNING in X.java (at line 6)\n" +
46493 				"	x.doStuff(Bob.class, new Thingy());\n" +
46494 				"	                         ^^^^^^\n" +
46495 				"Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" +
46496 				"----------\n" +
46497 				"4. ERROR in X.java (at line 15)\n" +
46498 				"	x.doStuff(Jim.class, new Thingy());\n" +
46499 				"	  ^^^^^^^\n" +
46500 				"The method doStuff(Class<T>, Thingy<T>) in the type X is not applicable for the arguments (Class<Jim>, Thingy)\n" +
46501 				"----------\n" +
46502 				"5. WARNING in X.java (at line 15)\n" +
46503 				"	x.doStuff(Jim.class, new Thingy());\n" +
46504 				"	                         ^^^^^^\n" +
46505 				"Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" +
46506 				"----------\n");
46507 }
46508 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094 - variation
46509 // FAIL ERRMSG and MISSING WARNINGS(?)
46510 public void test1323() {
46511 	if (this.complianceLevel >= ClassFileConstants.JDK1_8)
46512 		return;
46513 	this.runNegativeTest(
46514 			new String[] {
46515 					"X.java", // =================
46516 					"public class X {\n" +
46517 					"	public static void main(String[] args) {\n" +
46518 					"		X x = new X();\n" +
46519 					"		x.doStuff2(Jim.class, new Thingy());\n" +
46520 					"		String s = x.doStuff2(Bob2.class, new Thingy());\n" +
46521 					"	}\n" +
46522 					"	<T extends Bob, U extends Bob> T doStuff2(Class<T> klass, Thingy<U> thingy) { return null; }\n" +
46523 					"}\n" +
46524 					"class Jim {}\n" +
46525 					"class Bob {}\n" +
46526 					"class Bob2 extends Bob {}\n" +
46527 					"class Thingy<T extends Bob> {}\n", // =================
46528 			},
46529 			"----------\n" +
46530 			"1. ERROR in X.java (at line 4)\n" +
46531 			"	x.doStuff2(Jim.class, new Thingy());\n" +
46532 			"	  ^^^^^^^^\n" +
46533 			"Bound mismatch: The generic method doStuff2(Class<T>, Thingy<U>) of type X is not applicable for the arguments (Class<Jim>, Thingy). The inferred type Jim is not a valid substitute for the bounded parameter <T extends Bob>\n" +
46534 			"----------\n" +
46535 			"2. WARNING in X.java (at line 4)\n" +
46536 			"	x.doStuff2(Jim.class, new Thingy());\n" +
46537 			"	                          ^^^^^^\n" +
46538 			"Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" +
46539 			"----------\n" +
46540 			"3. WARNING in X.java (at line 5)\n" +
46541 			"	String s = x.doStuff2(Bob2.class, new Thingy());\n" +
46542 			"	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
46543 			"Type safety: Unchecked invocation doStuff2(Class<Bob2>, Thingy) of the generic method doStuff2(Class<T>, Thingy<U>) of type X\n" +
46544 			"----------\n" +
46545 			"4. ERROR in X.java (at line 5)\n" +
46546 			"	String s = x.doStuff2(Bob2.class, new Thingy());\n" +
46547 			"	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
46548 			"Type mismatch: cannot convert from Bob2 to String\n" +
46549 			"----------\n" +
46550 			"5. WARNING in X.java (at line 5)\n" +
46551 			"	String s = x.doStuff2(Bob2.class, new Thingy());\n" +
46552 			"	                                  ^^^^^^^^^^^^\n" +
46553 			"Type safety: The expression of type Thingy needs unchecked conversion to conform to Thingy<Bob>\n" +
46554 			"----------\n" +
46555 			"6. WARNING in X.java (at line 5)\n" +
46556 			"	String s = x.doStuff2(Bob2.class, new Thingy());\n" +
46557 			"	                                      ^^^^^^\n" +
46558 			"Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" +
46559 			"----------\n");
46560 }
46561 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094 - variation
46562 public void test1324() {
46563 	this.runNegativeTest(
46564 			new String[] {
46565 					"X.java", // =================
46566 					"public class X {\n" +
46567 					"	public static void main(String[] args) {\n" +
46568 					"		X x = new X();\n" +
46569 					"\n" +
46570 					"		/** OK: Bob.class is correct. No idea about the Thingy */\n" +
46571 					"		x.doStuff(Bob.class, new Thingy());\n" +
46572 					"		x.doStuff(Bob.class, new Thingy<Bob>()); // second invocation is NOT unchecked\n" +
46573 					"		Zork z;\n" +
46574 					"	}\n" +
46575 					"	<T extends Bob> T doStuff(Class<T> klass, Thingy<T> thingy) { return null; }\n" +
46576 					"}\n" +
46577 					"class Jim {}\n" +
46578 					"class Bob {}\n" +
46579 					"class Thingy<T extends Bob> {}\n", // =================
46580 			},
46581 			"----------\n" +
46582 			"1. WARNING in X.java (at line 6)\n" +
46583 			"	x.doStuff(Bob.class, new Thingy());\n" +
46584 			"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
46585 			"Type safety: Unchecked invocation doStuff(Class<Bob>, Thingy) of the generic method doStuff(Class<T>, Thingy<T>) of type X\n" +
46586 			"----------\n" +
46587 			"2. WARNING in X.java (at line 6)\n" +
46588 			"	x.doStuff(Bob.class, new Thingy());\n" +
46589 			"	                     ^^^^^^^^^^^^\n" +
46590 			"Type safety: The expression of type Thingy needs unchecked conversion to conform to Thingy<Bob>\n" +
46591 			"----------\n" +
46592 			"3. WARNING in X.java (at line 6)\n" +
46593 			"	x.doStuff(Bob.class, new Thingy());\n" +
46594 			"	                         ^^^^^^\n" +
46595 			"Thingy is a raw type. References to generic type Thingy<T> should be parameterized\n" +
46596 			"----------\n" +
46597 			"4. ERROR in X.java (at line 8)\n" +
46598 			"	Zork z;\n" +
46599 			"	^^^^\n" +
46600 			"Zork cannot be resolved to a type\n" +
46601 			"----------\n");
46602 }
46603 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094 - variation
46604 public void test1325() {
46605 	this.runNegativeTest(
46606 			new String[] {
46607 					"X.java", // =================
46608 					"public class X<E> {\n" +
46609 					"	<T,U> U foo(X<T> xt) {\n" +
46610 					"		return null;\n" +
46611 					"	}\n" +
46612 					"	void bar(X x) {\n" +
46613 					"		X<String> xs2 = foo(x);\n" +
46614 					"	}\n" +
46615 					"}\n", // =================
46616 			},
46617 			(this.complianceLevel < ClassFileConstants.JDK1_8
46618 			?
46619 			"----------\n" +
46620 			"1. WARNING in X.java (at line 5)\n" +
46621 			"	void bar(X x) {\n" +
46622 			"	         ^\n" +
46623 			"X is a raw type. References to generic type X<E> should be parameterized\n" +
46624 			"----------\n" +
46625 			"2. WARNING in X.java (at line 6)\n" +
46626 			"	X<String> xs2 = foo(x);\n" +
46627 			"	                ^^^^^^\n" +
46628 			"Type safety: Unchecked invocation foo(X) of the generic method foo(X<T>) of type X<E>\n" +
46629 			"----------\n" +
46630 			"3. WARNING in X.java (at line 6)\n" +
46631 			"	X<String> xs2 = foo(x);\n" +
46632 			"	                ^^^^^^\n" +
46633 			"Type safety: The expression of type X needs unchecked conversion to conform to X<String>\n" +
46634 			"----------\n" +
46635 			"4. WARNING in X.java (at line 6)\n" +
46636 			"	X<String> xs2 = foo(x);\n" +
46637 			"	                    ^\n" +
46638 			"Type safety: The expression of type X needs unchecked conversion to conform to X<Object>\n" +
46639 			"----------\n"
46640 			: // 1.8 is stricter:
46641 			"----------\n" +
46642 			"1. WARNING in X.java (at line 5)\n" +
46643 			"	void bar(X x) {\n" +
46644 			"	         ^\n" +
46645 			"X is a raw type. References to generic type X<E> should be parameterized\n" +
46646 			"----------\n" +
46647 			"2. ERROR in X.java (at line 6)\n" +
46648 			"	X<String> xs2 = foo(x);\n" +
46649 			"	                ^^^^^^\n" +
46650 			"Type mismatch: cannot convert from Object to X<String>\n" +
46651 			"----------\n"));
46652 }
46653 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094 - variation
46654 public void test1326() {
46655 	this.runNegativeTest(
46656 			new String[] {
46657 					"X.java", // =================
46658 					"public class X<E> {\n" +
46659 					"	<T extends Thread,U> X<T> foo(X<T> xt, X<U> xt2) {\n" +
46660 					"		return null;\n" +
46661 					"	}\n" +
46662 					"	X<E> identity() {\n" +
46663 					"		return this;\n" +
46664 					"	}\n" +
46665 					"	void bar(X x, X<String> xs) {\n" +
46666 					"		X<String> xs2 = foo(xs, x).identity();\n" +
46667 					"	}\n" +
46668 					"}\n", // =================
46669 			},
46670 			this.complianceLevel < ClassFileConstants.JDK1_8 ?
46671 			"----------\n" +
46672 			"1. WARNING in X.java (at line 8)\n" +
46673 			"	void bar(X x, X<String> xs) {\n" +
46674 			"	         ^\n" +
46675 			"X is a raw type. References to generic type X<E> should be parameterized\n" +
46676 			"----------\n" +
46677 			"2. ERROR in X.java (at line 9)\n" +
46678 			"	X<String> xs2 = foo(xs, x).identity();\n" +
46679 			"	                ^^^\n" +
46680 			"Bound mismatch: The generic method foo(X<T>, X<U>) of type X<E> is not applicable for the arguments (X<String>, X). The inferred type String is not a valid substitute for the bounded parameter <T extends Thread>\n" +
46681 			"----------\n" :
46682 				"----------\n" +
46683 				"1. WARNING in X.java (at line 8)\n" +
46684 				"	void bar(X x, X<String> xs) {\n" +
46685 				"	         ^\n" +
46686 				"X is a raw type. References to generic type X<E> should be parameterized\n" +
46687 				"----------\n" +
46688 				"2. ERROR in X.java (at line 9)\n" +
46689 				"	X<String> xs2 = foo(xs, x).identity();\n" +
46690 				"	                ^^^\n" +
46691 				"The method foo(X<T>, X<U>) in the type X<E> is not applicable for the arguments (X<String>, X)\n" +
46692 				"----------\n");
46693 }
46694 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094 - variation
46695 public void test1327() {
46696 	this.runNegativeTest(
46697 			new String[] {
46698 					"X.java", // =================
46699 					"public class X<E> {\n" +
46700 					"	<T,U> X<Object> foo(X<T> xt, X<U> xt2) {\n" +
46701 					"		return null;\n" +
46702 					"	}\n" +
46703 					"	X<E> identity() {\n" +
46704 					"		return this;\n" +
46705 					"	}\n" +
46706 					"	void bar(X x, X<String> xs) {\n" +
46707 					"		X<String> xs2 = foo(x, xs).identity();\n" +
46708 					"	}\n" +
46709 					"}\n", // =================
46710 			},
46711 			"----------\n" +
46712 			"1. WARNING in X.java (at line 8)\n" +
46713 			"	void bar(X x, X<String> xs) {\n" +
46714 			"	         ^\n" +
46715 			"X is a raw type. References to generic type X<E> should be parameterized\n" +
46716 			"----------\n" +
46717 			"2. WARNING in X.java (at line 9)\n" +
46718 			"	X<String> xs2 = foo(x, xs).identity();\n" +
46719 			"	                ^^^^^^^^^^\n" +
46720 			"Type safety: Unchecked invocation foo(X, X<String>) of the generic method foo(X<T>, X<U>) of type X<E>\n" +
46721 			"----------\n" +
46722 			"3. WARNING in X.java (at line 9)\n" +
46723 			"	X<String> xs2 = foo(x, xs).identity();\n" +
46724 			"	                ^^^^^^^^^^^^^^^^^^^^^\n" +
46725 			"Type safety: The expression of type X needs unchecked conversion to conform to X<String>\n" +
46726 			"----------\n" +
46727 			"4. WARNING in X.java (at line 9)\n" +
46728 			"	X<String> xs2 = foo(x, xs).identity();\n" +
46729 			"	                    ^\n" +
46730 			"Type safety: The expression of type X needs unchecked conversion to conform to X<Object>\n" +
46731 			"----------\n");
46732 }
46733 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=231094 - variation
46734 public void test1328() {
46735 	this.runNegativeTest(
46736 			new String[] {
46737 					"X.java", // =================
46738 					"import java.util.List;\n" +
46739 					"\n" +
46740 					"public class X {\n" +
46741 					"	\n" +
46742 					"	void bar(List<B> lb, List<C> lc) {\n" +
46743 					"		String s = foo(lb, lc);\n" +
46744 					"	}\n" +
46745 					"	<U extends A> U foo(List<? extends U> u, List<? extends U> v) { return null; }\n" +
46746 					"}\n" +
46747 					"class A {}\n" +
46748 					"class B extends A {}\n" +
46749 					"class C extends A {}\n", // =================
46750 			},
46751 			"----------\n" +
46752 			"1. ERROR in X.java (at line 6)\n" +
46753 			"	String s = foo(lb, lc);\n" +
46754 			"	           ^^^^^^^^^^^\n" +
46755 			"Type mismatch: cannot convert from A to String\n" +
46756 			"----------\n");
46757 }
46758 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=232174
46759 public void test1329() {
46760 	this.runConformTest(
46761 			new String[] {
46762 					"com/b/p1/A.java", // =================
46763 					"package com.b.p1;\n" +
46764 					"public class A<K> {\n" +
46765 					"    protected final class Inner {}\n" +
46766 					"}\n",
46767 					"com/b/p1/ADerivedSamePkg.java", // =================
46768 					"package com.b.p1;\n" +
46769 					"import java.util.Map;\n" +
46770 					"public class ADerivedSamePkg extends A<Object> {\n" +
46771 					"    protected void someMethod() {\n" +
46772 					"        Map.Entry<String, Inner> some = null;\n" +
46773 					"        Inner x = some.getValue();\n" +
46774 					"    }\n" +
46775 					"}\n",
46776 					"com/b/p2/ADerivedDifferentPkg.java", // =================
46777 					"package com.b.p2;\n" +
46778 					"import java.util.Map;\n" +
46779 					"import com.b.p1.A;\n" +
46780 					"public class ADerivedDifferentPkg extends A<Object> {\n" +
46781 					"    protected void someMethod()     {\n" +
46782 					"        Map.Entry<String, Inner> some = null;\n" +
46783 					"        Inner x = some.getValue(); // <-- error in this line\n" +
46784 					"    }\n" +
46785 					"}\n", // =================
46786 			},
46787 			"");
46788 }
46789 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=231861
46790 public void test1330() {
46791 	this.runConformTest(
46792 			new String[] {
46793 				"p/BaseValue.java", // =================
46794 				"package p;\n" +
46795 				"interface Value<B> {}\n" +
46796 				"public class BaseValue<B> implements Value<B> {}\n",
46797 				"p/Model.java", // =================
46798 				"package p;\n" +
46799 				"public class Model {\n" +
46800 				"  public java.util.Map<String, Value> map = new java.util.LinkedHashMap<String,Value>();\n" +
46801 				"}\n", // =================
46802 			},
46803 			"");
46804 	this.runConformTest(
46805 			new String[] {
46806 				"p2/Person.java", // =================
46807 				"package p2;\n" +
46808 				"public class Person extends p.Model {\n" +
46809 				"        void test() {\n" +
46810 				"                this.map.put(\"name\", new p.BaseValue<String>());\n" +
46811 				"        }\n" +
46812 				"}\n", // =================
46813 			},
46814 			"",
46815 			null,
46816 			false,
46817 			null);
46818 }
46819 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=231861 - variation
46820 public void test1331() {
46821 	this.runConformTest(
46822 			new String[] {
46823 				"p/BaseValue.java", // =================
46824 				"package p;\n" +
46825 				"interface Value<B> {}\n" +
46826 				"public class BaseValue<B> implements Value<B> {}\n",
46827 				"p/Model.java", // =================
46828 				"package p;\n" +
46829 				"public class Model {\n" +
46830 				"  public java.util.Map<String, Value> map = new java.util.LinkedHashMap<String,Value>();\n" +
46831 				"}\n",
46832 				"p2/Person.java", // =================
46833 				"package p2;\n" +
46834 				"public class Person extends p.Model {\n" +
46835 				"        void test() {\n" +
46836 				"                this.map.put(\"name\", new p.BaseValue<String>());\n" +
46837 				"        }\n" +
46838 				"}\n", // =================
46839 			},
46840 			"");
46841 }
46842 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=232487
46843 public void test1332() throws Exception {
46844 	runConformTest(
46845 		// test directory preparation
46846 		new String[] { /* test files */
46847 			"X.java",
46848 			"import java.util.*;\n" +
46849 			"\n" +
46850 			"public class X implements Runnable {\n" +
46851 			"	public void run() {/**/}\n" +
46852 			"	void foo() {\n" +
46853 			"		  List<X> runnables = new ArrayList<X>();\n" +
46854 			"		  for (Runnable r : runnables) {\n" +
46855 			"			  r.run();\n" +
46856 			"		  }\n" +
46857 			"		  Object o = runnables.get(0);\n" +
46858 			"		  Runnable r = runnables.get(1);\n" +
46859 			"	}\n" +
46860 			"} \n",
46861 		},
46862 		// runtime results
46863 		"" /* expected output string */);
46864 	String expectedOutput =
46865 		"  // Method descriptor #8 ()V\n" +
46866 		"  // Stack: 2, Locals: 4\n" +
46867 		"  void foo();\n" +
46868 		"     0  new java.util.ArrayList [18]\n" +
46869 		"     3  dup\n" +
46870 		"     4  invokespecial java.util.ArrayList() [20]\n" +
46871 		"     7  astore_1 [runnables]\n" +
46872 		"     8  aload_1 [runnables]\n" +
46873 		"     9  invokeinterface java.util.List.iterator() : java.util.Iterator [21] [nargs: 1]\n" +
46874 		"    14  astore_3\n" +
46875 		"    15  goto 34\n" +
46876 		"    18  aload_3\n" +
46877 		"    19  invokeinterface java.util.Iterator.next() : java.lang.Object [27] [nargs: 1]\n" +
46878 		"    24  checkcast java.lang.Runnable [5]\n" +
46879 		"    27  astore_2 [r]\n" +
46880 		"    28  aload_2 [r]\n" +
46881 		"    29  invokeinterface java.lang.Runnable.run() : void [33] [nargs: 1]\n" +
46882 		"    34  aload_3\n" +
46883 		"    35  invokeinterface java.util.Iterator.hasNext() : boolean [35] [nargs: 1]\n" +
46884 		"    40  ifne 18\n" +
46885 		"    43  aload_1 [runnables]\n" +
46886 		"    44  iconst_0\n" +
46887 		"    45  invokeinterface java.util.List.get(int) : java.lang.Object [39] [nargs: 2]\n" +
46888 		"    50  astore_2 [o]\n" +
46889 		"    51  aload_1 [runnables]\n" +
46890 		"    52  iconst_1\n" +
46891 		"    53  invokeinterface java.util.List.get(int) : java.lang.Object [39] [nargs: 2]\n" +
46892 		"    58  checkcast java.lang.Runnable [5]\n" +
46893 		"    61  astore_3 [r]\n" +
46894 		"    62  return\n" +
46895 		"      Line numbers:\n" +
46896 		"        [pc: 0, line: 6]\n" +
46897 		"        [pc: 8, line: 7]\n" +
46898 		"        [pc: 28, line: 8]\n" +
46899 		"        [pc: 34, line: 7]\n" +
46900 		"        [pc: 43, line: 10]\n" +
46901 		"        [pc: 51, line: 11]\n" +
46902 		"        [pc: 62, line: 12]\n" +
46903 		"      Local variable table:\n" +
46904 		"        [pc: 0, pc: 63] local: this index: 0 type: X\n" +
46905 		"        [pc: 8, pc: 63] local: runnables index: 1 type: java.util.List\n" +
46906 		"        [pc: 28, pc: 34] local: r index: 2 type: java.lang.Runnable\n" +
46907 		"        [pc: 51, pc: 63] local: o index: 2 type: java.lang.Object\n" +
46908 		"        [pc: 62, pc: 63] local: r index: 3 type: java.lang.Runnable\n";
46909 
46910 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
46911 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
46912 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
46913 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
46914 	int index = result.indexOf(expectedOutput);
46915 	if (index == -1 || expectedOutput.length() == 0) {
46916 		System.out.println(Util.displayString(result, 3));
46917 	}
46918 	if (index == -1) {
46919 		assertEquals("Wrong contents", expectedOutput, result);
46920 	}
46921 }
46922 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=225737
46923 public void test1333() {
46924 	this.runConformTest(
46925 			new String[] {
46926 				"X.java", // =================
46927 				"import java.util.ArrayList;\n" +
46928 				"import java.util.List;\n" +
46929 				"public class X extends AbstractProject<X, Object> {\n" +
46930 				"	public void testBug() {\n" +
46931 				"		// javac compiles the following line without complaining\n" +
46932 				"		BuildStepDescriptor.filter(BuildStep.PUBLISHERS, getClass());\n" +
46933 				"	}\n" +
46934 				"	\n" +
46935 				"	public static void main(String[] args) {\n" +
46936 				"		new X().testBug();\n" +
46937 				"	}\n" +
46938 				"}\n" +
46939 				"interface BuildStep {\n" +
46940 				"	public static final PublisherList PUBLISHERS = new PublisherList();\n" +
46941 				"}\n" +
46942 				"\n" +
46943 				"@SuppressWarnings(\"serial\")\n" +
46944 				"class PublisherList extends ArrayList<Descriptor<Publisher>> {\n" +
46945 				"}\n" +
46946 				"abstract class Publisher implements BuildStep, Describable<Publisher> {\n" +
46947 				"}\n" +
46948 				"interface Describable<T extends Describable<T>> {\n" +
46949 				"}\n" +
46950 				"abstract class Descriptor<T extends Describable<T>> {\n" +
46951 				"}\n" +
46952 				"abstract class BuildStepDescriptor<T extends BuildStep & Describable<T>> extends Descriptor<T> {\n" +
46953 				"	\n" +
46954 				"	public static <T extends BuildStep & Describable<T>> List<Descriptor<T>> filter(\n" +
46955 				"			List<Descriptor<T>> base,\n" +
46956 				"			Class<? extends AbstractProject<?, ?>> type) {\n" +
46957 				"		return null;\n" +
46958 				"	}\n" +
46959 				"}\n" +
46960 				"abstract class AbstractProject<P extends AbstractProject<P, R>, R> {\n" +
46961 				"}\n", // =================
46962 			},
46963 			"");
46964 }
46965 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=225737 - variation
46966 public void test1334() {
46967 	this.runConformTest(
46968 			new String[] {
46969 				"X.java", // =================
46970 				"public class X extends AbstractProject<X, Object> {\n" +
46971 				"	public void testBug() {\n" +
46972 				"		filter(getClass());//1\n" +
46973 				"		filter(this.getClass());//2\n" +
46974 				"		filter(X.class);//3\n" +
46975 				"	}\n" +
46976 				"	public static void filter(Class<? extends AbstractProject<?, ?>> type) {\n" +
46977 				"	}\n" +
46978 				"}\n" +
46979 				"abstract class AbstractProject<P extends AbstractProject<P, R>, R> {\n" +
46980 				"}\n", // =================
46981 			},
46982 			"");
46983 }
46984 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=233800
46985 public void test1335() {
46986 	this.runNegativeTest(
46987 			new String[] {
46988 				"X.java", // =================
46989 				"public class X<T> {\n" +
46990 				"	public void doesNotCompile(SomeInterface i) {\n" +
46991 				"		T t = ((SomeDerivedInterface<T>) i).getItem();\n" +
46992 				"	}\n" +
46993 				"	static interface SomeInterface {\n" +
46994 				"	}\n" +
46995 				"	static interface SomeDerivedInterface<T> extends SomeInterface {\n" +
46996 				"		T getItem();\n" +
46997 				"	}\n" +
46998 				"	Zork z;\n" +
46999 				"}\n", // =================
47000 			},
47001 			"----------\n" +
47002 			"1. WARNING in X.java (at line 3)\n" +
47003 			"	T t = ((SomeDerivedInterface<T>) i).getItem();\n" +
47004 			"	      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
47005 			"Type safety: Unchecked cast from X.SomeInterface to X.SomeDerivedInterface<T>\n" +
47006 			"----------\n" +
47007 			"2. ERROR in X.java (at line 10)\n" +
47008 			"	Zork z;\n" +
47009 			"	^^^^\n" +
47010 			"Zork cannot be resolved to a type\n" +
47011 			"----------\n");
47012 }
47013 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=233800 - variation
47014 public void test1336() {
47015 	this.runNegativeTest(
47016 			new String[] {
47017 				"X.java", // =================
47018 				"public class X {\n" +
47019 				"	void foo(Other2<?>.Member2<?> om2) {\n" +
47020 				"		Other<String>.Member m = (Other<String>.Member) om2;\n" +
47021 				"	}\n" +
47022 				"}\n" +
47023 				"class Other<T> {\n" +
47024 				"	class Member {}\n" +
47025 				"}\n" +
47026 				"class Other2<T> extends Other<T> {\n" +
47027 				"	class Member2<U> extends Other<U>.Member {\n" +
47028 				"	}\n" +
47029 				"}\n", // =================
47030 			},
47031 			"----------\n" +
47032 			"1. WARNING in X.java (at line 3)\n" +
47033 			"	Other<String>.Member m = (Other<String>.Member) om2;\n" +
47034 			"	                         ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
47035 			"Type safety: Unchecked cast from Other2<?>.Member2<capture#1-of ?> to Other<String>.Member\n" +
47036 			"----------\n");
47037 }
47038 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=233800 - variation
47039 public void test1337() {
47040 	this.runNegativeTest(
47041 			new String[] {
47042 				"X.java", // =================
47043 				"public class X {\n" +
47044 				"	void foo(Other2.Member2<?> om2) {\n" +
47045 				"		Other<String>.Member m = (Other<String>.Member) om2;\n" +
47046 				"	}\n" +
47047 				"}\n" +
47048 				"class Other<T> {\n" +
47049 				"	class Member {}\n" +
47050 				"}\n" +
47051 				"class Other2 extends Other<X> {\n" +
47052 				"	class Member2<U> extends Other<U>.Member {\n" +
47053 				"	}\n" +
47054 				"}\n", // =================
47055 			},
47056 			"----------\n" +
47057 			"1. WARNING in X.java (at line 3)\n" +
47058 			"	Other<String>.Member m = (Other<String>.Member) om2;\n" +
47059 			"	                         ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
47060 			"Type safety: Unchecked cast from Other2.Member2<capture#1-of ?> to Other<String>.Member\n" +
47061 			"----------\n");
47062 }
47063 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=234619
47064 public void test1338() {
47065 	this.runNegativeTest(
47066 			new String[] {
47067 				"X.java", // =================
47068 				"public class X {\n" +
47069 				"        void m(Object someObject, Integer intObject) {\n" +
47070 				"                Exception class1 = someObject.getClass();\n" +
47071 				"                Exception class2 = intObject.getClass();\n" +
47072 				"        }\n" +
47073 				"}\n", // =================
47074 			},
47075 			"----------\n" +
47076 			"1. ERROR in X.java (at line 3)\n" +
47077 			"	Exception class1 = someObject.getClass();\n" +
47078 			"	                   ^^^^^^^^^^^^^^^^^^^^^\n" +
47079 			"Type mismatch: cannot convert from Class<capture#1-of ? extends Object> to Exception\n" +
47080 			"----------\n" +
47081 			"2. ERROR in X.java (at line 4)\n" +
47082 			"	Exception class2 = intObject.getClass();\n" +
47083 			"	                   ^^^^^^^^^^^^^^^^^^^^\n" +
47084 			"Type mismatch: cannot convert from Class<capture#2-of ? extends Integer> to Exception\n" +
47085 			"----------\n");
47086 }
47087 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=234619 - variation
47088 public void test1339() {
47089 	this.runNegativeTest(
47090 			new String[] {
47091 				"java/lang/Object.java", // =================
47092 				"package java.lang;\n" +
47093 				"\n" +
47094 				"public class Object {\n" +
47095 				"	void foo() {\n" +
47096 				"		Exception e1 = getClass();\n" +
47097 				"		Exception e2 = this.getClass();\n" +
47098 				"	}\n" +
47099 				"	public Class<?> getClass() { return null; }\n" +
47100 				"}\n", // =================
47101 			},
47102 			"----------\n" +
47103 			"1. ERROR in java\\lang\\Object.java (at line 5)\n" +
47104 			"	Exception e1 = getClass();\n" +
47105 			"	               ^^^^^^^^^^\n" +
47106 			"Type mismatch: cannot convert from Class<capture#1-of ? extends Object> to Exception\n" +
47107 			"----------\n" +
47108 			"2. ERROR in java\\lang\\Object.java (at line 6)\n" +
47109 			"	Exception e2 = this.getClass();\n" +
47110 			"	               ^^^^^^^^^^^^^^^\n" +
47111 			"Type mismatch: cannot convert from Class<capture#2-of ? extends Object> to Exception\n" +
47112 			"----------\n");
47113 }
47114 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=235460
47115 public void test1340() {
47116 	this.runConformTest(
47117 			new String[] {
47118 				"Derived_A.java", // =================
47119 				"import java.util.Map;\n" +
47120 				"import java.util.HashMap;\n" +
47121 				"class Base_A {}\n" +
47122 				"public class Derived_A extends Base_A {\n" +
47123 				"	public Map<Object, Base_B> getMap() {\n" +
47124 				"		return new HashMap<Object, Base_B>();\n" +
47125 				"	}\n" +
47126 				"}\n", // =================
47127 				"Derived_B.java", // =================
47128 				"class Base_B<T> {\n" +
47129 				"}\n" +
47130 				"public class Derived_B extends Base_B<Object> {\n" +
47131 				"}\n", // =================
47132 			},
47133 			"");
47134 	this.runConformTest(
47135 			new String[] {
47136 				"InternalCompilerError_Main.java", // =================
47137 				"public class InternalCompilerError_Main {\n" +
47138 				"	public static void main(String args[]) {\n" +
47139 				"		Derived_A dummy = new Derived_A();\n" +
47140 				"		Derived_B propPrice = (Derived_B)dummy.getMap().get(null);		\n" +
47141 				"	}\n" +
47142 				"}\n", // =================
47143 			},
47144 			"",
47145 			null,
47146 			false,
47147 			null);
47148 }
47149 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=235837
47150 public void test1341() {
47151 	Map options = getCompilerOptions();
47152 	options.put(JavaCore.COMPILER_PB_UNCHECKED_TYPE_OPERATION, JavaCore.IGNORE);
47153 	this.runNegativeTest(
47154 			new String[] {
47155 				"X.java", // =================
47156 				"import java.util.*;\n" +
47157 				"public class X {\n" +
47158 				"  void bar() {\n" +
47159 				"    Integer i = 0;\n" +
47160 				"    Double d = 0.0;\n" +
47161 				"    foo((Collection<Number>) Arrays.asList(i, d));\n" +
47162 				"  }\n" +
47163 				"  void foo(Collection<Number> c) {}\n" +
47164 				"}\n", // =================
47165 			},
47166 			"----------\n" +
47167 			"1. ERROR in X.java (at line 6)\n" +
47168 			"	foo((Collection<Number>) Arrays.asList(i, d));\n" +
47169 			"	    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
47170 			"Cannot cast from List<"+intersection("Number","Comparable<?>")+"> to Collection<Number>\n" +
47171 			"----------\n",
47172 			null,
47173 			true,
47174 			options);
47175 }
47176 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=235921 - variation
47177 public void test1342() throws Exception {
47178 	this.runConformTest(
47179 			new String[] {
47180 				"X.java", // =================
47181 				"import java.util.*;\n" +
47182 				"interface Adapter<T> {\n" +
47183 				"  interface Setter<V> {}\n" +
47184 				"  public <V> Setter<V> makeSetter();\n" +
47185 				"}\n" +
47186 				"\n" +
47187 				"public class X<T> implements Adapter<T> {\n" +
47188 				"  public <V> X.Setter<V> makeSetter() {\n" +
47189 				"    return new X.Setter<V>() {};\n" +
47190 				"  }\n" +
47191 				"  void foo() {\n" +
47192 				"	  List<Adapter.Setter<T>> l = new ArrayList<X.Setter<T>>();\n" +
47193 				"  }\n" +
47194 				"}\n", // =================
47195 			},
47196 			"");
47197 	// check X$1
47198 	String expectedOutput =
47199 		"// Signature: Ljava/lang/Object;LAdapter$Setter<TV;>;\n" +
47200 		"class X$1 implements Adapter$Setter {\n";
47201 
47202 	File f = new File(OUTPUT_DIR + File.separator + "X$1.class");
47203 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
47204 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
47205 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
47206 	int index = result.indexOf(expectedOutput);
47207 	if (index == -1 || expectedOutput.length() == 0) {
47208 		System.out.println(Util.displayString(result, 3));
47209 	}
47210 	if (index == -1) {
47211 		assertEquals("Wrong contents", expectedOutput, result);
47212 	}
47213 
47214 	// check X
47215 	expectedOutput =
47216 		"  // Signature: <V:Ljava/lang/Object;>()LAdapter$Setter<TV;>;\n" +
47217 		"  // Stack: 3, Locals: 1\n" +
47218 		"  public Adapter.Setter makeSetter();\n";
47219 
47220 	f = new File(OUTPUT_DIR + File.separator + "X.class");
47221 	classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
47222 	disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
47223 	result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
47224 	index = result.indexOf(expectedOutput);
47225 	if (index == -1 || expectedOutput.length() == 0) {
47226 		System.out.println(Util.displayString(result, 3));
47227 	}
47228 	if (index == -1) {
47229 		assertEquals("Wrong contents", expectedOutput, result);
47230 	}
47231 }
47232 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=235921 - variation
47233 public void test1343() throws Exception {
47234 	this.runConformTest(
47235 			new String[] {
47236 				"X.java", // =================
47237 				"import java.util.*;\n" +
47238 				"class Adapter<T> {\n" +
47239 				"  class Setter<V> {}\n" +
47240 				"  public <V> Setter<V> makeSetter() { return null; }\n" +
47241 				"}\n" +
47242 				"\n" +
47243 				"public class X<T> extends Adapter<T> {\n" +
47244 				"  public <V> X<T>.Setter<V> makeSetter() {\n" +
47245 				"    return new X<T>().new Setter<V>() {};\n" +
47246 				"  }\n" +
47247 				"  void foo() {\n" +
47248 				"	  List<Adapter<T>.Setter<T>> l = new ArrayList<X<T>.Setter<T>>();\n" +
47249 				"  }\n" +
47250 				"}\n", // =================
47251 			},
47252 			"");
47253 }
47254 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=235921 - variation
47255 public void test1344() throws Exception {
47256 	this.runNegativeTest(
47257 			new String[] {
47258 				"X.java", // =================
47259 				"import java.util.*;\n" +
47260 				"class Adapter<T> {\n" +
47261 				"  class Setter<V> {}\n" +
47262 				"  public <V> Setter<V> makeSetter() { return null; }\n" +
47263 				"}\n" +
47264 				"\n" +
47265 				"public class X<T> extends Adapter {\n" +
47266 				"  public <V> X.Setter makeSetter() {\n" +
47267 				"    return new X().new Setter() {};\n" +
47268 				"  }\n" +
47269 				"  void foo() {\n" +
47270 				"	  List<Adapter.Setter> l = new ArrayList<X.Setter>();\n" +
47271 				"  }\n" +
47272 				"}\n", // =================
47273 			},
47274 			"----------\n" +
47275 			"1. WARNING in X.java (at line 7)\n" +
47276 			"	public class X<T> extends Adapter {\n" +
47277 			"	                          ^^^^^^^\n" +
47278 			"Adapter is a raw type. References to generic type Adapter<T> should be parameterized\n" +
47279 			"----------\n" +
47280 			"2. WARNING in X.java (at line 8)\n" +
47281 			"	public <V> X.Setter makeSetter() {\n" +
47282 			"	           ^^^^^^^^\n" +
47283 			"Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
47284 			"----------\n" +
47285 			"3. ERROR in X.java (at line 8)\n" +
47286 			"	public <V> X.Setter makeSetter() {\n" +
47287 			"	                    ^^^^^^^^^^^^\n" +
47288 			"Name clash: The method makeSetter() of type X<T> has the same erasure as makeSetter() of type Adapter but does not override it\n" +
47289 			"----------\n" +
47290 			"4. WARNING in X.java (at line 9)\n" +
47291 			"	return new X().new Setter() {};\n" +
47292 			"	           ^\n" +
47293 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
47294 			"----------\n" +
47295 			"5. WARNING in X.java (at line 9)\n" +
47296 			"	return new X().new Setter() {};\n" +
47297 			"	                   ^^^^^^\n" +
47298 			"Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
47299 			"----------\n" +
47300 			"6. WARNING in X.java (at line 12)\n" +
47301 			"	List<Adapter.Setter> l = new ArrayList<X.Setter>();\n" +
47302 			"	     ^^^^^^^^^^^^^^\n" +
47303 			"Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
47304 			"----------\n" +
47305 			"7. WARNING in X.java (at line 12)\n" +
47306 			"	List<Adapter.Setter> l = new ArrayList<X.Setter>();\n" +
47307 			"	                                       ^^^^^^^^\n" +
47308 			"Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
47309 			"----------\n"
47310 		);
47311 }
47312 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=235921 - variation
47313 public void test1345() throws Exception {
47314 	this.runNegativeTest(
47315 			new String[] {
47316 				"X.java", // =================
47317 				"import java.util.*;\n" +
47318 				"class Adapter<T> {\n" +
47319 				"  class Setter<V> {}\n" +
47320 				"  public <V> Setter<V> makeSetter() { return null; }\n" +
47321 				"}\n" +
47322 				"\n" +
47323 				"public class X<T> extends Adapter {\n" +
47324 				"  public <V> X.Setter makeSetter() {\n" +
47325 				"    return (String) new X().new Setter() {};\n" +
47326 				"  }\n" +
47327 				"  void foo() {\n" +
47328 				"          List<Adapter.Setter> l = new ArrayList<X.Setter>();\n" +
47329 				"  }\n" +
47330 				"}\n", // =================
47331 			},
47332 			"----------\n" +
47333 			"1. WARNING in X.java (at line 7)\n" +
47334 			"	public class X<T> extends Adapter {\n" +
47335 			"	                          ^^^^^^^\n" +
47336 			"Adapter is a raw type. References to generic type Adapter<T> should be parameterized\n" +
47337 			"----------\n" +
47338 			"2. WARNING in X.java (at line 8)\n" +
47339 			"	public <V> X.Setter makeSetter() {\n" +
47340 			"	           ^^^^^^^^\n" +
47341 			"Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
47342 			"----------\n" +
47343 			"3. ERROR in X.java (at line 8)\n" +
47344 			"	public <V> X.Setter makeSetter() {\n" +
47345 			"	                    ^^^^^^^^^^^^\n" +
47346 			"Name clash: The method makeSetter() of type X<T> has the same erasure as makeSetter() of type Adapter but does not override it\n" +
47347 			"----------\n" +
47348 			"4. ERROR in X.java (at line 9)\n" +
47349 			"	return (String) new X().new Setter() {};\n" +
47350 			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
47351 			"Cannot cast from new Adapter.Setter(){} to String\n" +
47352 			"----------\n" +
47353 			"5. ERROR in X.java (at line 9)\n" +
47354 			"	return (String) new X().new Setter() {};\n" +
47355 			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
47356 			"Type mismatch: cannot convert from String to Adapter.Setter\n" +
47357 			"----------\n" +
47358 			"6. WARNING in X.java (at line 9)\n" +
47359 			"	return (String) new X().new Setter() {};\n" +
47360 			"	                    ^\n" +
47361 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
47362 			"----------\n" +
47363 			"7. WARNING in X.java (at line 9)\n" +
47364 			"	return (String) new X().new Setter() {};\n" +
47365 			"	                            ^^^^^^\n" +
47366 			"Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
47367 			"----------\n" +
47368 			"8. WARNING in X.java (at line 12)\n" +
47369 			"	List<Adapter.Setter> l = new ArrayList<X.Setter>();\n" +
47370 			"	     ^^^^^^^^^^^^^^\n" +
47371 			"Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
47372 			"----------\n" +
47373 			"9. WARNING in X.java (at line 12)\n" +
47374 			"	List<Adapter.Setter> l = new ArrayList<X.Setter>();\n" +
47375 			"	                                       ^^^^^^^^\n" +
47376 			"Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
47377 			"----------\n"
47378 		);
47379 }
47380 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=235921 - variation
47381 public void test1346() throws Exception {
47382 	this.runNegativeTest(
47383 			new String[] {
47384 				"X.java", // =================
47385 				"import java.util.*;\n" +
47386 				"class Adapter<T> {\n" +
47387 				"  class Setter<V> {}\n" +
47388 				"}\n" +
47389 				"\n" +
47390 				"public class X<T> extends Adapter {\n" +
47391 				"  public <V> Adapter.Setter makeSetter() {\n" +
47392 				"    return (X.Setter) \"a\";\n" +
47393 				"  }\n" +
47394 				"}\n", // =================
47395 			},
47396 			"----------\n" +
47397 			"1. WARNING in X.java (at line 6)\n" +
47398 			"	public class X<T> extends Adapter {\n" +
47399 			"	                          ^^^^^^^\n" +
47400 			"Adapter is a raw type. References to generic type Adapter<T> should be parameterized\n" +
47401 			"----------\n" +
47402 			"2. WARNING in X.java (at line 7)\n" +
47403 			"	public <V> Adapter.Setter makeSetter() {\n" +
47404 			"	           ^^^^^^^^^^^^^^\n" +
47405 			"Adapter.Setter is a raw type. References to generic type Adapter<T>.Setter<V> should be parameterized\n" +
47406 			"----------\n" +
47407 			"3. ERROR in X.java (at line 8)\n" +
47408 			"	return (X.Setter) \"a\";\n" +
47409 			"	       ^^^^^^^^^^^^^^\n" +
47410 			"Cannot cast from String to Adapter.Setter\n" +
47411 			"----------\n");
47412 }
47413 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=236220
47414 public void test1347() throws Exception {
47415 	this.runNegativeTest(
47416 			new String[] {
47417 				"DeprecatedType.java", // =================
47418 				"class Base {\n" +
47419 				"	class Member<U> {\n" +
47420 				"   }\n" +
47421 				"}\n" +
47422 				"\n" +
47423 				"@Deprecated\n" +
47424 				"public class DeprecatedType<T> extends Base {\n" +
47425 				"}\n",
47426 				"X.java", // =================
47427 				"public class X {\n" +
47428 				"  DeprecatedType.Member m1; // DeprecatedType and Member are raw + indirect access to Member\n" +
47429 				"  DeprecatedType.Member<String> m2; // DeprecatedType is raw + indirect access to Member\n" +
47430 				"  Zork z;\n" +
47431 				"}\n", // =================
47432 			},
47433 			"----------\n" +
47434 			"1. WARNING in X.java (at line 2)\n" +
47435 			"	DeprecatedType.Member m1; // DeprecatedType and Member are raw + indirect access to Member\n" +
47436 			"	^^^^^^^^^^^^^^\n" +
47437 			"The type DeprecatedType<T> is deprecated\n" +
47438 			"----------\n" +
47439 			"2. WARNING in X.java (at line 2)\n" +
47440 			"	DeprecatedType.Member m1; // DeprecatedType and Member are raw + indirect access to Member\n" +
47441 			"	^^^^^^^^^^^^^^^^^^^^^\n" +
47442 			"Base.Member is a raw type. References to generic type Base.Member<U> should be parameterized\n" +
47443 			"----------\n" +
47444 			"3. WARNING in X.java (at line 3)\n" +
47445 			"	DeprecatedType.Member<String> m2; // DeprecatedType is raw + indirect access to Member\n" +
47446 			"	^^^^^^^^^^^^^^\n" +
47447 			"The type DeprecatedType is deprecated\n" +
47448 			"----------\n" +
47449 			"4. ERROR in X.java (at line 4)\n" +
47450 			"	Zork z;\n" +
47451 			"	^^^^\n" +
47452 			"Zork cannot be resolved to a type\n" +
47453 			"----------\n");
47454 }
47455 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=174282 - variation
47456 public void test1348() {
47457 	this.runNegativeTest(
47458 			new String[] {
47459 				"X.java", // =================
47460 				"abstract class AbstractOBOverlaySettings extends AbstractOverlaySettings implements RefSymbolTypeSettings {/*empty*/}\n" +
47461 				"abstract class AbstractOverlaySettings implements SymbolTypeSettings {/*empty*/}\n" +
47462 				"interface DAFDataController<V> {/*empty*/}\n" +
47463 				"interface ReferenceableData {/*empty*/}\n" +
47464 				"enum SymbolTypes {/*empty*/}\n" +
47465 				"interface SymbolTypeSettings {/*empty*/}\n" +
47466 				"interface AllOverlaySettingsController {/*empty*/}\n" +
47467 				"interface DAFDataWithRefController<V extends ReferenceableData> extends DAFDataController<V> {/*empty*/}\n" +
47468 				"class OBAreaOverlaySettings extends AbstractOBOverlaySettings {/*empty*/}\n" +
47469 				"interface RefSymbolTypeSettings extends SymbolTypeSettings, ReferenceableData {/*empty*/}\n" +
47470 				"public class X {\n" +
47471 				"    public X() {\n" +
47472 				"        DAFDataController<? extends SymbolTypeSettings> controller00 = null;\n" +
47473 				"        DAFDataWithRefController<OBAreaOverlaySettings> controller01 = \n" +
47474 				"            (DAFDataWithRefController<OBAreaOverlaySettings>) controller00;\n" +
47475 				"    }\n" +
47476 				"    Zork z;\n" +
47477 				"}\n", // =================
47478 			},
47479 			"----------\n" +
47480 			"1. WARNING in X.java (at line 15)\n" +
47481 			"	(DAFDataWithRefController<OBAreaOverlaySettings>) controller00;\n" +
47482 			"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
47483 			"Type safety: Unchecked cast from DAFDataController<capture#1-of ? extends SymbolTypeSettings> to DAFDataWithRefController<OBAreaOverlaySettings>\n" +
47484 			"----------\n" +
47485 			"2. ERROR in X.java (at line 17)\n" +
47486 			"	Zork z;\n" +
47487 			"	^^^^\n" +
47488 			"Zork cannot be resolved to a type\n" +
47489 			"----------\n");
47490 }
47491 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=236707
47492 public void test1349() {
47493 	this.runNegativeTest(
47494 			new String[] {
47495 				"Scratch.java", // =================
47496 				"public class Scratch {\n" +
47497 				"        private Y rawObject = new Y();\n" +
47498 				"        public void caller() {\n" +
47499 				"                method(new X<Y<Z>>(), rawObject); // compile error in javac, unchecked conversion in Eclipse\n" +
47500 				"                this.<Y<Z>>method(new X<Y<Z>>(), rawObject); // unchecked warning in both\n" +
47501 				"        }\n" +
47502 				"        public <T> void method(X<T> x, T t) {}\n" +
47503 				"}\n" +
47504 				"class X<S> {}\n" +
47505 				"class Y<S> {}\n" +
47506 				"class Z { Zork z; }\n", // =================
47507 			},
47508 			"----------\n" +
47509 			"1. WARNING in Scratch.java (at line 2)\n" +
47510 			"	private Y rawObject = new Y();\n" +
47511 			"	        ^\n" +
47512 			"Y is a raw type. References to generic type Y<S> should be parameterized\n" +
47513 			"----------\n" +
47514 			"2. WARNING in Scratch.java (at line 2)\n" +
47515 			"	private Y rawObject = new Y();\n" +
47516 			"	                          ^\n" +
47517 			"Y is a raw type. References to generic type Y<S> should be parameterized\n" +
47518 			"----------\n" +
47519 			"3. WARNING in Scratch.java (at line 4)\n" +
47520 			"	method(new X<Y<Z>>(), rawObject); // compile error in javac, unchecked conversion in Eclipse\n" +
47521 			"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
47522 			"Type safety: Unchecked invocation method(X<Y<Z>>, Y) of the generic method method(X<T>, T) of type Scratch\n" +
47523 			"----------\n" +
47524 			"4. WARNING in Scratch.java (at line 4)\n" +
47525 			"	method(new X<Y<Z>>(), rawObject); // compile error in javac, unchecked conversion in Eclipse\n" +
47526 			"	                      ^^^^^^^^^\n" +
47527 			"Type safety: The expression of type Y needs unchecked conversion to conform to Y<Z>\n" +
47528 			"----------\n" +
47529 			"5. WARNING in Scratch.java (at line 5)\n" +
47530 			"	this.<Y<Z>>method(new X<Y<Z>>(), rawObject); // unchecked warning in both\n" +
47531 			"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
47532 			"Type safety: Unchecked invocation method(X<Y<Z>>, Y) of the generic method method(X<T>, T) of type Scratch\n" +
47533 			"----------\n" +
47534 			"6. WARNING in Scratch.java (at line 5)\n" +
47535 			"	this.<Y<Z>>method(new X<Y<Z>>(), rawObject); // unchecked warning in both\n" +
47536 			"	                                 ^^^^^^^^^\n" +
47537 			"Type safety: The expression of type Y needs unchecked conversion to conform to Y<Z>\n" +
47538 			"----------\n" +
47539 			"7. ERROR in Scratch.java (at line 11)\n" +
47540 			"	class Z { Zork z; }\n" +
47541 			"	          ^^^^\n" +
47542 			"Zork cannot be resolved to a type\n" +
47543 			"----------\n");
47544 }
47545 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=238484
47546 public void test1350() {
47547 	this.runConformTest(
47548 			new String[] {
47549 				"X.java", // =================
47550 				"import java.io.IOException;\n" +
47551 				"\n" +
47552 				"interface TreeVisitor<T, U> {\n" +
47553 				"	public T visit(U location);\n" +
47554 				"}\n" +
47555 				"\n" +
47556 				"interface TreeVisitable<U> {\n" +
47557 				"	public <T> T visit(TreeVisitor<T, U> visitor) throws IOException;\n" +
47558 				"}\n" +
47559 				"\n" +
47560 				"abstract class Param implements TreeVisitable<Param> {\n" +
47561 				"	public final Param lookforParam(final String name) {\n" +
47562 				"		TreeVisitor<Param, Param> visitor = new TreeVisitor<Param, Param>() {\n" +
47563 				"			public Param visit(Param location) {\n" +
47564 				"				return null;\n" +
47565 				"			}\n" +
47566 				"		};\n" +
47567 				"		return visit(visitor);\n" +
47568 				"	}\n" +
47569 				"\n" +
47570 				"	public abstract <T> T visit(TreeVisitor<T, Param> visitor);\n" +
47571 				"}\n" +
47572 				"\n" +
47573 				"class StructParam extends Param {\n" +
47574 				"	public <T> T visit(TreeVisitor<T, Param> visitor) {\n" +
47575 				"		return null;\n" +
47576 				"	}\n" +
47577 				"}\n" +
47578 				"\n" +
47579 				"public class X {\n" +
47580 				"	public static void main(String[] args) {\n" +
47581 				"		StructParam p = new StructParam();\n" +
47582 				"		p.lookforParam(\"abc\");\n" +
47583 				"		System.out.println(\"done\");\n" +
47584 				"	}\n" +
47585 				"}\n", // =================
47586 			},
47587 			"done");
47588 }
47589 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=238484 - variation
47590 public void test1351() {
47591 	this.runConformTest(
47592 			new String[] {
47593 				"X.java", // =================
47594 				"import java.io.IOException;\n" +
47595 				"\n" +
47596 				"interface IFoo {\n" +
47597 				"	<T> T foo(T t) throws IOException;\n" +
47598 				"}\n" +
47599 				"interface JFoo {\n" +
47600 				"	<T> T foo(T t) throws Exception;\n" +
47601 				"}\n" +
47602 				"abstract class Foo implements IFoo, JFoo {}\n" +
47603 				"\n" +
47604 				"public class X {\n" +
47605 				"	public static void main(String[] args) {\n" +
47606 				"		Foo f = createFoo();\n" +
47607 				"		try {\n" +
47608 				"			f.foo(null);\n" +
47609 				"		} catch(IOException e) {\n" +
47610 				"		}\n" +
47611 				"		System.out.println(\"done\");\n" +
47612 				"	}\n" +
47613 				"	static Foo createFoo() {\n" +
47614 				"		return new Foo() {\n" +
47615 				"			public <T> T foo(T t) {\n" +
47616 				"				return t;\n" +
47617 				"			}\n" +
47618 				"		};\n" +
47619 				"	}\n" +
47620 				"}\n", // =================
47621 			},
47622 			"done");
47623 }
47624 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=238484 - variation
47625 public void test1352() {
47626 	this.runConformTest(
47627 			new String[] {
47628 				"X.java", // =================
47629 				"import java.io.IOException;\n" +
47630 				"\n" +
47631 				"interface IFoo<U> {\n" +
47632 				"	<T> T foo(T t) throws IOException;\n" +
47633 				"}\n" +
47634 				"interface JFoo<U> {\n" +
47635 				"	<T> T foo(T t) throws Exception;\n" +
47636 				"}\n" +
47637 				"abstract class Foo implements IFoo<String>, JFoo<String> {}\n" +
47638 				"\n" +
47639 				"public class X {\n" +
47640 				"	public static void main(String[] args) {\n" +
47641 				"		Foo f = createFoo();\n" +
47642 				"		try {\n" +
47643 				"			f.foo(null);\n" +
47644 				"		} catch(IOException e) {\n" +
47645 				"		}\n" +
47646 				"		System.out.println(\"done\"); //dd\n" +
47647 				"	}\n" +
47648 				"	static Foo createFoo() {\n" +
47649 				"		return new Foo() {\n" +
47650 				"			public <T> T foo(T t) {\n" +
47651 				"				return t;\n" +
47652 				"			}\n" +
47653 				"		};\n" +
47654 				"	}\n" +
47655 				"}\n", // =================
47656 			},
47657 			"done");
47658 }
47659 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=238484 - variation
47660 public void test1353() {
47661 	this.runNegativeTest(
47662 			new String[] {
47663 				"X.java", // =================
47664 				"import java.io.IOException;\n" +
47665 				"\n" +
47666 				"interface IFoo<U> {\n" +
47667 				"	<T> T foo(T t) throws IOException;\n" +
47668 				"}\n" +
47669 				"interface JFoo<U> {\n" +
47670 				"	<T> T foo(T t);\n" +
47671 				"}\n" +
47672 				"abstract class Foo implements IFoo<String>, JFoo<String> {}\n" +
47673 				"\n" +
47674 				"public class X {\n" +
47675 				"	public static void main(String[] args) {\n" +
47676 				"		Foo f = createFoo();\n" +
47677 				"		try {\n" +
47678 				"			f.foo(null);\n" +
47679 				"		} catch(IOException e) {\n" +
47680 				"		}\n" +
47681 				"		System.out.println(\"done\"); //dd\n" +
47682 				"	}\n" +
47683 				"	static Foo createFoo() {\n" +
47684 				"		return new Foo() {\n" +
47685 				"			public <T> T foo(T t) {\n" +
47686 				"				return t;\n" +
47687 				"			}\n" +
47688 				"		};\n" +
47689 				"	}\n" +
47690 				"}\n", // =================
47691 			},
47692 			"----------\n" +
47693 			"1. ERROR in X.java (at line 16)\n" +
47694 			"	} catch(IOException e) {\n" +
47695 			"	        ^^^^^^^^^^^\n" +
47696 			"Unreachable catch block for IOException. This exception is never thrown from the try statement body\n" +
47697 			"----------\n");
47698 }
47699 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=237912
47700 public void test1354() {
47701 	this.runConformTest(
47702 			new String[] {
47703 				"X.java", // =================
47704 				"interface Operation<In> extends CheckedOperation<In, RuntimeException> {\n" +
47705 				"  void op(In o);\n" +
47706 				"}\n" +
47707 				"\n" +
47708 				"interface CheckedOperation<In, E extends Exception> {\n" +
47709 				"  void op(In o) throws E;\n" +
47710 				"}\n" +
47711 				"\n" +
47712 				"class ToUpper implements Operation<String> {\n" +
47713 				"  public void op(String o) {\n" +
47714 				"    System.out.print(\"[\"+o.toUpperCase()+\"]\");\n" +
47715 				"  }\n" +
47716 				"}\n" +
47717 				"\n" +
47718 				"public class X {\n" +
47719 				"  public static void main(String[] args) {\n" +
47720 				"    new ToUpper().op(\"hello world 1\"); // Works\n" +
47721 				"    Operation<String> t = new ToUpper();\n" +
47722 				"    t.op(\"hello world 2\"); // Doesn\'t work: Exception in thread \"main\" java.lang.NoSuchMethodError: Operation.op(Ljava/lang/String;)V\n" +
47723 				"  }\n" +
47724 				"}\n", // =================
47725 			},
47726 			"[HELLO WORLD 1][HELLO WORLD 2]");
47727 }
47728 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=237912 - variation
47729 public void test1355() {
47730 	this.runConformTest(
47731 			new String[] {
47732 				"X.java", // =================
47733 				"interface Operation<In> extends CheckedOperation<In, RuntimeException> {\n" +
47734 				"  void op(In o) throws RuntimeException;\n" +
47735 				"}\n" +
47736 				"\n" +
47737 				"interface CheckedOperation<In, E extends Exception> {\n" +
47738 				"  void op(In o) throws E;\n" +
47739 				"}\n" +
47740 				"\n" +
47741 				"class ToUpper implements Operation<String> {\n" +
47742 				"  public void op(String o) {\n" +
47743 				"    System.out.print(\"[\"+o.toUpperCase()+\"]\");\n" +
47744 				"  }\n" +
47745 				"}\n" +
47746 				"\n" +
47747 				"public class X {\n" +
47748 				"  public static void main(String[] args) {\n" +
47749 				"    new ToUpper().op(\"hello world 1\"); // Works\n" +
47750 				"    Operation<String> t = new ToUpper();\n" +
47751 				"    t.op(\"hello world 2\"); // Doesn\'t work: Exception in thread \"main\" java.lang.NoSuchMethodError: Operation.op(Ljava/lang/String;)V\n" +
47752 				"  }\n" +
47753 				"}\n", // =================
47754 			},
47755 			"[HELLO WORLD 1][HELLO WORLD 2]");
47756 }
47757 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=237912 - variation
47758 public void test1356() {
47759 	this.runConformTest(
47760 			new String[] {
47761 				"X.java", // =================
47762 				"class Activator {\n" +
47763 				"}\n" +
47764 				"interface Child<T> extends Parent<T> {\n" +
47765 				"	Activator get(T value);\n" +
47766 				"}\n" +
47767 				"interface Parent<T> {\n" +
47768 				"	Activator get(T value) throws RuntimeException;\n" +
47769 				"}\n" +
47770 				"public class X {\n" +
47771 				"	static class Impl<T> implements Child<T> {\n" +
47772 				"		public Activator get(T value) {\n" +
47773 				"			System.out.println(\"done\");\n" +
47774 				"			return null;\n" +
47775 				"		}\n" +
47776 				"	}\n" +
47777 				"	public static void main(String[] args) {\n" +
47778 				"		Child<Boolean> c = new Impl<Boolean>();\n" +
47779 				"		try {\n" +
47780 				"			c.get(true);\n" +
47781 				"		} catch (Throwable t) {			\n" +
47782 				"			t.printStackTrace();\n" +
47783 				"		}\n" +
47784 				"	}\n" +
47785 				"}\n", // =================
47786 			},
47787 			"done");
47788 }
47789 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=185422
47790 public void test1357() {
47791 	this.runNegativeTest(
47792 			new String[] {
47793 				"X.java", // =================
47794 				"import java.util.*;\n" +
47795 				"@interface Ann { Class<?> value(); }\n" +
47796 				"\n" +
47797 				"/**\n" +
47798 				" * @see Private - Private is not visible here\n" +
47799 				" */\n" +
47800 				"@Ann(X.Private.class) // Private is not visible here\n" +
47801 				"public abstract class X implements Map<X.Private,Secondary.SecondaryPrivate> {\n" +
47802 				"	/**\n" +
47803 				" * @see Private - Private is visible here\n" +
47804 				"	 */\n" +
47805 				"	private static interface Private {}\n" +
47806 				"	Private field;\n" +
47807 				"}\n" +
47808 				"class Secondary {\n" +
47809 				"	private static interface SecondaryPrivate {}\n" +
47810 				"}\n", // =================
47811 			},
47812 			"----------\n" +
47813 			"1. ERROR in X.java (at line 8)\n" +
47814 			"	public abstract class X implements Map<X.Private,Secondary.SecondaryPrivate> {\n" +
47815 			"	                                       ^^^^^^^^^\n" +
47816 			"The type X.Private is not visible\n" +
47817 			"----------\n" +
47818 			"2. ERROR in X.java (at line 8)\n" +
47819 			"	public abstract class X implements Map<X.Private,Secondary.SecondaryPrivate> {\n" +
47820 			"	                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
47821 			"The type Secondary.SecondaryPrivate is not visible\n" +
47822 			"----------\n");
47823 }
47824 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=185422 - variation
47825 public void test1358() {
47826 	this.runNegativeTest(
47827 			new String[] {
47828 				"X.java", // =================
47829 				"import java.util.List;\n" +
47830 				"public abstract class X implements List<X.Inter.Private> {\n" +
47831 				"	/**\n" +
47832 				"	 * @see Inter.Private - Private is visible here\n" +
47833 				"	 */\n" +
47834 				"	class Inter {\n" +
47835 				"		private class Private {}\n" +
47836 				"	}\n" +
47837 				"	Inter.Private field;\n" +
47838 				"}\n", // =================
47839 			},
47840 			"----------\n" +
47841 			"1. ERROR in X.java (at line 2)\n" +
47842 			"	public abstract class X implements List<X.Inter.Private> {\n" +
47843 			"	                                        ^^^^^^^^^^^^^^^\n" +
47844 			"The type X.Inter.Private is not visible\n" +
47845 			"----------\n");
47846 }
47847 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=185422 - variation
47848 public void test1359() {
47849 	this.runConformTest(
47850 			new String[] {
47851 				"X.java", // =================
47852 				"public class X<T> {\n" +
47853 				"	class M1 <U>{\n" +
47854 				"		private class Private<U> {\n" +
47855 				"		}\n" +
47856 				"	}\n" +
47857 				"	void foo() {\n" +
47858 				"		M1<String>.Private<?> p;\n" +
47859 				"	}\n" +
47860 				"}\n", // =================
47861 			},
47862 			"");
47863 }
47864 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=239118
47865 public void test1360() {
47866 	this.runConformTest(
47867 			new String[] {
47868 				"X.java", // =================
47869 				"public class X {\n" +
47870 				"    public static <T> T getValue(final Object bean, final String property) {\n" +
47871 				"        return (T)new Object();\n" +
47872 				"    }\n" +
47873 				"    public void testGenerics() {\n" +
47874 				"        int value = getValue(new Object(), \"\");\n" +
47875 				"    }\n" +
47876 				"}\n", // =================
47877 			},
47878 			"");
47879 }
47880 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=239118 - variation
47881 public void test1361() {
47882 	this.runConformTest(
47883 			new String[] {
47884 				"X.java", // =================
47885 				"public class X {\n" +
47886 				"    public static <T> T getValue(T t) {\n" +
47887 				"        return t;\n" +
47888 				"    }\n" +
47889 				"    public void testGenerics() {\n" +
47890 				"        int value = getValue(0);\n" +
47891 				"    }\n" +
47892 				"}\n", // =================
47893 			},
47894 			"");
47895 }
47896 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=239118 - variation
47897 public void test1362() {
47898 	this.runConformTest(
47899 			new String[] {
47900 				"X.java", // =================
47901 				"public class X {\n" +
47902 				"    public static <T> T getValue(T t1, T t2) {\n" +
47903 				"        return t1;\n" +
47904 				"    }\n" +
47905 				"    public void testGenerics() {\n" +
47906 				"        getValue(0, this);\n" +
47907 				"    }\n" +
47908 				"}\n", // =================
47909 			},
47910 			"");
47911 }
47912 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=239118 - variation
47913 public void test1363() {
47914 	this.runNegativeTest(
47915 			new String[] {
47916 				"X.java", // =================
47917 				"public class X {\n" +
47918 				"    public static <T> T getValue(T t1, T t2) {\n" +
47919 				"        return t1;\n" +
47920 				"    }\n" +
47921 				"\n" +
47922 				"    public void testGenerics(Comparable<String> s) {\n" +
47923 				"        int i = getValue(0, s);\n" +
47924 				"    }\n" +
47925 				"}\n", // =================
47926 			},
47927 			"----------\n" +
47928 			"1. ERROR in X.java (at line 7)\n" +
47929 			"	int i = getValue(0, s);\n" +
47930 			"	        ^^^^^^^^^^^^^^\n" +
47931 			"Type mismatch: cannot convert from Comparable<capture#1-of ? extends "+intersection("Object","Comparable<?>","Serializable")+"> to int\n" +
47932 			"----------\n");
47933 }
47934 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=239225
47935 public void test1364() {
47936 	this.runNegativeTest(
47937 			new String[] {
47938 				"Status.java", // =================
47939 				"import java.util.HashMap;\n" +
47940 				"import java.util.Map;\n" +
47941 				"\n" +
47942 				"public enum Status {\n" +
47943 				"	GOOD((byte) 0x00), BAD((byte) 0x02);\n" +
47944 				"\n" +
47945 				"	private static Map<Byte, Status> mapping;\n" +
47946 				"\n" +
47947 				"	private Status(final byte newValue) {\n" +
47948 				"\n" +
47949 				"		if (Status.mapping == null) {\n" +
47950 				"			Status.mapping = new HashMap<Byte, Status>();\n" +
47951 				"		}\n" +
47952 				"\n" +
47953 				"		Status.mapping.put(newValue, this);\n" +
47954 				"	}\n" +
47955 				"}\n", // =================
47956 			},
47957 			"----------\n" +
47958 			"1. ERROR in Status.java (at line 11)\n" +
47959 			"	if (Status.mapping == null) {\n" +
47960 			"	           ^^^^^^^\n" +
47961 			"Cannot refer to the static enum field Status.mapping within an initializer\n" +
47962 			"----------\n" +
47963 			"2. ERROR in Status.java (at line 12)\n" +
47964 			"	Status.mapping = new HashMap<Byte, Status>();\n" +
47965 			"	       ^^^^^^^\n" +
47966 			"Cannot refer to the static enum field Status.mapping within an initializer\n" +
47967 			"----------\n" +
47968 			"3. ERROR in Status.java (at line 15)\n" +
47969 			"	Status.mapping.put(newValue, this);\n" +
47970 			"	       ^^^^^^^\n" +
47971 			"Cannot refer to the static enum field Status.mapping within an initializer\n" +
47972 			"----------\n");
47973 }
47974 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=239203
47975 public void test1365() {
47976 	this.runConformTest(
47977 			new String[] {
47978 				"C.java", // =================
47979 				"class A<I extends B> {\n" +
47980 				"}\n" +
47981 				"\n" +
47982 				"class B {\n" +
47983 				"}\n" +
47984 				"\n" +
47985 				"public class C {\n" +
47986 				"	<U extends B, V extends A<U>> A<U> foo(Class<V> clazz) {\n" +
47987 				"		A<U> ret = bar(\"bla\");\n" +
47988 				"		return ret;\n" +
47989 				"	}\n" +
47990 				"\n" +
47991 				"	<U extends B, V extends A<U>> A<U> bar(String clazzName) {\n" +
47992 				"		return null;\n" +
47993 				"	}\n" +
47994 				"}\n", // =================
47995 			},
47996 			"");
47997 }
47998 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=239758
47999 public void test1366() {
48000 	this.runConformTest(
48001 			new String[] {
48002 				"X.java", // =================
48003 				"import java.io.IOException;\n" +
48004 				"\n" +
48005 				"interface IServiceAction<Response, Request, Fault extends Exception> {\n" +
48006 				"	Response execute(Request parameter) throws Fault;\n" +
48007 				"}\n" +
48008 				"\n" +
48009 				"interface IServiceOperation<Response, Request, Fault extends Exception> extends IServiceAction<Response, Request, Fault> {\n" +
48010 				"	Response execute(Request parameter) throws Fault;\n" +
48011 				"}\n" +
48012 				"\n" +
48013 				"public class X {\n" +
48014 				"	public String execute(String parameter) throws IOException {\n" +
48015 				"		return serviceOperation.execute(parameter);\n" +
48016 				"	}\n" +
48017 				"\n" +
48018 				"	private final IServiceOperation<String, String, IOException> serviceOperation = null;\n" +
48019 				"}\n", // =================
48020 			},
48021 			"");
48022 }
48023 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=239439
48024 public void test1367() {
48025 	this.runNegativeTest(
48026 			new String[] {
48027 				"X.java", //-----------------------------------------------------------------------
48028 				"public class X {\n" +
48029 				"	private static Map<String, String> var;\n" +
48030 				"	static {\n" +
48031 				"		var= new HashMap<String, String>();\n" +
48032 				"	}\n" +
48033 				"}\n",//-----------------------------------------------------------------------
48034 			},
48035 			"----------\n" +
48036 			"1. ERROR in X.java (at line 2)\n" +
48037 			"	private static Map<String, String> var;\n" +
48038 			"	               ^^^\n" +
48039 			"Map cannot be resolved to a type\n" +
48040 			"----------\n" +
48041 			"2. ERROR in X.java (at line 4)\n" +
48042 			"	var= new HashMap<String, String>();\n" +
48043 			"	^^^\n" +
48044 			"Map cannot be resolved to a type\n" +
48045 			"----------\n" +
48046 			"3. ERROR in X.java (at line 4)\n" +
48047 			"	var= new HashMap<String, String>();\n" +
48048 			"	         ^^^^^^^\n" +
48049 			"HashMap cannot be resolved to a type\n" +
48050 			"----------\n");
48051 }
48052 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=244164
48053 public void test1368() {
48054 	this.runNegativeTest(
48055 			new String[] {
48056 				"X.java", //-----------------------------------------------------------------------
48057 				"import java.util.HashMap;\n" +
48058 				"import java.util.Map;\n" +
48059 				"public class X {\n" +
48060 				"	private static Map<String, Zork> map = new HashMap<String, X>();\n" +
48061 				"	public static X foo(String s) {\n" +
48062 				"		return map.get(s);\n" +
48063 				"	}\n" +
48064 				"}",//-----------------------------------------------------------------------
48065 			},
48066 			"----------\n" +
48067 			"1. ERROR in X.java (at line 4)\n" +
48068 			"	private static Map<String, Zork> map = new HashMap<String, X>();\n" +
48069 			"	                           ^^^^\n" +
48070 			"Zork cannot be resolved to a type\n" +
48071 			"----------\n" +
48072 			"2. ERROR in X.java (at line 6)\n" +
48073 			"	return map.get(s);\n" +
48074 			"	       ^^^\n" +
48075 			"Zork cannot be resolved to a type\n" +
48076 			"----------\n");
48077 }
48078 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=244164
48079 public void test1369() {
48080 	this.runNegativeTest(
48081 			new String[] {
48082 				"X.java", //-----------------------------------------------------------------------
48083 				"class X {\n" +
48084 				"	A<E> a; // E is undefined on purpose\n" +
48085 				"	X() { a = new A<E>(); } // causes Missing code implementation\n" +
48086 				"}",
48087 				"A.java",
48088 				"class A<E> {}",//-----------------------------------------------------------------------
48089 			},
48090 			"----------\n" +
48091 			"1. ERROR in X.java (at line 2)\n" +
48092 			"	A<E> a; // E is undefined on purpose\n" +
48093 			"	  ^\n" +
48094 			"E cannot be resolved to a type\n" +
48095 			"----------\n" +
48096 			"2. ERROR in X.java (at line 3)\n" +
48097 			"	X() { a = new A<E>(); } // causes Missing code implementation\n" +
48098 			"	      ^\n" +
48099 			"E cannot be resolved to a type\n" +
48100 			"----------\n" +
48101 			"3. ERROR in X.java (at line 3)\n" +
48102 			"	X() { a = new A<E>(); } // causes Missing code implementation\n" +
48103 			"	                ^\n" +
48104 			"E cannot be resolved to a type\n" +
48105 			"----------\n");
48106 }
48107 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=242448
48108 public void test1370() {
48109 	this.runConformTest(
48110 			new String[] {
48111 				"restricted/NonPublicInterface.java", //-----------------------------------------------------------------------
48112 				"package restricted;\n" +
48113 				"interface NonPublicInterface {}\n",
48114 				"restricted/NonPublicInterfaceImplementor.java", //-----------------------------------------------------------------------
48115 				"package restricted;\n" +
48116 				"public class NonPublicInterfaceImplementor<E> implements NonPublicInterface {\n" +
48117 				"    public NonPublicInterfaceImplementor<E> selfCall() {\n" +
48118 				"        return this;\n" +
48119 				"    }\n" +
48120 				"}\n",
48121 				"restricted/UnuseableOutsideRestrictedWithECJ.java", //-----------------------------------------------------------------------
48122 				"package restricted;\n" +
48123 				"public class UnuseableOutsideRestrictedWithECJ {\n" +
48124 				"    public void ecjDoesNotLikeGenericizedParameter(NonPublicInterface notVisible) { }\n" +
48125 				"}\n",
48126 				"usesrestricted/CannotCompileInEcj.java", //-----------------------------------------------------------------------
48127 				"package usesrestricted;\n" +
48128 				"import restricted.UnuseableOutsideRestrictedWithECJ;\n" +
48129 				"import restricted.NonPublicInterfaceImplementor;\n" +
48130 				"public class CannotCompileInEcj {\n" +
48131 				"    public static void main(String[] args) {\n" +
48132 				"        new UnuseableOutsideRestrictedWithECJ().ecjDoesNotLikeGenericizedParameter(new NonPublicInterfaceImplementor().selfCall());\n" +
48133 				"    }\n" +
48134 				"}\n",//-----------------------------------------------------------------------
48135 			},
48136 			"");
48137 }
48138 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=242448 - variation
48139 public void test1371() {
48140 	this.runConformTest(
48141 			new String[] {
48142 				"restricted/NonPublicInterface.java", //-----------------------------------------------------------------------
48143 				"package restricted;\n" +
48144 				"interface NonPublicInterface {}\n",
48145 				"restricted/NonPublicInterfaceImplementor.java", //-----------------------------------------------------------------------
48146 				"package restricted;\n" +
48147 				"public class NonPublicInterfaceImplementor<E extends NonPublicInterface> implements NonPublicInterface {\n" +
48148 				"    public E selfCall() {\n" +
48149 				"        return null;\n" +
48150 				"    }\n" +
48151 				"}\n",
48152 				"restricted/UnuseableOutsideRestrictedWithECJ.java", //-----------------------------------------------------------------------
48153 				"package restricted;\n" +
48154 				"public class UnuseableOutsideRestrictedWithECJ {\n" +
48155 				"    public void ecjDoesNotLikeGenericizedParameter(NonPublicInterface notVisible) { }\n" +
48156 				"}\n",
48157 				"usesrestricted/CannotCompileInEcj.java", //-----------------------------------------------------------------------
48158 				"package usesrestricted;\n" +
48159 				"import restricted.UnuseableOutsideRestrictedWithECJ;\n" +
48160 				"import restricted.NonPublicInterfaceImplementor;\n" +
48161 				"public class CannotCompileInEcj {\n" +
48162 				"    public static void main(String[] args) {\n" +
48163 				"        new UnuseableOutsideRestrictedWithECJ().ecjDoesNotLikeGenericizedParameter(new NonPublicInterfaceImplementor().selfCall());\n" +
48164 				"    }\n" +
48165 				"}\n",//-----------------------------------------------------------------------
48166 			},
48167 			"");
48168 }
48169 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=242448 - variation
48170 public void test1372() {
48171 	this.runConformTest(
48172 			new String[] {
48173 				"restricted/NonPublicInterface.java", //-----------------------------------------------------------------------
48174 				"package restricted;\n" +
48175 				"interface NonPublicInterface {}\n",
48176 				"restricted/NonPublicInterfaceImplementor.java", //-----------------------------------------------------------------------
48177 				"package restricted;\n" +
48178 				"public class NonPublicInterfaceImplementor<E extends NonPublicInterfaceImplementor> implements NonPublicInterface {\n" +
48179 				"    public E selfCall() {\n" +
48180 				"        return null;\n" +
48181 				"    }\n" +
48182 				"}\n",
48183 				"restricted/UnuseableOutsideRestrictedWithECJ.java", //-----------------------------------------------------------------------
48184 				"package restricted;\n" +
48185 				"public class UnuseableOutsideRestrictedWithECJ {\n" +
48186 				"    public void ecjDoesNotLikeGenericizedParameter(NonPublicInterface notVisible) { }\n" +
48187 				"}\n",
48188 				"usesrestricted/CannotCompileInEcj.java", //-----------------------------------------------------------------------
48189 				"package usesrestricted;\n" +
48190 				"import restricted.UnuseableOutsideRestrictedWithECJ;\n" +
48191 				"import restricted.NonPublicInterfaceImplementor;\n" +
48192 				"public class CannotCompileInEcj {\n" +
48193 				"    public static void main(String[] args) {\n" +
48194 				"        new UnuseableOutsideRestrictedWithECJ().ecjDoesNotLikeGenericizedParameter(new NonPublicInterfaceImplementor().selfCall());\n" +
48195 				"    }\n" +
48196 				"}\n",//-----------------------------------------------------------------------
48197 			},
48198 			"");
48199 }
48200 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=242448 - variation
48201 public void test1373() {
48202 	this.runConformTest(
48203 			new String[] {
48204 				"restricted/NonPublicInterface.java", //-----------------------------------------------------------------------
48205 				"package restricted;\n" +
48206 				"interface NonPublicInterface {}\n",
48207 				"restricted/NonPublicInterfaceImplementor.java", //-----------------------------------------------------------------------
48208 				"package restricted;\n" +
48209 				"public class NonPublicInterfaceImplementor<E> implements NonPublicInterface {\n" +
48210 				"    public NonPublicInterfaceImplementor<E> next;\n" +
48211 				"}\n",
48212 				"restricted/UnuseableOutsideRestrictedWithECJ.java", //-----------------------------------------------------------------------
48213 				"package restricted;\n" +
48214 				"public class UnuseableOutsideRestrictedWithECJ {\n" +
48215 				"    public void ecjDoesNotLikeGenericizedParameter(NonPublicInterface notVisible) { }\n" +
48216 				"}\n",
48217 				"usesrestricted/CannotCompileInEcj.java", //-----------------------------------------------------------------------
48218 				"package usesrestricted;\n" +
48219 				"import restricted.UnuseableOutsideRestrictedWithECJ;\n" +
48220 				"import restricted.NonPublicInterfaceImplementor;\n" +
48221 				"public class CannotCompileInEcj {\n" +
48222 				"    public static void main(String[] args) {\n" +
48223 				"        new UnuseableOutsideRestrictedWithECJ().ecjDoesNotLikeGenericizedParameter(new NonPublicInterfaceImplementor().next);\n" +
48224 				"    }\n" +
48225 				"}\n",//-----------------------------------------------------------------------
48226 			},
48227 			"");
48228 }
48229 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=242448 - variation
48230 public void test1374() {
48231 	this.runConformTest(
48232 			new String[] {
48233 				"restricted/NonPublicInterface.java", //-----------------------------------------------------------------------
48234 				"package restricted;\n" +
48235 				"interface NonPublicInterface {}\n",
48236 				"restricted/NonPublicInterfaceImplementor.java", //-----------------------------------------------------------------------
48237 				"package restricted;\n" +
48238 				"public class NonPublicInterfaceImplementor<E> implements NonPublicInterface {\n" +
48239 				"    public NonPublicInterfaceImplementor<E> next;\n" +
48240 				"}\n",
48241 				"restricted/UnuseableOutsideRestrictedWithECJ.java", //-----------------------------------------------------------------------
48242 				"package restricted;\n" +
48243 				"public class UnuseableOutsideRestrictedWithECJ {\n" +
48244 				"    public void ecjDoesNotLikeGenericizedParameter(NonPublicInterface notVisible) { }\n" +
48245 				"}\n",
48246 				"usesrestricted/CannotCompileInEcj.java", //-----------------------------------------------------------------------
48247 				"package usesrestricted;\n" +
48248 				"import restricted.UnuseableOutsideRestrictedWithECJ;\n" +
48249 				"import restricted.NonPublicInterfaceImplementor;\n" +
48250 				"public class CannotCompileInEcj {\n" +
48251 				"    public static void main(String[] args) {\n" +
48252 				"        NonPublicInterfaceImplementor impl = new NonPublicInterfaceImplementor();\n" +
48253 				"        new UnuseableOutsideRestrictedWithECJ().ecjDoesNotLikeGenericizedParameter(impl.next);\n" +
48254 				"    }\n" +
48255 				"}\n",//-----------------------------------------------------------------------
48256 			},
48257 			"");
48258 }
48259 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=242448 - variation
48260 public void test1375() {
48261 	this.runConformTest(
48262 			new String[] {
48263 				"restricted/NonPublicInterface.java", //-----------------------------------------------------------------------
48264 				"package restricted;\n" +
48265 				"interface NonPublicInterface {}\n",
48266 				"restricted/NonPublicInterfaceImplementor.java", //-----------------------------------------------------------------------
48267 				"package restricted;\n" +
48268 				"public class NonPublicInterfaceImplementor<E> implements NonPublicInterface {\n" +
48269 				"    public NonPublicInterfaceImplementor<E> next;\n" +
48270 				"}\n",
48271 				"restricted/UnuseableOutsideRestrictedWithECJ.java", //-----------------------------------------------------------------------
48272 				"package restricted;\n" +
48273 				"public class UnuseableOutsideRestrictedWithECJ {\n" +
48274 				"    public void ecjDoesNotLikeGenericizedParameter(NonPublicInterface notVisible) { }\n" +
48275 				"}\n",
48276 				"usesrestricted/CannotCompileInEcj.java", //-----------------------------------------------------------------------
48277 				"package usesrestricted;\n" +
48278 				"import restricted.UnuseableOutsideRestrictedWithECJ;\n" +
48279 				"import restricted.NonPublicInterfaceImplementor;\n" +
48280 				"public class CannotCompileInEcj {\n" +
48281 				"    public static void main(String[] args) {\n" +
48282 				"        NonPublicInterfaceImplementor impl = new NonPublicInterfaceImplementor();\n" +
48283 				"        new UnuseableOutsideRestrictedWithECJ().ecjDoesNotLikeGenericizedParameter(impl.next.next);\n" +
48284 				"    }\n" +
48285 				"}\n",//-----------------------------------------------------------------------
48286 			},
48287 			"");
48288 }
48289 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=242448 - variation
48290 public void test1376() {
48291 	this.runConformTest(
48292 			new String[] {
48293 				"restricted/NonPublicInterface.java", //-----------------------------------------------------------------------
48294 				"package restricted;\n" +
48295 				"interface NonPublicInterface {}\n",
48296 				"restricted/NonPublicInterfaceImplementor.java", //-----------------------------------------------------------------------
48297 				"package restricted;\n" +
48298 				"public class NonPublicInterfaceImplementor<E> implements NonPublicInterface {}\n",
48299 				"restricted/UnuseableOutsideRestrictedWithECJ.java", //-----------------------------------------------------------------------
48300 				"package restricted;\n" +
48301 				"public class UnuseableOutsideRestrictedWithECJ {\n" +
48302 				"    public void ecjDoesNotLikeGenericizedParameter(NonPublicInterface notVisible) { }\n" +
48303 				"}\n",
48304 				"usesrestricted/CannotCompileInEcj.java", //-----------------------------------------------------------------------
48305 				"package usesrestricted;\n" +
48306 				"import restricted.UnuseableOutsideRestrictedWithECJ;\n" +
48307 				"import restricted.NonPublicInterfaceImplementor;\n" +
48308 				"public class CannotCompileInEcj<E> {\n" +
48309 				"    public NonPublicInterfaceImplementor<E> next;\n" +
48310 				"    public void foo() {\n" +
48311 				"        new UnuseableOutsideRestrictedWithECJ().ecjDoesNotLikeGenericizedParameter(next);\n" +
48312 				"    }\n" +
48313 				"}\n",//-----------------------------------------------------------------------
48314 			},
48315 			"");
48316 }
48317 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=245453
48318 public void test1377() {
48319 	this.runNegativeTest(
48320 			new String[] {
48321 				"X.java", //-----------------------------------------------------------------------
48322 				"import java.rmi.RemoteException;\n" +
48323 				"public class X {\n" +
48324 				"        private static <T extends Exception> T foo() throws T {\n" +
48325 				"                throw (T) new InterruptedException();\n" +
48326 				"        }\n" +
48327 				"        private static void foo2() {\n" +
48328 				"                try {\n" +
48329 				"                        RemoteException ex = foo();\n" +
48330 				"                } catch (RemoteException e) {\n" +
48331 				"                        e.printStackTrace();\n" +
48332 				"                }\n" +
48333 				"        }\n" +
48334 				"        public static void main( String[] args) {\n" +
48335 			"               foo2();\n" +
48336 				"			Zork z;\n" +
48337 				"        }\n" +
48338 				"}\n",//-----------------------------------------------------------------------
48339 			},
48340 			"----------\n" +
48341 			"1. WARNING in X.java (at line 4)\n" +
48342 			"	throw (T) new InterruptedException();\n" +
48343 			"	      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
48344 			"Type safety: Unchecked cast from InterruptedException to T\n" +
48345 			"----------\n" +
48346 			"2. ERROR in X.java (at line 15)\n" +
48347 			"	Zork z;\n" +
48348 			"	^^^^\n" +
48349 			"Zork cannot be resolved to a type\n" +
48350 			"----------\n");
48351 }
48352 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=241502
48353 public void test1378() {
48354 	this.runConformTest(
48355 			new String[] {
48356 				"X.java", //-----------------------------------------------------------------------
48357 				"//the remote-usable interface\n" +
48358 				"class RemoteException extends Throwable {}\n" +
48359 				"	\n" +
48360 				"interface RemoteStore {\n" +
48361 				"    public abstract <P> P get(Class<P> c) throws RemoteException;\n" +
48362 				"}\n" +
48363 				"\n" +
48364 				"//the interface for local use\n" +
48365 				"interface Store extends RemoteStore{\n" +
48366 				"    public <P> P get(Class<P> c) ;\n" +
48367 				"}\n" +
48368 				"\n" +
48369 				"//the implementation\n" +
48370 				"class StoreImpl implements Store {\n" +
48371 				"    public <P> P get(Class<P> c) {\n" +
48372 				"        System.out.print(\"[get]\");\n" +
48373 				"        return null;\n" +
48374 				"    }\n" +
48375 				"}\n" +
48376 				"\n" +
48377 				"class Persistent {\n" +
48378 				"}\n" +
48379 				"\n" +
48380 				"public class X {\n" +
48381 				"public static void main(String[] args) {\n" +
48382 				"    try {\n" +
48383 				"        RemoteStore t = new StoreImpl();\n" +
48384 				"        t.get(Object.class); //works\n" +
48385 				"        t.get(Persistent.class); //works\n" +
48386 				"    } catch (RemoteException e) {\n" +
48387 				"        e.printStackTrace();\n" +
48388 				"    }\n" +
48389 				"    Store t = new StoreImpl();\n" +
48390 				"    t.get(Object.class); //works\n" +
48391 				"    t.get(Persistent.class); //NoSuchMethodError\n" +
48392 				"} \n" +
48393 				"}\n",//-----------------------------------------------------------------------
48394 			},
48395 			"[get][get][get][get]");
48396 }
48397 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=245453 - variation
48398 public void test1379() {
48399 	this.runNegativeTest(
48400 			new String[] {
48401 				"X.java", //-----------------------------------------------------------------------
48402 				"import java.rmi.RemoteException;\n" +
48403 				"public class X{\n" +
48404 				"        private static <T extends Exception> T foo() {\n" +
48405 				"                return (T)new InterruptedException();\n" +
48406 				"        }\n" +
48407 				"        public static void main( String[] args) {\n" +
48408 				"            RemoteException ex = foo();\n" +
48409 				"			 Zork z;\n" +
48410 				"        }\n" +
48411 				"}\n",//-----------------------------------------------------------------------
48412 			},
48413 			"----------\n" +
48414 			"1. WARNING in X.java (at line 4)\n" +
48415 			"	return (T)new InterruptedException();\n" +
48416 			"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
48417 			"Type safety: Unchecked cast from InterruptedException to T\n" +
48418 			"----------\n" +
48419 			"2. ERROR in X.java (at line 8)\n" +
48420 			"	Zork z;\n" +
48421 			"	^^^^\n" +
48422 			"Zork cannot be resolved to a type\n" +
48423 			"----------\n");
48424 }
48425 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=174447
48426 public void test1380() {
48427 	this.runConformTest(
48428 			new String[] {
48429 				"X.java", //-----------------------------------------------------------------------
48430 				"public class X {\n" +
48431 				"    public static <E extends Enum<E>> void f() {\n" +
48432 				"    }\n" +
48433 				"    public static void main(String[] args) {\n" +
48434 				"      f();\n" +
48435 				"    }\n" +
48436 				"}\n",//-----------------------------------------------------------------------
48437 			},
48438 			"");
48439 }
48440 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=247953
48441 // FIXME javac8 rejects (why?)
48442 public void test1381()  throws Exception {
48443 	this.runConformTest(
48444 		new String[] {
48445 			"X.java",
48446 			"public class X<T extends AA & p.IB> {\n" +
48447 			"	T t;\n" +
48448 			"	void foo() {\n" +
48449 			"		this.t.baz();\n" +
48450 			"	}\n" +
48451 			"	public static void main(String[] args) {\n" +
48452 			"		X<CC> xcc = new X<CC>();\n" +
48453 			"		xcc.t = new CC();\n" +
48454 			"		xcc.foo();\n" +
48455 			"	}\n" +
48456 			"}\n" +
48457 			"class AA {\n" +
48458 			"	void bar() {}\n" +
48459 			"}\n" +
48460 			"class CC extends AA implements p.IB {\n" +
48461 			"	public void baz() {\n" +
48462 			"		System.out.println(\"done\");\n" +
48463 			"	}\n" +
48464 			"}\n",
48465 			"p/IB.java", // =====================
48466 			"package p;\n" +
48467 			"interface IA {\n" + // non visible
48468 			"	void baz();\n" +
48469 			"}\n" +
48470 			"public interface IB extends IA {\n" +
48471 			"}\n",
48472 		},
48473 		"done");
48474 	// check #baz() invocation declaring class is IB
48475 	String expectedOutput =
48476 		"  // Method descriptor #10 ()V\n" +
48477 		"  // Stack: 1, Locals: 1\n" +
48478 		"  void foo();\n" +
48479 		"     0  aload_0 [this]\n" +
48480 		"     1  getfield X.t : AA [21]\n" +
48481 		"     4  checkcast p.IB [23]\n" +
48482 		"     7  invokeinterface p.IB.baz() : void [25] [nargs: 1]\n" +
48483 		"    12  return\n" +
48484 		"      Line numbers:\n" +
48485 		"        [pc: 0, line: 4]\n" +
48486 		"        [pc: 12, line: 5]\n" +
48487 		"      Local variable table:\n" +
48488 		"        [pc: 0, pc: 13] local: this index: 0 type: X\n";
48489 
48490 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
48491 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
48492 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
48493 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
48494 	int index = result.indexOf(expectedOutput);
48495 	if (index == -1 || expectedOutput.length() == 0) {
48496 		System.out.println(Util.displayString(result, 3));
48497 	}
48498 	if (index == -1) {
48499 		assertEquals("Wrong contents", expectedOutput, result);
48500 	}
48501 }
48502 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=247953 - variation
48503 public void test1382()  throws Exception {
48504 	this.runConformTest(
48505 		new String[] {
48506 			"X.java",
48507 			"public class X<T> {\n" +
48508 			"	T get() { return null; }\n" +
48509 			"	\n" +
48510 			"	void foo() {\n" +
48511 			"		X<BB> xbb = new X<BB>();\n" +
48512 			"		xbb.get().bar();\n" +
48513 			"	}\n" +
48514 			"}\n" +
48515 			"class AA {\n" +
48516 			"	void bar() {}\n" +
48517 			"}\n" +
48518 			"class BB extends AA {}\n"
48519 		},
48520 		"");
48521 	// check #bar() invocation declaring class is BB
48522 	String expectedOutput =
48523 		"  // Method descriptor #6 ()V\n" +
48524 		"  // Stack: 2, Locals: 2\n" +
48525 		"  void foo();\n" +
48526 		"     0  new X [1]\n" +
48527 		"     3  dup\n" +
48528 		"     4  invokespecial X() [21]\n" +
48529 		"     7  astore_1 [xbb]\n" +
48530 		"     8  aload_1 [xbb]\n" +
48531 		"     9  invokevirtual X.get() : java.lang.Object [22]\n" +
48532 		"    12  checkcast BB [24]\n" +
48533 		"    15  invokevirtual BB.bar() : void [26]\n" +
48534 		"    18  return\n" +
48535 		"      Line numbers:\n" +
48536 		"        [pc: 0, line: 5]\n" +
48537 		"        [pc: 8, line: 6]\n" +
48538 		"        [pc: 18, line: 7]\n" +
48539 		"      Local variable table:\n" +
48540 		"        [pc: 0, pc: 19] local: this index: 0 type: X\n" +
48541 		"        [pc: 8, pc: 19] local: xbb index: 1 type: X\n";
48542 
48543 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
48544 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
48545 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
48546 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
48547 	int index = result.indexOf(expectedOutput);
48548 	if (index == -1 || expectedOutput.length() == 0) {
48549 		System.out.println(Util.displayString(result, 3));
48550 	}
48551 	if (index == -1) {
48552 		assertEquals("Wrong contents", expectedOutput, result);
48553 	}
48554 }
48555 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=247953 - variation
48556 public void test1383()  throws Exception {
48557 	this.runConformTest(
48558 		new String[] {
48559 			"X.java",
48560 			"public class X<T> {\n" +
48561 			"	T get() { return null; }\n" +
48562 			"	\n" +
48563 			"	void foo() {\n" +
48564 			"		X<BB> xbb = new X<BB>();\n" +
48565 			"		int j = xbb.get().bar;\n" +
48566 			"	}\n" +
48567 			"}\n" +
48568 			"class AA {\n" +
48569 			"	int bar;\n" +
48570 			"}\n" +
48571 			"class BB extends AA {}\n"
48572 		},
48573 		"");
48574 	// check #bar field read declaring class is BB
48575 	String expectedOutput =
48576 		"  // Method descriptor #6 ()V\n" +
48577 		"  // Stack: 2, Locals: 3\n" +
48578 		"  void foo();\n" +
48579 		"     0  new X [1]\n" +
48580 		"     3  dup\n" +
48581 		"     4  invokespecial X() [21]\n" +
48582 		"     7  astore_1 [xbb]\n" +
48583 		"     8  aload_1 [xbb]\n" +
48584 		"     9  invokevirtual X.get() : java.lang.Object [22]\n" +
48585 		"    12  checkcast BB [24]\n" +
48586 		"    15  getfield BB.bar : int [26]\n" +
48587 		"    18  istore_2 [j]\n" +
48588 		"    19  return\n" +
48589 		"      Line numbers:\n" +
48590 		"        [pc: 0, line: 5]\n" +
48591 		"        [pc: 8, line: 6]\n" +
48592 		"        [pc: 19, line: 7]\n" +
48593 		"      Local variable table:\n" +
48594 		"        [pc: 0, pc: 20] local: this index: 0 type: X\n" +
48595 		"        [pc: 8, pc: 20] local: xbb index: 1 type: X\n" +
48596 		"        [pc: 19, pc: 20] local: j index: 2 type: int\n";
48597 
48598 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
48599 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
48600 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
48601 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
48602 	int index = result.indexOf(expectedOutput);
48603 	if (index == -1 || expectedOutput.length() == 0) {
48604 		System.out.println(Util.displayString(result, 3));
48605 	}
48606 	if (index == -1) {
48607 		assertEquals("Wrong contents", expectedOutput, result);
48608 	}
48609 }
48610 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=247953 - variation
48611 public void test1384()  throws Exception {
48612 	this.runConformTest(
48613 		new String[] {
48614 			"X.java",
48615 			"public class X<T> {\n" +
48616 			"	T get() { return null; }\n" +
48617 			"	\n" +
48618 			"	void foo() {\n" +
48619 			"		X<BB> xbb = new X<BB>();\n" +
48620 			"		xbb.get().bar = 12;\n" +
48621 			"	}\n" +
48622 			"}\n" +
48623 			"class AA {\n" +
48624 			"	int bar;\n" +
48625 			"}\n" +
48626 			"class BB extends AA {}\n"
48627 		},
48628 		"");
48629 	// check #bar field store declaring class is BB
48630 	String expectedOutput =
48631 		"  // Method descriptor #6 ()V\n" +
48632 		"  // Stack: 2, Locals: 2\n" +
48633 		"  void foo();\n" +
48634 		"     0  new X [1]\n" +
48635 		"     3  dup\n" +
48636 		"     4  invokespecial X() [21]\n" +
48637 		"     7  astore_1 [xbb]\n" +
48638 		"     8  aload_1 [xbb]\n" +
48639 		"     9  invokevirtual X.get() : java.lang.Object [22]\n" +
48640 		"    12  checkcast BB [24]\n" +
48641 		"    15  bipush 12\n" +
48642 		"    17  putfield BB.bar : int [26]\n" +
48643 		"    20  return\n" +
48644 		"      Line numbers:\n" +
48645 		"        [pc: 0, line: 5]\n" +
48646 		"        [pc: 8, line: 6]\n" +
48647 		"        [pc: 20, line: 7]\n" +
48648 		"      Local variable table:\n" +
48649 		"        [pc: 0, pc: 21] local: this index: 0 type: X\n" +
48650 		"        [pc: 8, pc: 21] local: xbb index: 1 type: X\n";
48651 
48652 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
48653 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
48654 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
48655 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
48656 	int index = result.indexOf(expectedOutput);
48657 	if (index == -1 || expectedOutput.length() == 0) {
48658 		System.out.println(Util.displayString(result, 3));
48659 	}
48660 	if (index == -1) {
48661 		assertEquals("Wrong contents", expectedOutput, result);
48662 	}
48663 }
48664 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=247953 - variation
48665 public void test1385()  throws Exception {
48666 	this.runConformTest(
48667 		new String[] {
48668 			"X.java",
48669 			"public class X<T extends AA & IB> {\n" +
48670 			"	T get() { return null; }\n" +
48671 			"	\n" +
48672 			"	void foo(X<T> xt) {\n" +
48673 			"		xt.get().baz();\n" +
48674 			"	}\n" +
48675 			"}\n" +
48676 			"class AA {\n" +
48677 			"	void bar() {}\n" +
48678 			"}\n" +
48679 			"interface IA {\n" +
48680 			"	void baz();\n" +
48681 			"}\n" +
48682 			"interface IB extends IA {\n" +
48683 			"}\n"
48684 		},
48685 		"");
48686 	// check #baz() invocation declaring class is not IA
48687 	String expectedOutput =
48688 		"  // Method descriptor #21 (LX;)V\n" +
48689 		"  // Signature: (LX<TT;>;)V\n" +
48690 		"  // Stack: 1, Locals: 2\n" +
48691 		"  void foo(X xt);\n" +
48692 		"     0  aload_1 [xt]\n" +
48693 		"     1  invokevirtual X.get() : AA [23]\n" +
48694 		"     4  checkcast IB [25]\n" +
48695 		"     7  invokeinterface IB.baz() : void [27] [nargs: 1]\n" +
48696 		"    12  return\n" +
48697 		"      Line numbers:\n" +
48698 		"        [pc: 0, line: 5]\n" +
48699 		"        [pc: 12, line: 6]\n" +
48700 		"      Local variable table:\n" +
48701 		"        [pc: 0, pc: 13] local: this index: 0 type: X\n" +
48702 		"        [pc: 0, pc: 13] local: xt index: 1 type: X\n";
48703 
48704 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
48705 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
48706 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
48707 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
48708 	int index = result.indexOf(expectedOutput);
48709 	if (index == -1 || expectedOutput.length() == 0) {
48710 		System.out.println(Util.displayString(result, 3));
48711 	}
48712 	if (index == -1) {
48713 		assertEquals("Wrong contents", expectedOutput, result);
48714 	}
48715 }
48716 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=247953 - variation
48717 //FIXME javac8 rejects (why?)
48718 public void test1386()  throws Exception {
48719 	this.runConformTest(
48720 		new String[] {
48721 			"X.java",
48722 			"public class X<T extends AA & p.IB> {\n" +
48723 			"	T get() { return null; }\n" +
48724 			"	\n" +
48725 			"	void foo(X<T> xt) {\n" +
48726 			"		xt.get().baz();\n" +
48727 			"	}\n" +
48728 			"}\n" +
48729 			"class AA {\n" +
48730 			"	void bar() {}\n" +
48731 			"}\n",
48732 			"p/IB.java", // =====================
48733 			"package p;\n" +
48734 			"interface IA {\n" +
48735 			"	void baz();\n" +
48736 			"}\n" +
48737 			"public interface IB extends IA {\n" +
48738 			"}\n",
48739 		},
48740 		"");
48741 	// check #baz() invocation declaring class is not IA
48742 	String expectedOutput =
48743 		"  // Method descriptor #21 (LX;)V\n" +
48744 		"  // Signature: (LX<TT;>;)V\n" +
48745 		"  // Stack: 1, Locals: 2\n" +
48746 		"  void foo(X xt);\n" +
48747 		"     0  aload_1 [xt]\n" +
48748 		"     1  invokevirtual X.get() : AA [23]\n" +
48749 		"     4  checkcast p.IB [25]\n" +
48750 		"     7  invokeinterface p.IB.baz() : void [27] [nargs: 1]\n" +
48751 		"    12  return\n" +
48752 		"      Line numbers:\n" +
48753 		"        [pc: 0, line: 5]\n" +
48754 		"        [pc: 12, line: 6]\n" +
48755 		"      Local variable table:\n" +
48756 		"        [pc: 0, pc: 13] local: this index: 0 type: X\n" +
48757 		"        [pc: 0, pc: 13] local: xt index: 1 type: X\n";
48758 
48759 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
48760 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
48761 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
48762 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
48763 	int index = result.indexOf(expectedOutput);
48764 	if (index == -1 || expectedOutput.length() == 0) {
48765 		System.out.println(Util.displayString(result, 3));
48766 	}
48767 	if (index == -1) {
48768 		assertEquals("Wrong contents", expectedOutput, result);
48769 	}
48770 }
48771 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=247953 - variation
48772 //FIXME javac8 rejects (why?)
48773 public void test1387()  throws Exception {
48774 	this.runConformTest(
48775 		new String[] {
48776 			"X.java",
48777 			"public class X<T extends AA & p.IB> {\n" +
48778 			"	T t;\n" +
48779 			"	void foo() {\n" +
48780 			"		System.out.println(this.t.baz);\n" +
48781 			"	}\n" +
48782 			"	public static void main(String[] args) {\n" +
48783 			"		X<CC> xcc = new X<CC>();\n" +
48784 			"		xcc.t = new CC();\n" +
48785 			"		xcc.foo();\n" +
48786 			"	}\n" +
48787 			"}\n" +
48788 			"class AA {\n" +
48789 			"	void bar() {}\n" +
48790 			"}\n" +
48791 			"class CC extends AA implements p.IB {\n" +
48792 			"}\n",
48793 			"p/IB.java", // =====================
48794 			"package p;\n" +
48795 			"interface IA {\n" +
48796 			"	Object baz = \"done\";\n" +
48797 			"}\n" +
48798 			"public interface IB extends IA {\n" +
48799 			"}\n",
48800 		},
48801 		"done");
48802 	// check #baz declaring class is not IA
48803 	String expectedOutput =
48804 		"  // Method descriptor #10 ()V\n" +
48805 		"  // Stack: 2, Locals: 1\n" +
48806 		"  void foo();\n" +
48807 		"     0  getstatic java.lang.System.out : java.io.PrintStream [21]\n" +
48808 		"     3  aload_0 [this]\n" +
48809 		"     4  getfield X.t : AA [27]\n" +
48810 		"     7  checkcast p.IB [29]\n" +
48811 		"    10  pop\n" +
48812 		"    11  getstatic p.IB.baz : java.lang.Object [31]\n" +
48813 		"    14  invokevirtual java.io.PrintStream.println(java.lang.Object) : void [35]\n" +
48814 		"    17  return\n" +
48815 		"      Line numbers:\n" +
48816 		"        [pc: 0, line: 4]\n" +
48817 		"        [pc: 17, line: 5]\n" +
48818 		"      Local variable table:\n" +
48819 		"        [pc: 0, pc: 18] local: this index: 0 type: X\n";
48820 
48821 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
48822 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
48823 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
48824 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
48825 	int index = result.indexOf(expectedOutput);
48826 	if (index == -1 || expectedOutput.length() == 0) {
48827 		System.out.println(Util.displayString(result, 3));
48828 	}
48829 	if (index == -1) {
48830 		assertEquals("Wrong contents", expectedOutput, result);
48831 	}
48832 }
48833 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=247953 - variation
48834 //FIXME javac8 rejects (why?)
48835 public void test1388()  throws Exception {
48836 	this.runConformTest(
48837 		new String[] {
48838 			"X.java",
48839 			"public class X<T extends AA & p.IB> {\n" +
48840 			"	T t;\n" +
48841 			"	void foo() {\n" +
48842 			"		System.out.println(t.baz);\n" +
48843 			"	}\n" +
48844 			"	public static void main(String[] args) {\n" +
48845 			"		X<CC> xcc = new X<CC>();\n" +
48846 			"		xcc.t = new CC();\n" +
48847 			"		xcc.foo();\n" +
48848 			"	}\n" +
48849 			"}\n" +
48850 			"class AA {\n" +
48851 			"	void bar() {}\n" +
48852 			"}\n" +
48853 			"class CC extends AA implements p.IB {\n" +
48854 			"}\n",
48855 			"p/IB.java", // =====================
48856 			"package p;\n" +
48857 			"interface IA {\n" +
48858 			"	Object baz = \"done\";\n" +
48859 			"}\n" +
48860 			"public interface IB extends IA {\n" +
48861 			"}\n",
48862 		},
48863 		"done");
48864 	// check #baz declaring class is not IA
48865 	String expectedOutput =
48866 		"  // Method descriptor #10 ()V\n" +
48867 		"  // Stack: 2, Locals: 1\n" +
48868 		"  void foo();\n" +
48869 		"     0  getstatic java.lang.System.out : java.io.PrintStream [21]\n" +
48870 		"     3  aload_0 [this]\n" +
48871 		"     4  getfield X.t : AA [27]\n" +
48872 		"     7  checkcast p.IB [29]\n" +
48873 		"    10  pop\n" +
48874 		"    11  getstatic p.IB.baz : java.lang.Object [31]\n" +
48875 		"    14  invokevirtual java.io.PrintStream.println(java.lang.Object) : void [35]\n" +
48876 		"    17  return\n" +
48877 		"      Line numbers:\n" +
48878 		"        [pc: 0, line: 4]\n" +
48879 		"        [pc: 17, line: 5]\n" +
48880 		"      Local variable table:\n" +
48881 		"        [pc: 0, pc: 18] local: this index: 0 type: X\n";
48882 
48883 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
48884 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
48885 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
48886 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
48887 	int index = result.indexOf(expectedOutput);
48888 	if (index == -1 || expectedOutput.length() == 0) {
48889 		System.out.println(Util.displayString(result, 3));
48890 	}
48891 	if (index == -1) {
48892 		assertEquals("Wrong contents", expectedOutput, result);
48893 	}
48894 }
48895 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=247953 - variation
48896 public void test1389()  throws Exception {
48897 	this.runConformTest(
48898 		new String[] {
48899 			"X.java",
48900 			"public class X extends AA implements p.IB {\n" +
48901 			"	void foo() {\n" +
48902 			"		System.out.println(baz);\n" +
48903 			"	}\n" +
48904 			"	public static void main(String[] args) {\n" +
48905 			"		new X().foo();\n" +
48906 			"	}\n" +
48907 			"}\n" +
48908 			"class AA {\n" +
48909 			"	void bar() {}\n" +
48910 			"}\n",
48911 			"p/IB.java", // =====================
48912 			"package p;\n" +
48913 			"interface IA {\n" +
48914 			"	Object baz = \"done\";\n" +
48915 			"}\n" +
48916 			"public interface IB extends IA {\n" +
48917 			"}\n",
48918 		},
48919 		"done");
48920 	// check #baz declaring class is not IA
48921 	String expectedOutput =
48922 		"  // Method descriptor #8 ()V\n" +
48923 		"  // Stack: 2, Locals: 1\n" +
48924 		"  void foo();\n" +
48925 		"     0  getstatic java.lang.System.out : java.io.PrintStream [17]\n" +
48926 		"     3  getstatic X.baz : java.lang.Object [23]\n" +
48927 		"     6  invokevirtual java.io.PrintStream.println(java.lang.Object) : void [27]\n" +
48928 		"     9  return\n" +
48929 		"      Line numbers:\n" +
48930 		"        [pc: 0, line: 3]\n" +
48931 		"        [pc: 9, line: 4]\n";
48932 
48933 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
48934 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
48935 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
48936 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
48937 	int index = result.indexOf(expectedOutput);
48938 	if (index == -1 || expectedOutput.length() == 0) {
48939 		System.out.println(Util.displayString(result, 3));
48940 	}
48941 	if (index == -1) {
48942 		assertEquals("Wrong contents", expectedOutput, result);
48943 	}
48944 }
48945 public void test1390()  throws Exception {
48946 	this.runNegativeTest(
48947 		new String[] {
48948 			"X.java", //=================================
48949 			"public class X<T extends SubX1<SubX2<T>>> {\n" +
48950 			"	T sx1() { return null; }\n" +
48951 			"	void foo(X<T> x0) {\n" +
48952 			"		x0.sx1().sx2().t().getClass();\n" +
48953 			"	}\n" +
48954 			"}\n" +
48955 			"interface X1<T extends SubX2<T>> {\n" +
48956 			"	T sx2();\n" +
48957 			"}\n" +
48958 			"abstract class SubX1<T extends SubX2<T>> implements X1<T> {\n" +
48959 			"}\n" +
48960 			"interface X2<T> {\n" +
48961 			"	T t();\n" +
48962 			"}\n" +
48963 			"abstract class SubX2<T> implements X2<T> {\n" +
48964 			"}\n",
48965 		},
48966 		"----------\n" +
48967 		"1. ERROR in X.java (at line 1)\n" +
48968 		"	public class X<T extends SubX1<SubX2<T>>> {\n" +
48969 		"	                               ^^^^^\n" +
48970 		"Bound mismatch: The type SubX2<T> is not a valid substitute for the bounded parameter <T extends SubX2<T>> of the type SubX1<T>\n" +
48971 		"----------\n");
48972 }
48973 public void test1391()  throws Exception {
48974 	this.runConformTest(
48975 		new String[] {
48976 			"X.java",
48977 			"public class X<T extends SubX2<T>> {\n" +
48978 			"	T sx1() { return null; }\n" +
48979 			"	void foo(X<T> x0) {\n" +
48980 			"		x0.sx1().sx2().t().getClass();\n" +
48981 			"	}\n" +
48982 			"}\n" +
48983 			"interface X1<T extends SubX2<T>> {\n" +
48984 			"	T sx2();\n" +
48985 			"}\n" +
48986 			"abstract class SubX1<T extends SubX2<T>> implements X1<T> {\n" +
48987 			"}\n" +
48988 			"interface X2<T> {\n" +
48989 			"	T t();\n" +
48990 			"}\n" +
48991 			"abstract class SubX2<T extends SubX2<T>> implements X1<T>, X2<T> {\n" +
48992 			"}\n",
48993 		},
48994 		"");
48995 	String expectedOutput =
48996 		"  // Method descriptor #21 (LX;)V\n" +
48997 		"  // Signature: (LX<TT;>;)V\n" +
48998 		"  // Stack: 1, Locals: 2\n" +
48999 		"  void foo(X x0);\n" +
49000 		"     0  aload_1 [x0]\n" +
49001 		"     1  invokevirtual X.sx1() : SubX2 [23]\n" +
49002 		"     4  invokevirtual SubX2.sx2() : SubX2 [25]\n" +
49003 		"     7  invokevirtual SubX2.t() : java.lang.Object [30]\n" +
49004 		"    10  checkcast SubX2 [26]\n" +
49005 		"    13  invokevirtual java.lang.Object.getClass() : java.lang.Class [34]\n" +
49006 		"    16  pop\n" +
49007 		"    17  return\n" +
49008 		"      Line numbers:\n" +
49009 		"        [pc: 0, line: 4]\n" +
49010 		"        [pc: 17, line: 5]\n" +
49011 		"      Local variable table:\n" +
49012 		"        [pc: 0, pc: 18] local: this index: 0 type: X\n" +
49013 		"        [pc: 0, pc: 18] local: x0 index: 1 type: X\n";
49014 
49015 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
49016 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
49017 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
49018 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
49019 	int index = result.indexOf(expectedOutput);
49020 	if (index == -1 || expectedOutput.length() == 0) {
49021 		System.out.println(Util.displayString(result, 3));
49022 	}
49023 	if (index == -1) {
49024 		assertEquals("Wrong contents", expectedOutput, result);
49025 	}
49026 }
49027 public void test1392()  throws Exception {
49028 	this.runConformTest(
49029 		new String[] {
49030 			"X.java",
49031 			"public class X<T extends SubX2<T>> {\n" +
49032 			"	T sx1;\n" +
49033 			"	void foo(X<T> x0) {\n" +
49034 			"		x0.sx1.sx2.t.getClass();\n" +
49035 			"	}\n" +
49036 			"}\n" +
49037 			"class X1<T extends SubX2<T>> {\n" +
49038 			"	T sx2;\n" +
49039 			"}\n" +
49040 			"abstract class SubX1<T extends SubX2<T>> extends X1<T> {\n" +
49041 			"}\n" +
49042 			"class X2<T extends SubX2<T>> extends X1<T>{\n" +
49043 			"	T t;\n" +
49044 			"}\n" +
49045 			"abstract class SubX2<T extends SubX2<T>> extends X2<T> {\n" +
49046 			"}\n",
49047 		},
49048 		"");
49049 	String expectedOutput =
49050 		"  // Method descriptor #21 (LX;)V\n" +
49051 		"  // Signature: (LX<TT;>;)V\n" +
49052 		"  // Stack: 1, Locals: 2\n" +
49053 		"  void foo(X x0);\n" +
49054 		"     0  aload_1 [x0]\n" +
49055 		"     1  getfield X.sx1 : SubX2 [23]\n" +
49056 		"     4  getfield SubX2.sx2 : SubX2 [25]\n" +
49057 		"     7  getfield SubX2.t : SubX2 [30]\n" +
49058 		"    10  invokevirtual java.lang.Object.getClass() : java.lang.Class [33]\n" +
49059 		"    13  pop\n" +
49060 		"    14  return\n" +
49061 		"      Line numbers:\n" +
49062 		"        [pc: 0, line: 4]\n" +
49063 		"        [pc: 14, line: 5]\n" +
49064 		"      Local variable table:\n" +
49065 		"        [pc: 0, pc: 15] local: this index: 0 type: X\n" +
49066 		"        [pc: 0, pc: 15] local: x0 index: 1 type: X\n";
49067 
49068 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
49069 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
49070 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
49071 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
49072 	int index = result.indexOf(expectedOutput);
49073 	if (index == -1 || expectedOutput.length() == 0) {
49074 		System.out.println(Util.displayString(result, 3));
49075 	}
49076 	if (index == -1) {
49077 		assertEquals("Wrong contents", expectedOutput, result);
49078 	}
49079 }
49080 public void test1393()  throws Exception {
49081 	this.runConformTest(
49082 		new String[] {
49083 			"X.java",
49084 			"public class X<T extends SubX2<T>> {\n" +
49085 			"	T sx1;\n" +
49086 			"	void foo(X<T> x0) {\n" +
49087 			"		x0.sx1.sx2.t.getClass();\n" +
49088 			"	}\n" +
49089 			"}\n" +
49090 			"interface X1<T extends X2<T>> {\n" +
49091 			"}\n" +
49092 			"abstract class SubX1<T extends X2<T>> implements X1<T> {\n" +
49093 			"	T sx2;\n" +
49094 			"}\n" +
49095 			"interface X2<T extends X2<T>> extends X1<T>{\n" +
49096 			"}\n" +
49097 			"abstract class SubX2<T extends X2<T>> extends SubX1<T> implements X2<T> {\n" +
49098 			"	T t;\n" +
49099 			"}\n",
49100 		},
49101 		"");
49102 	String expectedOutput =
49103 		"  // Method descriptor #21 (LX;)V\n" +
49104 		"  // Signature: (LX<TT;>;)V\n" +
49105 		"  // Stack: 1, Locals: 2\n" +
49106 		"  void foo(X x0);\n" +
49107 		"     0  aload_1 [x0]\n" +
49108 		"     1  getfield X.sx1 : SubX2 [23]\n" +
49109 		"     4  getfield SubX2.sx2 : X2 [25]\n" +
49110 		"     7  checkcast SubX2 [26]\n" +
49111 		"    10  getfield SubX2.t : X2 [31]\n" +
49112 		"    13  checkcast SubX2 [26]\n" +
49113 		"    16  invokevirtual java.lang.Object.getClass() : java.lang.Class [34]\n" +
49114 		"    19  pop\n" +
49115 		"    20  return\n" +
49116 		"      Line numbers:\n" +
49117 		"        [pc: 0, line: 4]\n" +
49118 		"        [pc: 20, line: 5]\n" +
49119 		"      Local variable table:\n" +
49120 		"        [pc: 0, pc: 21] local: this index: 0 type: X\n" +
49121 		"        [pc: 0, pc: 21] local: x0 index: 1 type: X\n";
49122 
49123 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
49124 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
49125 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
49126 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
49127 	int index = result.indexOf(expectedOutput);
49128 	if (index == -1 || expectedOutput.length() == 0) {
49129 		System.out.println(Util.displayString(result, 3));
49130 	}
49131 	if (index == -1) {
49132 		assertEquals("Wrong contents", expectedOutput, result);
49133 	}
49134 }
49135 public void test1394()  throws Exception {
49136 	this.runConformTest(
49137 		new String[] {
49138 			"X.java",
49139 			"public class X<T extends SubX2<T>> {\n" +
49140 			"	T sx1(){return null;}\n" +
49141 			"	void foo(X<T> x0) {\n" +
49142 			"		x0.sx1().sx2().t().getClass();\n" +
49143 			"	}\n" +
49144 			"}\n" +
49145 			"interface X1<T extends X2<T>> {\n" +
49146 			"}\n" +
49147 			"abstract class SubX1<T extends X2<T>> implements X1<T> {\n" +
49148 			"	T sx2(){return null;}\n" +
49149 			"}\n" +
49150 			"interface X2<T extends X2<T>> extends X1<T>{\n" +
49151 			"}\n" +
49152 			"abstract class SubX2<T extends X2<T>> extends SubX1<T> implements X2<T> {\n" +
49153 			"	T t(){return null;}\n" +
49154 			"}\n",
49155 		},
49156 		"");
49157 	String expectedOutput =
49158 		"  // Method descriptor #21 (LX;)V\n" +
49159 		"  // Signature: (LX<TT;>;)V\n" +
49160 		"  // Stack: 1, Locals: 2\n" +
49161 		"  void foo(X x0);\n" +
49162 		"     0  aload_1 [x0]\n" +
49163 		"     1  invokevirtual X.sx1() : SubX2 [23]\n" +
49164 		"     4  invokevirtual SubX2.sx2() : X2 [25]\n" +
49165 		"     7  checkcast SubX2 [26]\n" +
49166 		"    10  invokevirtual SubX2.t() : X2 [31]\n" +
49167 		"    13  checkcast SubX2 [26]\n" +
49168 		"    16  invokevirtual java.lang.Object.getClass() : java.lang.Class [34]\n" +
49169 		"    19  pop\n" +
49170 		"    20  return\n" +
49171 		"      Line numbers:\n" +
49172 		"        [pc: 0, line: 4]\n" +
49173 		"        [pc: 20, line: 5]\n" +
49174 		"      Local variable table:\n" +
49175 		"        [pc: 0, pc: 21] local: this index: 0 type: X\n" +
49176 		"        [pc: 0, pc: 21] local: x0 index: 1 type: X\n";
49177 
49178 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
49179 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
49180 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
49181 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
49182 	int index = result.indexOf(expectedOutput);
49183 	if (index == -1 || expectedOutput.length() == 0) {
49184 		System.out.println(Util.displayString(result, 3));
49185 	}
49186 	if (index == -1) {
49187 		assertEquals("Wrong contents", expectedOutput, result);
49188 	}
49189 }
49190 public void test1395()  throws Exception {
49191 	this.runConformTest(
49192 		new String[] {
49193 			"X.java",
49194 			"public class X<T extends SubX2<T>> {\n" +
49195 			"	T sx1(){return null;}\n" +
49196 			"	void foo() {\n" +
49197 			"		this.sx1().sx2().t().getClass();\n" +
49198 			"	}\n" +
49199 			"}\n" +
49200 			"interface X1<T extends X2<T>> {\n" +
49201 			"}\n" +
49202 			"abstract class SubX1<T extends X2<T>> implements X1<T> {\n" +
49203 			"	T sx2(){return null;}\n" +
49204 			"}\n" +
49205 			"interface X2<T extends X2<T>> extends X1<T>{\n" +
49206 			"}\n" +
49207 			"abstract class SubX2<T extends X2<T>> extends SubX1<T> implements X2<T> {\n" +
49208 			"	T t(){return null;}\n" +
49209 			"}\n",
49210 		},
49211 		"");
49212 	String expectedOutput =
49213 		"  // Method descriptor #6 ()V\n" +
49214 		"  // Stack: 1, Locals: 1\n" +
49215 		"  void foo();\n" +
49216 		"     0  aload_0 [this]\n" +
49217 		"     1  invokevirtual X.sx1() : SubX2 [21]\n" +
49218 		"     4  invokevirtual SubX2.sx2() : X2 [23]\n" +
49219 		"     7  checkcast SubX2 [24]\n" +
49220 		"    10  invokevirtual SubX2.t() : X2 [29]\n" +
49221 		"    13  checkcast SubX2 [24]\n" +
49222 		"    16  invokevirtual java.lang.Object.getClass() : java.lang.Class [32]\n" +
49223 		"    19  pop\n" +
49224 		"    20  return\n" +
49225 		"      Line numbers:\n" +
49226 		"        [pc: 0, line: 4]\n" +
49227 		"        [pc: 20, line: 5]\n" +
49228 		"      Local variable table:\n" +
49229 		"        [pc: 0, pc: 21] local: this index: 0 type: X\n" +
49230 		"      Local variable type table:\n" +
49231 		"        [pc: 0, pc: 21] local: this index: 0 type: X<T>\n";
49232 
49233 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
49234 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
49235 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
49236 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
49237 	int index = result.indexOf(expectedOutput);
49238 	if (index == -1 || expectedOutput.length() == 0) {
49239 		System.out.println(Util.displayString(result, 3));
49240 	}
49241 	if (index == -1) {
49242 		assertEquals("Wrong contents", expectedOutput, result);
49243 	}
49244 }
49245 public void test1396()  throws Exception {
49246 	this.runConformTest(
49247 		new String[] {
49248 			"X.java",
49249 			"public class X<T extends SubX2<T>> {\n" +
49250 			"	T sx1;\n" +
49251 			"	void foo(T t) {\n" +
49252 			"		t.sx2.t.getClass();\n" +
49253 			"	}\n" +
49254 			"}\n" +
49255 			"interface X1<T extends X2<T>> {\n" +
49256 			"}\n" +
49257 			"abstract class SubX1<T extends X2<T>> implements X1<T> {\n" +
49258 			"	T sx2;\n" +
49259 			"}\n" +
49260 			"interface X2<T extends X2<T>> extends X1<T>{\n" +
49261 			"}\n" +
49262 			"abstract class SubX2<T extends X2<T>> extends SubX1<T> implements X2<T> {\n" +
49263 			"	T t;\n" +
49264 			"}\n",
49265 		},
49266 		"");
49267 	String expectedOutput =
49268 		"  // Method descriptor #21 (LSubX2;)V\n" +
49269 		"  // Signature: (TT;)V\n" +
49270 		"  // Stack: 1, Locals: 2\n" +
49271 		"  void foo(SubX2 t);\n" +
49272 		"     0  aload_1 [t]\n" +
49273 		"     1  getfield SubX2.sx2 : X2 [23]\n" +
49274 		"     4  checkcast SubX2 [24]\n" +
49275 		"     7  getfield SubX2.t : X2 [29]\n" +
49276 		"    10  checkcast SubX2 [24]\n" +
49277 		"    13  invokevirtual java.lang.Object.getClass() : java.lang.Class [32]\n" +
49278 		"    16  pop\n" +
49279 		"    17  return\n" +
49280 		"      Line numbers:\n" +
49281 		"        [pc: 0, line: 4]\n" +
49282 		"        [pc: 17, line: 5]\n" +
49283 		"      Local variable table:\n" +
49284 		"        [pc: 0, pc: 18] local: this index: 0 type: X\n" +
49285 		"        [pc: 0, pc: 18] local: t index: 1 type: SubX2\n";
49286 
49287 	File f = new File(OUTPUT_DIR + File.separator + "X.class");
49288 	byte[] classFileBytes = org.eclipse.jdt.internal.compiler.util.Util.getFileByteContent(f);
49289 	ClassFileBytesDisassembler disassembler = ToolFactory.createDefaultClassFileBytesDisassembler();
49290 	String result = disassembler.disassemble(classFileBytes, "\n", ClassFileBytesDisassembler.DETAILED);
49291 	int index = result.indexOf(expectedOutput);
49292 	if (index == -1 || expectedOutput.length() == 0) {
49293 		System.out.println(Util.displayString(result, 3));
49294 	}
49295 	if (index == -1) {
49296 		assertEquals("Wrong contents", expectedOutput, result);
49297 	}
49298 }
49299 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=172672
49300 public void _test1397()  throws Exception {
49301 	this.runConformTest(
49302 		new String[] {
49303 			"X.java",
49304 			"class A { }\n" +
49305 			"class B<T> { }\n" +
49306 			"class C<U> extends B<B<? super C<C<U>>>> {\n" +
49307 			"	B<? super C<A>> foo(C<A> c) { return c; }\n" +
49308 			"}\n",
49309 		},
49310 		"");
49311 }
49312 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=252120
49313 public void test1398()  throws Exception {
49314 	this.runNegativeTest(
49315 		new String[] {
49316 			"A.java",
49317 			"public class A<T> {\n" +
49318 			"  void f() {\n" +
49319 			"    boolean b=null instanceof A; \n" +
49320 			"	 Zork z;\n" +
49321 			"  }\n" +
49322 			"}\n",
49323 		},
49324 		"----------\n" +
49325 		"1. ERROR in A.java (at line 4)\n" +
49326 		"	Zork z;\n" +
49327 		"	^^^^\n" +
49328 		"Zork cannot be resolved to a type\n" +
49329 		"----------\n");
49330 }
49331 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=252120 - variation
49332 public void test1399()  throws Exception {
49333 	this.runNegativeTest(
49334 		new String[] {
49335 			"A.java",
49336 			"public class A<T> {\n" +
49337 			"  void f() {\n" +
49338 			"    boolean b=null instanceof A<?>; \n" +
49339 			"	 Zork z;\n" +
49340 			"  }\n" +
49341 			"}\n",
49342 		},
49343 		"----------\n" +
49344 		"1. ERROR in A.java (at line 4)\n" +
49345 		"	Zork z;\n" +
49346 		"	^^^^\n" +
49347 		"Zork cannot be resolved to a type\n" +
49348 		"----------\n");
49349 }
49350 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=252120 - variation
49351 public void test1400()  throws Exception {
49352 	this.runNegativeTest(
49353 		new String[] {
49354 			"A.java",
49355 			"public class A<T> {\n" +
49356 			"  void f() {\n" +
49357 			"    Object o = (A)this; \n" +
49358 			"	 Zork z;\n" +
49359 			"  }\n" +
49360 			"}\n",
49361 		},
49362 		"----------\n" +
49363 		"1. WARNING in A.java (at line 3)\n" +
49364 		"	Object o = (A)this; \n" +
49365 		"	           ^^^^^^^\n" +
49366 		"Unnecessary cast from A<T> to A\n" +
49367 		"----------\n" +
49368 		"2. WARNING in A.java (at line 3)\n" +
49369 		"	Object o = (A)this; \n" +
49370 		"	            ^\n" +
49371 		"A is a raw type. References to generic type A<T> should be parameterized\n" +
49372 		"----------\n" +
49373 		"3. ERROR in A.java (at line 4)\n" +
49374 		"	Zork z;\n" +
49375 		"	^^^^\n" +
49376 		"Zork cannot be resolved to a type\n" +
49377 		"----------\n");
49378 }
49379 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=252120 - variation
49380 public void test1401()  throws Exception {
49381 	this.runNegativeTest(
49382 		new String[] {
49383 			"A.java",
49384 			"public class A<T> {\n" +
49385 			"  void f() {\n" +
49386 			"    Object o = (A<?>)this; \n" +
49387 			"	 Zork z;\n" +
49388 			"  }\n" +
49389 			"}\n",
49390 		},
49391 		"----------\n" +
49392 		"1. WARNING in A.java (at line 3)\n" +
49393 		"	Object o = (A<?>)this; \n" +
49394 		"	           ^^^^^^^^^^\n" +
49395 		"Unnecessary cast from A<T> to A<?>\n" +
49396 		"----------\n" +
49397 		"2. ERROR in A.java (at line 4)\n" +
49398 		"	Zork z;\n" +
49399 		"	^^^^\n" +
49400 		"Zork cannot be resolved to a type\n" +
49401 		"----------\n");
49402 }
49403 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=252120 - variation
49404 public void test1402()  throws Exception {
49405 	this.runNegativeTest(
49406 		new String[] {
49407 			"A.java",
49408 			"public class A<T> {\n" +
49409 			"  void f() {\n" +
49410 			"    Class<?> c = A.class; \n" +
49411 			"	 Zork z;\n" +
49412 			"  }\n" +
49413 			"}\n",
49414 		},
49415 		"----------\n" +
49416 		"1. ERROR in A.java (at line 4)\n" +
49417 		"	Zork z;\n" +
49418 		"	^^^^\n" +
49419 		"Zork cannot be resolved to a type\n" +
49420 		"----------\n");
49421 }
49422 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=252120 - variation
49423 public void test1403()  throws Exception {
49424 	this.runNegativeTest(
49425 		new String[] {
49426 			"A.java",
49427 			"public class A<T> {\n" +
49428 			"  void f() {\n" +
49429 			"    Class<?> c = A<?>.class; \n" +
49430 			"	 Zork z;\n" +
49431 			"  }\n" +
49432 			"}\n",
49433 		},
49434 		"----------\n" +
49435 		"1. ERROR in A.java (at line 3)\n" +
49436 		"	Class<?> c = A<?>.class; \n" +
49437 		"	             ^\n" +
49438 		"Syntax error on token \"A\", . expected after this token\n" +
49439 		"----------\n" +
49440 		"2. ERROR in A.java (at line 3)\n" +
49441 		"	Class<?> c = A<?>.class; \n" +
49442 		"	              ^^^\n" +
49443 		"Syntax error on token(s), misplaced construct(s)\n" +
49444 		"----------\n");
49445 }
49446 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=242159
49447 // SHOULD FAIL AT 1.8 (RET): Type mismatch: cannot convert from X<Comparable<Comparable<T>>> to X
49448 public void test1404()  throws Exception {
49449 	this.runConformTest(
49450 		new String[] {
49451 			"X.java",
49452 			"public class X<A> {\n" +
49453 			"	A get() { return null; }\n" +
49454 			"	<B extends Comparable<B>> X<B> bar() {\n" +
49455 			"		return null;\n" +
49456 			"	}\n" +
49457 			"	void foo() {\n" +
49458 			"		bar(); // 0 rejected\n" +
49459 			"		X raw = bar(); // 1 accepted\n" +
49460 			"		X<?> wild = bar(); // 2 rejected\n" +
49461 			"	}\n" +
49462 			"}\n",
49463 		});
49464 }
49465 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=240807
49466 public void test1405()  throws Exception {
49467 	this.runNegativeTest(
49468 		new String[] {
49469 			"X.java",
49470 			"import java.util.*;\n" +
49471 			"public class X {\n" +
49472 			"    X(List rawList, List<?> unboundList) {\n" +
49473 			"            Throwable t0 = (Throwable) Collections.emptyList();\n" +
49474 			"            Throwable t1 = (Throwable) rawList;\n" +
49475 			"            Throwable t2 = (Throwable) unboundList;\n" +
49476 			"            Map m0 = (Map) Collections.emptyList();\n" +
49477 			"            Map m1 = (Map) rawList;\n" +
49478 			"            Map m2 = (Map) unboundList;\n" +
49479 			"            Zork z;\n" +
49480 			"    }\n" +
49481 			"}\n",
49482 		},
49483 		"----------\n" +
49484 		"1. WARNING in X.java (at line 3)\n" +
49485 		"	X(List rawList, List<?> unboundList) {\n" +
49486 		"	  ^^^^\n" +
49487 		"List is a raw type. References to generic type List<E> should be parameterized\n" +
49488 		"----------\n" +
49489 		"2. WARNING in X.java (at line 7)\n" +
49490 		"	Map m0 = (Map) Collections.emptyList();\n" +
49491 		"	^^^\n" +
49492 		"Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
49493 		"----------\n" +
49494 		"3. WARNING in X.java (at line 7)\n" +
49495 		"	Map m0 = (Map) Collections.emptyList();\n" +
49496 		"	          ^^^\n" +
49497 		"Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
49498 		"----------\n" +
49499 		"4. WARNING in X.java (at line 8)\n" +
49500 		"	Map m1 = (Map) rawList;\n" +
49501 		"	^^^\n" +
49502 		"Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
49503 		"----------\n" +
49504 		"5. WARNING in X.java (at line 8)\n" +
49505 		"	Map m1 = (Map) rawList;\n" +
49506 		"	          ^^^\n" +
49507 		"Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
49508 		"----------\n" +
49509 		"6. WARNING in X.java (at line 9)\n" +
49510 		"	Map m2 = (Map) unboundList;\n" +
49511 		"	^^^\n" +
49512 		"Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
49513 		"----------\n" +
49514 		"7. WARNING in X.java (at line 9)\n" +
49515 		"	Map m2 = (Map) unboundList;\n" +
49516 		"	          ^^^\n" +
49517 		"Map is a raw type. References to generic type Map<K,V> should be parameterized\n" +
49518 		"----------\n" +
49519 		"8. ERROR in X.java (at line 10)\n" +
49520 		"	Zork z;\n" +
49521 		"	^^^^\n" +
49522 		"Zork cannot be resolved to a type\n" +
49523 		"----------\n");
49524 }
49525 public void test1406() {
49526 	this.runNegativeTest(
49527 			new String[] {
49528 				"GenericTest.java", //-----------------------------------------------------------------------
49529 				"import java.util.*;\n" +
49530 				"\n" +
49531 				"public class GenericTest {\n" +
49532 				"    public static void test() {\n" +
49533 				"        Set testList = GenericTest.method1(new Class[] { ArrayList.class });\n" +
49534 				"    }\n" +
49535 				" \n" +
49536 				"    public static <I> I method1(Class<List>[] params) {\n" +
49537 				"        return null;\n" +
49538 				"    }\n" +
49539 				"}\n",//-----------------------------------------------------------------------
49540 			},
49541 			this.complianceLevel < ClassFileConstants.JDK1_8 ?
49542 			"----------\n" +
49543 			"1. WARNING in GenericTest.java (at line 5)\n" +
49544 			"	Set testList = GenericTest.method1(new Class[] { ArrayList.class });\n" +
49545 			"	^^^\n" +
49546 			"Set is a raw type. References to generic type Set<E> should be parameterized\n" +
49547 			"----------\n" +
49548 			"2. WARNING in GenericTest.java (at line 5)\n" +
49549 			"	Set testList = GenericTest.method1(new Class[] { ArrayList.class });\n" +
49550 			"	               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
49551 			"Type safety: Unchecked invocation method1(Class[]) of the generic method method1(Class<List>[]) of type GenericTest\n" +
49552 			"----------\n" +
49553 			"3. WARNING in GenericTest.java (at line 5)\n" +
49554 			"	Set testList = GenericTest.method1(new Class[] { ArrayList.class });\n" +
49555 			"	                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
49556 			"Type safety: The expression of type Class[] needs unchecked conversion to conform to Class<List>[]\n" +
49557 			"----------\n" +
49558 			"4. WARNING in GenericTest.java (at line 8)\n" +
49559 			"	public static <I> I method1(Class<List>[] params) {\n" +
49560 			"	                                  ^^^^\n" +
49561 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
49562 			"----------\n" :
49563 				"----------\n" +
49564 				"1. WARNING in GenericTest.java (at line 5)\n" +
49565 				"	Set testList = GenericTest.method1(new Class[] { ArrayList.class });\n" +
49566 				"	^^^\n" +
49567 				"Set is a raw type. References to generic type Set<E> should be parameterized\n" +
49568 				"----------\n" +
49569 				"2. ERROR in GenericTest.java (at line 5)\n" +
49570 				"	Set testList = GenericTest.method1(new Class[] { ArrayList.class });\n" +
49571 				"	               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
49572 				"Type mismatch: cannot convert from Object to Set\n" +
49573 				"----------\n" +
49574 				"3. WARNING in GenericTest.java (at line 8)\n" +
49575 				"	public static <I> I method1(Class<List>[] params) {\n" +
49576 				"	                                  ^^^^\n" +
49577 				"List is a raw type. References to generic type List<E> should be parameterized\n" +
49578 				"----------\n");
49579 }
49580 public void test1407() {
49581 	this.runNegativeTest(
49582 			new String[] {
49583 				"Foo.java", //-----------------------------------------------------------------------
49584 				"public class Foo {\n" +
49585 				"	public static <I> I m1(Class<Foo> c) { return null; }\n" +
49586 				"	void bar() {\n" +
49587 				"		Foo l1 = m1((Class)Foo.class);\n" +
49588 				"	}\n" +
49589 				"}\n",//-----------------------------------------------------------------------
49590 			},
49591 			this.complianceLevel < ClassFileConstants.JDK1_8 ?
49592 			"----------\n" +
49593 			"1. WARNING in Foo.java (at line 4)\n" +
49594 			"	Foo l1 = m1((Class)Foo.class);\n" +
49595 			"	         ^^^^^^^^^^^^^^^^^^^^\n" +
49596 			"Type safety: Unchecked invocation m1(Class) of the generic method m1(Class<Foo>) of type Foo\n" +
49597 			"----------\n" +
49598 			"2. WARNING in Foo.java (at line 4)\n" +
49599 			"	Foo l1 = m1((Class)Foo.class);\n" +
49600 			"	            ^^^^^^^^^^^^^^^^\n" +
49601 			"Type safety: The expression of type Class needs unchecked conversion to conform to Class<Foo>\n" +
49602 			"----------\n" +
49603 			"3. WARNING in Foo.java (at line 4)\n" +
49604 			"	Foo l1 = m1((Class)Foo.class);\n" +
49605 			"	             ^^^^^\n" +
49606 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
49607 			"----------\n" :
49608 				"----------\n" +
49609 				"1. WARNING in Foo.java (at line 4)\n" +
49610 				"	Foo l1 = m1((Class)Foo.class);\n" +
49611 				"	             ^^^^^\n" +
49612 				"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
49613 				"----------\n" +
49614 				"2. ERROR in Foo.java (at line 4)\n" +
49615 				"	Foo l1 = m1((Class)Foo.class);\n" +
49616 				"	         ^^^^^^^^^^^^^^^^^^^^\n" +
49617 				"Type mismatch: cannot convert from Object to Foo\n" +
49618 				"----------\n");
49619 }
49620 public void test1408() {
49621 	this.runNegativeTest(
49622 			new String[] {
49623 				"X.java", //-----------------------------------------------------------------------
49624 				"import java.util.*;\n" +
49625 				"public class X {\n" +
49626 				"	void foo(Collection<? extends X> i) {\n" +
49627 				"		Zork z = (List<? extends X>) i;\n" +
49628 				"	}\n" +
49629 				"	void bar(List<? extends X> i) {\n" +
49630 				"		Zork z = (ArrayList<? extends X>) i;\n" +
49631 				"	}	\n" +
49632 				"}\n",//-----------------------------------------------------------------------
49633 			},
49634 			"----------\n" +
49635 			"1. ERROR in X.java (at line 4)\n" +
49636 			"	Zork z = (List<? extends X>) i;\n" +
49637 			"	^^^^\n" +
49638 			"Zork cannot be resolved to a type\n" +
49639 			"----------\n" +
49640 			"2. ERROR in X.java (at line 7)\n" +
49641 			"	Zork z = (ArrayList<? extends X>) i;\n" +
49642 			"	^^^^\n" +
49643 			"Zork cannot be resolved to a type\n" +
49644 			"----------\n");
49645 }
49646 public void test1409() {
49647 	this.runNegativeTest(
49648 			new String[] {
49649 				"X.java", //-----------------------------------------------------------------------
49650 				"import java.util.*;\n" +
49651 				"public class X {\n" +
49652 				"	void foo(List<X> lx, List<?> lw) {\n" +
49653 				"		LinkedList<Object> lo = (LinkedList<Object>) lx;\n" +
49654 				"		LinkedList<String> ls = (LinkedList<String>) lw;\n" +
49655 				"	}\n" +
49656 				"	void bar(List<X> lx, List<Integer> li) {\n" +
49657 				"		LinkedList<? extends Object> lo = (LinkedList<? extends Object>) lx;\n" +
49658 				"		LinkedList<? extends Number> ln = (LinkedList<? extends Number>) li;		\n" +
49659 				"	}\n" +
49660 				"}\n",//-----------------------------------------------------------------------
49661 			},
49662 			"----------\n" +
49663 			"1. ERROR in X.java (at line 4)\n" +
49664 			"	LinkedList<Object> lo = (LinkedList<Object>) lx;\n" +
49665 			"	                        ^^^^^^^^^^^^^^^^^^^^^^^\n" +
49666 			"Cannot cast from List<X> to LinkedList<Object>\n" +
49667 			"----------\n" +
49668 			"2. WARNING in X.java (at line 5)\n" +
49669 			"	LinkedList<String> ls = (LinkedList<String>) lw;\n" +
49670 			"	                        ^^^^^^^^^^^^^^^^^^^^^^^\n" +
49671 			"Type safety: Unchecked cast from List<capture#1-of ?> to LinkedList<String>\n" +
49672 			"----------\n");
49673 }
49674 public void test1410() {
49675 	this.runNegativeTest(
49676 			new String[] {
49677 				"X.java", //-----------------------------------------------------------------------
49678 				"interface I<T> {}\n" +
49679 				"class Y<T> implements I<T> {}\n" +
49680 				"public class X {\n" +
49681 				"	I<Short>[] x = null;\n" +
49682 				"	Y<? extends Number>[] y1 = (Y<? extends Number>[]) x;\n" +
49683 				"	Y<? extends Number> y2 = (Y<? extends Number>) x[0];\n" +
49684 				"	Y<? extends X>[] y3 = (Y<? extends X>[]) x;\n" +
49685 				"}\n",//-----------------------------------------------------------------------
49686 			},
49687 			"----------\n" +
49688 			"1. ERROR in X.java (at line 7)\n" +
49689 			"	Y<? extends X>[] y3 = (Y<? extends X>[]) x;\n" +
49690 			"	                      ^^^^^^^^^^^^^^^^^^^^\n" +
49691 			"Cannot cast from I<Short>[] to Y<? extends X>[]\n" +
49692 			"----------\n");
49693 }
49694 public void test1411() {
49695 	this.runNegativeTest(
49696 			new String[] {
49697 				"X.java", //-----------------------------------------------------------------------
49698 				"public class X<T> {\n" +
49699 				"	static class Child extends X<Object> {	}\n" +
49700 				"	static <U> X<U> create() {\n" +
49701 				"		Child child = new Child();\n" +
49702 				"		child.set(new Object());\n" +
49703 				"		return (X<U>) child;\n" +
49704 				"	}\n" +
49705 				"	public static void main(String[] args) {\n" +
49706 				"		X<Number> c = create();\n" +
49707 				"		Number n = c.get();\n" +
49708 				"	}\n" +
49709 				"	T t;\n" +
49710 				"	void set(T t) {\n" +
49711 				"		this.t = t;\n" +
49712 				"	}\n" +
49713 				"	T get() {\n" +
49714 				"		return t;\n" +
49715 				"	}\n" +
49716 				"	static X<Object> willWarn = new X<Object>();\n" +
49717 				"	static <U> X<U> raisesTheWarning() {\n" +
49718 				"		return (X<U>) willWarn;\n" +
49719 				"	}\n" +
49720 				"	Zork z;\n" +
49721 				"}\n",//-----------------------------------------------------------------------
49722 			},
49723 			"----------\n" +
49724 			"1. WARNING in X.java (at line 6)\n" +
49725 			"	return (X<U>) child;\n" +
49726 			"	       ^^^^^^^^^^^^\n" +
49727 			"Type safety: Unchecked cast from X.Child to X<U>\n" +
49728 			"----------\n" +
49729 			"2. WARNING in X.java (at line 21)\n" +
49730 			"	return (X<U>) willWarn;\n" +
49731 			"	       ^^^^^^^^^^^^^^^\n" +
49732 			"Type safety: Unchecked cast from X<Object> to X<U>\n" +
49733 			"----------\n" +
49734 			"3. ERROR in X.java (at line 23)\n" +
49735 			"	Zork z;\n" +
49736 			"	^^^^\n" +
49737 			"Zork cannot be resolved to a type\n" +
49738 			"----------\n");
49739 }
49740 public void test1412() {
49741 	this.runNegativeTest(
49742 			new String[] {
49743 				"X.java", //-----------------------------------------------------------------------
49744 				"import java.util.List;\n" +
49745 				"class A<T> {\n" +
49746 				"	List<String> foo() {\n" +
49747 				"		return null;\n" +
49748 				"	}\n" +
49749 				"}\n" +
49750 				"class B<U> {\n" +
49751 				"	A a1 = new A<U>();\n" +
49752 				"	A<?> a2 = new A<U>();\n" +
49753 				"}\n" +
49754 				"class X {\n" +
49755 				"	void bar() {\n" +
49756 				"		B<X> bx = new B<X>();\n" +
49757 				"		List<String> s1 = bx.a1.foo();\n" +
49758 				"		List<String> s2 = bx.a2.foo();\n" +
49759 				"		Zork z;\n" +
49760 				"	}\n" +
49761 				"}\n",//-----------------------------------------------------------------------
49762 			},
49763 			"----------\n" +
49764 			"1. WARNING in X.java (at line 8)\n" +
49765 			"	A a1 = new A<U>();\n" +
49766 			"	^\n" +
49767 			"A is a raw type. References to generic type A<T> should be parameterized\n" +
49768 			"----------\n" +
49769 			"2. WARNING in X.java (at line 14)\n" +
49770 			"	List<String> s1 = bx.a1.foo();\n" +
49771 			"	                  ^^^^^^^^^^^\n" +
49772 			"Type safety: The expression of type List needs unchecked conversion to conform to List<String>\n" +
49773 			"----------\n" +
49774 			"3. ERROR in X.java (at line 16)\n" +
49775 			"	Zork z;\n" +
49776 			"	^^^^\n" +
49777 			"Zork cannot be resolved to a type\n" +
49778 			"----------\n");
49779 }
49780 public void test1413() {
49781 	this.runNegativeTest(
49782 			new String[] {
49783 				"X.java", //-----------------------------------------------------------------------
49784 				"import java.util.*;\n" +
49785 				"public class X  {\n" +
49786 				"	HashMap <String, ArrayList> m = new HashMap<String, ArrayList>();\n" +
49787 				"	ArrayList <X> ax = m.get(\"\");\n" +
49788 				"	Zork z;\n" +
49789 				"}\n",//-----------------------------------------------------------------------
49790 			},
49791 			"----------\n" +
49792 			"1. WARNING in X.java (at line 3)\n" +
49793 			"	HashMap <String, ArrayList> m = new HashMap<String, ArrayList>();\n" +
49794 			"	                 ^^^^^^^^^\n" +
49795 			"ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
49796 			"----------\n" +
49797 			"2. WARNING in X.java (at line 3)\n" +
49798 			"	HashMap <String, ArrayList> m = new HashMap<String, ArrayList>();\n" +
49799 			"	                                                    ^^^^^^^^^\n" +
49800 			"ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized\n" +
49801 			"----------\n" +
49802 			"3. WARNING in X.java (at line 4)\n" +
49803 			"	ArrayList <X> ax = m.get(\"\");\n" +
49804 			"	                   ^^^^^^^^^\n" +
49805 			"Type safety: The expression of type ArrayList needs unchecked conversion to conform to ArrayList<X>\n" +
49806 			"----------\n" +
49807 			"4. ERROR in X.java (at line 5)\n" +
49808 			"	Zork z;\n" +
49809 			"	^^^^\n" +
49810 			"Zork cannot be resolved to a type\n" +
49811 			"----------\n");
49812 }
49813 public void test1414() {
49814 	this.runNegativeTest(
49815 			new String[] {
49816 				"X.java", //-----------------------------------------------------------------------
49817 				"interface A<T> {}\n" +
49818 				"class B<T> {}\n" +
49819 				"public class X {\n" +
49820 				"        A<?> a = null;\n" +
49821 				"        B y = (B)a;\n" +
49822 				"        Zork z;\n" +
49823 				"}\n",//-----------------------------------------------------------------------
49824 			},
49825 			"----------\n" +
49826 			"1. WARNING in X.java (at line 5)\n" +
49827 			"	B y = (B)a;\n" +
49828 			"	^\n" +
49829 			"B is a raw type. References to generic type B<T> should be parameterized\n" +
49830 			"----------\n" +
49831 			"2. WARNING in X.java (at line 5)\n" +
49832 			"	B y = (B)a;\n" +
49833 			"	       ^\n" +
49834 			"B is a raw type. References to generic type B<T> should be parameterized\n" +
49835 			"----------\n" +
49836 			"3. ERROR in X.java (at line 6)\n" +
49837 			"	Zork z;\n" +
49838 			"	^^^^\n" +
49839 			"Zork cannot be resolved to a type\n" +
49840 			"----------\n");
49841 }
49842 public void test1415() {
49843 	this.runNegativeTest(
49844 			new String[] {
49845 				"X.java", //-----------------------------------------------------------------------
49846 				"public class X {\n" +
49847 				"    <T, U extends T, V extends T> T foo(boolean b, U u, V v) {\n" +
49848 				"        return b ? (T) u: v;\n" +
49849 				"    }\n" +
49850 				"    Zork z;\n" +
49851 				"}\n",//-----------------------------------------------------------------------
49852 			},
49853 			"----------\n" +
49854 			"1. ERROR in X.java (at line 5)\n" +
49855 			"	Zork z;\n" +
49856 			"	^^^^\n" +
49857 			"Zork cannot be resolved to a type\n" +
49858 			"----------\n");
49859 }
49860 public void test1416() {
49861 	this.runNegativeTest(
49862 			new String[] {
49863 				"X.java", //-----------------------------------------------------------------------
49864 				"interface A {}\n" +
49865 				"interface B<RELATED extends A> extends A {}\n" +
49866 				"interface C<RELATED extends A, SOURCE  extends RELATED> extends B<RELATED> {}\n" +
49867 				"interface D<RELATED extends A, SOURCE  extends B<?>> extends C<RELATED, SOURCE> {}\n" +
49868 				"interface E<RELATED extends B<?>, SOURCE  extends RELATED> extends C<RELATED, SOURCE> {}\n" +
49869 				"public class X {\n" +
49870 				"	C<B<?>,C<?,?>> ok;\n" +
49871 				"	C<C<?,?>,B<?>> wrong;\n" +
49872 				"}\n",//-----------------------------------------------------------------------
49873 			},
49874 			"----------\n" +
49875 			"1. ERROR in X.java (at line 4)\n" +
49876 			"	interface D<RELATED extends A, SOURCE  extends B<?>> extends C<RELATED, SOURCE> {}\n" +
49877 			"	                                                                        ^^^^^^\n" +
49878 			"Bound mismatch: The type SOURCE is not a valid substitute for the bounded parameter <SOURCE extends RELATED> of the type C<RELATED,SOURCE>\n" +
49879 			"----------\n" +
49880 			"2. ERROR in X.java (at line 8)\n" +
49881 			"	C<C<?,?>,B<?>> wrong;\n" +
49882 			"	         ^\n" +
49883 			"Bound mismatch: The type B<?> is not a valid substitute for the bounded parameter <SOURCE extends RELATED> of the type C<RELATED,SOURCE>\n" +
49884 			"----------\n");
49885 }
49886 public void test1417() {
49887 	this.runConformTest(
49888 			new String[] {
49889 				"X.java", //-----------------------------------------------------------------------
49890 				"class XSuper {\n" +
49891 				"    protected void bar() {}\n" +
49892 				"}\n" +
49893 				"interface I {\n" +
49894 				"    void baz();\n" +
49895 				"}\n" +
49896 				"public class X extends XSuper implements I{\n" +
49897 				"    public void baz() {}\n" +
49898 				"    public static void main(String argv[]) {\n" +
49899 				"        testMethod(new X());\n" +
49900 				"        System.out.println(\"SUCCESS\");\n" +
49901 				"    }\n" +
49902 				"    static <T extends XSuper & I, U extends T> void testMethod(U u) {\n" +
49903 				"        u.baz();\n" +
49904 				"        u.bar();\n" +
49905 				"    }\n" +
49906 				"}\n",//-----------------------------------------------------------------------
49907 			},
49908 			"SUCCESS");
49909 }
49910 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=257434
49911 public void test1418() {
49912 	this.runNegativeTest(
49913 			new String[] {
49914 				"X.java", //-----------------------------------------------------------------------
49915 				"class Box<U extends Box<?, ?>, V extends U> {\n" +
49916 				"	V value;\n" +
49917 				"	Box<U, V> next;\n" +
49918 				"	Box(V value) {\n" +
49919 				"		this.value = value;\n" +
49920 				"	}\n" +
49921 				"	Box() {}\n" +
49922 				"}\n" +
49923 				"class A extends Box<A, A> {}\n" +
49924 				"class B extends Box<B, B> {}\n" +
49925 				"public class X {\n" +
49926 				"	public static void main(String[] args) {\n" +
49927 				"		Box<Box<A, A>, Box<A, A>> a = new Box<Box<A, A>, Box<A, A>>(new Box<A, A>(new A()));\n" +
49928 				"		Box<?, ?> b = a;\n" +
49929 				"		b.value.next = new Box<B, B>(new B());\n" +
49930 				"		A c = a.value.next.value;\n" +
49931 				"		String s = b.value;\n" +
49932 				"		b.value.next.next = new Box<B, B>(new B());\n" +
49933 				"	}\n" +
49934 				"}\n",//-----------------------------------------------------------------------
49935 			},
49936 			"----------\n" +
49937 			"1. ERROR in X.java (at line 15)\n" +
49938 			"	b.value.next = new Box<B, B>(new B());\n" +
49939 			"	               ^^^^^^^^^^^^^^^^^^^^^^\n" +
49940 			"Type mismatch: cannot convert from Box<B,B> to Box<capture#3-of ?,capture#4-of ?>\n" +
49941 			"----------\n" +
49942 			"2. ERROR in X.java (at line 17)\n" +
49943 			"	String s = b.value;\n" +
49944 			"	           ^^^^^^^\n" +
49945 			"Type mismatch: cannot convert from capture#6-of ? to String\n" +
49946 			"----------\n" +
49947 			"3. ERROR in X.java (at line 18)\n" +
49948 			"	b.value.next.next = new Box<B, B>(new B());\n" +
49949 			"	                    ^^^^^^^^^^^^^^^^^^^^^^\n" +
49950 			"Type mismatch: cannot convert from Box<B,B> to Box<capture#9-of ?,capture#10-of ?>\n" +
49951 			"----------\n");
49952 }
49953 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=257434 - variation
49954 public void test1419() {
49955 	this.runNegativeTest(
49956 			new String[] {
49957 				"X.java", //-----------------------------------------------------------------------
49958 				"class Box<U extends Box<?, ?>, V extends U> {\n" +
49959 				"	private V value;\n" +
49960 				"	Box<U, V> next;\n" +
49961 				"	Box(V value) {\n" +
49962 				"		this.value = value;\n" +
49963 				"	}\n" +
49964 				"	Box() {}\n" +
49965 				"	V getValue() { return this.value; }\n" +
49966 				"}\n" +
49967 				"class A extends Box<A, A> {}\n" +
49968 				"class B extends Box<B, B> {}\n" +
49969 				"public class X {\n" +
49970 				"	public static void main(String[] args) {\n" +
49971 				"		Box<Box<A, A>, Box<A, A>> a = new Box<Box<A, A>, Box<A, A>>(new Box<A, A>(new A()));\n" +
49972 				"		Box<?, ?> b = a;\n" +
49973 				"		b.getValue().next = new Box<B, B>(new B());\n" +
49974 				"		A c = a.getValue().next.getValue();\n" +
49975 				"		String s = b.getValue();\n" +
49976 				"		b.getValue().next.next = new Box<B, B>(new B());\n" +
49977 				"	}\n" +
49978 				"}\n",//-----------------------------------------------------------------------
49979 			},
49980 			"----------\n" +
49981 			"1. ERROR in X.java (at line 16)\n" +
49982 			"	b.getValue().next = new Box<B, B>(new B());\n" +
49983 			"	                    ^^^^^^^^^^^^^^^^^^^^^^\n" +
49984 			"Type mismatch: cannot convert from Box<B,B> to Box<capture#3-of ?,capture#4-of ?>\n" +
49985 			"----------\n" +
49986 			"2. ERROR in X.java (at line 18)\n" +
49987 			"	String s = b.getValue();\n" +
49988 			"	           ^^^^^^^^^^^^\n" +
49989 			"Type mismatch: cannot convert from capture#6-of ? to String\n" +
49990 			"----------\n" +
49991 			"3. ERROR in X.java (at line 19)\n" +
49992 			"	b.getValue().next.next = new Box<B, B>(new B());\n" +
49993 			"	                         ^^^^^^^^^^^^^^^^^^^^^^\n" +
49994 			"Type mismatch: cannot convert from Box<B,B> to Box<capture#9-of ?,capture#10-of ?>\n" +
49995 			"----------\n");
49996 }
49997 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=257434 - variation
49998 public void test1420() {
49999 	this.runNegativeTest(
50000 			new String[] {
50001 				"X.java", //-----------------------------------------------------------------------
50002 				"class Box<U extends Box<?, ?>, V extends U> {\n" +
50003 				"	V value;\n" +
50004 				"	Box<U, V> next(V v) { return new Box<U,V>(v); }\n" +
50005 				"	Box(V value) {\n" +
50006 				"		this.value = value;\n" +
50007 				"	}\n" +
50008 				"	Box() {/**/}\n" +
50009 				"}\n" +
50010 				"class A extends Box<A, A> {/**/}\n" +
50011 				"class B extends Box<B, B> {/**/}\n" +
50012 				"public class X {\n" +
50013 				"	public static void main(String[] args) {\n" +
50014 				"		Box<Box<A, A>, Box<A, A>> a = new Box<Box<A, A>, Box<A, A>>(new Box<A, A>(new A()));\n" +
50015 				"		Box<?, ?> b = a;\n" +
50016 				"		b.value.next(new Box<B, B>(new B()));\n" +
50017 				"		b.value.next(b.value);\n" +
50018 				"	}\n" +
50019 				"}\n",//-----------------------------------------------------------------------
50020 			},
50021 			"----------\n" +
50022 			"1. ERROR in X.java (at line 15)\n" +
50023 			"	b.value.next(new Box<B, B>(new B()));\n" +
50024 			"	        ^^^^\n" +
50025 			"The method next(capture#4-of ?) in the type Box<capture#3-of ?,capture#4-of ?> is not applicable for the arguments (Box<B,B>)\n" +
50026 			"----------\n" +
50027 			"2. ERROR in X.java (at line 16)\n" +
50028 			"	b.value.next(b.value);\n" +
50029 			"	        ^^^^\n" +
50030 			"The method next(capture#10-of ?) in the type Box<capture#9-of ?,capture#10-of ?> is not applicable for the arguments (capture#8-of ?)\n" +
50031 			"----------\n");
50032 }
50033 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=257849
50034 // FIXME javac8 doesn't find the error
50035 public void test1421() {
50036 	this.runNegativeTest(
50037 			false /* skipJavac */,
50038 			this.complianceLevel < ClassFileConstants.JDK1_8 ?
50039 			null : JavacTestOptions.Excuse.JavacCompilesIncorrectSource,
50040 			new String[] {
50041 				"X.java", //-----------------------------------------------------------------------
50042 				"public class X {\n" +
50043 				"	public interface ID {	};\n" +
50044 				"	public abstract class DomainObject<T extends ID> {};\n" +
50045 				"	public interface DAO<T extends DomainObject<ID>> {	};\n" +
50046 				"	public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<ID>> {};\n" +
50047 				"}\n",//-----------------------------------------------------------------------
50048 			},
50049 			"----------\n" +
50050 			"1. WARNING in X.java (at line 5)\n" +
50051 			"	public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<ID>> {};\n" +
50052 			"	                                       ^^^^^^^^^^^^\n" +
50053 			"The type parameter DomainObject is hiding the type X.DomainObject<T>\n" +
50054 			"----------\n" +
50055 			"2. ERROR in X.java (at line 5)\n" +
50056 			"	public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<ID>> {};\n" +
50057 			"	                                                                    ^^^^^^^^^^^^\n" +
50058 			"The type DomainObject is not generic; it cannot be parameterized with arguments <X.ID>\n" +
50059 			"----------\n");
50060 }
50061 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=257849 - variation
50062 public void test1422() {
50063 	this.runNegativeTest(
50064 			new String[] {
50065 				"X.java", //-----------------------------------------------------------------------
50066 				"public class X {\n" +
50067 				"	public interface ID {	};\n" +
50068 				"	public abstract class DomainObject<T extends ID> {};\n" +
50069 				"	public interface DAO<T extends DomainObject<ID>> {	};\n" +
50070 				"	public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<ID>.Zork> {};\n" +
50071 				"}\n",//-----------------------------------------------------------------------
50072 			},
50073 			"----------\n" +
50074 			"1. WARNING in X.java (at line 5)\n" +
50075 			"	public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<ID>.Zork> {};\n" +
50076 			"	                                       ^^^^^^^^^^^^\n" +
50077 			"The type parameter DomainObject is hiding the type X.DomainObject<T>\n" +
50078 			"----------\n" +
50079 			"2. ERROR in X.java (at line 5)\n" +
50080 			"	public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<ID>.Zork> {};\n" +
50081 			"	                                                                    ^^^^^^^^^^^^\n" +
50082 			"The type DomainObject is not generic; it cannot be parameterized with arguments <X.ID>\n" +
50083 			"----------\n");
50084 }
50085 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=257849
50086 public void test1423() {
50087 	this.runNegativeTest(
50088 			new String[] {
50089 				"X.java", //-----------------------------------------------------------------------
50090 				"public class X {\n" +
50091 				"	public interface ID {	};\n" +
50092 				"	public abstract class DomainObject<T extends ID> {};\n" +
50093 				"	public interface DAO<T extends DomainObject<ID>> {	};\n" +
50094 				"	public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>> {};\n" +
50095 				"}\n",//-----------------------------------------------------------------------
50096 			},
50097 			"----------\n" +
50098 			"1. WARNING in X.java (at line 5)\n" +
50099 			"	public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>> {};\n" +
50100 			"	                                       ^^^^^^^^^^^^\n" +
50101 			"The type parameter DomainObject is hiding the type X.DomainObject<T>\n" +
50102 			"----------\n" +
50103 			"2. ERROR in X.java (at line 5)\n" +
50104 			"	public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>> {};\n" +
50105 			"	                                                                    ^^^^^^^^^^^^\n" +
50106 			"The type DomainObject is not generic; it cannot be parameterized with arguments <? extends Zork>\n" +
50107 			"----------\n" +
50108 			"3. ERROR in X.java (at line 5)\n" +
50109 			"	public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>> {};\n" +
50110 			"	                                                                                           ^^^^\n" +
50111 			"Zork cannot be resolved to a type\n" +
50112 			"----------\n");
50113 }
50114 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=257849 - variation
50115 public void test1424() {
50116 	this.runNegativeTest(
50117 			new String[] {
50118 				"X.java", //-----------------------------------------------------------------------
50119 				"public class X {\n" +
50120 				"	public interface ID {	};\n" +
50121 				"	public abstract class DomainObject<T extends ID> {};\n" +
50122 				"	public interface DAO<T extends DomainObject<ID>> {	};\n" +
50123 				"	public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>.Zork> {};\n" +
50124 				"}\n",//-----------------------------------------------------------------------
50125 			},
50126 			"----------\n" +
50127 			"1. WARNING in X.java (at line 5)\n" +
50128 			"	public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>.Zork> {};\n" +
50129 			"	                                       ^^^^^^^^^^^^\n" +
50130 			"The type parameter DomainObject is hiding the type X.DomainObject<T>\n" +
50131 			"----------\n" +
50132 			"2. ERROR in X.java (at line 5)\n" +
50133 			"	public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>.Zork> {};\n" +
50134 			"	                                                                    ^^^^^^^^^^^^\n" +
50135 			"The type DomainObject is not generic; it cannot be parameterized with arguments <? extends Zork>\n" +
50136 			"----------\n" +
50137 			"3. ERROR in X.java (at line 5)\n" +
50138 			"	public abstract class HibernateDAOBase<DomainObject> implements DAO<DomainObject<? extends Zork>.Zork> {};\n" +
50139 			"	                                                                                           ^^^^\n" +
50140 			"Zork cannot be resolved to a type\n" +
50141 			"----------\n");
50142 }
50143 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=206123
50144 public void test1425() {
50145 	this.runNegativeTest(
50146 			new String[] {
50147 				"X.java", //-----------------------------------------------------------------------
50148 				"public class X {\n" +
50149 				"	void test() {\n" +
50150 				"		B b = new C();\n" +
50151 				"		Class<? extends B> cb = C.class;\n" +
50152 				"		\n" +
50153 				"		YYY<C> y = new XXX();\n" +
50154 				"		Class<? extends YYY<C>> cy = XXX.class;\n" +
50155 				"		\n" +
50156 				"		YYY<? extends B> yb = new XXX();\n" +
50157 				"		Class<? extends YYY<? extends B>> ybc = XXX.class;\n" +
50158 				"		\n" +
50159 				"		Class<? extends YYY> ybb = yb.getClass();\n" +
50160 				"		Class<? extends YYY<?>> ybb2 = yb.getClass();\n" +
50161 				"		Class<? extends YYY<? extends B>> ybb3 = yb.getClass();\n" +
50162 				"	}\n" +
50163 				"}\n" +
50164 				"class Obj {}\n" +
50165 				"class B extends Obj {}\n" +
50166 				"class C extends B {}\n" +
50167 				"class ZZZ<T extends Obj> {}\n" +
50168 				"class YYY<T extends B> extends ZZZ<T> {}\n" +
50169 				"class XXX extends YYY<C> {}\n",//-----------------------------------------------------------------------
50170 			},
50171 			"----------\n" +
50172 			"1. WARNING in X.java (at line 12)\n" +
50173 			"	Class<? extends YYY> ybb = yb.getClass();\n" +
50174 			"	                ^^^\n" +
50175 			"YYY is a raw type. References to generic type YYY<T> should be parameterized\n" +
50176 			"----------\n" +
50177 			"2. ERROR in X.java (at line 13)\n" +
50178 			"	Class<? extends YYY<?>> ybb2 = yb.getClass();\n" +
50179 			"	                               ^^^^^^^^^^^^^\n" +
50180 			"Type mismatch: cannot convert from Class<capture#4-of ? extends YYY> to Class<? extends YYY<?>>\n" +
50181 			"----------\n" +
50182 			"3. ERROR in X.java (at line 14)\n" +
50183 			"	Class<? extends YYY<? extends B>> ybb3 = yb.getClass();\n" +
50184 			"	                                         ^^^^^^^^^^^^^\n" +
50185 			"Type mismatch: cannot convert from Class<capture#6-of ? extends YYY> to Class<? extends YYY<? extends B>>\n" +
50186 			"----------\n");
50187 }
50188 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=258039
50189 public void test1426() {
50190 	this.runNegativeTest(
50191 			new String[] {
50192 				"X.java", //-----------------------------------------------------------------------
50193 				"import java.util.*;\n" +
50194 				"public class X {\n" +
50195 				"	boolean foo() {\n" +
50196 				"		return null instanceof List<Object>;\n" +
50197 				"	}\n" +
50198 				"	<T extends List<Object>> boolean foo2() {\n" +
50199 				"		return null instanceof T;\n" +
50200 				"	}\n" +
50201 				"	boolean foo3() {\n" +
50202 				"		return null instanceof Map<Object,String>;\n" +
50203 				"	}\n" +
50204 				"	<T extends Map<Object,String>> boolean foo4() {\n" +
50205 				"		return null instanceof T;\n" +
50206 				"	}\n" +
50207 				"}\n",//-----------------------------------------------------------------------
50208 			},
50209 			"----------\n" +
50210 			"1. ERROR in X.java (at line 4)\n" +
50211 			"	return null instanceof List<Object>;\n" +
50212 			"	       ^^^^^^^^^^^^^^^^^^^^\n" +
50213 			"Cannot perform instanceof check against parameterized type List<Object>. Use the form List<?> instead since further generic type information will be erased at runtime\n" +
50214 			"----------\n" +
50215 			"2. ERROR in X.java (at line 7)\n" +
50216 			"	return null instanceof T;\n" +
50217 			"	       ^^^^^^^^^^^^^^^^^\n" +
50218 			"Cannot perform instanceof check against type parameter T. Use its erasure List<?> instead since further generic type information will be erased at runtime\n" +
50219 			"----------\n" +
50220 			"3. ERROR in X.java (at line 10)\n" +
50221 			"	return null instanceof Map<Object,String>;\n" +
50222 			"	       ^^^^^^^^^^^^^^^^^^^\n" +
50223 			"Cannot perform instanceof check against parameterized type Map<Object,String>. Use the form Map<?,?> instead since further generic type information will be erased at runtime\n" +
50224 			"----------\n" +
50225 			"4. ERROR in X.java (at line 13)\n" +
50226 			"	return null instanceof T;\n" +
50227 			"	       ^^^^^^^^^^^^^^^^^\n" +
50228 			"Cannot perform instanceof check against type parameter T. Use its erasure Map<?,?> instead since further generic type information will be erased at runtime\n" +
50229 			"----------\n");
50230 }
50231 public void test1427() {
50232 	String xSource =
50233 			"import java.util.List;\n" +
50234 			"public class X {\n" +
50235 			"    public <T> List<T> nil() { return null; }\n" +
50236 			"    public <T> T getHead(List<T> x) { return null; }\n" +
50237 			"    X() {\n" +
50238 			"	   String s = getHead(nil());\n" +
50239 			"    }\n" +
50240 			"}\n";
50241 	if (this.complianceLevel < ClassFileConstants.JDK1_8) {
50242 		this.runNegativeTest(
50243 				new String[] {
50244 					"X.java",
50245 					xSource
50246 				},
50247 				"----------\n" +
50248 				"1. ERROR in X.java (at line 6)\n" +
50249 				"	String s = getHead(nil());\n" +
50250 				"	           ^^^^^^^^^^^^^^\n" +
50251 				"Type mismatch: cannot convert from Object to String\n" +
50252 				"----------\n");
50253 	} else {
50254 		runConformTest(
50255 			new String[] {
50256 				"X.java",
50257 				xSource
50258 			});
50259 	}
50260 }
50261 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=239203
50262 public void test1428() {
50263 	this.runConformTest(
50264 			new String[] {
50265 				"X.java", //-----------------------------------------------------------------------
50266 				"class A<I extends B> {}\n" +
50267 				"class B {}\n" +
50268 				"public class X {\n" +
50269 				"	public <I extends B, C extends A<I>> A<I> foo(Class<C> clazz) {\n" +
50270 				"		A<I> ret = bar(\"bla\");\n" +
50271 				"		return ret;\n" +
50272 				"	}\n" +
50273 				"	public <I extends B, C extends A<I>> A<I> bar(String clazzName) {\n" +
50274 				"		return null;\n" +
50275 				"	}\n" +
50276 				"}\n",//-----------------------------------------------------------------------
50277 			},
50278 			"");
50279 }
50280 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798
50281 public void test1429() {
50282 	this.runNegativeTest(
50283 			new String[] {
50284 				"X.java", //-----------------------------------------------------------------------
50285 				"class Foo<T> {}\n" +
50286 				"public class X {\n" +
50287 				"	public void test() {\n" +
50288 				"		Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" +
50289 				"	}\n" +
50290 				"	public <T> T m(Foo<T> x, T t) {\n" +
50291 				"		return t;\n" +
50292 				"	}\n" +
50293 				"}\n",//-----------------------------------------------------------------------
50294 			},
50295 			this.complianceLevel < ClassFileConstants.JDK1_8 ?
50296 			"----------\n" +
50297 			"1. WARNING in X.java (at line 4)\n" +
50298 			"	Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" +
50299 			"	            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
50300 			"Type safety: Unchecked invocation m(Foo<Foo<Integer>>, Foo) of the generic method m(Foo<T>, T) of type X\n" +
50301 			"----------\n" +
50302 			"2. ERROR in X.java (at line 4)\n" +
50303 			"	Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" +
50304 			"	            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
50305 			"Type mismatch: cannot convert from Foo to Integer\n" +
50306 			"----------\n" +
50307 			"3. WARNING in X.java (at line 4)\n" +
50308 			"	Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" +
50309 			"	                                       ^^^^^^^^^\n" +
50310 			"Type safety: The expression of type Foo needs unchecked conversion to conform to Foo<Integer>\n" +
50311 			"----------\n" +
50312 			"4. WARNING in X.java (at line 4)\n" +
50313 			"	Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" +
50314 			"	                                           ^^^\n" +
50315 			"Foo is a raw type. References to generic type Foo<T> should be parameterized\n" +
50316 			"----------\n" :
50317 				"----------\n" +
50318 				"1. ERROR in X.java (at line 4)\n" +
50319 				"	Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" +
50320 				"	            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
50321 				"Type mismatch: cannot convert from Foo to Integer\n" +
50322 				"----------\n" +
50323 				"2. WARNING in X.java (at line 4)\n" +
50324 				"	Integer i = m(new Foo<Foo<Integer>>(), new Foo());\n" +
50325 				"	                                           ^^^\n" +
50326 				"Foo is a raw type. References to generic type Foo<T> should be parameterized\n" +
50327 				"----------\n");
50328 }
50329 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798 - variation
50330 public void test1430() {
50331 	this.runNegativeTest(
50332 			new String[] {
50333 				"X.java", //-----------------------------------------------------------------------
50334 				"class Foo<T> {}\n" +
50335 				"public class X {\n" +
50336 				"        public void test() {\n" +
50337 				"                m(new Foo<Foo<Integer>>(), new Foo());\n" +
50338 				"        }\n" +
50339 				"        public <T> void m(Foo<T> x, T t) {}\n" +
50340 				"}\n",//-----------------------------------------------------------------------
50341 			},
50342 			"----------\n" +
50343 			"1. WARNING in X.java (at line 4)\n" +
50344 			"	m(new Foo<Foo<Integer>>(), new Foo());\n" +
50345 			"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
50346 			"Type safety: Unchecked invocation m(Foo<Foo<Integer>>, Foo) of the generic method m(Foo<T>, T) of type X\n" +
50347 			"----------\n" +
50348 			"2. WARNING in X.java (at line 4)\n" +
50349 			"	m(new Foo<Foo<Integer>>(), new Foo());\n" +
50350 			"	                           ^^^^^^^^^\n" +
50351 			"Type safety: The expression of type Foo needs unchecked conversion to conform to Foo<Integer>\n" +
50352 			"----------\n" +
50353 			"3. WARNING in X.java (at line 4)\n" +
50354 			"	m(new Foo<Foo<Integer>>(), new Foo());\n" +
50355 			"	                               ^^^\n" +
50356 			"Foo is a raw type. References to generic type Foo<T> should be parameterized\n" +
50357 			"----------\n");
50358 }
50359 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=258039
50360 public void test1431()  throws Exception {
50361 	this.runNegativeTest(
50362 		new String[] {
50363 			"X.java", //=================================
50364 			"public class X {\n" +
50365 			"	void foo() {\n" +
50366 			"		class M<T extends Number> {}\n" +
50367 			"		class N extends M<String> {}\n" +
50368 			"		class O implements I<String>, I<Number> {}\n" +
50369 			"	}\n" +
50370 			"	class MM<T extends Number> {}\n" +
50371 			"	class NN extends MM<String> {}\n" +
50372 			"	class OO implements I<String>, I<Number> {}\n" +
50373 			"}\n" +
50374 			"interface I<T> {}"
50375 		},
50376 		"----------\n" +
50377 		"1. ERROR in X.java (at line 4)\n" +
50378 		"	class N extends M<String> {}\n" +
50379 		"	                  ^^^^^^\n" +
50380 		"Bound mismatch: The type String is not a valid substitute for the bounded parameter <T extends Number> of the type M<T>\n" +
50381 		"----------\n" +
50382 		"2. ERROR in X.java (at line 5)\n" +
50383 		"	class O implements I<String>, I<Number> {}\n" +
50384 		"	      ^\n" +
50385 		"The interface I cannot be implemented more than once with different arguments: I<Number> and I<String>\n" +
50386 		"----------\n" +
50387 		"3. ERROR in X.java (at line 8)\n" +
50388 		"	class NN extends MM<String> {}\n" +
50389 		"	                    ^^^^^^\n" +
50390 		"Bound mismatch: The type String is not a valid substitute for the bounded parameter <T extends Number> of the type X.MM<T>\n" +
50391 		"----------\n" +
50392 		"4. ERROR in X.java (at line 9)\n" +
50393 		"	class OO implements I<String>, I<Number> {}\n" +
50394 		"	      ^^\n" +
50395 		"The interface I cannot be implemented more than once with different arguments: I<Number> and I<String>\n" +
50396 		"----------\n"
50397 	);
50398 }
50399 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798 - variation
50400 public void test1432() {
50401 	this.runNegativeTest(
50402 			new String[] {
50403 				"X.java", //-----------------------------------------------------------------------
50404 				"class Foo<T> {\n" +
50405 				"	T bar(Foo<T> ft, T t) {\n" +
50406 				"		return t;\n" +
50407 				"	}\n" +
50408 				"}\n" +
50409 				"public class X {\n" +
50410 				"	public void test() {\n" +
50411 				"		Foo<Foo<Integer>> ffi = new Foo<Foo<Integer>>();\n" +
50412 				"		Integer j = ffi.bar(ffi, new Foo());\n" +
50413 				"	}\n" +
50414 				"}\n",//-----------------------------------------------------------------------
50415 			},
50416 			"----------\n" +
50417 			"1. ERROR in X.java (at line 9)\n" +
50418 			"	Integer j = ffi.bar(ffi, new Foo());\n" +
50419 			"	            ^^^^^^^^^^^^^^^^^^^^^^^\n" +
50420 			(this.complianceLevel < ClassFileConstants.JDK1_8
50421 			? "Type mismatch: cannot convert from Foo<Integer> to Integer\n"
50422 			: "Type mismatch: cannot convert from Foo to Integer\n") +
50423 			"----------\n" +
50424 			"2. WARNING in X.java (at line 9)\n" +
50425 			"	Integer j = ffi.bar(ffi, new Foo());\n" +
50426 			"	                         ^^^^^^^^^\n" +
50427 			"Type safety: The expression of type Foo needs unchecked conversion to conform to Foo<Integer>\n" +
50428 			"----------\n" +
50429 			"3. WARNING in X.java (at line 9)\n" +
50430 			"	Integer j = ffi.bar(ffi, new Foo());\n" +
50431 			"	                             ^^^\n" +
50432 			"Foo is a raw type. References to generic type Foo<T> should be parameterized\n" +
50433 			"----------\n");
50434 }
50435 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798 - variation
50436 public void test1433() {
50437 	this.runNegativeTest(
50438 			new String[] {
50439 				"X.java", //-----------------------------------------------------------------------
50440 				"import java.util.*;\n" +
50441 				"public class X<T> {\n" +
50442 				"	Zork z;\n" +
50443 				"	<U> void foo(X<U> xu) {}\n" +
50444 				"	void bar(X x) {\n" +
50445 				"		foo(x);\n" +
50446 				"	}\n" +
50447 				"}\n",//-----------------------------------------------------------------------
50448 			},
50449 			"----------\n" +
50450 			"1. ERROR in X.java (at line 3)\n" +
50451 			"	Zork z;\n" +
50452 			"	^^^^\n" +
50453 			"Zork cannot be resolved to a type\n" +
50454 			"----------\n" +
50455 			"2. WARNING in X.java (at line 5)\n" +
50456 			"	void bar(X x) {\n" +
50457 			"	         ^\n" +
50458 			"X is a raw type. References to generic type X<T> should be parameterized\n" +
50459 			"----------\n" +
50460 			"3. WARNING in X.java (at line 6)\n" +
50461 			"	foo(x);\n" +
50462 			"	^^^^^^\n" +
50463 			"Type safety: Unchecked invocation foo(X) of the generic method foo(X<U>) of type X<T>\n" +
50464 			"----------\n" +
50465 			"4. WARNING in X.java (at line 6)\n" +
50466 			"	foo(x);\n" +
50467 			"	    ^\n" +
50468 			"Type safety: The expression of type X needs unchecked conversion to conform to X<Object>\n" +
50469 			"----------\n");
50470 }
50471 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798 - variation
50472 public void test1434() {
50473 	this.runNegativeTest(
50474 			new String[] {
50475 				"Foo.java", //-----------------------------------------------------------------------
50476 				"public class Foo {\n" +
50477 				"	public static <I> I m2(Class<I> c) { return null; }	\n" +
50478 				"	void bar() {\n" +
50479 				"		Foo l2 = m2((Class)Foo.class);\n" +
50480 				"	}\n" +
50481 				"}\n",//-----------------------------------------------------------------------
50482 			},
50483 			(this.complianceLevel < ClassFileConstants.JDK1_8 ?
50484 			"----------\n" +
50485 			"1. WARNING in Foo.java (at line 4)\n" +
50486 			"	Foo l2 = m2((Class)Foo.class);\n" +
50487 			"	         ^^^^^^^^^^^^^^^^^^^^\n" +
50488 			"Type safety: Unchecked invocation m2(Class) of the generic method m2(Class<I>) of type Foo\n" +
50489 			"----------\n" +
50490 			"2. WARNING in Foo.java (at line 4)\n" +
50491 			"	Foo l2 = m2((Class)Foo.class);\n" +
50492 			"	            ^^^^^^^^^^^^^^^^\n" +
50493 			"Type safety: The expression of type Class needs unchecked conversion to conform to Class<Foo>\n" +
50494 			"----------\n" +
50495 			"3. WARNING in Foo.java (at line 4)\n" +
50496 			"	Foo l2 = m2((Class)Foo.class);\n" +
50497 			"	            ^^^^^^^^^^^^^^^^\n" +
50498 			"Unnecessary cast from Class<Foo> to Class\n" +
50499 			"----------\n" +
50500 			"4. WARNING in Foo.java (at line 4)\n" +
50501 			"	Foo l2 = m2((Class)Foo.class);\n" +
50502 			"	             ^^^^^\n" +
50503 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
50504 			"----------\n"
50505 			: // 1.8 is stricter:
50506 			"----------\n" +
50507 			"1. ERROR in Foo.java (at line 4)\n" +
50508 			"	Foo l2 = m2((Class)Foo.class);\n" +
50509 			"	         ^^^^^^^^^^^^^^^^^^^^\n" +
50510 			"Type mismatch: cannot convert from Object to Foo\n" +
50511 			"----------\n" +
50512 			"2. WARNING in Foo.java (at line 4)\n" +
50513 			"	Foo l2 = m2((Class)Foo.class);\n" +
50514 			"	             ^^^^^\n" +
50515 			"Class is a raw type. References to generic type Class<T> should be parameterized\n" +
50516 			"----------\n"));
50517 }
50518 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798 - variation
50519 public void test1435() {
50520 	String xSource =
50521 				"public class X {\n" +
50522 				"	<T extends Comparable<T>>	T min(T x, T y) { return x; }\n" +
50523 				"	\n" +
50524 				"	void foo(Foo f, Bar b) {\n" +
50525 				"		min(f, f);\n" +
50526 				"		min(b, b);\n" +
50527 				"	}\n" +
50528 				"}\n" +
50529 				"abstract class Foo implements Comparable<Foo> {\n" +
50530 				"}\n" +
50531 				"abstract class Bar extends Foo {}\n";
50532 	if (this.complianceLevel < ClassFileConstants.JDK1_8) {
50533 		this.runNegativeTest(
50534 				new String[] {
50535 					"X.java",
50536 					xSource,
50537 				},
50538 				"----------\n" +
50539 				"1. ERROR in X.java (at line 6)\n" +
50540 				"	min(b, b);\n" +
50541 				"	^^^\n" +
50542 				"Bound mismatch: The generic method min(T, T) of type X is not applicable for the arguments (Bar, Bar). The inferred type Bar is not a valid substitute for the bounded parameter <T extends Comparable<T>>\n" +
50543 				"----------\n");
50544 	} else {
50545 		runConformTest(new String[]{ "X.java", xSource });
50546 	}
50547 }
50548 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798 - variation
50549 public void test1436() {
50550 	this.runNegativeTest(
50551 			new String[] {
50552 				"X.java", //-----------------------------------------------------------------------
50553 				"import java.util.*;\n" +
50554 				"public class X {\n" +
50555 				"	<U extends List<?>, T extends Throwable> void foo(List<U> lu, T t) throws T {\n" +
50556 				"		if (lu.isEmpty()) throw t;\n" +
50557 				"	}\n" +
50558 				"	void bar(List l, IllegalArgumentException iae) {\n" +
50559 				"		try {\n" +
50560 				"			foo(l, iae);\n" +
50561 				"		} catch (IllegalArgumentException e) {\n" +
50562 				"		}\n" +
50563 				"	}\n" +
50564 				"}\n",//-----------------------------------------------------------------------
50565 			},
50566 			"----------\n" +
50567 			"1. WARNING in X.java (at line 6)\n" +
50568 			"	void bar(List l, IllegalArgumentException iae) {\n" +
50569 			"	         ^^^^\n" +
50570 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
50571 			"----------\n" +
50572 			"2. WARNING in X.java (at line 8)\n" +
50573 			"	foo(l, iae);\n" +
50574 			"	^^^^^^^^^^^\n" +
50575 			"Type safety: Unchecked invocation foo(List, IllegalArgumentException) of the generic method foo(List<U>, T) of type X\n" +
50576 			"----------\n" +
50577 			(this.complianceLevel < ClassFileConstants.JDK1_8
50578 			?
50579 				"3. WARNING in X.java (at line 8)\n" +
50580 				"	foo(l, iae);\n" +
50581 				"	    ^\n" +
50582 				"Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n"
50583 			:
50584 				"3. ERROR in X.java (at line 8)\n" +
50585 				"	foo(l, iae);\n" +
50586 				"	^^^^^^^^^^^\n" +
50587 				"Unhandled exception type Throwable\n" + // new error since 1.8 (bug 473657)
50588 				"----------\n" +
50589 				"4. WARNING in X.java (at line 8)\n" +
50590 				"	foo(l, iae);\n" +
50591 				"	    ^\n" +
50592 				"Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n"
50593 			) +
50594 			"----------\n");
50595 }
50596 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798 - variation
50597 public void test1437() {
50598 	this.runNegativeTest(
50599 			new String[] {
50600 				"X.java", //-----------------------------------------------------------------------
50601 				"import java.util.*;\n" +
50602 				"public class X {\n" +
50603 				"	<U extends List<?>, T extends Throwable> X(List<U> lu, T t) throws T {\n" +
50604 				"		if (lu.isEmpty()) throw t;\n" +
50605 				"	}\n" +
50606 				"	void bar(List l, IllegalArgumentException iae) {\n" +
50607 				"		try {\n" +
50608 				"			new X(l, iae);\n" +
50609 				"		} catch (IllegalArgumentException e) {\n" +
50610 				"		}\n" +
50611 				"	}\n" +
50612 				"}\n",//-----------------------------------------------------------------------
50613 			},
50614 			"----------\n" +
50615 			"1. WARNING in X.java (at line 6)\n" +
50616 			"	void bar(List l, IllegalArgumentException iae) {\n" +
50617 			"	         ^^^^\n" +
50618 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
50619 			"----------\n" +
50620 			"2. WARNING in X.java (at line 8)\n" +
50621 			"	new X(l, iae);\n" +
50622 			"	^^^^^^^^^^^^^\n" +
50623 			"Type safety: Unchecked invocation X(List, IllegalArgumentException) of the generic constructor X(List<U>, T) of type X\n" +
50624 			"----------\n" +
50625 			(this.complianceLevel < ClassFileConstants.JDK1_8
50626 			?
50627 				"3. WARNING in X.java (at line 8)\n" +
50628 				"	new X(l, iae);\n" +
50629 				"	      ^\n" +
50630 				"Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n"
50631 			:
50632 				"3. ERROR in X.java (at line 8)\n" +
50633 				"	new X(l, iae);\n" +
50634 				"	^^^^^^^^^^^^^\n" +
50635 				"Unhandled exception type Throwable\n" + // new error since 1.8 (bug 473657)
50636 				"----------\n" +
50637 				"4. WARNING in X.java (at line 8)\n" +
50638 				"	new X(l, iae);\n" +
50639 				"	      ^\n" +
50640 				"Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n"
50641 			) +
50642 			"----------\n");
50643 }
50644 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798 - variation
50645 public void test1438() {
50646 	this.runNegativeTest(
50647 			new String[] {
50648 				"X.java", //-----------------------------------------------------------------------
50649 				"import java.util.*;\n" +
50650 				"public class X {\n" +
50651 				"	<U extends List<?>, T extends Throwable> X(List<U> lu, T t) throws T {\n" +
50652 				"		if (lu.isEmpty()) throw t;\n" +
50653 				"	}\n" +
50654 				"	void bar(List l, IllegalArgumentException iae) {\n" +
50655 				"		try {\n" +
50656 				"			new X(l, iae){};\n" +
50657 				"		} catch (IllegalArgumentException e) {\n" +
50658 				"		}\n" +
50659 				"	}\n" +
50660 				"}\n",//-----------------------------------------------------------------------
50661 			},
50662 			"----------\n" +
50663 			"1. WARNING in X.java (at line 6)\n" +
50664 			"	void bar(List l, IllegalArgumentException iae) {\n" +
50665 			"	         ^^^^\n" +
50666 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
50667 			"----------\n" +
50668 			"2. WARNING in X.java (at line 8)\n" +
50669 			"	new X(l, iae){};\n" +
50670 			"	^^^^^^^^^^^^^^^\n" +
50671 			"Type safety: Unchecked invocation X(List, IllegalArgumentException) of the generic constructor X(List<U>, T) of type X\n" +
50672 			"----------\n" +
50673 			(this.complianceLevel < ClassFileConstants.JDK1_8
50674 			?
50675 				"3. WARNING in X.java (at line 8)\n" +
50676 				"	new X(l, iae){};\n" +
50677 				"	      ^\n" +
50678 				"Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n"
50679 			:
50680 				"3. ERROR in X.java (at line 8)\n" +
50681 				"	new X(l, iae){};\n" +
50682 				"	^^^^^^^^^^^^^^^\n" +
50683 				"Unhandled exception type Throwable\n" + // new error since 1.8 (bug 473657)
50684 				"----------\n" +
50685 				"4. WARNING in X.java (at line 8)\n" +
50686 				"	new X(l, iae){};\n" +
50687 				"	      ^\n" +
50688 				"Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n"
50689 			) +
50690 			"----------\n");
50691 }
50692 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=258798 - variation
50693 public void test1439() {
50694 	this.runNegativeTest(
50695 			new String[] {
50696 				"X.java", //-----------------------------------------------------------------------
50697 				"import java.util.*;\n" +
50698 				"public class X {\n" +
50699 				"	<U extends List<?>, T extends Throwable> X(List<U> lu, T t) throws T {\n" +
50700 				"		if (lu.isEmpty()) throw t;\n" +
50701 				"	}\n" +
50702 				"	X() { \n" +
50703 				"		this((List) null, null);\n" +
50704 				"	}\n" +
50705 				"}\n" +
50706 				"class Y extends X {\n" +
50707 				"	<U extends List<?>, T extends Throwable> Y(List<U> lu, T t) {\n" +
50708 				"		super((List)lu, t);\n" +
50709 				"	}\n" +
50710 				"}\n",//-----------------------------------------------------------------------
50711 			},
50712 			"----------\n" +
50713 			"1. WARNING in X.java (at line 7)\n" +
50714 			"	this((List) null, null);\n" +
50715 			"	^^^^^^^^^^^^^^^^^^^^^^^^\n" +
50716 			"Type safety: Unchecked invocation X(List, null) of the generic constructor X(List<U>, T) of type X\n" +
50717 			"----------\n" +
50718 			"2. ERROR in X.java (at line 7)\n" +
50719 			"	this((List) null, null);\n" +
50720 			"	^^^^^^^^^^^^^^^^^^^^^^^^\n" +
50721 			"Unhandled exception type Throwable\n" +
50722 			"----------\n" +
50723 			"3. WARNING in X.java (at line 7)\n" +
50724 			"	this((List) null, null);\n" +
50725 			"	     ^^^^^^^^^^^\n" +
50726 			"Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n" +
50727 			"----------\n" +
50728 			"4. WARNING in X.java (at line 7)\n" +
50729 			"	this((List) null, null);\n" +
50730 			"	      ^^^^\n" +
50731 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
50732 			"----------\n" +
50733 			"5. WARNING in X.java (at line 12)\n" +
50734 			"	super((List)lu, t);\n" +
50735 			"	^^^^^^^^^^^^^^^^^^^\n" +
50736 			"Type safety: Unchecked invocation X(List, T) of the generic constructor X(List<U>, T) of type X\n" +
50737 			"----------\n" +
50738 			"6. ERROR in X.java (at line 12)\n" +
50739 			"	super((List)lu, t);\n" +
50740 			"	^^^^^^^^^^^^^^^^^^^\n" +
50741 			"Unhandled exception type Throwable\n" +
50742 			"----------\n" +
50743 			"7. WARNING in X.java (at line 12)\n" +
50744 			"	super((List)lu, t);\n" +
50745 			"	      ^^^^^^^^\n" +
50746 			"Type safety: The expression of type List needs unchecked conversion to conform to List<List<?>>\n" +
50747 			"----------\n" +
50748 			"8. WARNING in X.java (at line 12)\n" +
50749 			"	super((List)lu, t);\n" +
50750 			"	       ^^^^\n" +
50751 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
50752 			"----------\n");
50753 }
50754 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=260567
50755 public void test1440() {
50756 	this.runNegativeTest(
50757 			new String[] {
50758 				"X.java", //-----------------------------------------------------------------------
50759 				"import java.util.*;\n" +
50760 				"interface GenricInterface<T> {}\n" +
50761 				"class NewMapType<U, V, R extends GenricInterface<U>> extends HashMap<R<U>, V> {}\n",//-----------------------------------------------------------------------
50762 			},
50763 			"----------\n" +
50764 			"1. ERROR in X.java (at line 3)\n" +
50765 			"	class NewMapType<U, V, R extends GenricInterface<U>> extends HashMap<R<U>, V> {}\n" +
50766 			"	                                                                     ^\n" +
50767 			"The type R is not generic; it cannot be parameterized with arguments <U>\n" +
50768 			"----------\n");
50769 }
50770 public void test1441() {
50771 	this.runNegativeTest(
50772 			new String[] {
50773 				"X.java", //-----------------------------------------------------------------------
50774 				"public class X<T> {\n" +
50775 				"	void bar(T t) {}\n" +
50776 				"	void foo(X<? extends String> x1, X<? extends Integer> x2) {\n" +
50777 				"		(x1 != null ? x1 : x2).bar(new Object());\n" +
50778 				"	}\n" +
50779 				"}\n",//-----------------------------------------------------------------------
50780 			},
50781 			"----------\n" +
50782 			"1. ERROR in X.java (at line 4)\n" +
50783 			"	(x1 != null ? x1 : x2).bar(new Object());\n" +
50784 			"	                       ^^^\n" +
50785 			"The method bar(capture#4-of ? extends "+intersection("Object","Serializable","Comparable<? extends "+intersection("Object","Serializable","Comparable<?>")+">")+") in the type X<capture#4-of ? extends "+intersection("Object","Serializable","Comparable<? extends "+intersection("Object","Serializable","Comparable<?>")+">")+"> is not applicable for the arguments (Object)\n" +
50786 			"----------\n");
50787 }
50788 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=221253
50789 public void test1442() {
50790 	this.runNegativeTest(
50791 			new String[] {
50792 				"X.java", //-----------------------------------------------------------------------
50793 				"public class X<T extends Comparable<T>> {\n" +
50794 				"        T[] array;\n" +
50795 				"\n" +
50796 				"        @Override public boolean equals(Object o) {\n" +
50797 				"                X<Comparable<T>> x;\n" +
50798 				"                if (array.length == ((X<Comparable<T>>) o).array.length) {\n" +
50799 				"                        return true;\n" +
50800 				"                }\n" +
50801 				"                return false;\n" +
50802 				"        }\n" +
50803 				"}\n",//-----------------------------------------------------------------------
50804 			},
50805 			"----------\n" +
50806 			"1. ERROR in X.java (at line 5)\n" +
50807 			"	X<Comparable<T>> x;\n" +
50808 			"	  ^^^^^^^^^^\n" +
50809 			"Bound mismatch: The type Comparable<T> is not a valid substitute for the bounded parameter <T extends Comparable<T>> of the type X<T>\n" +
50810 			"----------\n" +
50811 			"2. WARNING in X.java (at line 6)\n" +
50812 			"	if (array.length == ((X<Comparable<T>>) o).array.length) {\n" +
50813 			"	                    ^^^^^^^^^^^^^^^^^^^^^^\n" +
50814 			"Type safety: Unchecked cast from Object to X<Comparable<T>>\n" +
50815 			"----------\n" +
50816 			"3. ERROR in X.java (at line 6)\n" +
50817 			"	if (array.length == ((X<Comparable<T>>) o).array.length) {\n" +
50818 			"	                        ^^^^^^^^^^\n" +
50819 			"Bound mismatch: The type Comparable<T> is not a valid substitute for the bounded parameter <T extends Comparable<T>> of the type X<T>\n" +
50820 			"----------\n");
50821 }
50822 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=254627
50823 public void test1443() {
50824 	this.runNegativeTest(
50825 			new String[] {
50826 				"X.java", //-----------------------------------------------------------------------
50827 				"import java.util.List;\n" +
50828 				"public class X {\n" +
50829 				"  private static class C {}\n" +
50830 				"  private static class B<T extends C> {}\n" +
50831 				"  private static class A<T extends B<? extends C>> {}\n" +
50832 				"  void bar (List<A> a) {\n" +
50833 				"    baz((List)a);\n" +
50834 				"    // Neither of these two following statements compile under javac\n" +
50835 				"    buz(a);\n" +
50836 				"    buz((List)a);\n" +
50837 				"    // Side note: the following statement is correctly identified as an error\n" +
50838 				"    // by Eclipse, but it does not suggest casting as a Quick Fix.\n" +
50839 				"    baz(a);\n" +
50840 				"  }\n" +
50841 				"  <R extends C, T extends B<R>> void baz(List<A<T>> a) {}\n" +
50842 				"  <R extends C, T extends B<R>> void buz(List a) {}\n" +
50843 				"}\n",//-----------------------------------------------------------------------
50844 			},
50845 			"----------\n" +
50846 			"1. WARNING in X.java (at line 6)\n" +
50847 			"	void bar (List<A> a) {\n" +
50848 			"	               ^\n" +
50849 			"X.A is a raw type. References to generic type X.A<T> should be parameterized\n" +
50850 			"----------\n" +
50851 			"2. WARNING in X.java (at line 7)\n" +
50852 			"	baz((List)a);\n" +
50853 			"	^^^^^^^^^^^^\n" +
50854 			"Type safety: Unchecked invocation baz(List) of the generic method baz(List<X.A<T>>) of type X\n" +
50855 			"----------\n" +
50856 			"3. WARNING in X.java (at line 7)\n" +
50857 			"	baz((List)a);\n" +
50858 			"	    ^^^^^^^\n" +
50859 			"Type safety: The expression of type List needs unchecked conversion to conform to List<X.A<X.B<X.C>>>\n" +
50860 			"----------\n" +
50861 			"4. WARNING in X.java (at line 7)\n" +
50862 			"	baz((List)a);\n" +
50863 			"	     ^^^^\n" +
50864 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
50865 			"----------\n" +
50866 			"5. WARNING in X.java (at line 10)\n" +
50867 			"	buz((List)a);\n" +
50868 			"	     ^^^^\n" +
50869 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
50870 			"----------\n" +
50871 			"6. ERROR in X.java (at line 13)\n" +
50872 			"	baz(a);\n" +
50873 			"	^^^\n" +
50874 			"The method baz(List<X.A<T>>) in the type X is not applicable for the arguments (List<X.A>)\n" +
50875 			"----------\n" +
50876 			"7. WARNING in X.java (at line 16)\n" +
50877 			"	<R extends C, T extends B<R>> void buz(List a) {}\n" +
50878 			"	                                       ^^^^\n" +
50879 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
50880 			"----------\n");
50881 }
50882 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=263215
50883 public void test1444() {
50884 	this.runNegativeTest(
50885 			new String[] {
50886 				"X.java", //-----------------------------------------------------------------------
50887 				"import java.util.ArrayList;\n" +
50888 				"import java.util.Iterator;\n" +
50889 				"import java.util.List;\n" +
50890 				"\n" +
50891 				"public class X {\n" +
50892 				"	@SuppressWarnings(\"all\") public static <T> T[] asArray(Iterator<? extends T> it, Class<T> clazz) {\n" +
50893 				"		List<T> lst = new ArrayList<T>();\n" +
50894 				"		while (it.hasNext()) {\n" +
50895 				"			lst.add(it.next());\n" +
50896 				"		}\n" +
50897 				"		return lst.toArray((T[]) java.lang.reflect.Array.newInstance(clazz, lst.size()));\n" +
50898 				"	}\n" +
50899 				"	public void test() {\n" +
50900 				"		String[] asString = null;\n" +
50901 				"		// eclipse 3.5M4 this worked in build I20090129-1200 it doesnt anymore\n" +
50902 				"		asString = X.<String> asArray(getIterator(), String.class);\n" +
50903 				"		// now i have to do this:\n" +
50904 				"		Iterator<String> iterator = getIterator();\n" +
50905 				"		asString = X.<String> asArray(iterator, String.class);\n" +
50906 				"		// this also works except if i have remove unnecessary cast enabled then\n" +
50907 				"		// the cast is removed and i get a compile error\n" +
50908 				"		asString = X.<String> asArray((Iterator<String>) getIterator(), String.class);\n" +
50909 				"	}\n" +
50910 				"	@SuppressWarnings(\"all\") public Iterator getIterator() {\n" +
50911 				"		return new Iterator() {\n" +
50912 				"			public void remove() {\n" +
50913 				"			}\n" +
50914 				"			public Object next() {\n" +
50915 				"				return null;\n" +
50916 				"			}\n" +
50917 				"			public boolean hasNext() {\n" +
50918 				"				return false;\n" +
50919 				"			}\n" +
50920 				"		};\n" +
50921 				"	}\n" +
50922 				"	Zork z;\n" +
50923 				"}\n",//-----------------------------------------------------------------------
50924 			},
50925 			"----------\n" +
50926 			"1. WARNING in X.java (at line 16)\n" +
50927 			"	asString = X.<String> asArray(getIterator(), String.class);\n" +
50928 			"	           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
50929 			"Type safety: Unchecked invocation asArray(Iterator, Class<String>) of the generic method asArray(Iterator<? extends T>, Class<T>) of type X\n" +
50930 			"----------\n" +
50931 			"2. WARNING in X.java (at line 16)\n" +
50932 			"	asString = X.<String> asArray(getIterator(), String.class);\n" +
50933 			"	                              ^^^^^^^^^^^^^\n" +
50934 			"Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<? extends String>\n" +
50935 			"----------\n" +
50936 			"3. WARNING in X.java (at line 18)\n" +
50937 			"	Iterator<String> iterator = getIterator();\n" +
50938 			"	                            ^^^^^^^^^^^^^\n" +
50939 			"Type safety: The expression of type Iterator needs unchecked conversion to conform to Iterator<String>\n" +
50940 			"----------\n" +
50941 			"4. WARNING in X.java (at line 22)\n" +
50942 			"	asString = X.<String> asArray((Iterator<String>) getIterator(), String.class);\n" +
50943 			"	                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
50944 			"Type safety: Unchecked cast from Iterator to Iterator<String>\n" +
50945 			"----------\n" +
50946 			(this.complianceLevel < ClassFileConstants.JDK1_8 ?
50947 			"5. WARNING in X.java (at line 22)\n" +
50948 			"	asString = X.<String> asArray((Iterator<String>) getIterator(), String.class);\n" +
50949 			"	                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
50950 			"Unnecessary cast from Iterator to Iterator<String>\n" +
50951 			"----------\n" +
50952 			"6. ERROR in X.java (at line 36)\n"
50953 			: // secondary error no longer reported at 1.8+
50954 			"5. ERROR in X.java (at line 36)\n"
50955 			) +
50956 			"	Zork z;\n" +
50957 			"	^^^^\n" +
50958 			"Zork cannot be resolved to a type\n" +
50959 			"----------\n");
50960 }
50961 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=263215 - variation
50962 public void test1445() {
50963 	this.runNegativeTest(
50964 			new String[] {
50965 				"X.java", //-----------------------------------------------------------------------
50966 				"import java.io.IOException;\n" +
50967 				"import java.util.List;\n" +
50968 				"\n" +
50969 				"public class X {\n" +
50970 				"	<T extends Throwable> X(List<T> lt) throws T { }\n" +
50971 				"	<T extends Throwable> List<T> foo(List<T> t) throws T { return t; }\n" +
50972 				"\n" +
50973 				"	static void bar(List l) {\n" +
50974 				"		new X(l).foo(l);\n" +
50975 				"	}\n" +
50976 				"	static void baz(List l) throws IOException {\n" +
50977 				"		new <IOException> X(l). <IOException> foo(l);\n" +
50978 				"	}\n" +
50979 				"	\n" +
50980 				"	X(List l, long l2) throws IOException {\n" +
50981 				"		<IOException> this(l);\n" +
50982 				"	}\n" +
50983 				"\n" +
50984 				"	static void baz2(List l) throws IOException {\n" +
50985 				"		new <IOException> X(l){}. <IOException> foo(l);\n" +
50986 				"	}\n" +
50987 				"\n" +
50988 				"}\n",
50989 			},
50990 			"----------\n" +
50991 			"1. WARNING in X.java (at line 8)\n" +
50992 			"	static void bar(List l) {\n" +
50993 			"	                ^^^^\n" +
50994 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
50995 			"----------\n" +
50996 			"2. WARNING in X.java (at line 9)\n" +
50997 			"	new X(l).foo(l);\n" +
50998 			"	^^^^^^^^\n" +
50999 			"Type safety: Unchecked invocation X(List) of the generic constructor X(List<T>) of type X\n" +
51000 			"----------\n" +
51001 			"3. WARNING in X.java (at line 9)\n" +
51002 			"	new X(l).foo(l);\n" +
51003 			"	^^^^^^^^^^^^^^^\n" +
51004 			"Type safety: Unchecked invocation foo(List) of the generic method foo(List<T>) of type X\n" +
51005 			"----------\n" +
51006 			"4. ERROR in X.java (at line 9)\n" +
51007 			"	new X(l).foo(l);\n" +
51008 			"	^^^^^^^^\n" +
51009 			"Unhandled exception type Throwable\n" +
51010 			"----------\n" +
51011 			"5. ERROR in X.java (at line 9)\n" +
51012 			"	new X(l).foo(l);\n" +
51013 			"	^^^^^^^^^^^^^^^\n" +
51014 			"Unhandled exception type Throwable\n" +
51015 			"----------\n" +
51016 			"6. WARNING in X.java (at line 9)\n" +
51017 			"	new X(l).foo(l);\n" +
51018 			"	      ^\n" +
51019 			(this.complianceLevel < ClassFileConstants.JDK1_8
51020 			? "Type safety: The expression of type List needs unchecked conversion to conform to List<Throwable>\n"
51021 			: "Type safety: The expression of type List needs unchecked conversion to conform to List<RuntimeException>\n" ) +
51022 			"----------\n" +
51023 			"7. WARNING in X.java (at line 9)\n" +
51024 			"	new X(l).foo(l);\n" +
51025 			"	             ^\n" +
51026 			(this.complianceLevel < ClassFileConstants.JDK1_8
51027 			? "Type safety: The expression of type List needs unchecked conversion to conform to List<Throwable>\n"
51028 			: "Type safety: The expression of type List needs unchecked conversion to conform to List<RuntimeException>\n" ) +
51029 			"----------\n" +
51030 			"8. WARNING in X.java (at line 11)\n" +
51031 			"	static void baz(List l) throws IOException {\n" +
51032 			"	                ^^^^\n" +
51033 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
51034 			"----------\n" +
51035 			"9. WARNING in X.java (at line 12)\n" +
51036 			"	new <IOException> X(l). <IOException> foo(l);\n" +
51037 			"	^^^^^^^^^^^^^^^^^^^^^^\n" +
51038 			"Type safety: Unchecked invocation X(List) of the generic constructor X(List<T>) of type X\n" +
51039 			"----------\n" +
51040 			"10. WARNING in X.java (at line 12)\n" +
51041 			"	new <IOException> X(l). <IOException> foo(l);\n" +
51042 			"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
51043 			"Type safety: Unchecked invocation foo(List) of the generic method foo(List<T>) of type X\n" +
51044 			"----------\n" +
51045 			"11. WARNING in X.java (at line 12)\n" +
51046 			"	new <IOException> X(l). <IOException> foo(l);\n" +
51047 			"	                    ^\n" +
51048 			"Type safety: The expression of type List needs unchecked conversion to conform to List<IOException>\n" +
51049 			"----------\n" +
51050 			"12. WARNING in X.java (at line 12)\n" +
51051 			"	new <IOException> X(l). <IOException> foo(l);\n" +
51052 			"	                                          ^\n" +
51053 			"Type safety: The expression of type List needs unchecked conversion to conform to List<IOException>\n" +
51054 			"----------\n" +
51055 			"13. WARNING in X.java (at line 15)\n" +
51056 			"	X(List l, long l2) throws IOException {\n" +
51057 			"	  ^^^^\n" +
51058 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
51059 			"----------\n" +
51060 			"14. WARNING in X.java (at line 16)\n" +
51061 			"	<IOException> this(l);\n" +
51062 			"	              ^^^^^^^^\n" +
51063 			"Type safety: Unchecked invocation X(List) of the generic constructor X(List<T>) of type X\n" +
51064 			"----------\n" +
51065 			"15. WARNING in X.java (at line 16)\n" +
51066 			"	<IOException> this(l);\n" +
51067 			"	                   ^\n" +
51068 			"Type safety: The expression of type List needs unchecked conversion to conform to List<IOException>\n" +
51069 			"----------\n" +
51070 			"16. WARNING in X.java (at line 19)\n" +
51071 			"	static void baz2(List l) throws IOException {\n" +
51072 			"	                 ^^^^\n" +
51073 			"List is a raw type. References to generic type List<E> should be parameterized\n" +
51074 			"----------\n" +
51075 			"17. WARNING in X.java (at line 20)\n" +
51076 			"	new <IOException> X(l){}. <IOException> foo(l);\n" +
51077 			"	^^^^^^^^^^^^^^^^^^^^^^^^\n" +
51078 			"Type safety: Unchecked invocation X(List) of the generic constructor X(List<T>) of type X\n" +
51079 			"----------\n" +
51080 			"18. WARNING in X.java (at line 20)\n" +
51081 			"	new <IOException> X(l){}. <IOException> foo(l);\n" +
51082 			"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
51083 			"Type safety: Unchecked invocation foo(List) of the generic method foo(List<T>) of type X\n" +
51084 			"----------\n" +
51085 			"19. WARNING in X.java (at line 20)\n" +
51086 			"	new <IOException> X(l){}. <IOException> foo(l);\n" +
51087 			"	                    ^\n" +
51088 			"Type safety: The expression of type List needs unchecked conversion to conform to List<IOException>\n" +
51089 			"----------\n" +
51090 			"20. WARNING in X.java (at line 20)\n" +
51091 			"	new <IOException> X(l){}. <IOException> foo(l);\n" +
51092 			"	                                            ^\n" +
51093 			"Type safety: The expression of type List needs unchecked conversion to conform to List<IOException>\n" +
51094 			"----------\n");
51095 }
51096 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=202393
51097 public void test1446() {
51098      this.runConformTest(
51099              new String[] {
51100                      "Bug202393.java",
51101                      "public class Bug202393 {\n" +
51102                      "   static <T> T id(T in) { return in; }\n" +
51103                      "   public static void main(String[] args) {\n" +
51104                      "      try {" +
51105                      "         bad();" +
51106                      "      } catch (Throwable t) {\n" +
51107                      "         System.out.print(\"CAUGHT\");\n" +
51108                      "      }\n" +
51109                      "   }\n" +
51110                      "   static void bad() throws Throwable {\n" +
51111                      "      throw id(new Exception());\n" +
51112                      "   }\n" +
51113                      "}\n"},
51114              "CAUGHT"
51115      );
51116 }
51117 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=263633
51118 public void test1447() {
51119     this.runConformTest(
51120             new String[] {
51121                     "X.java",
51122         			"public abstract class X implements Visitable {\n" +
51123         			"	public <T, U extends Visitor<T>> T accept(U v) {\n" +
51124         			"		return null;\n" +
51125         			"	}\n" +
51126         			"	public <T, U extends Visitor<T>> T accept2(U v) {\n" +
51127         			"		if (v == null)\n" +
51128         			"			return this.accept(v);\n" +
51129         			"		else \n" +
51130         			"			return this.<T, U> accept(v);\n" +
51131         			"	}\n" +
51132         			"}\n" +
51133         			"interface Visitable {\n" +
51134         			"	<T, U extends Visitor<T>> T accept(U v);\n" +
51135         			"}\n" +
51136         			"interface Visitor<T> {\n" +
51137         			"}\n",
51138        		},
51139             ""
51140     );
51141 }
51142 
51143 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=263633 - variation
51144 public void test1448() {
51145     this.runConformTest(
51146             new String[] {
51147                     "X.java",
51148         			"public abstract class X implements Visitable {\n" +
51149         			"	public <T, U extends Visitor> T accept(U v) {\n" +
51150         			"		return null;\n" +
51151         			"	}\n" +
51152         			"	public <T, U extends Visitor> T accept2(U v) {\n" +
51153         			"		if (v == null)\n" +
51154         			"			return this.accept(v);\n" +
51155         			"		else \n" +
51156         			"			return this.<T, U> accept(v);\n" +
51157         			"	}\n" +
51158         			"}\n" +
51159         			"interface Visitable {\n" +
51160         			"	<T, U extends Visitor> T accept(U v);\n" +
51161         			"}\n" +
51162         			"interface Visitor{\n" +
51163         			"}\n",
51164        		},
51165             ""
51166     );
51167 }
51168 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=263633 - variation
51169 public void test1449() {
51170      this.runConformTest(
51171              new String[] {
51172                      "X.java",
51173          			"interface Visitor<T, C, O, P, EL, PM, S, COA, SSA, CT> {\n" +
51174         			"}\n" +
51175         			"public class X<U> {\n" +
51176         			"	public <T, U extends Visitor<T, ?, ?, ?, ?, ?, ?, ?, ?, ?>> T accept(U v) {\n" +
51177         			"		throw new UnsupportedOperationException();\n" +
51178         			"	}\n" +
51179         			"}\n" +
51180         			"class Y<V> extends X<V> {\n" +
51181         			"	public <T, U extends Visitor<T, ?, ?, ?, ?, ?, ?, ?, ?, ?>> T accept(U v) {\n" +
51182         			"		if (v == null)\n" +
51183         			"			return super.accept(v);\n" +
51184         			"		else\n" +
51185         			"			return super.<T, U> accept(v);\n" +
51186         			"	}\n" +
51187         			"}\n",
51188         		},
51189              ""
51190      );
51191 }
51192 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=159851
51193 public void test1450() {
51194 	this.runNegativeTest(
51195 		new String[] {
51196 			"X.java",
51197 			"import java.util.*;\n" +
51198 			"class A {}\n" +
51199 			"class B<T extends A> {}\n" +
51200 			"class X<T extends ArrayList<B<Integer>>> extends TreeMap<Integer, B<String>> {}\n" +
51201 			"\n" +
51202 			"class D<T> {}\n" +
51203 			"class E<T extends Number> {}\n" +
51204 			"class Y<T> extends E<D<T>> {}",
51205 		},
51206 		"----------\n" +
51207 		"1. WARNING in X.java (at line 4)\n" +
51208 		"	class X<T extends ArrayList<B<Integer>>> extends TreeMap<Integer, B<String>> {}\n" +
51209 		"	      ^\n" +
51210 		"The serializable class X does not declare a static final serialVersionUID field of type long\n" +
51211 		"----------\n" +
51212 		"2. ERROR in X.java (at line 4)\n" +
51213 		"	class X<T extends ArrayList<B<Integer>>> extends TreeMap<Integer, B<String>> {}\n" +
51214 		"	                              ^^^^^^^\n" +
51215 		"Bound mismatch: The type Integer is not a valid substitute for the bounded parameter <T extends A> of the type B<T>\n" +
51216 		"----------\n" +
51217 		"3. ERROR in X.java (at line 4)\n" +
51218 		"	class X<T extends ArrayList<B<Integer>>> extends TreeMap<Integer, B<String>> {}\n" +
51219 		"	                                                                    ^^^^^^\n" +
51220 		"Bound mismatch: The type String is not a valid substitute for the bounded parameter <T extends A> of the type B<T>\n" +
51221 		"----------\n" +
51222 		"4. ERROR in X.java (at line 8)\n" +
51223 		"	class Y<T> extends E<D<T>> {}\n" +
51224 		"	                     ^\n" +
51225 		"Bound mismatch: The type D<T> is not a valid substitute for the bounded parameter <T extends Number> of the type E<T>\n" +
51226 		"----------\n"
51227 	);
51228 }
51229 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=159851
51230 public void test1451() {
51231 	this.runNegativeTest(
51232 		new String[] {
51233 			"X.java",
51234 			"class A<T> {}\n" +
51235 			"class B<T2 extends Number> {}\n" +
51236 			"class C<T3, T4> {}\n" +
51237 			"class X<T1, T2> extends C<A<A<B<T1>>>, A<B<T2>>> {}\n" +
51238 			"class Y<T> extends A<A<B<T>>> {}\n" +
51239 			"class Z<T> extends C<B<T>, A<B<T>>> {}",
51240 		},
51241 		"----------\n" +
51242 		"1. ERROR in X.java (at line 4)\n" +
51243 		"	class X<T1, T2> extends C<A<A<B<T1>>>, A<B<T2>>> {}\n" +
51244 		"	                                ^^\n" +
51245 		"Bound mismatch: The type T1 is not a valid substitute for the bounded parameter <T2 extends Number> of the type B<T2>\n" +
51246 		"----------\n" +
51247 		"2. ERROR in X.java (at line 4)\n" +
51248 		"	class X<T1, T2> extends C<A<A<B<T1>>>, A<B<T2>>> {}\n" +
51249 		"	                                           ^^\n" +
51250 		"Bound mismatch: The type T2 is not a valid substitute for the bounded parameter <T2 extends Number> of the type B<T2>\n" +
51251 		"----------\n" +
51252 		"3. ERROR in X.java (at line 5)\n" +
51253 		"	class Y<T> extends A<A<B<T>>> {}\n" +
51254 		"	                         ^\n" +
51255 		"Bound mismatch: The type T is not a valid substitute for the bounded parameter <T2 extends Number> of the type B<T2>\n" +
51256 		"----------\n" +
51257 		"4. ERROR in X.java (at line 6)\n" +
51258 		"	class Z<T> extends C<B<T>, A<B<T>>> {}\n" +
51259 		"	                       ^\n" +
51260 		"Bound mismatch: The type T is not a valid substitute for the bounded parameter <T2 extends Number> of the type B<T2>\n" +
51261 		"----------\n" +
51262 		"5. ERROR in X.java (at line 6)\n" +
51263 		"	class Z<T> extends C<B<T>, A<B<T>>> {}\n" +
51264 		"	                               ^\n" +
51265 		"Bound mismatch: The type T is not a valid substitute for the bounded parameter <T2 extends Number> of the type B<T2>\n" +
51266 		"----------\n"
51267 	);
51268 }
51269 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=273751
51270 public void test1452() {
51271 	this.runNegativeTest(
51272 		new String[] {
51273 			"A.java",
51274 			"class A<T> {}\n" +
51275 			"class B extends A<B.Secret> {\n" +
51276 			"	private class Secret {};\n" +
51277 			"	B.Secret s;\n" +
51278 			"	A<B.Secret> a;\n" +
51279 			"}\n" +
51280 			"class C extends B.Secret {}\n" +
51281 			"class D {\n" +
51282 			"	class M { private class Secret {}; }\n" +
51283 			"	class N extends A<M.Secret> {}\n" +
51284 			"}\n" +
51285 			"class E {\n" +
51286 			"	class M extends A<M.Secret> {\n" +
51287 			"	  private class Secret {};\n" +
51288 			"	}\n" +
51289 			"}"
51290 		},
51291 		"----------\n" +
51292 		"1. ERROR in A.java (at line 2)\n" +
51293 		"	class B extends A<B.Secret> {\n" +
51294 		"	                  ^^^^^^^^\n" +
51295 		"The type B.Secret is not visible\n" +
51296 		"----------\n" +
51297 		"2. ERROR in A.java (at line 7)\n" +
51298 		"	class C extends B.Secret {}\n" +
51299 		"	                ^^^^^^^^\n" +
51300 		"The type B.Secret is not visible\n" +
51301 		"----------\n"
51302 	);
51303 }
51304 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=278305
51305 public void test1453() {
51306 	this.runNegativeTest(
51307 		new String[] {
51308 			"X.java",
51309 			"class X {\n" +
51310 			"	I<?> i = new I<?>() {};\n" +
51311 			"}\n" +
51312 			"class Y implements I<?> {}\n" +
51313 			"interface I<T> {}"
51314 		},
51315 		"----------\n" +
51316 		"1. ERROR in X.java (at line 2)\n" +
51317 		"	I<?> i = new I<?>() {};\n" +
51318 		"	             ^\n" +
51319 		"The type new I(){} cannot extend or implement I<?>. A supertype may not specify any wildcard\n" +
51320 		"----------\n" +
51321 		"2. ERROR in X.java (at line 4)\n" +
51322 		"	class Y implements I<?> {}\n" +
51323 		"	                   ^\n" +
51324 		"The type Y cannot extend or implement I<?>. A supertype may not specify any wildcard\n" +
51325 		"----------\n"
51326 	);
51327 }
51328 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=289538
51329 public void test1454() {
51330 	this.runConformTest(
51331 		new String[] {
51332 			"X.java",
51333 			"public class X<T> {\n" +
51334 			"	Node first;\n" +
51335 			"	public void add(T e) {\n" +
51336 			"		first = new Node(e);\n" +
51337 			"		System.out.print(true);\n" +
51338 			"	}\n" +
51339 			"	private class Node {\n" +
51340 			"		private Node next;\n" +
51341 			"		private Node(T d) {}\n" +
51342 			"		private Node(T d, Node n) { next = n; }\n" +
51343 			"	}\n" +
51344 			"	public static void main(String[] args) {\n" +
51345 			"		X<String> x = new X<String>();\n" +
51346 			"		x.add(\"\");\n" +
51347 			"	}\n" +
51348 			"}"
51349 		},
51350    		"true"
51351 	);
51352 }
51353 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=287607
51354 public void test1455() {
51355 	this.runNegativeTest(
51356 		new String[] {
51357 			"Outer.java",
51358 			"public class Outer<E> {\n" +
51359 			"  Inner inner;\n" +
51360 			"  class Inner {\n" +
51361 			"    E e;\n" +
51362 			"    E getOtherElement(Object other) {\n" +
51363 			"      if (!(other instanceof Outer<?>.Inner))\n" +
51364 			"       throw new IllegalArgumentException(String.valueOf(other));\n" +
51365 			"      Inner that = (Inner) other;\n" +
51366 			"      return that.e;\n" +
51367 			"    }\n" +
51368 			"  }\n" +
51369 			"  public static void main(String[] args) {\n" +
51370 			"    Outer<String> s = new Outer<String>();\n" +
51371 			"    s.inner = s.new Inner();\n" +
51372  			"   s.inner.e = \"hello\";\n" +
51373  			"   Outer<Integer> i = new Outer<Integer>();\n" +
51374  			"   i.inner = i.new Inner();\n" +
51375  			"   i.inner.e = 1234;\n" +
51376  			"   s.inner.getOtherElement(i.inner);\n" +
51377  			" }\n" +
51378 			"}"
51379 		},
51380 		"----------\n" +
51381 		"1. WARNING in Outer.java (at line 8)\n" +
51382 		"	Inner that = (Inner) other;\n" +
51383 		"	             ^^^^^^^^^^^^^\n" +
51384 		"Type safety: Unchecked cast from Object to Outer<E>.Inner\n" +
51385 		"----------\n"
51386 	);
51387 }
51388 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=292428
51389 public void test1456() {
51390 	this.runConformTest(
51391 		new String[] {
51392 			"X.java",
51393 			"import java.util.ArrayList;\n" +
51394 			"\n" +
51395 			"public class X<K,V> {\n" +
51396 			"	interface E<V> {}\n" +
51397 			"	class S implements E<V> {\n" +
51398 			"		V value;\n" +
51399 			"	}\n" +
51400 			"	class M implements E<V>  {\n" +
51401 			"		ArrayList<V> list = new ArrayList<V>();\n" +
51402 			"		M(E<V> se) {\n" +
51403 			"			list.add(((S)se).value);\n" +
51404 			"		}\n" +
51405 			"	}\n" +
51406 			"}"
51407 		},
51408 		""
51409 	);
51410 }
51411 // Test to verify that partial types in a parameterized qualified reference are
51412 // demarcated correctly while annotating an arity problem in case of wrong number of arguments.
51413 // Related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=292510
51414 public void test1457() {
51415 	this.runNegativeTest(
51416 		new String[] {
51417 			"test/X.java",
51418 			"package test;\n" +
51419 				"// Valid Parameterized Type Declaration\n" +
51420 				"public class X<A1, A2> {\n" +
51421 				"	public class Y<A3,A4,A5> {\n" +
51422 				"		public class Z<A6> {\n" +
51423 				"		}\n" +
51424 				"	}\n" +
51425 				"}\n" +
51426 				"// Invalid Valid Type Syntax (too many parameters)\n" +
51427 				"class Y {\n" +
51428 				"	X<String, Number>.Y<String,Integer>.Z<String> x;\n" +
51429 				"}\n"
51430 		},
51431 		"----------\n" +
51432 		"1. ERROR in test\\X.java (at line 11)\n" +
51433 		"	X<String, Number>.Y<String,Integer>.Z<String> x;\n" +
51434 		"	^^^^^^^^^^^^^^^^^^^\n" +
51435 		"Incorrect number of arguments for type X<String,Number>.Y; it cannot be parameterized with arguments <String, Integer>\n" +
51436 		"----------\n"
51437 	);
51438 }
51439 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=285002 (visibility error for package private method)
51440 public void test1458() {
51441 	this.runNegativeTest(
51442 			new String[] {
51443 					"CompilerBug.java",
51444 					"@SuppressWarnings(\"deprecation\")\n" +
51445 					"public class CompilerBug {\n" +
51446 					"	public <T> T newInstance( Class<T> c ) throws InstantiationException, IllegalAccessException {\n" +
51447 					"	      return c.newInstance();\n" +
51448 					"		   }\n" +
51449 					"		   protected void protectedMethod() {}\n" +
51450 					"		   void packagePrivateMethod() {}\n" +
51451 					"		   private void privateMethod() {}\n" +
51452 					"		   private int privateInt = 0;\n" +
51453 					"		   int packagePrivateInt = 0;\n" +
51454 					"		   protected int protectedInt = 0;\n" +
51455 					"		   private void isThisBuggy() throws InstantiationException, IllegalAccessException {\n" +
51456 					"		      CompilerBug c = getClass().newInstance();\n" +
51457 					"		      c.privateMethod();\n" +
51458 					"		      c.packagePrivateMethod();\n" +
51459 					"		      c.protectedMethod();\n" +
51460 					"		      getClass().newInstance().packagePrivateMethod();\n" +
51461 					"		      getClass().newInstance().privateMethod();\n" +
51462 					"		      getClass().newInstance().protectedMethod();\n" +
51463 					"		      getClass().newInstance().privateInt = 10;\n" +
51464 					"		      getClass().newInstance().packagePrivateInt = 10;\n" +
51465 					"		      getClass().newInstance().protectedInt = 10;\n" +
51466 					"             Zork z;\n" +
51467 					"		   }\n" +
51468 					"	}\n",
51469 			},
51470 			this.complianceLevel <= ClassFileConstants.JDK1_6 ?
51471 			"----------\n" +
51472 			"1. ERROR in CompilerBug.java (at line 23)\n" +
51473 			"	Zork z;\n" +
51474 			"	^^^^\n" +
51475 			"Zork cannot be resolved to a type\n" +
51476 			"----------\n" :
51477 
51478 			// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=334622
51479 			"----------\n" +
51480 			"1. ERROR in CompilerBug.java (at line 18)\n" +
51481 			"	getClass().newInstance().privateMethod();\n" +
51482 			"	                         ^^^^^^^^^^^^^\n" +
51483 			"The method privateMethod() from the type CompilerBug is not visible\n" +
51484 			"----------\n" +
51485 			"2. ERROR in CompilerBug.java (at line 20)\n" +
51486 			"	getClass().newInstance().privateInt = 10;\n" +
51487 			"	                         ^^^^^^^^^^\n" +
51488 			"The field CompilerBug.privateInt is not visible\n" +
51489 			"----------\n" +
51490 			"3. ERROR in CompilerBug.java (at line 23)\n" +
51491 			"	Zork z;\n" +
51492 			"	^^^^\n" +
51493 			"Zork cannot be resolved to a type\n" +
51494 			"----------\n"
51495 			);
51496 }
51497 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=295698
51498 public void test1459() {
51499 	this.runConformTest(
51500 		new String[] {
51501 			"B.java",
51502 			"import java.util.Collection;\n" +
51503 			"public class B extends X<Collection<?>> {\n" +
51504 			"	public B(Collection<X<?>> c, I i) {\n" +
51505 			"		super(c, i);\n" +
51506 			"	}\n" +
51507 			"}",
51508 			"I.java",
51509 			"public interface I<T>{}",
51510 			"X.java",
51511 			"public class X<T> {\n" +
51512 			"	public <V extends T> X(V v, I<T> i, Object... o) {}\n" +
51513 			"}"
51514 		},
51515 		""); // no specific success output string
51516 }
51517 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=277643
51518 // SHOULD FAIL AT 1.8 (18.2.3): The method get(Class<W>, T) in the type Test is not applicable for the arguments (Class<Test.W_Description>, Object)
51519 // FIXME: javac rejects (correctly? how?), see http://mail.openjdk.java.net/pipermail/lambda-spec-experts/2013-December/000443.html
51520 public void test277643() {
51521 	this.runNegativeTest(
51522 		false /* skipJavac */,
51523 		this.complianceLevel < ClassFileConstants.JDK1_8 ? null :
51524 		JavacTestOptions.EclipseHasABug.EclipseBug428061,
51525 		new String[] {
51526 	    "Test.java",
51527 	    "public class Test {\n" +
51528 	    "public final void addShortDescription(Object object, StringBuffer buf) {\n" +
51529 	    "	try {\n" +
51530 	    "		W_Description wdescription = get(W_Description.class, object);\n" +
51531 	    "	} catch (Exception e) {\n" +
51532 	    "	}\n" +
51533 	    "}\n" +
51534 	    "public abstract class W_Description<WRAPPED> extends WrapperLogic<WRAPPED> {}\n" +
51535 	    "public <T, W extends WrapperLogic<? super T>> W get(Class<W> wrapperClass, T entity) {\n" +
51536 	    "	return getLogicFactory().get(wrapperClass, entity);\n" +
51537 	    "}\n" +
51538 	    "private LogicFactory logicFactory;\n" +
51539 	    "public final LogicFactory getLogicFactory() {\n" +
51540 	    "	return logicFactory;\n" +
51541 	    "}\n" +
51542 	    "public interface LogicFactory {\n" +
51543 	    "	<LOGIC extends Logic> LOGIC get(Class<LOGIC> logicClass);\n" +
51544 	    "	<WRAPPED, WRAPPER_LOGIC extends WrapperLogic<? super WRAPPED>> WRAPPER_LOGIC get(Class<WRAPPER_LOGIC> wrapperLogicClass, WRAPPED entityToWrap);\n" +
51545 	    "}\n" +
51546 	    "public abstract class WrapperLogic<WRAPPED> extends AbstractLogic implements Wrapper<WRAPPED> {}\n" +
51547 	    "public abstract class AbstractLogic {}\n" +
51548 	    "public interface Wrapper<WRAPPED> {\n" +
51549 	    "	WRAPPED getWrapped();\n" +
51550 	    "}\n" +
51551 	    "public abstract class Logic extends AbstractLogic {}\n" +
51552 	    "}"
51553 		},
51554 		"----------\n" +
51555 		"1. WARNING in Test.java (at line 4)\n" +
51556 		"	W_Description wdescription = get(W_Description.class, object);\n" +
51557 		"	^^^^^^^^^^^^^\n" +
51558 		"Test.W_Description is a raw type. References to generic type Test.W_Description<WRAPPED> should be parameterized\n" +
51559 		"----------\n" +
51560 		"2. WARNING in Test.java (at line 4)\n" +
51561 		"	W_Description wdescription = get(W_Description.class, object);\n" +
51562 		"	                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
51563 		"Type safety: Unchecked invocation get(Class<Test.W_Description>, Object) of the generic method get(Class<W>, T) of type Test\n" +
51564 		"----------\n");
51565 }
51566 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=280054
51567 // SHOULD FAIL AT 1.8 (18.2.3): The method get(Class<V>, Class<S>) in the type X.L is not applicable for the arguments (Class<V>, Class<X.B>)
51568 public void test280054() {
51569 	this.runNegativeTest(
51570 		new String[] {
51571 	    "X.java",
51572 	    "public class X {\n" +
51573 	    "static class A<V> {\n" +
51574 	    "L l;\n" +
51575 	    "public Class<V> vtype() {\n" +
51576 	    "   return null;\n" +
51577 	    "}\n" +
51578 	    "public A<V> method1() {\n" +
51579 	    "   return l.get(vtype(), B.class);\n" +
51580 	    "}\n" +
51581 	    "}\n" +
51582 	    "static class L {\n" +
51583 	    "public <V,S extends A<V>> S get(Class<V> vtype, Class<S> stype) {\n" +
51584 	    "   return null;\n" +
51585 	    "}\n" +
51586 	    "}\n" +
51587 	    "static class B<V> extends A<V> {\n" +
51588 	    "public B<V> method2() {\n" +
51589 	    "   return l.get(vtype(), B.class);\n" +
51590 	    "}\n" +
51591 	    "}\n" +
51592 	    "}\n"
51593 		},
51594 		"----------\n" +
51595 		"1. WARNING in X.java (at line 8)\n" +
51596 		"	return l.get(vtype(), B.class);\n" +
51597 		"	       ^^^^^^^^^^^^^^^^^^^^^^^\n" +
51598 		"Type safety: Unchecked invocation get(Class<V>, Class<X.B>) of the generic method get(Class<V>, Class<S>) of type X.L\n" +
51599 		"----------\n" +
51600 		"2. WARNING in X.java (at line 8)\n" +
51601 		"	return l.get(vtype(), B.class);\n" +
51602 		"	       ^^^^^^^^^^^^^^^^^^^^^^^\n" +
51603 		"Type safety: The expression of type X.B needs unchecked conversion to conform to X.A<V>\n" +
51604 		"----------\n" +
51605 		"3. WARNING in X.java (at line 18)\n" +
51606 		"	return l.get(vtype(), B.class);\n" +
51607 		"	       ^^^^^^^^^^^^^^^^^^^^^^^\n" +
51608 		"Type safety: Unchecked invocation get(Class<V>, Class<X.B>) of the generic method get(Class<V>, Class<S>) of type X.L\n" +
51609 		"----------\n" +
51610 		"4. WARNING in X.java (at line 18)\n" +
51611 		"	return l.get(vtype(), B.class);\n" +
51612 		"	       ^^^^^^^^^^^^^^^^^^^^^^^\n" +
51613 		"Type safety: The expression of type X.B needs unchecked conversion to conform to X.B<V>\n" +
51614 		"----------\n");
51615 }
51616 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=283306
51617 // SHOULD FAIL AT 1.8 (18.2.3): The method get(Class<V>, Class<S>) in the type X.L is not applicable for the arguments (Class<V>, Class<X.B>)
51618 // FIXME: javac rejects (correctly? how?), see http://mail.openjdk.java.net/pipermail/lambda-spec-experts/2013-December/000443.html
51619 public void test283306() {
51620 	this.runNegativeTest(
51621 		false /* skipJavac */,
51622 		this.complianceLevel < ClassFileConstants.JDK1_8 ? null :
51623 		JavacTestOptions.EclipseHasABug.EclipseBug428061,
51624 		new String[] {
51625 	    "Test.java",
51626 	    "public class Test {\n" +
51627 	    "    public WWorkflow<? extends Workflow> getMainWorkflow(){\n" +
51628 	    "        return get(WWorkflow.class, null);\n" +
51629 	    "    }\n" +
51630 	    "    public <T, W extends WrapperLogic<? super T>> W get(Class<W> wrapperClass, T entity) {\n" +
51631 	    "        return null;\n" +
51632 	    "    }\n" +
51633 	    "}\n" +
51634 	    "class Workflow {}\n" +
51635 	    "class WWorkflow<T extends Workflow> extends WrapperLogic<T> {}\n" +
51636 	    "abstract class WrapperLogic<WRAPPED> {}\n"
51637 		},
51638 		"----------\n" +
51639 		"1. WARNING in Test.java (at line 3)\n" +
51640 		"	return get(WWorkflow.class, null);\n" +
51641 		"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
51642 		"Type safety: Unchecked invocation get(Class<WWorkflow>, null) of the generic method get(Class<W>, T) of type Test\n" +
51643 		"----------\n" +
51644 		"2. WARNING in Test.java (at line 3)\n" +
51645 		"	return get(WWorkflow.class, null);\n" +
51646 		"	       ^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
51647 		"Type safety: The expression of type WWorkflow needs unchecked conversion to conform to WWorkflow<? extends Workflow>\n" +
51648 		"----------\n");
51649 }
51650 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=294724
51651 // Test extracted from bug submission code by kabir.khan@jboss.com (Kabir Khan)
51652 // SHOULD FAIL AT 1.8 (18.2.3): The method cloneCollection(T, Class<? extends T>, Class<U>) in the type SimpleExample is not applicable for the arguments (Set<SimpleExample.Data>, Class<HashSet>, Class<SimpleExample.Data>)
51653 public void test294724() {
51654 	this.runNegativeTest(
51655 		new String[] {
51656 	    "SimpleExample.java",
51657 	    "import java.util.Collection;\n" +
51658 	    "import java.util.HashSet;\n" +
51659 	    "import java.util.Set;\n" +
51660 	    "public class SimpleExample {\n" +
51661 	    "  Set<Data> data;\n" +
51662 	    "  public void setData(Set<Data> data) {\n" +
51663 	    "     this.data = data;\n" +
51664 	    "  }\n" +
51665 	    "  public void copy(SimpleExample clone) {\n" +
51666 	    "     clone.setData(cloneCollection(data, HashSet.class, Data.class));\n" +
51667 	    "  }\n" +
51668 	    "	public static <U extends Interface, T extends Collection<U>> T cloneCollection(T collection, Class<? extends T> expectedClass, Class<U> componentType) {\n" +
51669 	    "   	return null;\n" +
51670 	    "   }\n" +
51671 	    "  private interface Interface {}\n" +
51672 	    "  private class Data implements Interface {}\n" +
51673 	    "}"
51674 	    },
51675 		"----------\n" +
51676 		"1. WARNING in SimpleExample.java (at line 10)\n" +
51677 		"	clone.setData(cloneCollection(data, HashSet.class, Data.class));\n" +
51678 		"	              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
51679 		"Type safety: Unchecked invocation cloneCollection(Set<SimpleExample.Data>, Class<HashSet>, Class<SimpleExample.Data>) of the generic method cloneCollection(T, Class<? extends T>, Class<U>) of type SimpleExample\n" +
51680 		"----------\n" +
51681 		"2. WARNING in SimpleExample.java (at line 10)\n" +
51682 		"	clone.setData(cloneCollection(data, HashSet.class, Data.class));\n" +
51683 		"	              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
51684 		"Type safety: The expression of type Set needs unchecked conversion to conform to Set<SimpleExample.Data>\n" +
51685 		"----------\n");
51686 }
51687 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=268798
51688 // SHOULD FAIL AT 1.8 (18.2.3): The method min(Collection<? extends T>) in the type Collections is not applicable for the arguments (List<GenericDemo.A>)
51689 public void test268798() {
51690 	this.runNegativeTest(
51691 		new String[] {
51692 	    "GenericDemo.java",
51693 	    "import java.util.Collections;\n" +
51694 	    "import java.util.List;\n" +
51695 	    "public class GenericDemo {\n" +
51696 	    "  static class A implements Comparable {\n" +
51697 	    "    public int compareTo(Object o) {\n" +
51698 	    "      return 0;\n" +
51699 	    "    }\n" +
51700 	    "  }\n" +
51701 	    "  void someCode(List<A> list) {\n" +
51702 	    "    A min = Collections.min(list); \n" +
51703 	    "  }\n" +
51704 	    "}\n"
51705 	    },
51706 		"----------\n" +
51707 		"1. WARNING in GenericDemo.java (at line 4)\n" +
51708 		"	static class A implements Comparable {\n" +
51709 		"	                          ^^^^^^^^^^\n" +
51710 		"Comparable is a raw type. References to generic type Comparable<T> should be parameterized\n" +
51711 		"----------\n" +
51712 		"2. WARNING in GenericDemo.java (at line 10)\n" +
51713 		"	A min = Collections.min(list); \n" +
51714 		"	        ^^^^^^^^^^^^^^^^^^^^^\n" +
51715 		"Type safety: Unchecked invocation min(List<GenericDemo.A>) of the generic method min(Collection<? extends T>) of type Collections\n" +
51716 		"----------\n");
51717 }
51718 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=268798
51719 // SHOULD FAIL AT 1.8 (18.2.3): Type mismatch: cannot convert from Bug268798.SomeInterface<? super Bug268798.SomeInterface<T>> to Bug268798.A
51720 public void test268798a() {
51721 	this.runNegativeTest(
51722 		new String[] {
51723 	    "Bug268798.java",
51724 	    "public class Bug268798 {\n" +
51725 	    "  interface SomeInterface<T> {\n" +
51726 	    "  }\n" +
51727 	    "  class A implements SomeInterface {\n" +
51728 	    "  }\n" +
51729 	    "  <T extends SomeInterface<? super T>> T someMethod() {\n" +
51730 	    "    return null;\n" +
51731 	    "  }\n" +
51732 	    "  void someCode() {\n" +
51733 	    "    A a = someMethod();\n" +
51734 	    "  }\n" +
51735 	    "}\n"
51736 	    },
51737 		"----------\n" +
51738 		"1. WARNING in Bug268798.java (at line 4)\n" +
51739 		"	class A implements SomeInterface {\n" +
51740 		"	                   ^^^^^^^^^^^^^\n" +
51741 		"Bug268798.SomeInterface is a raw type. References to generic type Bug268798.SomeInterface<T> should be parameterized\n" +
51742 		"----------\n" +
51743 		"2. WARNING in Bug268798.java (at line 10)\n" +
51744 		"	A a = someMethod();\n" +
51745 		"	      ^^^^^^^^^^^^\n" +
51746 		"Type safety: Unchecked invocation someMethod() of the generic method someMethod() of type Bug268798\n" +
51747 		"----------\n");
51748 }
51749 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=307885
51750 public void test1460() {
51751 	this.runNegativeTest(
51752 		new String[] {
51753 			"Test.java",
51754 			"class Test<A> {\n" +
51755 			"    interface MyInt<K> {\n" +
51756 			"        K getKey();\n" +
51757 			"    }\n" +
51758 			"    class MyEntry implements MyInt<A> {\n" +
51759 			"        public A getKey() { return null; }\n" +
51760 			"        @Override\n" +
51761 			"        public boolean equals(Object o) {\n" +
51762 			"            if(!(o instanceof MyEntry))\n" +
51763 			"                return false;\n" +
51764 			"            return true;\n" +
51765 			"        }\n" +
51766 			"    }\n" +
51767 			"}"
51768 		},
51769 		"----------\n" +
51770 		"1. ERROR in Test.java (at line 9)\n" +
51771 		"	if(!(o instanceof MyEntry))\n" +
51772 		"	    ^^^^^^^^^^^^^^^^^^^^^^\n" +
51773 		"Cannot perform instanceof check against parameterized type Test<A>.MyEntry. Use the form Test.MyEntry instead since further generic type information will be erased at runtime\n" +
51774 		"----------\n");
51775 }
51776 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=306464
51777 public void test1461() {
51778 	this.runNegativeTest(
51779 		new String[] {
51780 			"JoinImpl.java",
51781 			"import javax.persistence.criteria.Expression;\n" +
51782 			"import javax.persistence.criteria.Fetch;\n" +
51783 			"import javax.persistence.criteria.From;\n" +
51784 			"import javax.persistence.criteria.Join;\n" +
51785 			"import javax.persistence.criteria.JoinType;\n" +
51786 			"import javax.persistence.criteria.Path;\n" +
51787 			"import javax.persistence.metamodel.Attribute;\n" +
51788 			"import javax.persistence.metamodel.Bindable;\n" +
51789 			"import javax.persistence.metamodel.ManagedType;\n" +
51790 			"import javax.persistence.metamodel.Metamodel;\n" +
51791 			"public class JoinImpl<Z, X> extends FromImpl<Z, X> implements Join<Z, X>, Fetch<Z, X> {\n" +
51792 			"}",
51793 			"FromImpl.java",
51794 			"import java.util.ArrayList;\n" +
51795 			"import java.util.HashSet;\n" +
51796 			"import java.util.List;\n" +
51797 			"import java.util.Set;\n" +
51798 			"import java.util.Stack;\n" +
51799 			"\n" +
51800 			"import javax.persistence.criteria.CollectionJoin;\n" +
51801 			"import javax.persistence.criteria.Expression;\n" +
51802 			"import javax.persistence.criteria.Fetch;\n" +
51803 			"import javax.persistence.criteria.From;\n" +
51804 			"import javax.persistence.criteria.Join;\n" +
51805 			"import javax.persistence.criteria.JoinType;\n" +
51806 			"import javax.persistence.criteria.ListJoin;\n" +
51807 			"import javax.persistence.criteria.MapJoin;\n" +
51808 			"import javax.persistence.criteria.Path;\n" +
51809 			"import javax.persistence.criteria.SetJoin;\n" +
51810 			"import javax.persistence.metamodel.Attribute;\n" +
51811 			"import javax.persistence.metamodel.Bindable;\n" +
51812 			"import javax.persistence.metamodel.CollectionAttribute;\n" +
51813 			"import javax.persistence.metamodel.ListAttribute;\n" +
51814 			"import javax.persistence.metamodel.ManagedType;\n" +
51815 			"import javax.persistence.metamodel.MapAttribute;\n" +
51816 			"import javax.persistence.metamodel.Metamodel;\n" +
51817 			"import javax.persistence.metamodel.PluralAttribute;\n" +
51818 			"import javax.persistence.metamodel.SingularAttribute;\n" +
51819 			"import javax.persistence.metamodel.Attribute.PersistentAttributeType;\n" +
51820 			"import javax.persistence.metamodel.PluralAttribute.CollectionType;\n" +
51821 			"import javax.persistence.metamodel.Type.PersistenceType;\n" +
51822 			"\n" +
51823 			"import org.eclipse.persistence.internal.helper.ClassConstants;\n" +
51824 			"import org.eclipse.persistence.internal.localization.ExceptionLocalization;\n" +
51825 			"\n" +
51826 			"public class FromImpl<Z, X>  extends PathImpl<X> implements javax.persistence.criteria.From<Z, X> {\n" +
51827 			"\n" +
51828 			"    protected Set<Join<X, ?>> joins;\n" +
51829 			"    \n" +
51830 			"    public Set<Join<X, ?>> getJoins() {\n" +
51831 			"        return joins;\n" +
51832 			"    }\n" +
51833 			"\n" +
51834 			"    public void findJoins(AbstractQueryImpl query){\n" +
51835 			"        Stack stack = new Stack();\n" +
51836 			"        stack.push(this);\n" +
51837 			"        while(!stack.isEmpty()){\n" +
51838 			"            FromImpl currentJoin = (FromImpl) stack.pop();\n" +
51839 			"            stack.addAll(currentJoin.getJoins());\n" +
51840 			"            if (currentJoin.isLeaf){\n" +
51841 			"                    query.addJoin(currentJoin);\n" +
51842 			"                }\n" +
51843 			"        }\n" +
51844 			"    }\n" +
51845 			"}"
51846 		},
51847 		"----------\n" +
51848 		"1. ERROR in JoinImpl.java (at line 1)\n" +
51849 		"	import javax.persistence.criteria.Expression;\n" +
51850 		"	       ^^^^^^^^^^^^^^^^^\n" +
51851 		"The import javax.persistence cannot be resolved\n" +
51852 		"----------\n" +
51853 		"2. ERROR in JoinImpl.java (at line 2)\n" +
51854 		"	import javax.persistence.criteria.Fetch;\n" +
51855 		"	       ^^^^^^^^^^^^^^^^^\n" +
51856 		"The import javax.persistence cannot be resolved\n" +
51857 		"----------\n" +
51858 		"3. ERROR in JoinImpl.java (at line 3)\n" +
51859 		"	import javax.persistence.criteria.From;\n" +
51860 		"	       ^^^^^^^^^^^^^^^^^\n" +
51861 		"The import javax.persistence cannot be resolved\n" +
51862 		"----------\n" +
51863 		"4. ERROR in JoinImpl.java (at line 4)\n" +
51864 		"	import javax.persistence.criteria.Join;\n" +
51865 		"	       ^^^^^^^^^^^^^^^^^\n" +
51866 		"The import javax.persistence cannot be resolved\n" +
51867 		"----------\n" +
51868 		"5. ERROR in JoinImpl.java (at line 5)\n" +
51869 		"	import javax.persistence.criteria.JoinType;\n" +
51870 		"	       ^^^^^^^^^^^^^^^^^\n" +
51871 		"The import javax.persistence cannot be resolved\n" +
51872 		"----------\n" +
51873 		"6. ERROR in JoinImpl.java (at line 6)\n" +
51874 		"	import javax.persistence.criteria.Path;\n" +
51875 		"	       ^^^^^^^^^^^^^^^^^\n" +
51876 		"The import javax.persistence cannot be resolved\n" +
51877 		"----------\n" +
51878 		"7. ERROR in JoinImpl.java (at line 7)\n" +
51879 		"	import javax.persistence.metamodel.Attribute;\n" +
51880 		"	       ^^^^^^^^^^^^^^^^^\n" +
51881 		"The import javax.persistence cannot be resolved\n" +
51882 		"----------\n" +
51883 		"8. ERROR in JoinImpl.java (at line 8)\n" +
51884 		"	import javax.persistence.metamodel.Bindable;\n" +
51885 		"	       ^^^^^^^^^^^^^^^^^\n" +
51886 		"The import javax.persistence cannot be resolved\n" +
51887 		"----------\n" +
51888 		"9. ERROR in JoinImpl.java (at line 9)\n" +
51889 		"	import javax.persistence.metamodel.ManagedType;\n" +
51890 		"	       ^^^^^^^^^^^^^^^^^\n" +
51891 		"The import javax.persistence cannot be resolved\n" +
51892 		"----------\n" +
51893 		"10. ERROR in JoinImpl.java (at line 10)\n" +
51894 		"	import javax.persistence.metamodel.Metamodel;\n" +
51895 		"	       ^^^^^^^^^^^^^^^^^\n" +
51896 		"The import javax.persistence cannot be resolved\n" +
51897 		"----------\n" +
51898 		"11. ERROR in JoinImpl.java (at line 11)\n" +
51899 		"	public class JoinImpl<Z, X> extends FromImpl<Z, X> implements Join<Z, X>, Fetch<Z, X> {\n" +
51900 		"	                                                              ^^^^\n" +
51901 		"Join cannot be resolved to a type\n" +
51902 		"----------\n" +
51903 		"12. ERROR in JoinImpl.java (at line 11)\n" +
51904 		"	public class JoinImpl<Z, X> extends FromImpl<Z, X> implements Join<Z, X>, Fetch<Z, X> {\n" +
51905 		"	                                                                          ^^^^^\n" +
51906 		"Fetch cannot be resolved to a type\n" +
51907 		"----------\n" +
51908 		"----------\n" +
51909 		"1. ERROR in FromImpl.java (at line 7)\n" +
51910 		"	import javax.persistence.criteria.CollectionJoin;\n" +
51911 		"	       ^^^^^^^^^^^^^^^^^\n" +
51912 		"The import javax.persistence cannot be resolved\n" +
51913 		"----------\n" +
51914 		"2. ERROR in FromImpl.java (at line 8)\n" +
51915 		"	import javax.persistence.criteria.Expression;\n" +
51916 		"	       ^^^^^^^^^^^^^^^^^\n" +
51917 		"The import javax.persistence cannot be resolved\n" +
51918 		"----------\n" +
51919 		"3. ERROR in FromImpl.java (at line 9)\n" +
51920 		"	import javax.persistence.criteria.Fetch;\n" +
51921 		"	       ^^^^^^^^^^^^^^^^^\n" +
51922 		"The import javax.persistence cannot be resolved\n" +
51923 		"----------\n" +
51924 		"4. ERROR in FromImpl.java (at line 10)\n" +
51925 		"	import javax.persistence.criteria.From;\n" +
51926 		"	       ^^^^^^^^^^^^^^^^^\n" +
51927 		"The import javax.persistence cannot be resolved\n" +
51928 		"----------\n" +
51929 		"5. ERROR in FromImpl.java (at line 11)\n" +
51930 		"	import javax.persistence.criteria.Join;\n" +
51931 		"	       ^^^^^^^^^^^^^^^^^\n" +
51932 		"The import javax.persistence cannot be resolved\n" +
51933 		"----------\n" +
51934 		"6. ERROR in FromImpl.java (at line 12)\n" +
51935 		"	import javax.persistence.criteria.JoinType;\n" +
51936 		"	       ^^^^^^^^^^^^^^^^^\n" +
51937 		"The import javax.persistence cannot be resolved\n" +
51938 		"----------\n" +
51939 		"7. ERROR in FromImpl.java (at line 13)\n" +
51940 		"	import javax.persistence.criteria.ListJoin;\n" +
51941 		"	       ^^^^^^^^^^^^^^^^^\n" +
51942 		"The import javax.persistence cannot be resolved\n" +
51943 		"----------\n" +
51944 		"8. ERROR in FromImpl.java (at line 14)\n" +
51945 		"	import javax.persistence.criteria.MapJoin;\n" +
51946 		"	       ^^^^^^^^^^^^^^^^^\n" +
51947 		"The import javax.persistence cannot be resolved\n" +
51948 		"----------\n" +
51949 		"9. ERROR in FromImpl.java (at line 15)\n" +
51950 		"	import javax.persistence.criteria.Path;\n" +
51951 		"	       ^^^^^^^^^^^^^^^^^\n" +
51952 		"The import javax.persistence cannot be resolved\n" +
51953 		"----------\n" +
51954 		"10. ERROR in FromImpl.java (at line 16)\n" +
51955 		"	import javax.persistence.criteria.SetJoin;\n" +
51956 		"	       ^^^^^^^^^^^^^^^^^\n" +
51957 		"The import javax.persistence cannot be resolved\n" +
51958 		"----------\n" +
51959 		"11. ERROR in FromImpl.java (at line 17)\n" +
51960 		"	import javax.persistence.metamodel.Attribute;\n" +
51961 		"	       ^^^^^^^^^^^^^^^^^\n" +
51962 		"The import javax.persistence cannot be resolved\n" +
51963 		"----------\n" +
51964 		"12. ERROR in FromImpl.java (at line 18)\n" +
51965 		"	import javax.persistence.metamodel.Bindable;\n" +
51966 		"	       ^^^^^^^^^^^^^^^^^\n" +
51967 		"The import javax.persistence cannot be resolved\n" +
51968 		"----------\n" +
51969 		"13. ERROR in FromImpl.java (at line 19)\n" +
51970 		"	import javax.persistence.metamodel.CollectionAttribute;\n" +
51971 		"	       ^^^^^^^^^^^^^^^^^\n" +
51972 		"The import javax.persistence cannot be resolved\n" +
51973 		"----------\n" +
51974 		"14. ERROR in FromImpl.java (at line 20)\n" +
51975 		"	import javax.persistence.metamodel.ListAttribute;\n" +
51976 		"	       ^^^^^^^^^^^^^^^^^\n" +
51977 		"The import javax.persistence cannot be resolved\n" +
51978 		"----------\n" +
51979 		"15. ERROR in FromImpl.java (at line 21)\n" +
51980 		"	import javax.persistence.metamodel.ManagedType;\n" +
51981 		"	       ^^^^^^^^^^^^^^^^^\n" +
51982 		"The import javax.persistence cannot be resolved\n" +
51983 		"----------\n" +
51984 		"16. ERROR in FromImpl.java (at line 22)\n" +
51985 		"	import javax.persistence.metamodel.MapAttribute;\n" +
51986 		"	       ^^^^^^^^^^^^^^^^^\n" +
51987 		"The import javax.persistence cannot be resolved\n" +
51988 		"----------\n" +
51989 		"17. ERROR in FromImpl.java (at line 23)\n" +
51990 		"	import javax.persistence.metamodel.Metamodel;\n" +
51991 		"	       ^^^^^^^^^^^^^^^^^\n" +
51992 		"The import javax.persistence cannot be resolved\n" +
51993 		"----------\n" +
51994 		"18. ERROR in FromImpl.java (at line 24)\n" +
51995 		"	import javax.persistence.metamodel.PluralAttribute;\n" +
51996 		"	       ^^^^^^^^^^^^^^^^^\n" +
51997 		"The import javax.persistence cannot be resolved\n" +
51998 		"----------\n" +
51999 		"19. ERROR in FromImpl.java (at line 25)\n" +
52000 		"	import javax.persistence.metamodel.SingularAttribute;\n" +
52001 		"	       ^^^^^^^^^^^^^^^^^\n" +
52002 		"The import javax.persistence cannot be resolved\n" +
52003 		"----------\n" +
52004 		"20. ERROR in FromImpl.java (at line 26)\n" +
52005 		"	import javax.persistence.metamodel.Attribute.PersistentAttributeType;\n" +
52006 		"	       ^^^^^^^^^^^^^^^^^\n" +
52007 		"The import javax.persistence cannot be resolved\n" +
52008 		"----------\n" +
52009 		"21. ERROR in FromImpl.java (at line 27)\n" +
52010 		"	import javax.persistence.metamodel.PluralAttribute.CollectionType;\n" +
52011 		"	       ^^^^^^^^^^^^^^^^^\n" +
52012 		"The import javax.persistence cannot be resolved\n" +
52013 		"----------\n" +
52014 		"22. ERROR in FromImpl.java (at line 28)\n" +
52015 		"	import javax.persistence.metamodel.Type.PersistenceType;\n" +
52016 		"	       ^^^^^^^^^^^^^^^^^\n" +
52017 		"The import javax.persistence cannot be resolved\n" +
52018 		"----------\n" +
52019 		"23. ERROR in FromImpl.java (at line 30)\n" +
52020 		"	import org.eclipse.persistence.internal.helper.ClassConstants;\n" +
52021 		"	       ^^^^^^^^^^^\n" +
52022 		"The import org.eclipse cannot be resolved\n" +
52023 		"----------\n" +
52024 		"24. ERROR in FromImpl.java (at line 31)\n" +
52025 		"	import org.eclipse.persistence.internal.localization.ExceptionLocalization;\n" +
52026 		"	       ^^^^^^^^^^^\n" +
52027 		"The import org.eclipse cannot be resolved\n" +
52028 		"----------\n" +
52029 		"25. ERROR in FromImpl.java (at line 33)\n" +
52030 		"	public class FromImpl<Z, X>  extends PathImpl<X> implements javax.persistence.criteria.From<Z, X> {\n" +
52031 		"	                                     ^^^^^^^^\n" +
52032 		"PathImpl cannot be resolved to a type\n" +
52033 		"----------\n" +
52034 		"26. ERROR in FromImpl.java (at line 33)\n" +
52035 		"	public class FromImpl<Z, X>  extends PathImpl<X> implements javax.persistence.criteria.From<Z, X> {\n" +
52036 		"	                                                            ^^^^^^^^^^^^^^^^^\n" +
52037 		"javax.persistence cannot be resolved to a type\n" +
52038 		"----------\n" +
52039 		"27. ERROR in FromImpl.java (at line 35)\n" +
52040 		"	protected Set<Join<X, ?>> joins;\n" +
52041 		"	              ^^^^\n" +
52042 		"Join cannot be resolved to a type\n" +
52043 		"----------\n" +
52044 		"28. ERROR in FromImpl.java (at line 37)\n" +
52045 		"	public Set<Join<X, ?>> getJoins() {\n" +
52046 		"	           ^^^^\n" +
52047 		"Join cannot be resolved to a type\n" +
52048 		"----------\n" +
52049 		"29. ERROR in FromImpl.java (at line 38)\n" +
52050 		"	return joins;\n" +
52051 		"	       ^^^^^\n" +
52052 		"Join cannot be resolved to a type\n" +
52053 		"----------\n" +
52054 		"30. ERROR in FromImpl.java (at line 41)\n" +
52055 		"	public void findJoins(AbstractQueryImpl query){\n" +
52056 		"	                      ^^^^^^^^^^^^^^^^^\n" +
52057 		"AbstractQueryImpl cannot be resolved to a type\n" +
52058 		"----------\n" +
52059 		"31. WARNING in FromImpl.java (at line 42)\n" +
52060 		"	Stack stack = new Stack();\n" +
52061 		"	^^^^^\n" +
52062 		"Stack is a raw type. References to generic type Stack<E> should be parameterized\n" +
52063 		"----------\n" +
52064 		"32. WARNING in FromImpl.java (at line 42)\n" +
52065 		"	Stack stack = new Stack();\n" +
52066 		"	                  ^^^^^\n" +
52067 		"Stack is a raw type. References to generic type Stack<E> should be parameterized\n" +
52068 		"----------\n" +
52069 		"33. WARNING in FromImpl.java (at line 43)\n" +
52070 		"	stack.push(this);\n" +
52071 		"	^^^^^^^^^^^^^^^^\n" +
52072 		"Type safety: The method push(Object) belongs to the raw type Stack. References to generic type Stack<E> should be parameterized\n" +
52073 		"----------\n" +
52074 		"34. WARNING in FromImpl.java (at line 45)\n" +
52075 		"	FromImpl currentJoin = (FromImpl) stack.pop();\n" +
52076 		"	^^^^^^^^\n" +
52077 		"FromImpl is a raw type. References to generic type FromImpl<Z,X> should be parameterized\n" +
52078 		"----------\n" +
52079 		"35. WARNING in FromImpl.java (at line 45)\n" +
52080 		"	FromImpl currentJoin = (FromImpl) stack.pop();\n" +
52081 		"	                        ^^^^^^^^\n" +
52082 		"FromImpl is a raw type. References to generic type FromImpl<Z,X> should be parameterized\n" +
52083 		"----------\n" +
52084 		"36. WARNING in FromImpl.java (at line 46)\n" +
52085 		"	stack.addAll(currentJoin.getJoins());\n" +
52086 		"	^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" +
52087 		"Type safety: The method addAll(Collection) belongs to the raw type Vector. References to generic type Vector<E> should be parameterized\n" +
52088 		"----------\n" +
52089 		"37. ERROR in FromImpl.java (at line 47)\n" +
52090 		"	if (currentJoin.isLeaf){\n" +
52091 		"	                ^^^^^^\n" +
52092 		"isLeaf cannot be resolved or is not a field\n" +
52093 		"----------\n");
52094 }
52095 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=316889
52096 public void test1462() {
52097 	this.runNegativeTest(
52098 		new String[] {
52099 			"AnotherClass.java",
52100 			"public class AnotherClass<I extends IRecursiveInterface<? super I>> {}\n" +
52101 			"class ImplementingClass implements IRecursiveInterface<IReferencedInterface>, IReferencedInterface {\n" +
52102 			"    private AnotherClass<IReferencedInterface> m_var;\n" +
52103 			"    public void setAnother(final AnotherClass<? extends IReferencedInterface> a) {\n" +
52104 			"	    m_var = a;\n" +
52105 			"    }\n" +
52106 			"}\n" +
52107 			"interface IRecursiveInterface<I extends IRecursiveInterface<? super I>> {\n" +
52108 			"	void setAnother(final AnotherClass<? extends I> a);\n" +
52109 			"}\n" +
52110 			"interface IReferencedInterface extends IRecursiveInterface<IReferencedInterface> {}\n"
52111 		},
52112 		"----------\n" +
52113 		"1. ERROR in AnotherClass.java (at line 5)\n" +
52114 		"	m_var = a;\n" +
52115 		"	        ^\n" +
52116 		"Type mismatch: cannot convert from AnotherClass<capture#1-of ? extends IReferencedInterface> to AnotherClass<IReferencedInterface>\n" +
52117 		"----------\n");
52118 }
52119 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=314556
52120 public void test1463() {
52121 	this.runNegativeTest(
52122 		new String[] {
52123 			"BaseType.java",
52124             "public interface BaseType {\n" +
52125             "	   BaseType clone() throws CloneNotSupportedException;\n" +
52126             "}\n" +
52127             "interface SubType<T extends BaseType & java.io.Closeable> extends BaseType {\n" +
52128             "}\n"
52129 		},
52130 		"----------\n" +
52131 		"1. ERROR in BaseType.java (at line 4)\n" +
52132 		"	interface SubType<T extends BaseType & java.io.Closeable> extends BaseType {\n" +
52133 		"	                  ^\n" +
52134 		"The inherited method Object.clone() cannot hide the public abstract method in BaseType\n" +
52135 		"----------\n");
52136 }
52137 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=319603
52138 public void test1464() {
52139 	this.runNegativeTest(
52140 		new String[] {
52141 			"X.java",
52142 			"import java.util.Collection;\n" +
52143 			"import java.util.Set;\n" +
52144 			"\n" +
52145 			"public class X {\n" +
52146 			"\n" +
52147 			"	public <T> Collection<T> m(Collection<T> a) {\n" +
52148 			"		return null;\n" +
52149 			"	}\n" +
52150 			"	public <T> Set<T> m(Set<T> a) {\n" +
52151 			"			return m(a); \n" +
52152 			"	}\n" +
52153 			"   Zork z;\n" +
52154 			"}\n"
52155 		},
52156 		"----------\n" +
52157 		"1. ERROR in X.java (at line 12)\n" +
52158 		"	Zork z;\n" +
52159 		"	^^^^\n" +
52160 		"Zork cannot be resolved to a type\n" +
52161 		"----------\n");
52162 }
52163 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=320275
52164 public void _test1465() {
52165 	this.runConformTest(
52166 			new String[] {
52167 				"AbstractSubClass.java",
52168 				"public abstract class AbstractSubClass extends AbstractClass {}",
52169 			},
52170 			new String[] {
52171 					"AbstractClass.java",
52172 					"public abstract class AbstractClass implements BaseInterface {}",
52173 					"AbstractSubClass.java",
52174 					"public abstract class AbstractSubClass extends AbstractClass {}",
52175 					"BaseInterface.java",
52176 					"public interface BaseInterface extends GenericInterface<ConcreteClass> {}",
52177 					"ConcreteClass.java",
52178 					"public class ConcreteClass extends AbstractSubClass {}",
52179 					"GenericInterface.java",
52180 					"public interface GenericInterface<T> {}",
52181 			},
52182 			"");
52183 }
52184 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=320463
52185 public void test1466() {
52186 	this.runNegativeTest(
52187 		new String[] {
52188 			"Outer.java",
52189 			"public class Outer<T> {\n"+
52190 			"    class Cell {\n"+
52191 			"        final T value;\n"+
52192 			"        Cell(T value) {\n"+
52193 			"            this.value = value;\n"+
52194 			"        }\n"+
52195 			"    }\n"+
52196 			"    Class<Outer<T>.Cell> cellClass = Cell.class;\n"+
52197 			"    {\n"+
52198 			"    	this.cellClass = Cell.class;\n"+
52199 			"    	this.cellClass = Outer.Cell.class;\n"+
52200 			"    }\n"+
52201 			"    public static void main(String[] args) {\n"+
52202 			"        Outer<Integer>.Cell intCell = new Outer<Integer>().new Cell(314);\n"+
52203 			"        Outer<String>.Cell strCell = new Outer<String>().cellClass.cast(intCell);\n"+
52204 			"        String val = strCell.value; // ClassCastException\n"+
52205 			"        System.out.println(val);\n"+
52206 			"    }\n"+
52207 			"}\n"
52208 		},
52209 		"----------\n" +
52210 		"1. ERROR in Outer.java (at line 8)\n" +
52211 		"	Class<Outer<T>.Cell> cellClass = Cell.class;\n" +
52212 		"	                                 ^^^^^^^^^^\n" +
52213 		"Type mismatch: cannot convert from Class<Outer.Cell> to Class<Outer<T>.Cell>\n" +
52214 		"----------\n" +
52215 		"2. ERROR in Outer.java (at line 10)\n" +
52216 		"	this.cellClass = Cell.class;\n" +
52217 		"	                 ^^^^^^^^^^\n" +
52218 		"Type mismatch: cannot convert from Class<Outer.Cell> to Class<Outer<T>.Cell>\n" +
52219 		"----------\n" +
52220 		"3. ERROR in Outer.java (at line 11)\n" +
52221 		"	this.cellClass = Outer.Cell.class;\n" +
52222 		"	                 ^^^^^^^^^^^^^^^^\n" +
52223 		"Type mismatch: cannot convert from Class<Outer.Cell> to Class<Outer<T>.Cell>\n" +
52224 		"----------\n");
52225 }
52226 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=312076
52227 public void test1467() {
52228 	this.runNegativeTest(
52229 		new String[] {
52230 			"X.java",
52231 			"public class X<T>  { \n" +
52232 			"    public abstract static class Base<S extends Base<S>> {\n" +
52233 			"        public Base(Class<S> sClass) {\n" +
52234 			"            Class<S> theClass = sClass;\n" +
52235 			"            System.out.println(theClass);\n" +
52236 			"            System.out.println(sClass);\n" +
52237 			"        }\n" +
52238 			"    }\n" +
52239 			"    public class Arr extends Base<Arr> {\n" +
52240 			"        public Arr() { \n" +
52241 			"            super(Arr.class);\n" +
52242 			"            System.out.println(Arr.class);\n" +
52243 			"        }\n" +
52244 			"    }\n" +
52245 			"    public static void main(String[] args) {\n" +
52246 			"        X<Integer> x = new X<Integer>();\n" +
52247 			"        X<Integer>.Arr a = x.new Arr();\n" +
52248 			"        System.out.println(a);\n" +
52249 			"    }\n" +
52250 			"}\n"
52251 		},
52252 		"----------\n" +
52253 		"1. ERROR in X.java (at line 11)\n" +
52254 		"	super(Arr.class);\n" +
52255 		"	^^^^^^^^^^^^^^^^^\n" +
52256 		"The constructor X.Base<X<T>.Arr>(Class<X.Arr>) is undefined\n" +
52257 		"----------\n");
52258 }
52259 public void testBug401783() {
52260 	if (this.complianceLevel >= ClassFileConstants.JDK1_8)
52261 		runConformTest(
52262 			new String[] {
52263 				"X.java",
52264 				"import java.util.*;\n" +
52265 				"public class X {\n" +
52266 				"	void foo() {\n" +
52267 				"		Iterable<Iterable<Integer>> iterables = Arrays.asList(Arrays.asList(1,2,3,4),Arrays.asList(5,6,7));\n" +
52268 				"	}\n" +
52269 				"}\n"
52270 			});
52271 }
52272 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=433989
52273 public void testBug433989() {
52274 	this.runConformTest(
52275 		new String[] {
52276 			"A.java",
52277 			"class A<V> {\n" +
52278 			"    public static class Container {\n" +
52279 			"        public static class In<T> {\n" +
52280 			"            public static class Inner<U> {}\n" +
52281 			"        }\n" +
52282 			"        public static <X> void doit() {\n" +
52283 			"            new In.Inner<X>();\n" +
52284 			"        }\n" +
52285 			"    }\n" +
52286 			"}\n"
52287 		});
52288 }
52289 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=433989
52290 public void testBug433989a() {
52291 	this.runNegativeTest(
52292 		new String[] {
52293 			"A.java",
52294 			"class A<V> {\n" +
52295 			"	public static class Nested {\n" +
52296 			"		public class In<U> {\n" +
52297 			"			public class Inner<V> {}\n" +
52298 			"		}\n" +
52299 			"		public <X> void create() {\n" +
52300 			"			new In.Inner<X>();\n" +
52301 			"		}\n" +
52302 			"	}\n" +
52303 			"}"
52304 		},
52305 		"----------\n" +
52306 		"1. ERROR in A.java (at line 7)\n" +
52307 		"	new In.Inner<X>();\n" +
52308 		"	    ^^^^^^^^\n" +
52309 		"The member type A.Nested.In.Inner<X> must be qualified with a parameterized type, since it is not static\n" +
52310 		"----------\n");
52311 }
52312 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=433989
52313 public void testBug433989b() {
52314 	this.runNegativeTest(
52315 		new String[] {
52316 			"A.java",
52317 			"class A<V> {\n" +
52318 			"	public class Nested {\n" +
52319 			"		public class In<U> {\n" +
52320 			"			public class Inner<W> {}\n" +
52321 			"		}\n" +
52322 			"		public <X> void create() {\n" +
52323 			"			new In.Inner<X>();\n" +
52324 			"		}\n" +
52325 			"	}\n" +
52326 			"}"
52327 		},
52328 		"----------\n" +
52329 		"1. ERROR in A.java (at line 7)\n" +
52330 		"	new In.Inner<X>();\n" +
52331 		"	    ^^\n" +
52332 		"The member type A<V>.Nested.In must be parameterized, since it is qualified with a parameterized type\n" +
52333 		"----------\n");
52334 }
52335 
52336 //https://bugs.eclipse.org/bugs/show_bug.cgi?id=469201
52337 public void testBug469201_A(){
52338 	this.runConformTest(
52339 		new String[]{
52340 			"T2.java",
52341 			"import java.util.*;\n" +
52342 					"\n" +
52343 					"class Bar {  }\n" +
52344 					"\n" +
52345 					"class FooPrime extends Bar {\n" +
52346 					"      void bar(Bar bar) { }\n" +
52347 					"}\n" +
52348 					"\n" +
52349 					"class Foo extends FooPrime { }\n" +
52350 					"\n" +
52351 					"public class T2 {\n" +
52352 					"\n" +
52353 					"	public static void someMethod(List<? extends Foo> foos ) {\n" +
52354 					"		Bar bar = new Bar(); \n" +
52355 					"		foos.get(0).bar(bar);\n" +
52356 					"	}\n" +
52357 					"  public static void main(String... args) {\n" +
52358 					"      List<Foo> foos = new ArrayList<Foo>();\n" +
52359 					"      foos.add(new Foo());\n" +
52360 					"      someMethod(foos);\n" +
52361 					"  }\n" +
52362 					"}"
52363 		});
52364 }
52365 
52366 public void testBug469201_B(){
52367 	this.runNegativeTest(
52368 		new String[]{
52369 				"A.java",
52370 				"package bug469201.p1;\n" +
52371 				"public class A {\n" +
52372 				"	void bar(Bar bar) { }\n" +
52373 				"}\n" +
52374 				"class Bar {}\n",
52375 				"D.java",
52376 				"package bug469201.p1;\n" +
52377 				"import java.util.ArrayList;\n" +
52378 				"import java.util.List;\n" +
52379 				"import bug469201.p2.B;\n" +
52380 				"public class D{\n" +
52381 				"	public static void main(String... args) {\n" +
52382 				"	      List<? extends B> foos = new ArrayList<B>();\n" +
52383 				"	      Bar bar = new Bar();\n" +
52384 				"	      foos.get(0).bar(bar);\n" +
52385 				"	}\n" +
52386 				"}",
52387 				"B.java",
52388 				"package bug469201.p2;\n" +
52389 				"import bug469201.p1.A;\n" +
52390 				"public class B extends A {}\n"
52391 		},
52392 		"----------\n" +
52393 		"1. ERROR in D.java (at line 9)\n" +
52394 		"	foos.get(0).bar(bar);\n" +
52395 		"	            ^^^\n" +
52396 		"The method bar(Bar) from the type A is not visible\n" +
52397 		"----------\n");
52398 		}
52399 public void testBug460491() {
52400 	if (this.complianceLevel >= ClassFileConstants.JDK1_7) {
52401 		Map customOptions = getCompilerOptions();
52402 		customOptions.put(CompilerOptions.OPTION_ReportRedundantSpecificationOfTypeArguments, CompilerOptions.WARNING);
52403 		this.runConformTest(
52404 			new String[] {
52405 				"A.java",
52406 				"class A {\n" +
52407 				"	private static final B.C c = new B.D<Void>();\n" +
52408 				"}",
52409 				"B.java",
52410 				"class B<T> {\n" +
52411 				"	public interface C {}\n" +
52412 				"	public static class D<R> implements C {}\n" +
52413 				"}"
52414 			},
52415 			customOptions);
52416 	}
52417 }
52418 public void testBug492450_comment0() {
52419 	if (this.complianceLevel >= ClassFileConstants.JDK1_6) {
52420 		runConformTest(
52421 			new String[] {
52422 				"DocumentObject.java",
52423 				"\n" +
52424 				"import java.util.ArrayList;\n" +
52425 				"\n" +
52426 				"interface IDocumentElementNode {\n" +
52427 				"	public ArrayList<?> getChildNodesList();\n" +
52428 				"}\n" +
52429 				"\n" +
52430 				"abstract class DocumentElementNode implements IDocumentElementNode {\n" +
52431 				"	@Override\n" +
52432 				"	public ArrayList<IDocumentElementNode> getChildNodesList() {\n" +
52433 				"		return null;\n" +
52434 				"	}\n" +
52435 				"}\n" +
52436 				"\n" +
52437 				"interface IDocumentObject extends IDocumentElementNode {\n" +
52438 				"	public ArrayList<?> getChildNodesList(Class<?>[] classes, boolean match);\n" +
52439 				"}\n" +
52440 				"\n" +
52441 				"public abstract class DocumentObject extends DocumentElementNode implements IDocumentObject {\n" +
52442 				"	@Override\n" +
52443 				"	public ArrayList<IDocumentElementNode> getChildNodesList(Class<?>[] classes, boolean match) {\n" +
52444 				"		return null;\n" +
52445 				"	}\n" +
52446 				"}\n"
52447 			});
52448 	}
52449 }
52450 public void testBug532653() {
52451 	if (this.complianceLevel >= ClassFileConstants.JDK1_6) {
52452 		runConformTest(
52453 			new String[] {
52454 				"Builder.java",
52455 				"public interface Builder<T> {\n" +
52456 				"	T build();\n" +
52457 				"}\n",
52458 				"ConcreteBuilder.java",
52459 				"public class ConcreteBuilder<B extends ConcreteBuilder<B>> implements Builder<String> {\n" +
52460 				"	private String s = \"\";\n" +
52461 				"	protected B b;\n" +
52462 				"	@Override\n" +
52463 				"	public String build() {\n" +
52464 				"		return s;\n" +
52465 				"	}\n" +
52466 				"	public B append(String s) {\n" +
52467 				"		this.s += s;\n" +
52468 				"		return b;\n" +
52469 				"	}\n" +
52470 				"	public static ConcreteBuilder<?> create() {\n" +
52471 				"		class ConcreteStringBuilder extends ConcreteBuilder<ConcreteStringBuilder> {\n" +
52472 				"			public ConcreteStringBuilder() {\n" +
52473 				"				b = this;\n" +
52474 				"			}\n" +
52475 				"		}\n" +
52476 				"		return new ConcreteStringBuilder();\n" +
52477 				"	}\n" +
52478 				"}",
52479 				"ConcreteSubBuilder.java",
52480 				"public class ConcreteSubBuilder<B extends ConcreteSubBuilder<B>> extends ConcreteBuilder<B>{\n" +
52481 				"	public B appendTwice(String s) {\n" +
52482 				"		return super.append(s).append(s);\n" +
52483 				"	}\n" +
52484 				"	public static ConcreteSubBuilder<?> create() {\n" +
52485 				"		class ConcreteSubStringBuilder extends ConcreteSubBuilder<ConcreteSubStringBuilder> {\n" +
52486 				"			public ConcreteSubStringBuilder() {\n" +
52487 				"				b = this;\n" +
52488 				"			}\n" +
52489 				"		}\n" +
52490 				"		return new ConcreteSubStringBuilder();\n" +
52491 				"	}\n" +
52492 				"}\n"
52493 			});
52494 	}
52495 }
52496 public void testBug541772() {
52497 	runConformTest(
52498 		new String[] {
52499 			"bug541772Runtime/GeneratedMessage.java",
52500 			"package bug541772Runtime;\n" +
52501 			"\n" +
52502 			"public class GeneratedMessage {\n" +
52503 			"    public class Builder<T> {\n" +
52504 			"    }\n" +
52505 			"}\n" +
52506 			"",
52507 		},
52508 		"",
52509 		getCompilerOptions()
52510 	);
52511 
52512 	runConformTest(
52513 	new String[] {
52514 		"token/Token.java",
52515 		"package token;\n" +
52516 		"\n" +
52517 		"public class Token {\n" +
52518 		"  \n" +
52519 		"  public Token() {\n" +
52520 		"  }\n" +
52521 		"\n" +
52522 		"  public Token(TokenProto tokenPB) {\n" +
52523 		"      tokenPB.hashCode();\n" +
52524 		"  }\n" +
52525 		"  public Token(String x) {\n" +
52526 		"      x.hashCode();\n" +
52527 		"  }\n" +
52528 		"}\n" +
52529 		"",
52530 		"token/TokenProto.java",
52531 		"package token;\n" +
52532 		"\n" +
52533 		"import bug541772Runtime.GeneratedMessage;\n" +
52534 		"\n" +
52535 		"public class TokenProto {\n" +
52536 		"\n" +
52537 		"    public TokenProto(GeneratedMessage.Builder<?> builder) {\n" +
52538 		"        builder.hashCode();\n" +
52539 		"    }\n" +
52540 		"}\n" +
52541 		"",
52542 	},
52543 	"",
52544 	null /*classLibraries*/,
52545 	false /*shouldFlushOutputDirectory*/,
52546 	null /*vmArguments*/,
52547 	getCompilerOptions(),
52548 	null /*customRequestor*/);
52549 
52550 	Util.flushDirectoryContent(new File(OUTPUT_DIR + File.separator + "bug541772Runtime"));
52551 
52552 	runConformTest(
52553 	new String[] {
52554 		"pkg/Example.java",
52555 		"package pkg;\n" +
52556 		"\n" +
52557 		"import token.Token;\n" +
52558 		"\n" +
52559 		"public abstract class Example {\n" +
52560 		"	public static void setConnectorInfo() {\n" +
52561 		"		new Token(\"\");\n" +
52562 		"	}\n" +
52563 		"}\n" +
52564 		"",
52565 	},
52566 	"",
52567 	null /*classLibraries*/,
52568 	false /*shouldFlushOutputDirectory*/,
52569 	null /*vmArguments*/,
52570 	getCompilerOptions(),
52571 	null /*customRequestor*/);
52572 }
52573 public void testBug541772_typeannotations() {
52574 	if (this.complianceLevel < ClassFileConstants.JDK1_8) {
52575 		return;
52576 	}
52577 	runConformTest(
52578 		new String[] {
52579 			"bug541772Runtime/GeneratedMessage.java",
52580 			"package bug541772Runtime;\n" +
52581 			"\n" +
52582 			"public class GeneratedMessage {\n" +
52583 			"    public class Builder<T> {\n" +
52584 			"    }\n" +
52585 			"}\n" +
52586 			"",
52587 		},
52588 		"",
52589 		getCompilerOptions()
52590 	);
52591 
52592 	runConformTest(
52593 	new String[] {
52594 		"token/Ann.java",
52595 		"package token;\n" +
52596 		"import java.lang.annotation.*;\n" +
52597 		"@Target(ElementType.TYPE_USE)\n" +
52598 		"@Retention(RetentionPolicy.CLASS)\n" +
52599 		"@interface Ann {}\n",
52600 		"token/Token.java",
52601 		"package token;\n" +
52602 		"\n" +
52603 		"public class Token {\n" +
52604 		"  \n" +
52605 		"  public Token() {\n" +
52606 		"  }\n" +
52607 		"\n" +
52608 		"  public Token(TokenProto tokenPB) {\n" +
52609 		"      tokenPB.hashCode();\n" +
52610 		"  }\n" +
52611 		"  public Token(String x) {\n" +
52612 		"      x.hashCode();\n" +
52613 		"  }\n" +
52614 		"}\n" +
52615 		"",
52616 		"token/TokenProto.java",
52617 		"package token;\n" +
52618 		"\n" +
52619 		"import bug541772Runtime.GeneratedMessage;\n" +
52620 		"\n" +
52621 		"public class TokenProto {\n" +
52622 		"\n" +
52623 		"    public TokenProto(GeneratedMessage.@Ann Builder<?> builder) {\n" +
52624 		"        builder.hashCode();\n" +
52625 		"    }\n" +
52626 		"}\n" +
52627 		"",
52628 	},
52629 	"",
52630 	null /*classLibraries*/,
52631 	false /*shouldFlushOutputDirectory*/,
52632 	null /*vmArguments*/,
52633 	getCompilerOptions(),
52634 	null /*customRequestor*/);
52635 
52636 	Util.flushDirectoryContent(new File(OUTPUT_DIR + File.separator + "bug541772Runtime"));
52637 
52638 	Map compilerOptions = getCompilerOptions();
52639 	compilerOptions.put(JavaCore.COMPILER_ANNOTATION_NULL_ANALYSIS, JavaCore.ENABLED);
52640 	runConformTest(
52641 	new String[] {
52642 		"pkg/Example.java",
52643 		"package pkg;\n" +
52644 		"\n" +
52645 		"import token.Token;\n" +
52646 		"\n" +
52647 		"public abstract class Example {\n" +
52648 		"	public static void setConnectorInfo() {\n" +
52649 		"		new Token(\"\");\n" +
52650 		"	}\n" +
52651 		"}\n" +
52652 		"",
52653 	},
52654 	"",
52655 	null /*classLibraries*/,
52656 	false /*shouldFlushOutputDirectory*/,
52657 	null /*vmArguments*/,
52658 	compilerOptions,
52659 	null /*customRequestor*/);
52660 }
52661 /**
52662  * This test targets the optimization for parameterized dependencies in {@code BoundSet.combineSameSameWithProperType(...)}.
52663  */
52664 public void testBug543480BasedOnTest2FromComment4ToSameSameOptimization() {
52665 	if (this.complianceLevel >= ClassFileConstants.JDK1_8) {
52666 		final List<Duration> durationsFor2TypeParameters = compileTimesAfterWarmup(() -> runConformTest(
52667 			new String[] {
52668 				"Test2_2.java",
52669 				"public class Test2_2 {\n" +
52670 				"	void test() {\n" +
52671 				"		m(s(\n" +
52672 				"			f(1),\n" +
52673 				"			f(2)\n" +
52674 				"		));\n" +
52675 				"	}\n" +
52676 				"\n" +
52677 				"	static <R> R m(S<R> s) { return null; }\n" +
52678 				"    static <T> F<T> f(T t) { return null; }\n" +
52679 				"	static <T1> S<R1<T1>> s(F<T1> t1) { return null; }\n" +
52680 				"	static <T1, T2> S<R2<T1, T2>> s(F<T1> t1, F<T2> t2) { return null; }\n" +
52681 				"}\n" +
52682 				"interface F<T> {}\n" +
52683 				"interface S<R> {}\n" +
52684 				"interface R1<T1> {}\n" +
52685 				"interface R2<T1, T2> {}\n"
52686 			}));
52687 		final List<Duration> durationsFor11TypeParameters = compileTimesAfterWarmup(() -> runConformTest(
52688 				new String[] {
52689 					"Test2_11.java",
52690 					"public class Test2_11 {\n" +
52691 					"	void test() {\n" +
52692 					"		m(s(\n" +
52693 					"			f(1),\n" +
52694 					"			f(2),\n" +
52695 					"			f(3),\n" +
52696 					"			f(4),\n" +
52697 					"			f(5),\n" +
52698 					"			f(6),\n" +
52699 					"			f(7),\n" +
52700 					"			f(8),\n" +
52701 					"			f(9),\n" +
52702 					"			f(10),\n" +
52703 					"			f(11)\n" +
52704 					"		));\n" +
52705 					"	}\n" +
52706 					"\n" +
52707 					"	static <R> R m(S<R> s) { return null; }\n" +
52708 					"   static <T> F<T> f(T t) { return null; }\n" +
52709 					"	static <T1> S<R1<T1>> s(F<T1> t1) { return null; }\n" +
52710 					"	static <T1, T2> S<R2<T1, T2>> s(F<T1> t1, F<T2> t2) { return null; }\n" +
52711 					"	static <T1, T2, T3> S<R3<T1, T2, T3>> s(F<T1> t1, F<T2> t2, F<T3> t3) { return null; }\n" +
52712 					"	static <T1, T2, T3, T4> S<R4<T1, T2, T3, T4>> s(F<T1> t1, F<T2> t2, F<T3> t3, F<T4> t4) { return null; }\n" +
52713 					"	static <T1, T2, T3, T4, T5> S<R5<T1, T2, T3, T4, T5>> s(F<T1> t1, F<T2> t2, F<T3> t3, F<T4> t4, F<T5> t5) { return null; }\n" +
52714 					"	static <T1, T2, T3, T4, T5, T6> S<R6<T1, T2, T3, T4, T5, T6>> s(F<T1> t1, F<T2> t2, F<T3> t3, F<T4> t4, F<T5> t5, F<T6> t6) { return null; }\n" +
52715 					"	static <T1, T2, T3, T4, T5, T6, T7> S<R7<T1, T2, T3, T4, T5, T6, T7>> s(F<T1> t1, F<T2> t2, F<T3> t3, F<T4> t4, F<T5> t5, F<T6> t6, F<T7> t7) { return null; }\n" +
52716 					"	static <T1, T2, T3, T4, T5, T6, T7, T8> S<R8<T1, T2, T3, T4, T5, T6, T7, T8>> s(F<T1> t1, F<T2> t2, F<T3> t3, F<T4> t4, F<T5> t5, F<T6> t6, F<T7> t7, F<T8> t8) { return null; }\n" +
52717 					"	static <T1, T2, T3, T4, T5, T6, T7, T8, T9> S<R9<T1, T2, T3, T4, T5, T6, T7, T8, T9>> s(F<T1> t1, F<T2> t2, F<T3> t3, F<T4> t4, F<T5> t5, F<T6> t6, F<T7> t7, F<T8> t8, F<T9> t9) { return null; }\n" +
52718 					"   static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> S<R10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>> s(F<T1> t1, F<T2> t2, F<T3> t3, F<T4> t4, F<T5> t5, F<T6> t6, F<T7> t7, F<T8> t8, F<T9> t9, F<T10> t10) { return null; }\n" +
52719 					"   static <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> S<R11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>> s(F<T1> t1, F<T2> t2, F<T3> t3, F<T4> t4, F<T5> t5, F<T6> t6, F<T7> t7, F<T8> t8, F<T9> t9, F<T10> t10, F<T11> t11) { return null; }\n" +
52720 					"}\n" +
52721 					"interface F<T> {}\n" +
52722 					"interface S<R> {}\n" +
52723 					"interface R1<T1> {}\n" +
52724 					"interface R2<T1, T2> {}\n" +
52725 					"interface R3<T1, T2, T3> {}\n" +
52726 					"interface R4<T1, T2, T3, T4> {}\n" +
52727 					"interface R5<T1, T2, T3, T4, T5> {}\n" +
52728 					"interface R6<T1, T2, T3, T4, T5, T6> {}\n" +
52729 					"interface R7<T1, T2, T3, T4, T5, T6, T7> {}\n" +
52730 					"interface R8<T1, T2, T3, T4, T5, T6, T7, T8> {}\n" +
52731 					"interface R9<T1, T2, T3, T4, T5, T6, T7, T8, T9> {}\n" +
52732 					"interface R10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> {}\n" +
52733 					"interface R11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> {}\n"
52734 				}));
52735 		// Time complexity should grow roughly linearly, not O(2^n)
52736 		// To make the test robust, it tests for the same order of magnitude only, i.e. factor 10.
52737 		assertCompileTimes(durationsFor2TypeParameters, 10, durationsFor11TypeParameters);
52738 	}
52739 }
52740 /**
52741  * This test targets the optimization for parameterized dependencies in {@code BoundSet.combineSameSubSuperWithProperType(...)}.
52742  */
52743 public void testBug543480WithSameSubSuperOptimization() {
52744 	if (this.complianceLevel >= ClassFileConstants.JDK1_8) {
52745 		final List<Duration> durationsFor2TypeParameters = compileTimesAfterWarmup(() -> runConformTest(
52746 			new String[] {
52747 					"WithParameterizedDependencies_2.java",
52748 					"abstract class WithParameterizedDependencies_2 {\n" +
52749 					"    <T1, T2> \n" +
52750 					"           Type1<T1, T2>\n" +
52751 					"           s1(Type1<T1, T2> t) {\n" +
52752 					// This line causes the optimization in BoundSet.combineSameSubSuperWithProperType(...) to be effective.
52753 					"        return s2(new Type1<>(t));\n" +
52754 					"    }\n" +
52755 					"    abstract <E> E s2(E e);\n" +
52756 					"}\n" +
52757 					"class Type1<T1, T2> {\n" +
52758 					"    Type1(final Type1<T1, T2> l) {}" +
52759 					"}\n"
52760 			}));
52761 		final List<Duration> durationsFor12TypeParameters = compileTimesAfterWarmup(() -> runConformTest(
52762 				new String[] {
52763 					"WithParameterizedDependencies_12.java",
52764 					"abstract class WithParameterizedDependencies_12 {\n" +
52765 					"    <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> \n" +
52766 					"           Type1<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>\n" +
52767 					"           s1(Type1<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> t) {\n" +
52768 					// This line causes the optimization in BoundSet.combineSameSubSuperWithProperType(...) to be effective.
52769 					"        return s2(new Type1<>(t));\n" +
52770 					"    }\n" +
52771 					"    abstract <E> E s2(E e);\n" +
52772 					"}\n" +
52773 					"class Type1<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> {\n" +
52774 					"    Type1(final Type1<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> l) {}" +
52775 					"}\n"
52776 				}));
52777 		// Time complexity should grow roughly linearly, not O(2^n).
52778 		// To make the test robust, it tests for the same order of magnitude only, i.e. factor 10.
52779 		assertCompileTimes(durationsFor2TypeParameters, 10, durationsFor12TypeParameters);
52780 	}
52781 }
52782 /**
52783  * An earlier version of the fix for bug 543480 causes a NullPointerException when compiling this code.
52784  */
52785 public void testBug543480WithoutNullPointerExceptionDuringBytecodeGeneration() {
52786 	if (this.complianceLevel >= ClassFileConstants.JDK1_8) {
52787 		runConformTest(
52788 			new String[] {
52789 				"Test.java",
52790 				"import java.util.function.BiConsumer;\n" +
52791 				"\n" +
52792 				"public class Test {\n" +
52793 				"	\n" +
52794 				"	interface I0<T extends I0<T>> {}\n" +
52795 				"\n" +
52796 				"	class Type<T extends I0<T>, D> {\n" +
52797 				"		// TODO: The problem might be that BiConsumer is not declared in the same file?\n" +
52798 				"		public Type(final BiConsumer<T, D> b) { }\n" +
52799 				"	}\n" +
52800 				"\n" +
52801 				"	public void foo() {\n" +
52802 				"		new Type<>((unused0, unused1) -> {});\n" +
52803 				"	}\n" +
52804 				"}"
52805 			});
52806 	}
52807 }
52808 
52809 protected void assertCompileTimes(final List<Duration> shortTimes, final double factor, final List<Duration> longTimes) {
52810 	final double shortTimesAverage = averageExcludingBoundaries(shortTimes);
52811 	final double longTimesAverage = averageExcludingBoundaries(longTimes);
52812 	final String message = "Potential fluctuation of a performance test: average long compile time "
52813 			+ longTimesAverage + "ms should be less than " + factor + "x the average short compile time " + shortTimesAverage +"ms\n"
52814 			+ "long compile times: "+longTimes+"\n"
52815 			+ "short compile times: "+shortTimes;
52816 	assertTrue(message,longTimesAverage < factor*shortTimesAverage);
52817 	System.out.println(message);
52818 }
52819 
52820 protected double averageExcludingBoundaries(final List<Duration> durations) {
52821 	return durations.stream()
52822 			.filter(duration -> !duration.isExcluded)
52823 			.mapToLong(duration -> duration.durationMs)
52824 			.average().orElse(-1);
52825 }
52826 
52827 protected List<Duration> compileTimesAfterWarmup(final Runnable compileTask) {
52828 	// warm up
52829 	duration(compileTask);
52830 	runGarbageCollection();
52831 	// draw samples, exclude boundaries i.e. exclude potential outliers
52832 	final int numberOfSamples = 10;
52833 	final int boundarySize = 2;
52834 	return IntStream.rangeClosed(1, numberOfSamples)
52835 			.mapToObj(duration(compileTask))
52836 			.sorted()
52837 			.peek(markExcludedBoundaries(boundarySize, numberOfSamples))
52838 			.collect(toList());
52839 }
52840 
52841 protected static IntFunction<Duration> duration(final Runnable runnable) {
52842 	return index -> {
52843 		final long startMs = System.currentTimeMillis();
52844 		runnable.run();
52845 		final long endMs = System.currentTimeMillis();
52846 		final long duration = endMs-startMs;
52847 		return new Duration(index, duration);
52848 	};
52849 }
52850 
52851 protected static Consumer<Duration> markExcludedBoundaries(final int boundarySize, final int numberOfSamples) {
52852 	final AtomicInteger seenSamples = new AtomicInteger(0);
52853 	return duration -> {
52854 		final int indexFromBottom = seenSamples.get();
52855 		final int indexFromTop = abs(seenSamples.get() - numberOfSamples);
52856 		if(indexFromBottom < boundarySize) {
52857 			// a sample within the lower boundary
52858 			duration.isExcluded = true;
52859 		} else if(indexFromTop <= boundarySize) {
52860 			// a sample within the upper boundary
52861 			duration.isExcluded = true;
52862 		}
52863 		seenSamples.incrementAndGet();
52864 	};
52865 }
52866 
52867 protected static class Duration implements Comparable<Duration> {
52868 	protected final int index;
52869 	protected final long durationMs;
52870 	protected boolean isExcluded = false;
52871 
52872 	public Duration(final int index, final long durationMs) {
52873 		this.index = index;
52874 		this.durationMs = durationMs;
52875 	}
52876 
52877 	@Override
52878 	public int compareTo(Duration other) {
52879 		return (int)(this.durationMs - other.durationMs);
52880 	}
52881 
52882 	@Override
52883 	public String toString() {
52884 		return "#"+this.index + " " + this.durationMs + "ms" + (this.isExcluded?" (excluded)":"");
52885 	}
52886 }
52887 
52888 }
52889 
52890