commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scolebou...@apache.org
Subject cvs commit: jakarta-commons/collections/data/test FixedSizeSortedMap.fullCollection.version3.1.obj FixedSizeSortedMap.emptyCollection.version3.1.obj
Date Fri, 02 Apr 2004 23:12:34 GMT
scolebourne    2004/04/02 15:12:34

  Modified:    collections/src/java/org/apache/commons/collections/map
                        FixedSizeSortedMap.java
               collections RELEASE-NOTES.html
               collections/src/test/org/apache/commons/collections/map
                        TestFixedSizeSortedMap.java
  Added:       collections/data/test
                        FixedSizeSortedMap.fullCollection.version3.1.obj
                        FixedSizeSortedMap.emptyCollection.version3.1.obj
  Log:
  Make FixedSizeSortedMap Serializable [18815]
  
  Revision  Changes    Path
  1.6       +20 -7     jakarta-commons/collections/src/java/org/apache/commons/collections/map/FixedSizeSortedMap.java
  
  Index: FixedSizeSortedMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/java/org/apache/commons/collections/map/FixedSizeSortedMap.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- FixedSizeSortedMap.java	18 Feb 2004 01:13:19 -0000	1.5
  +++ FixedSizeSortedMap.java	2 Apr 2004 23:12:34 -0000	1.6
  @@ -15,6 +15,10 @@
    */
   package org.apache.commons.collections.map;
   
  +import java.io.IOException;
  +import java.io.ObjectInputStream;
  +import java.io.ObjectOutputStream;
  +import java.io.Serializable;
   import java.util.Collection;
   import java.util.Iterator;
   import java.util.Map;
  @@ -45,7 +49,8 @@
    * @author Paul Jack
    */
   public class FixedSizeSortedMap
  -        extends AbstractSortedMapDecorator implements SortedMap, BoundedMap {
  +        extends AbstractSortedMapDecorator
  +        implements SortedMap, BoundedMap, Serializable {
   
       /**
        * Factory method to create a fixed size sorted map.
  @@ -68,13 +73,21 @@
           super(map);
       }
   
  +    //-----------------------------------------------------------------------
       /**
  -     * Gets the map being decorated.
  -     * 
  -     * @return the decorated map
  +     * Write the map out using a custom routine.
  +     */
  +    private void writeObject(ObjectOutputStream out) throws IOException {
  +        out.defaultWriteObject();
  +        out.writeObject(map);
  +    }
  +
  +    /**
  +     * Read the map in using a custom routine.
        */
  -    protected SortedMap getSortedMap() {
  -        return (SortedMap) map;
  +    private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
  +        in.defaultReadObject();
  +        map = (Map) in.readObject();
       }
   
       //-----------------------------------------------------------------------
  
  
  
  1.26      +1 -0      jakarta-commons/collections/RELEASE-NOTES.html
  
  Index: RELEASE-NOTES.html
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/RELEASE-NOTES.html,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- RELEASE-NOTES.html	2 Apr 2004 21:15:05 -0000	1.25
  +++ RELEASE-NOTES.html	2 Apr 2004 23:12:34 -0000	1.26
  @@ -34,6 +34,7 @@
   <li>Fast3Map - Make Serializable [27946]</li>
   <li>Fast3Map - Add clone() method</li>
   <li>FixedSizeMap - Make Serializable [18815]</li>
  +<li>FixedSizeSortedMap - Make Serializable [18815]</li>
   <li>MultiKey - Add getKey(index) and size() methods and make constructor public</li>
   <li>MultiHashMap - Add five methods to improve the API</li>
   <li>AbstractHashedMap,AbstractLinkedMap - Add methods to access entry methods when
protected scope blocks</li>
  
  
  
  1.6       +30 -1     jakarta-commons/collections/src/test/org/apache/commons/collections/map/TestFixedSizeSortedMap.java
  
  Index: TestFixedSizeSortedMap.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/collections/src/test/org/apache/commons/collections/map/TestFixedSizeSortedMap.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- TestFixedSizeSortedMap.java	18 Feb 2004 01:20:38 -0000	1.5
  +++ TestFixedSizeSortedMap.java	2 Apr 2004 23:12:34 -0000	1.6
  @@ -65,4 +65,33 @@
           return false;
       }
   
  +    public String getCompatibilityVersion() {
  +        return "3.1";
  +    }
  +    
  +    public String[] ignoredTests() {
  +        // TreeMap has a bug (it doesn't deserialize SubMaps properly), thus ignore...
  +        return new String [] {
  +            "TestFixedSizeSortedMap.bulkTestHeadMap.testEmptyMapCompatibility",
  +            "TestFixedSizeSortedMap.bulkTestHeadMap.testFullMapCompatibility",
  +            "TestFixedSizeSortedMap.bulkTestHeadMap.testSerializeDeserializeThenCompare",
  +            "TestFixedSizeSortedMap.bulkTestTailMap.testEmptyMapCompatibility",
  +            "TestFixedSizeSortedMap.bulkTestTailMap.testFullMapCompatibility",
  +            "TestFixedSizeSortedMap.bulkTestTailMap.testSerializeDeserializeThenCompare",
  +            "TestFixedSizeSortedMap.bulkTestSubMap.testEmptyMapCompatibility",
  +            "TestFixedSizeSortedMap.bulkTestSubMap.testFullMapCompatibility",
  +            "TestFixedSizeSortedMap.bulkTestSubMap.testSerializeDeserializeThenCompare",
  +        };
  +    }
  +
  +//    public void testCreate() throws Exception {
  +//        resetEmpty();
  +//        writeExternalFormToDisk(
  +//            (java.io.Serializable) map,
  +//            "D:/dev/collections/data/test/FixedSizeSortedMap.emptyCollection.version3.1.obj");
  +//        resetFull();
  +//        writeExternalFormToDisk(
  +//            (java.io.Serializable) map,
  +//            "D:/dev/collections/data/test/FixedSizeSortedMap.fullCollection.version3.1.obj");
  +//    }
   }
  
  
  
  1.1                  jakarta-commons/collections/data/test/FixedSizeSortedMap.fullCollection.version3.1.obj
  
  	<<Binary file>>
  
  
  1.1                  jakarta-commons/collections/data/test/FixedSizeSortedMap.emptyCollection.version3.1.obj
  
  	<<Binary file>>
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message