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:
Sebastian Bazley 2009-12-18 18:44:24 +00:00
parent 352a4ef2a3
commit 5739bba3eb
1 changed files with 2 additions and 2 deletions

View File

@ -336,10 +336,10 @@ public class Range<T> implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked") // Comparator works for all types
public static final ComparableComparator<?> INSTANCE = new ComparableComparator(); 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() { public static <E extends Comparable<? super E>> ComparableComparator<E> getInstance() {
return (ComparableComparator<E>) INSTANCE; return (ComparableComparator<E>) INSTANCE;
} }