[COLLECTIONS-507] Removed wrong type bounds for ComparatorUtils.chainedComparator. Thanks to Gerson.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1567759 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Neidhart 2014-02-12 21:17:41 +00:00
parent d172c62418
commit 2ddd54a7dd
2 changed files with 5 additions and 6 deletions

View File

@ -22,6 +22,9 @@
<body>
<release version="4.0.1" date="TBD" description="">
<action issue="COLLECTIONS-507" dev="tn" type="fix" due-to="Gerson">
Removed wrong type bounds for "ComparatorUtils#chainedComparator(...)".
</action>
<action issue="COLLECTIONS-506" dev="tn" type="fix" due-to="Anthony Communier">
Added javadoc clarification to class "CollectionUtils" that input objects which
override "Object#equals(Object)" must also maintain the general contract of

View File

@ -74,9 +74,7 @@ public class ComparatorUtils {
* @throws NullPointerException if comparators array is null or contains a null
* @see ComparatorChain
*/
public static <E extends Comparable<? super E>> Comparator<E> chainedComparator(
final Comparator<E>... comparators) {
public static <E> Comparator<E> chainedComparator(final Comparator<E>... comparators) {
final ComparatorChain<E> chain = new ComparatorChain<E>();
for (final Comparator<E> comparator : comparators) {
if (comparator == null) {
@ -100,9 +98,7 @@ public class ComparatorUtils {
* @see ComparatorChain
*/
@SuppressWarnings("unchecked")
public static <E extends Comparable<? super E>> Comparator<E> chainedComparator(
final Collection<Comparator<E>> comparators) {
public static <E> Comparator<E> chainedComparator(final Collection<Comparator<E>> comparators) {
return chainedComparator(
(Comparator<E>[]) comparators.toArray(new Comparator[comparators.size()])
);