Lines 49455-49458
Link Here
|
49455 |
"" |
49455 |
"" |
49456 |
); |
49456 |
); |
49457 |
} |
49457 |
} |
|
|
49458 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=159851 |
49459 |
public void test1450() { |
49460 |
this.runNegativeTest( |
49461 |
new String[] { |
49462 |
"X.java", |
49463 |
"import java.util.*;\n" + |
49464 |
"class A {}\n" + |
49465 |
"class B<T extends A> {}\n" + |
49466 |
"class X<T extends ArrayList<B<Integer>>> extends TreeMap<Integer, B<String>> {}\n" + |
49467 |
"\n" + |
49468 |
"class D<T> {}\n" + |
49469 |
"class E<T extends Number> {}\n" + |
49470 |
"class Y<T> extends E<D<T>> {}", |
49471 |
}, |
49472 |
"----------\n" + |
49473 |
"1. WARNING in X.java (at line 4)\n" + |
49474 |
" class X<T extends ArrayList<B<Integer>>> extends TreeMap<Integer, B<String>> {}\n" + |
49475 |
" ^\n" + |
49476 |
"The serializable class X does not declare a static final serialVersionUID field of type long\n" + |
49477 |
"----------\n" + |
49478 |
"2. ERROR in X.java (at line 4)\n" + |
49479 |
" class X<T extends ArrayList<B<Integer>>> extends TreeMap<Integer, B<String>> {}\n" + |
49480 |
" ^^^^^^^\n" + |
49481 |
"Bound mismatch: The type Integer is not a valid substitute for the bounded parameter <T extends A> of the type B<T>\n" + |
49482 |
"----------\n" + |
49483 |
"3. ERROR in X.java (at line 4)\n" + |
49484 |
" class X<T extends ArrayList<B<Integer>>> extends TreeMap<Integer, B<String>> {}\n" + |
49485 |
" ^^^^^^\n" + |
49486 |
"Bound mismatch: The type String is not a valid substitute for the bounded parameter <T extends A> of the type B<T>\n" + |
49487 |
"----------\n" + |
49488 |
"4. ERROR in X.java (at line 8)\n" + |
49489 |
" class Y<T> extends E<D<T>> {}\n" + |
49490 |
" ^\n" + |
49491 |
"Bound mismatch: The type D<T> is not a valid substitute for the bounded parameter <T extends Number> of the type E<T>\n" + |
49492 |
"----------\n" |
49493 |
); |
49494 |
} |
49495 |
//https://bugs.eclipse.org/bugs/show_bug.cgi?id=159851 |
49496 |
public void test1451() { |
49497 |
this.runNegativeTest( |
49498 |
new String[] { |
49499 |
"X.java", |
49500 |
"class A<T> {}\n" + |
49501 |
"class B<T2 extends Number> {}\n" + |
49502 |
"class C<T3, T4> {}\n" + |
49503 |
"class X<T1, T2> extends C<A<A<B<T1>>>, A<B<T2>>> {}\n" + |
49504 |
"class Y<T> extends A<A<B<T>>> {}\n" + |
49505 |
"class Z<T> extends C<B<T>, A<B<T>>> {}", |
49506 |
}, |
49507 |
"----------\n" + |
49508 |
"1. ERROR in X.java (at line 4)\n" + |
49509 |
" class X<T1, T2> extends C<A<A<B<T1>>>, A<B<T2>>> {}\n" + |
49510 |
" ^^\n" + |
49511 |
"Bound mismatch: The type T1 is not a valid substitute for the bounded parameter <T2 extends Number> of the type B<T2>\n" + |
49512 |
"----------\n" + |
49513 |
"2. ERROR in X.java (at line 4)\n" + |
49514 |
" class X<T1, T2> extends C<A<A<B<T1>>>, A<B<T2>>> {}\n" + |
49515 |
" ^^\n" + |
49516 |
"Bound mismatch: The type T2 is not a valid substitute for the bounded parameter <T2 extends Number> of the type B<T2>\n" + |
49517 |
"----------\n" + |
49518 |
"3. ERROR in X.java (at line 5)\n" + |
49519 |
" class Y<T> extends A<A<B<T>>> {}\n" + |
49520 |
" ^\n" + |
49521 |
"Bound mismatch: The type T is not a valid substitute for the bounded parameter <T2 extends Number> of the type B<T2>\n" + |
49522 |
"----------\n" + |
49523 |
"4. ERROR in X.java (at line 6)\n" + |
49524 |
" class Z<T> extends C<B<T>, A<B<T>>> {}\n" + |
49525 |
" ^\n" + |
49526 |
"Bound mismatch: The type T is not a valid substitute for the bounded parameter <T2 extends Number> of the type B<T2>\n" + |
49527 |
"----------\n" + |
49528 |
"5. ERROR in X.java (at line 6)\n" + |
49529 |
" class Z<T> extends C<B<T>, A<B<T>>> {}\n" + |
49530 |
" ^\n" + |
49531 |
"Bound mismatch: The type T is not a valid substitute for the bounded parameter <T2 extends Number> of the type B<T2>\n" + |
49532 |
"----------\n" |
49533 |
); |
49534 |
} |
49458 |
} |
49535 |
} |