commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r655756 - in /commons/proper/collections/trunk: data/test/ src/java/org/apache/commons/collections/bidimap/ src/test/org/apache/commons/collections/bidimap/
Date Tue, 13 May 2008 07:10:34 GMT
Author: bayard
Date: Tue May 13 00:10:34 2008
New Revision: 655756

URL: http://svn.apache.org/viewvc?rev=655756&view=rev
Log:
Applying my patch, with the obj creation commented out, from COLLECTIONS-285. This makes TreeBidiMap
serializable. 

Added:
    commons/proper/collections/trunk/data/test/TreeBidiMap.emptyCollection.version3.3.obj
  (with props)
    commons/proper/collections/trunk/data/test/TreeBidiMap.fullCollection.version3.3.obj 
 (with props)
Modified:
    commons/proper/collections/trunk/src/java/org/apache/commons/collections/bidimap/TreeBidiMap.java
    commons/proper/collections/trunk/src/test/org/apache/commons/collections/bidimap/TestTreeBidiMap.java

Added: commons/proper/collections/trunk/data/test/TreeBidiMap.emptyCollection.version3.3.obj
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/data/test/TreeBidiMap.emptyCollection.version3.3.obj?rev=655756&view=auto
==============================================================================
Binary file - no diff available.

Propchange: commons/proper/collections/trunk/data/test/TreeBidiMap.emptyCollection.version3.3.obj
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: commons/proper/collections/trunk/data/test/TreeBidiMap.fullCollection.version3.3.obj
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/data/test/TreeBidiMap.fullCollection.version3.3.obj?rev=655756&view=auto
==============================================================================
Binary file - no diff available.

Propchange: commons/proper/collections/trunk/data/test/TreeBidiMap.fullCollection.version3.3.obj
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: commons/proper/collections/trunk/src/java/org/apache/commons/collections/bidimap/TreeBidiMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/java/org/apache/commons/collections/bidimap/TreeBidiMap.java?rev=655756&r1=655755&r2=655756&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/java/org/apache/commons/collections/bidimap/TreeBidiMap.java
(original)
+++ commons/proper/collections/trunk/src/java/org/apache/commons/collections/bidimap/TreeBidiMap.java
Tue May 13 00:10:34 2008
@@ -16,6 +16,8 @@
  */
 package org.apache.commons.collections.bidimap;
 
+import java.io.Serializable;
+
 import java.util.AbstractSet;
 import java.util.Collection;
 import java.util.ConcurrentModificationException;
@@ -73,7 +75,7 @@
  * @author Marc Johnson
  * @author Stephen Colebourne
  */
-public class TreeBidiMap implements OrderedBidiMap {
+public class TreeBidiMap implements OrderedBidiMap, Serializable {
 
     private static final int KEY = 0;
     private static final int VALUE = 1;
@@ -87,10 +89,11 @@
     private Node[] rootNode = new Node[2];
     private int nodeCount = 0;
     private int modifications = 0;
-    private Set keySet;
-    private Set valuesSet;
-    private Set entrySet;
-    private TreeBidiMap.Inverse inverse = null;
+
+    private transient Set keySet;
+    private transient Set valuesSet;
+    private transient Set entrySet;
+    private transient TreeBidiMap.Inverse inverse = null;
 
     //-----------------------------------------------------------------------
     /**
@@ -148,7 +151,7 @@
     }
 
     /**
-     * Checks whether this map contains the a mapping for the specified value.
+     * Checks whether this map contains a mapping for the specified value.
      * <p>
      * The value must implement <code>Comparable</code>.
      *
@@ -1707,7 +1710,7 @@
     /**
      * A node used to store the data.
      */
-    static class Node implements Map.Entry, KeyValue {
+    static class Node implements Map.Entry, KeyValue, Serializable {
 
         private Comparable[] data;
         private Node[] leftNode;

Modified: commons/proper/collections/trunk/src/test/org/apache/commons/collections/bidimap/TestTreeBidiMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/org/apache/commons/collections/bidimap/TestTreeBidiMap.java?rev=655756&r1=655755&r2=655756&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/org/apache/commons/collections/bidimap/TestTreeBidiMap.java
(original)
+++ commons/proper/collections/trunk/src/test/org/apache/commons/collections/bidimap/TestTreeBidiMap.java
Tue May 13 00:10:34 2008
@@ -73,4 +73,15 @@
         return false;
     }
     
+    public String getCompatibilityVersion() {
+        return "3.3";
+    }
+
+//    public void testCreate() throws Exception {
+//        resetEmpty();
+//        writeExternalFormToDisk((java.io.Serializable) map, "/tmp/TreeBidiMap.emptyCollection.version3.3.obj");
+//        resetFull();
+//        writeExternalFormToDisk((java.io.Serializable) map, "/tmp/TreeBidiMap.fullCollection.version3.3.obj");
+//    }
+
 }



Mime
View raw message