Skip to content

Commit ff1167e

Browse files
committed
SortedList consumer super generic
1 parent 79d4a80 commit ff1167e

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/main/java/org/libj/util/SortedList.java

+3-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
import static org.libj.lang.Assertions.*;
2020

21-
import java.lang.reflect.ParameterizedType;
2221
import java.util.Collection;
2322
import java.util.Comparator;
2423
import java.util.Iterator;
@@ -36,7 +35,7 @@ public class SortedList<E,L extends List<E>> extends ObservableList<E,L> {
3635
@SuppressWarnings("rawtypes")
3736
private static final Comparator DEFAULT_COMPARATOR = Comparator.nullsFirst(Comparator.naturalOrder());
3837

39-
private final Comparator<E> comparator;
38+
private final Comparator<? super E> comparator;
4039

4140
/**
4241
* Creates a new {@link SortedList} with the provided {@link List list} of elements as the underlying target, and the
@@ -60,11 +59,11 @@ public SortedList(final L list) {
6059
* {@linkplain Comparable natural ordering} should be used.
6160
* @throws NullPointerException If the provided {@link List list} or {@link Comparator comparator} is null.
6261
*/
63-
public SortedList(final L list, final Comparator<E> comparator) {
62+
public SortedList(final L list, final Comparator<? super E> comparator) {
6463
this(list, Objects.requireNonNull(comparator), true);
6564
}
6665

67-
private SortedList(final L list, final Comparator<E> comparator, final boolean sort) {
66+
private SortedList(final L list, final Comparator<? super E> comparator, final boolean sort) {
6867
super(list);
6968
this.comparator = comparator;
7069
if (sort)

0 commit comments

Comments
 (0)