diff --git a/data/test/TreeBidiMap.emptyCollection.version3.3.obj b/data/test/TreeBidiMap.emptyCollection.version3.3.obj new file mode 100644 index 000000000..d74791e35 Binary files /dev/null and b/data/test/TreeBidiMap.emptyCollection.version3.3.obj differ diff --git a/data/test/TreeBidiMap.fullCollection.version3.3.obj b/data/test/TreeBidiMap.fullCollection.version3.3.obj new file mode 100644 index 000000000..492cdc58e Binary files /dev/null and b/data/test/TreeBidiMap.fullCollection.version3.3.obj differ diff --git a/src/java/org/apache/commons/collections/bidimap/TreeBidiMap.java b/src/java/org/apache/commons/collections/bidimap/TreeBidiMap.java index ad08d6b7f..efeeec3bf 100644 --- a/src/java/org/apache/commons/collections/bidimap/TreeBidiMap.java +++ b/src/java/org/apache/commons/collections/bidimap/TreeBidiMap.java @@ -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 @@ import org.apache.commons.collections.keyvalue.UnmodifiableMapEntry; * @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 @@ public class TreeBidiMap implements OrderedBidiMap { 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 @@ public class TreeBidiMap implements OrderedBidiMap { } /** - * Checks whether this map contains the a mapping for the specified value. + * Checks whether this map contains a mapping for the specified value. *

* The value must implement Comparable. * @@ -1707,7 +1710,7 @@ public class TreeBidiMap implements OrderedBidiMap { /** * 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; diff --git a/src/test/org/apache/commons/collections/bidimap/TestTreeBidiMap.java b/src/test/org/apache/commons/collections/bidimap/TestTreeBidiMap.java index 9200f7798..22093c40a 100644 --- a/src/test/org/apache/commons/collections/bidimap/TestTreeBidiMap.java +++ b/src/test/org/apache/commons/collections/bidimap/TestTreeBidiMap.java @@ -73,4 +73,15 @@ public class TestTreeBidiMap extends AbstractTestOrderedBidiMap { 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"); +// } + }