Bug 94701 - Bound mismatch: The generic method sort(List<T>) of type Collections
Summary: Bound mismatch: The generic method sort(List<T>) of type Collections
Status: RESOLVED DUPLICATE of bug 90879
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-11 09:54 EDT by Allistair Crossley CLA
Modified: 2005-05-11 09:59 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Allistair Crossley CLA 2005-05-11 09:54:15 EDT
Hi,

I upgraded to Eclipse 3.1 M6 the other day and a whole bunch of errors came out 
of it where we use Collections.sort. The error and a small class that 
reproduces this error is provided.

Bound mismatch: The generic method sort(List<T>) of type Collections is not 
applicable for the arguments (List<CollectionSort.InnerClass>) since the type 
CollectionSort.InnerClass is not a valid substitute for the bounded parameter 
<T extends Comparable<? super T>>

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class CollectionSort {

	public static void main(String[] args) {
		List<InnerClass> list = new ArrayList<InnerClass>();
		Collections.sort(list);
	}
	
	static class InnerClass implements Comparable {
		public int compareTo(Object arg0) {
			return 0;
		}
	}
}
Comment 1 Allistair Crossley CLA 2005-05-11 09:59:05 EDT
Sorry

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