Summary: | [1.5][compiler] Collections.sort (List<Comparable>) compile error | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Ulrik Restorp <ulrik.restorp> |
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | major | ||
Priority: | P3 | CC: | g.castaldi, gunnar, loskutov |
Version: | 3.1 | ||
Target Milestone: | 3.1 M7 | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Whiteboard: |
Description
Ulrik Restorp
2005-04-04 05:48:42 EDT
1) should generate an unchecked warning 2) should still be an error ---------- 1. WARNING in X.java (at line 11) Collections.sort (lComp); ^^^^^^^^^^^^^^^^^^^^^^^^ Type safety: Unchecked invocation sort(List<Comparable>) of the generic method sort(List<T>) of type Collections ---------- ---------- 2. ERROR in X.java (at line 15) Collections.sort (lStr); ^^^^ Bound mismatch: The generic method sort(List<T>) of type Collections is not applicable for the arguments (List<Comparable<String>>) since the type Comparable<String> is not a valid substitute for the bounded parameter <T extends Comparable<? super T>> ---------- Added GenericTypeTest#test607. Changed generic method type argument inference to tolerate unchecked conversion, and then issue an unchecked method invocation warning. Fixed, will release changes along with fix for bug 84496 Released ok. works fine. |