Lines 1-5
Link Here
|
1 |
/******************************************************************************* |
1 |
/******************************************************************************* |
2 |
* Copyright (c) 2000, 2010 IBM Corporation and others. |
2 |
* Copyright (c) 2000, 2011 IBM Corporation and others. |
3 |
* All rights reserved. This program and the accompanying materials |
3 |
* All rights reserved. This program and the accompanying materials |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
4 |
* are made available under the terms of the Eclipse Public License v1.0 |
5 |
* which accompanies this distribution, and is available at |
5 |
* which accompanies this distribution, and is available at |
Lines 3269-3274
Link Here
|
3269 |
} |
3269 |
} |
3270 |
|
3270 |
|
3271 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=268837 |
3271 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=268837 |
|
|
3272 |
// See that this test case exhibits the bug 345947 |
3272 |
public void test076() { |
3273 |
public void test076() { |
3273 |
this.runNegativeTest( |
3274 |
this.runNegativeTest( |
3274 |
new String[] { |
3275 |
new String[] { |
Lines 3320-3416
Link Here
|
3320 |
"}" |
3321 |
"}" |
3321 |
}, |
3322 |
}, |
3322 |
"----------\n" + |
3323 |
"----------\n" + |
3323 |
"1. ERROR in X.java (at line 15)\n" + |
3324 |
"1. ERROR in X.java (at line 8)\n" + |
|
|
3325 |
" <U> J<String> b();\n" + |
3326 |
" ^^^\n" + |
3327 |
"Name clash: The method b() of type J<E> has the same erasure as b() of type I<E> but does not override it\n" + |
3328 |
"----------\n" + |
3329 |
"2. ERROR in X.java (at line 15)\n" + |
3324 |
" J<Integer> b = ints.a();\n" + |
3330 |
" J<Integer> b = ints.a();\n" + |
3325 |
" ^^^^^^^^\n" + |
3331 |
" ^^^^^^^^\n" + |
3326 |
"Type mismatch: cannot convert from J<String> to J<Integer>\n" + |
3332 |
"Type mismatch: cannot convert from J<String> to J<Integer>\n" + |
3327 |
"----------\n" + |
3333 |
"----------\n" + |
3328 |
"2. ERROR in X.java (at line 16)\n" + |
3334 |
"3. ERROR in X.java (at line 16)\n" + |
3329 |
" J<Object> c = ints.a();\n" + |
3335 |
" J<Object> c = ints.a();\n" + |
3330 |
" ^^^^^^^^\n" + |
3336 |
" ^^^^^^^^\n" + |
3331 |
"Type mismatch: cannot convert from J<String> to J<Object>\n" + |
3337 |
"Type mismatch: cannot convert from J<String> to J<Object>\n" + |
3332 |
"----------\n" + |
3338 |
"----------\n" + |
3333 |
"3. WARNING in X.java (at line 17)\n" + |
3339 |
"4. WARNING in X.java (at line 17)\n" + |
3334 |
" J d = ints.a();\n" + |
3340 |
" J d = ints.a();\n" + |
3335 |
" ^\n" + |
3341 |
" ^\n" + |
3336 |
"J is a raw type. References to generic type J<E> should be parameterized\n" + |
3342 |
"J is a raw type. References to generic type J<E> should be parameterized\n" + |
3337 |
"----------\n" + |
3343 |
"----------\n" + |
3338 |
"4. ERROR in X.java (at line 19)\n" + |
3344 |
"5. ERROR in X.java (at line 19)\n" + |
3339 |
" I<Integer> f = ints.a();\n" + |
3345 |
" I<Integer> f = ints.a();\n" + |
3340 |
" ^^^^^^^^\n" + |
3346 |
" ^^^^^^^^\n" + |
3341 |
"Type mismatch: cannot convert from J<String> to I<Integer>\n" + |
3347 |
"Type mismatch: cannot convert from J<String> to I<Integer>\n" + |
3342 |
"----------\n" + |
3348 |
"----------\n" + |
3343 |
"5. ERROR in X.java (at line 20)\n" + |
3349 |
"6. ERROR in X.java (at line 20)\n" + |
3344 |
" I<Object> g = ints.a();\n" + |
3350 |
" I<Object> g = ints.a();\n" + |
3345 |
" ^^^^^^^^\n" + |
3351 |
" ^^^^^^^^\n" + |
3346 |
"Type mismatch: cannot convert from J<String> to I<Object>\n" + |
3352 |
"Type mismatch: cannot convert from J<String> to I<Object>\n" + |
3347 |
"----------\n" + |
3353 |
"----------\n" + |
3348 |
"6. WARNING in X.java (at line 21)\n" + |
3354 |
"7. WARNING in X.java (at line 21)\n" + |
3349 |
" I h = ints.a();\n" + |
3355 |
" I h = ints.a();\n" + |
3350 |
" ^\n" + |
3356 |
" ^\n" + |
3351 |
"I is a raw type. References to generic type I<E> should be parameterized\n" + |
3357 |
"I is a raw type. References to generic type I<E> should be parameterized\n" + |
3352 |
"----------\n" + |
3358 |
"----------\n" + |
3353 |
"7. ERROR in X.java (at line 24)\n" + |
3359 |
"8. ERROR in X.java (at line 24)\n" + |
3354 |
" ints.b();\n" + |
3360 |
" ints.b();\n" + |
3355 |
" ^\n" + |
3361 |
" ^\n" + |
3356 |
"The method b() is ambiguous for the type J<Integer>\n" + |
3362 |
"The method b() is ambiguous for the type J<Integer>\n" + |
3357 |
"----------\n" + |
3363 |
"----------\n" + |
3358 |
"8. ERROR in X.java (at line 25)\n" + |
3364 |
"9. ERROR in X.java (at line 25)\n" + |
3359 |
" J<String> a = ints.b();\n" + |
3365 |
" J<String> a = ints.b();\n" + |
3360 |
" ^\n" + |
3366 |
" ^\n" + |
3361 |
"The method b() is ambiguous for the type J<Integer>\n" + |
3367 |
"The method b() is ambiguous for the type J<Integer>\n" + |
3362 |
"----------\n" + |
3368 |
"----------\n" + |
3363 |
"9. ERROR in X.java (at line 26)\n" + |
3369 |
"10. ERROR in X.java (at line 26)\n" + |
3364 |
" J<Integer> b = ints.b();\n" + |
3370 |
" J<Integer> b = ints.b();\n" + |
3365 |
" ^\n" + |
3371 |
" ^\n" + |
3366 |
"The method b() is ambiguous for the type J<Integer>\n" + |
3372 |
"The method b() is ambiguous for the type J<Integer>\n" + |
3367 |
"----------\n" + |
3373 |
"----------\n" + |
3368 |
"10. ERROR in X.java (at line 27)\n" + |
3374 |
"11. ERROR in X.java (at line 27)\n" + |
3369 |
" J<Object> c = ints.b();\n" + |
3375 |
" J<Object> c = ints.b();\n" + |
3370 |
" ^\n" + |
3376 |
" ^\n" + |
3371 |
"The method b() is ambiguous for the type J<Integer>\n" + |
3377 |
"The method b() is ambiguous for the type J<Integer>\n" + |
3372 |
"----------\n" + |
3378 |
"----------\n" + |
3373 |
"11. WARNING in X.java (at line 28)\n" + |
3379 |
"12. WARNING in X.java (at line 28)\n" + |
3374 |
" J d = ints.b();\n" + |
3380 |
" J d = ints.b();\n" + |
3375 |
" ^\n" + |
3381 |
" ^\n" + |
3376 |
"J is a raw type. References to generic type J<E> should be parameterized\n" + |
3382 |
"J is a raw type. References to generic type J<E> should be parameterized\n" + |
3377 |
"----------\n" + |
3383 |
"----------\n" + |
3378 |
"12. ERROR in X.java (at line 28)\n" + |
3384 |
"13. ERROR in X.java (at line 28)\n" + |
3379 |
" J d = ints.b();\n" + |
3385 |
" J d = ints.b();\n" + |
3380 |
" ^\n" + |
3386 |
" ^\n" + |
3381 |
"The method b() is ambiguous for the type J<Integer>\n" + |
3387 |
"The method b() is ambiguous for the type J<Integer>\n" + |
3382 |
"----------\n" + |
3388 |
"----------\n" + |
3383 |
"13. ERROR in X.java (at line 29)\n" + |
3389 |
"14. ERROR in X.java (at line 29)\n" + |
3384 |
" I<String> e = ints.b();\n" + |
3390 |
" I<String> e = ints.b();\n" + |
3385 |
" ^\n" + |
3391 |
" ^\n" + |
3386 |
"The method b() is ambiguous for the type J<Integer>\n" + |
3392 |
"The method b() is ambiguous for the type J<Integer>\n" + |
3387 |
"----------\n" + |
3393 |
"----------\n" + |
3388 |
"14. ERROR in X.java (at line 30)\n" + |
3394 |
"15. ERROR in X.java (at line 30)\n" + |
3389 |
" I<Integer> f = ints.b();\n" + |
3395 |
" I<Integer> f = ints.b();\n" + |
3390 |
" ^\n" + |
3396 |
" ^\n" + |
3391 |
"The method b() is ambiguous for the type J<Integer>\n" + |
3397 |
"The method b() is ambiguous for the type J<Integer>\n" + |
3392 |
"----------\n" + |
3398 |
"----------\n" + |
3393 |
"15. ERROR in X.java (at line 31)\n" + |
3399 |
"16. ERROR in X.java (at line 31)\n" + |
3394 |
" I<Object> g = ints.b();\n" + |
3400 |
" I<Object> g = ints.b();\n" + |
3395 |
" ^\n" + |
3401 |
" ^\n" + |
3396 |
"The method b() is ambiguous for the type J<Integer>\n" + |
3402 |
"The method b() is ambiguous for the type J<Integer>\n" + |
3397 |
"----------\n" + |
3403 |
"----------\n" + |
3398 |
"16. WARNING in X.java (at line 32)\n" + |
3404 |
"17. WARNING in X.java (at line 32)\n" + |
3399 |
" I h = ints.b();\n" + |
3405 |
" I h = ints.b();\n" + |
3400 |
" ^\n" + |
3406 |
" ^\n" + |
3401 |
"I is a raw type. References to generic type I<E> should be parameterized\n" + |
3407 |
"I is a raw type. References to generic type I<E> should be parameterized\n" + |
3402 |
"----------\n" + |
3408 |
"----------\n" + |
3403 |
"17. ERROR in X.java (at line 32)\n" + |
3409 |
"18. ERROR in X.java (at line 32)\n" + |
3404 |
" I h = ints.b();\n" + |
3410 |
" I h = ints.b();\n" + |
3405 |
" ^\n" + |
3411 |
" ^\n" + |
3406 |
"The method b() is ambiguous for the type J<Integer>\n" + |
3412 |
"The method b() is ambiguous for the type J<Integer>\n" + |
3407 |
"----------\n" + |
3413 |
"----------\n" + |
3408 |
"18. WARNING in X.java (at line 39)\n" + |
3414 |
"19. WARNING in X.java (at line 39)\n" + |
3409 |
" J d = ints.c();\n" + |
3415 |
" J d = ints.c();\n" + |
3410 |
" ^\n" + |
3416 |
" ^\n" + |
3411 |
"J is a raw type. References to generic type J<E> should be parameterized\n" + |
3417 |
"J is a raw type. References to generic type J<E> should be parameterized\n" + |
3412 |
"----------\n" + |
3418 |
"----------\n" + |
3413 |
"19. WARNING in X.java (at line 43)\n" + |
3419 |
"20. WARNING in X.java (at line 43)\n" + |
3414 |
" I h = ints.c();\n" + |
3420 |
" I h = ints.c();\n" + |
3415 |
" ^\n" + |
3421 |
" ^\n" + |
3416 |
"I is a raw type. References to generic type I<E> should be parameterized\n" + |
3422 |
"I is a raw type. References to generic type I<E> should be parameterized\n" + |
Lines 3479-3486
Link Here
|
3479 |
} |
3485 |
} |
3480 |
|
3486 |
|
3481 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=292350 |
3487 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=292350 |
|
|
3488 |
// See that this test case exhibits the bug 345947 |
3482 |
public void test079() { |
3489 |
public void test079() { |
3483 |
this.runConformTest( |
3490 |
this.runNegativeTest( |
3484 |
new String[] { |
3491 |
new String[] { |
3485 |
"X.java", |
3492 |
"X.java", |
3486 |
"interface I<T> {}\n" + |
3493 |
"interface I<T> {}\n" + |
Lines 3499-3505
Link Here
|
3499 |
" void y(Two t) { t.y(); }\n" + |
3506 |
" void y(Two t) { t.y(); }\n" + |
3500 |
"}" |
3507 |
"}" |
3501 |
}, |
3508 |
}, |
3502 |
"" |
3509 |
"----------\n" + |
|
|
3510 |
"1. ERROR in X.java (at line 9)\n" + |
3511 |
" <T extends A> I<T> x() throws IllegalAccessError;\n" + |
3512 |
" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n" + |
3513 |
"Name clash: The method x() of type Two has the same erasure as x() of type One but does not override it\n" + |
3514 |
"----------\n" + |
3515 |
"2. WARNING in X.java (at line 10)\n" + |
3516 |
" I<B> y() throws IllegalAccessError;\n" + |
3517 |
" ^\n" + |
3518 |
"Type safety: The return type I<B> for y() from the type Two needs unchecked conversion to conform to I<A> from the type One\n" + |
3519 |
"----------\n" |
3503 |
); |
3520 |
); |
3504 |
} |
3521 |
} |
3505 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=293384 |
3522 |
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=293384 |