Bug 84284 - [1.5] no unchecked warning when javac issue one
Summary: [1.5] no unchecked warning when javac issue one
Status: RESOLVED DUPLICATE of bug 90879
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.1 M7   Edit
Assignee: Philipe Mulet CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-02 16:36 EST by Adam Kiezun CLA
Modified: 2005-04-15 04:54 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***