6 |
|
*/ |
7 |
|
|
8 |
|
package java.util; |
9 |
– |
import java.util.*; // for javadoc (till 6280605 is fixed) |
9 |
|
import java.io.Serializable; |
10 |
|
import java.io.ObjectOutputStream; |
11 |
|
import java.io.IOException; |
3319 |
|
public int compare(Comparable<Object> c1, Comparable<Object> c2) { |
3320 |
|
return c2.compareTo(c1); |
3321 |
|
} |
3322 |
+ |
|
3323 |
+ |
private Object readResolve() { return reverseOrder(); } |
3324 |
|
} |
3325 |
|
|
3326 |
|
/** |
3339 |
|
*/ |
3340 |
|
public static <T> Comparator<T> reverseOrder(Comparator<T> cmp) { |
3341 |
|
if (cmp == null) |
3342 |
< |
return new ReverseComparator(); // Unchecked warning!! |
3342 |
> |
return reverseOrder(); |
3343 |
|
|
3344 |
|
return new ReverseComparator2<T>(cmp); |
3345 |
|
} |