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

        Paulex Yang created issue -
        Hide
        Paulex Yang added a comment -

        Pls. try this patch. thank you.

        Show
        Paulex Yang added a comment - Pls. try this patch. thank you.
        Paulex Yang made changes -
        Field Original Value New Value
        Attachment 02.JIRA349_text.zip [ 12325485 ]
        George Harley made changes -
        Assignee George Harley [ georgeharley ]
        George Harley made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        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
        George Harley made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        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 -

        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.
        George Harley made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        5d 42m 1 George Harley 19/Apr/06 20:36
        In Progress In Progress Resolved Resolved
        2h 5m 1 George Harley 19/Apr/06 22:42
        Resolved Resolved Closed Closed
        21h 54m 1 George Harley 20/Apr/06 20:37

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development