Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-4327

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • Classlib
    • 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

      Attachments

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

        Issue Links

          Activity

            People

              liyilei1979@gmail.com Leo Li
              spark shen spark shen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: