Uploaded image for project: 'Commons Collections'
  1. Commons Collections
  2. COLLECTIONS-363

TransformedMap is Serializable but its superclass doesn't define an accessible void constructor

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.2
    • Fix Version/s: 4.0-alpha1, 4.0
    • Component/s: Map
    • Labels:
      None

      Description

      TransformedMap is Serializable but its superclass doesn't define an accessible void constructor.
      For example, the following test fails:

      public void testSerialisation() throws Exception {
          TransformedMap<String, String, String, String> map = TransformedMap.decorate(
                  new HashMap<String, String>(),  NOPTransformer.<String> getInstance(), NOPTransformer.<String> getInstance());
          ByteArrayOutputStream bytes = new ByteArrayOutputStream();
          ObjectOutputStream out = new ObjectOutputStream(bytes);
          out.writeObject(map); // fails with java.io.InvalidClassException: org.apache.commons.collections.splitmap.TransformedMap; no valid constructor
          out.close();
      }
      

        Attachments

        1. COLLECTIONS-363.patch
          2 kB
          Igor Saprykin
        2. COLLECTIONS-363-obj-test-fix.patch
          4 kB
          Igor Saprykin
        3. TransformedMap.emptyCollection.version3.2.obj
          0.3 kB
          Igor Saprykin
        4. TransformedMap.fullCollection.version3.2.obj
          0.3 kB
          Igor Saprykin

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sebb@apache.org Sebb
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: