[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:
parent
d172c62418
commit
2ddd54a7dd
|
@ -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
|
||||
|
|
|
@ -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()])
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue