Bug 84284

Summary: [1.5] no unchecked warning when javac issue one
Product: [Eclipse Project] JDT Reporter: Adam Kiezun <akiezun>
Component: CoreAssignee: Philipe Mulet <philippe_mulet>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: gunnar
Version: 3.1   
Target Milestone: 3.1 M7   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Adam Kiezun CLA 2005-02-02 16:36:01 EST
3.1M4

class Ball implements Comparable {

    public int compareTo(Object o) {
    	return 0;
    }
    
    public static void main(String[] args) {
    	LinkedList<Ball> foo = new LinkedList<Ball>();
    	Collections.sort(foo);
    }
}

javac gives:
   [javac] Lint.java:15: warning: [unchecked] unchecked method invocation:
<T>sort(java.util.List<T>) in java.util.Collections is applied to
(java.util.LinkedList<p.Ball>)
    [javac] Collections.sort(foo);
    [javac] ^
    [javac] 1 warning

eclipse accepts this code with no warning, which seems wrong because of the raw
extends clause - if you change the clause to 'extends Comparable<Ball>' and
update the compareTo method, javac likes it.
Comment 1 Philipe Mulet CLA 2005-02-18 06:29:24 EST
Type argument currently doesn't consider this a raw invocation as the argument
to #sort() is not a raw type per se. 

Need to double check the spec.
Comment 2 Philipe Mulet CLA 2005-04-15 04:54:09 EDT
Added GenericTypeTest#test608.
Added support for unchecked method invocation, if raw conversion is performed
during type inference of generic method invocation.



*** This bug has been marked as a duplicate of 90879 ***