Making ComparableComparator Serializable. This doesn't stop people putting non-Serializable comparators in a Range, but it does mean the default case can be serialized. LANG-551
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@891627 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6e4a19b9e5
commit
a926c717c0
|
@ -328,7 +328,9 @@ public class Range<T> implements Serializable {
|
|||
|
||||
|
||||
// Taken from Commons Collections - documentation removed as not a public class
|
||||
private static class ComparableComparator<E extends Comparable<? super E>> implements Comparator<E> {
|
||||
private static class ComparableComparator<E extends Comparable<? super E>> implements Comparator<E>, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static final ComparableComparator<?> INSTANCE = new ComparableComparator();
|
||||
|
|
|
@ -269,4 +269,8 @@ public class RangeTest extends TestCase {
|
|||
|
||||
}
|
||||
|
||||
public void testSerializing() {
|
||||
SerializationUtils.clone(intRange);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue