I've looked a little on the JavaDocs on the
Collections15, and
dicovered bugs in the comparator classes.
Example problem:
ComparableComparator<E extends Comparable> implements
Comparator<E>
should really be:
ComparableComparator implements Comparator<Comparable>
and its static method:
static <T extends Comparable> ComparableComparator<T>
getInstance()
should really be:
static ComparableComparator getInstance()
OR, if you really need subclasses to have the option to
specialize the type even more...
ComparableComparator<E extends Comparable> implements
Comparator<E>
and the static method:
static ComparableComparator<Comparable> getInstance()
The way it works now, getInstance returns a Comparator
where the paramerterized type may be something very
specialized, which means it cannot even be used to sort
a collection of say Integers!
Logged In: YES
user_id=958687
Would you please provide some use case that we can test
against. Thanks!