Harmony
  1. Harmony
  2. HARMONY-205

java.text.DecimalFormat doesn't support BigDecimal and BigInteger parsing

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

      Description

      Java 5 enhances java.text.DecimalFormat to format and parse BigDecimal and BigInteger values without loss of precision. Parsing into BigDecimal needs to be enabled using the setParseBigDecimal method. Harmony doesn't provide this method, neither this feature.

      1. JIRA205-v2.zip
        18 kB
        Paulex Yang
      2. JIRA205_text.zip
        16 kB
        Paulex Yang

        Activity

        Hide
        George Harley added a comment -

        Verified by Paulex.

        Show
        George Harley added a comment - Verified by Paulex.
        Hide
        Paulex Yang added a comment -

        looks fine, thank you, George.

        Show
        Paulex Yang added a comment - looks fine, thank you, George.
        Hide
        George Harley added a comment -

        Hi Paulex,

        Anton has agreed to open HARMONY-333 to track the attributes problem. If you can verify for me that your patches were applied as you hoped then we can close out this issue.

        Thanks,
        George

        Show
        George Harley added a comment - Hi Paulex, Anton has agreed to open HARMONY-333 to track the attributes problem. If you can verify for me that your patches were applied as you hoped then we can close out this issue. Thanks, George
        Hide
        Anton Avtamonov added a comment -

        Hi George,

        Thank you for your check.
        My issue is tracked as HARMONY-333 now.

        Wishes,
        Anton.

        Show
        Anton Avtamonov added a comment - Hi George, Thank you for your check. My issue is tracked as HARMONY-333 now. Wishes, Anton.
        Hide
        George Harley added a comment -

        Hi Paulex,

        New changes committed in revision 393270.
        Thanks for these patches. Please could you check that they have been applied as expected.

        Hi Anton,

        With the latest changes to DecimalFormat in place the test case you supply does still fail. Would you be happy to raise that matter in a separate JIRA issue ?

        Best regards,
        George

        Show
        George Harley added a comment - Hi Paulex, New changes committed in revision 393270. Thanks for these patches. Please could you check that they have been applied as expected. Hi Anton, With the latest changes to DecimalFormat in place the test case you supply does still fail. Would you be happy to raise that matter in a separate JIRA issue ? Best regards, George
        Hide
        Paulex Yang added a comment -

        I've fixed two bugs, and run tests of all modules, it should be OK now. Besides the testcases and documents have been enriched. Pls. try it again, sorry for the inconvenience caused.

        Show
        Paulex Yang added a comment - I've fixed two bugs, and run tests of all modules, it should be OK now. Besides the testcases and documents have been enriched. Pls. try it again, sorry for the inconvenience caused.
        Hide
        Anton Avtamonov added a comment -

        Hi Paulex,

        I just found the issue with DecimalFormat/AttributedCharacterIterator which you can understand from the test below:

        public void testAttributedCharacterIterator() throws Exception

        { AttributedCharacterIterator iterator = new DecimalFormat().formatToCharacterIterator(new Integer(1)); assertFalse("attributes should exist", iterator.getAttributes().isEmpty()); }

        Is it covered by this or any other existing issues (like HARMONY-106)?
        Should I submit new issue?

        Show
        Anton Avtamonov added a comment - Hi Paulex, I just found the issue with DecimalFormat/AttributedCharacterIterator which you can understand from the test below: public void testAttributedCharacterIterator() throws Exception { AttributedCharacterIterator iterator = new DecimalFormat().formatToCharacterIterator(new Integer(1)); assertFalse("attributes should exist", iterator.getAttributes().isEmpty()); } Is it covered by this or any other existing issues (like HARMONY-106 )? Should I submit new issue?
        Hide
        George Harley added a comment -

        Hi Paulex,

        Despite not causing any failures in the text module tests, the changes to DecimalFormat has resulted in failures in the LUNI, SQL and security modules. I am backing out these changes until the cause has been fully investigated and fixed.

        One quick comment : in the failures for java.util.Date, the year part of a date was including a grouping separator so that, for example, the year "1970" was presented as "1,970".

        Best regards,
        George

        Show
        George Harley added a comment - Hi Paulex, Despite not causing any failures in the text module tests, the changes to DecimalFormat has resulted in failures in the LUNI, SQL and security modules. I am backing out these changes until the cause has been fully investigated and fixed. One quick comment : in the failures for java.util.Date, the year part of a date was including a grouping separator so that, for example, the year "1970" was presented as "1,970". Best regards, George
        Hide
        Paulex Yang added a comment -

        looks good, thank you, George.
        I'll raise JIRA for serialization completement later when if you don't mind. thank you for remind.

        Show
        Paulex Yang added a comment - looks good, thank you, George. I'll raise JIRA for serialization completement later when if you don't mind. thank you for remind.
        Hide
        George Harley added a comment -

        Hi Paulex,

        Enhancements applied in revision 393068. Everything builds alright and the supplied tests run sweetly against Harmony and the 5.0 RI (except where specified).

        Thanks for this patch, please could you check that it has been applied as expected.

        Do you want to raise the follow-on JIRA for implementing the serialization support methods or shall I ?

        Best regards,
        George

        Show
        George Harley added a comment - Hi Paulex, Enhancements applied in revision 393068. Everything builds alright and the supplied tests run sweetly against Harmony and the 5.0 RI (except where specified). Thanks for this patch, please could you check that it has been applied as expected. Do you want to raise the follow-on JIRA for implementing the serialization support methods or shall I ? Best regards, George
        Hide
        Paulex Yang added a comment -

        The wrapped DecimalFormat and test is attached. Pls. note that the serialization relevant methods read/writeObject has not been implemented yet, because it is a little complex so that I think it worths another JIRA if this one is accepted.

        Show
        Paulex Yang added a comment - The wrapped DecimalFormat and test is attached. Pls. note that the serialization relevant methods read/writeObject has not been implemented yet, because it is a little complex so that I think it worths another JIRA if this one is accepted.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development