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

[classlib][beans] XMLEncoder does not encode array values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • Classlib
    • None

    Description

      The expected content of out.xml file after execution of the test
      ----------------------------------------- Test.java ----------------------------------------------------
      import java.beans.XMLEncoder;
      import java.io.*;

      public class Test {
      public static void main(String[] args) throws Exception {
      XMLEncoder encoder = new XMLEncoder(new FileOutputStream("out.xml"));
      encoder.writeObject(new int[]

      { 2, 4 }

      );
      encoder.close();
      }
      }
      ------------------------------------------------------------------------------------------------------------
      is
      ------------------------------------------------ out.xml -------------------------------------------------
      <?xml version="1.0" encoding="UTF-8"?>
      <java version="1.5.0" class="java.beans.XMLDecoder">
      <array class="int" length="2">
      <void index="0">
      <int>2</int>
      </void>
      <void index="1">
      <int>4</int>
      </void>
      </array>
      </java>
      ------------------------------------------------------------------------------------------------------------
      however, Harmony produces the following
      ------------------------------------------------ out.xml -------------------------------------------------
      <?xml version="1.0" encoding="UTF-8"?>
      <java version="1.5.0" class="java.beans.XMLDecoder">
      <array class="int" length="2"/>
      </java>
      ------------------------------------------------------------------------------------------------------------

      Attachments

        Issue Links

          Activity

            People

              zakha Alexei Zakharov
              rbouchma Roman S. Bushmanov
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: