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

The currency field of DecimalFormatSymbols is not deserialized properly

    XMLWordPrintableJSON

Details

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

    Description

      According to the serialized form of DecimalFormatSymbols, the DecimalFormatSymbols itself should be responsible for initializing the currency from the intlCurrencySymbol field. But Harmony only leave it as null.

      The following test case reproduces this bug:

      public void test_serialization() {
      DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.FRANCE);
      Currency currency = symbols.getCurrency();
      assertNotNull(currency);

      try

      { // serialize ByteArrayOutputStream byteOStream = new ByteArrayOutputStream(); ObjectOutputStream objectOStream = new ObjectOutputStream( byteOStream); objectOStream.writeObject(symbols); // and deserialize ObjectInputStream objectIStream = new ObjectInputStream( new ByteArrayInputStream(byteOStream.toByteArray())); DecimalFormatSymbols symbolsD = (DecimalFormatSymbols) objectIStream .readObject(); // The associated currency will not persist currency = symbolsD.getCurrency(); }

      catch (Exception e1)

      { fail("Errors occur during serialization"); }

      try

      { assertNotNull(currency); }

      catch (Exception e)

      { fail("currency should not be null"); }

      }

      Pass on RI(Sun JDK1.5.0_06)
      Rail on Harmony

      Attachments

        1. 02.JIRA349_text.zip
          3 kB
          Paulex Yang

        Activity

          People

            georgeharley George Harley
            paulex Paulex Yang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: