Community
Participate
Working Groups
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.
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.
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 ***