-
Bug
-
Resolution: Fixed
-
P4
-
5.0
-
b69
-
generic
-
solaris_8
From: <###@###.###>
Subject: Collections and reverse order comparator
In version version 1.77, 11/17/03 of the classe
java.util.Collections, the class ReverseComparator
is definied with a formal parameter T that is unused.
moreover method reverseOrder() when cmp is null
doesn't use the static field REVERSE_ORDER.
public static <T> Comparator<T> reverseOrder(Comparator<T> cmp) {
if (cmp == null)
return REVERSE_ORDER;
//return new ReverseComparator();
return new ReverseComparator2<T>(cmp);
}
Subject: Collections and reverse order comparator
In version version 1.77, 11/17/03 of the classe
java.util.Collections, the class ReverseComparator
is definied with a formal parameter T that is unused.
moreover method reverseOrder() when cmp is null
doesn't use the static field REVERSE_ORDER.
public static <T> Comparator<T> reverseOrder(Comparator<T> cmp) {
if (cmp == null)
return REVERSE_ORDER;
//return new ReverseComparator();
return new ReverseComparator2<T>(cmp);
}
- relates to
-
JDK-6366832 (coll) Collections.reverseOrder(null) should return Collections.REVERSE_ORDER
- Closed