Harmony
  1. Harmony
  2. HARMONY-4327

[classlib][beans] Current bean implementation does not persist Collection and its subclasses correctly

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Classlib
    • Labels:
      None

      Description

      The following test case will pass on RI6, but will fail on harmony branch java6.
      public void test_writeObject_java_util_Collection()

      { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream( byteArrayOutputStream)); LinkedList<Integer> list = new LinkedList<Integer>(); list.add(10); list.addFirst(2); encoder.writeObject(list); encoder.close(); DataInputStream stream = new DataInputStream(new ByteArrayInputStream( byteArrayOutputStream.toByteArray())); XMLDecoder decoder = new XMLDecoder(stream); LinkedList<Integer> l = (LinkedList<Integer>) decoder.readObject(); assertEquals(list, l); }

      Harmony-branch-java6:
      expected:<[2, 10]> but was:<[]>
      RI:
      pass

      1. hy-4327.patch
        70 kB
        spark shen
      2. HY-4327.sh
        0.2 kB
        spark shen

        Issue Links

          Activity

          Hide
          spark shen added a comment -

          This patch tries to add a PersistenceDelegate for java.util.Collection.

          Best regards

          Show
          spark shen added a comment - This patch tries to add a PersistenceDelegate for java.util.Collection. Best regards
          Hide
          Leo Li added a comment -

          Hi, Spark
          Patch applied at r556804. Thank you for your improvement. Please verify whether the problem is resolved as you expected.

          Good luck!
          Leo.

          Show
          Leo Li added a comment - Hi, Spark Patch applied at r556804. Thank you for your improvement. Please verify whether the problem is resolved as you expected. Good luck! Leo.
          Hide
          spark shen added a comment -

          Verified at r556816.

          Show
          spark shen added a comment - Verified at r556816.

            People

            • Assignee:
              Leo Li
              Reporter:
              spark shen
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development