commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r891627 - in /commons/proper/lang/trunk/src: java/org/apache/commons/lang3/Range.java test/org/apache/commons/lang3/RangeTest.java
Date Thu, 17 Dec 2009 11:02:54 GMT
Author: bayard
Date: Thu Dec 17 11:02:53 2009
New Revision: 891627

URL: http://svn.apache.org/viewvc?rev=891627&view=rev
Log:
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

Modified:
    commons/proper/lang/trunk/src/java/org/apache/commons/lang3/Range.java
    commons/proper/lang/trunk/src/test/org/apache/commons/lang3/RangeTest.java

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang3/Range.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang3/Range.java?rev=891627&r1=891626&r2=891627&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang3/Range.java (original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang3/Range.java Thu Dec 17 11:02:53
2009
@@ -328,7 +328,9 @@
 
 
     // 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();

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang3/RangeTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang3/RangeTest.java?rev=891627&r1=891626&r2=891627&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang3/RangeTest.java (original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang3/RangeTest.java Thu Dec 17
11:02:53 2009
@@ -269,4 +269,8 @@
 
     }
 
+    public void testSerializing() {
+        SerializationUtils.clone(intRange);
+    }
+
 }



Mime
View raw message