Harmony
  1. Harmony
  2. HARMONY-349

The currency field of DecimalFormatSymbols is not deserialized properly

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Classlib
    • Labels:
      None
    • Estimated Complexity:
      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

        Activity

          People

          • Assignee:
            George Harley
            Reporter:
            Paulex Yang
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development