LANG-568 - @SuppressWarnings("unchecked") is used too generally
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@892343 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
352a4ef2a3
commit
5739bba3eb
|
@ -336,10 +336,10 @@ public class Range<T> implements Serializable {
|
|||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings("unchecked") // Comparator works for all types
|
||||
public static final ComparableComparator<?> INSTANCE = new ComparableComparator();
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SuppressWarnings("unchecked") // OK to cast, because comparator works for all types
|
||||
public static <E extends Comparable<? super E>> ComparableComparator<E> getInstance() {
|
||||
return (ComparableComparator<E>) INSTANCE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue