Harmony
  1. Harmony
  2. HARMONY-346

java.text.DecimalFormat serialization is to be implemented

    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:
      Moderate

      Description

      Java 5 spec redefins DecimalFormat serialization form, meanwhile DecimalFormat wraps ICU now. So the serialization related methods readObject/writeObject needs to be reimplemented. I'll attach the testcase and related resource.

      1. 01.JIRA346-v2.sh
        0.5 kB
        Paulex Yang
      2. 02.JIRA346-v2.diff
        49 kB
        Paulex Yang
      3. DecimalFormat-v2.ser
        1 kB
        Paulex Yang
      4. 01.JIRA346.sh
        0.5 kB
        Paulex Yang
      5. 02.JIRA346.diff
        100 kB
        Paulex Yang
      6. DecimalFormat.ser
        1 kB
        Paulex Yang

        Activity

        Hide
        Paulex Yang added a comment -

        Here goes the testcase to reproduce the bug:

        public void test_serialization() {
        DecimalFormat decimalFormat = new DecimalFormat();

        try

        { // serialize ByteArrayOutputStream byteOStream = new ByteArrayOutputStream(); ObjectOutputStream objectOStream = new ObjectOutputStream( byteOStream); objectOStream.writeObject(decimalFormat); // and deserialize ObjectInputStream objectIStream = new ObjectInputStream( new ByteArrayInputStream(byteOStream.toByteArray())); objectIStream .readObject(); }

        catch (Exception e1)

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

        }

        RI: pass, Harmony, NotYetImplementedException thrown

        Show
        Paulex Yang added a comment - Here goes the testcase to reproduce the bug: public void test_serialization() { DecimalFormat decimalFormat = new DecimalFormat(); try { // serialize ByteArrayOutputStream byteOStream = new ByteArrayOutputStream(); ObjectOutputStream objectOStream = new ObjectOutputStream( byteOStream); objectOStream.writeObject(decimalFormat); // and deserialize ObjectInputStream objectIStream = new ObjectInputStream( new ByteArrayInputStream(byteOStream.toByteArray())); objectIStream .readObject(); } catch (Exception e1) { fail("Errors occur during serialization"); } } RI: pass, Harmony, NotYetImplementedException thrown
        Hide
        Paulex Yang added a comment -

        These files include implementation and test of serialization for DecimalFormat. thx.

        Show
        Paulex Yang added a comment - These files include implementation and test of serialization for DecimalFormat. thx.
        Hide
        George Harley added a comment -

        Hi Paulex,

        There have been a couple of big changes in the text test code since you supplied your attachments and they are making it very hard/impossible to easily apply the patch to DecimalFormatTest.java (the other parts of the patch go on fine).

        Please could you supply a refresh of the patch just for the DecimalFormatTest.java file ?

        Best regards,
        George

        Show
        George Harley added a comment - Hi Paulex, There have been a couple of big changes in the text test code since you supplied your attachments and they are making it very hard/impossible to easily apply the patch to DecimalFormatTest.java (the other parts of the patch go on fine). Please could you supply a refresh of the patch just for the DecimalFormatTest.java file ? Best regards, George
        Hide
        Paulex Yang added a comment -

        George, here goes the modified patch.

        I noticed the merged testcase from original tests.api.java.text.DecimalFormat still fail on RI or Harmony(they are exclued before), I'll investigate later on these failures.

        Show
        Paulex Yang added a comment - George, here goes the modified patch. I noticed the merged testcase from original tests.api.java.text.DecimalFormat still fail on RI or Harmony(they are exclued before), I'll investigate later on these failures.
        Hide
        George Harley added a comment -

        Hi Paulex,

        Thank you for the refresh of your patches which have been committed in revsion 404992. Please could you check that they were applied as you expected.

        Thank you for this enhancement.

        Best regards,
        George

        Show
        George Harley added a comment - Hi Paulex, Thank you for the refresh of your patches which have been committed in revsion 404992. Please could you check that they were applied as you expected. Thank you for this enhancement. Best regards, George
        Hide
        George Harley added a comment -

        Forgot to respond to your comment about the continuing number of failures in DecimalFormatTest. Yes, I see these too but committed your changes on the basis that they do not appear to influence the existing problems and your new tests pass OK.

        Best regards,
        George

        Show
        George Harley added a comment - Forgot to respond to your comment about the continuing number of failures in DecimalFormatTest. Yes, I see these too but committed your changes on the basis that they do not appear to influence the existing problems and your new tests pass OK. Best regards, George
        Hide
        Paulex Yang added a comment -

        The new revision looks fine, thank you, George. And I agree with you about the failed tests.

        Show
        Paulex Yang added a comment - The new revision looks fine, thank you, George. And I agree with you about the failed tests.
        Hide
        George Harley added a comment -

        Verified by Paulex.

        Show
        George Harley added a comment - Verified by Paulex.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development