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

        Hide
        George Harley added a comment -

        Verified by Paulex. Eclipse IDE metadata changed in relation to this.

        Show
        George Harley added a comment - Verified by Paulex. Eclipse IDE metadata changed in relation to this.
        Hide
        Paulex Yang added a comment -

        Looks fine, thank you, George.

        But there is an issue to run test within Eclipse. pls. see my reply to dev-list for details.

        Show
        Paulex Yang added a comment - Looks fine, thank you, George. But there is an issue to run test within Eclipse. pls. see my reply to dev-list for details.
        Hide
        George Harley added a comment -

        Hi Paulex,

        Changes committed in revision 395251. I made a couple of modifications to the supplied test case to enable it to load the .ser file from the system classloader. In addition I put the .ser into the modules/text/src/test/resources/serialization/java/text location and updated the build.xml with a new copy.test.resources target so that this .ser file (and eventually others like it) make it onto the runtime classpath.

        Please could you confirm if this version of your patch has been applied to your satisfaction.

        Thanks for this enhancement,
        George

        Show
        George Harley added a comment - Hi Paulex, Changes committed in revision 395251. I made a couple of modifications to the supplied test case to enable it to load the .ser file from the system classloader. In addition I put the .ser into the modules/text/src/test/resources/serialization/java/text location and updated the build.xml with a new copy.test.resources target so that this .ser file (and eventually others like it) make it onto the runtime classpath. Please could you confirm if this version of your patch has been applied to your satisfaction. Thanks for this enhancement, George
        Hide
        Paulex Yang added a comment -

        Pls. try this patch. thank you.

        Show
        Paulex Yang added a comment - Pls. try this patch. thank you.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development