You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Nathan Beyer (JIRA)" <ji...@apache.org> on 2006/07/06 05:36:30 UTC

[jira] Resolved: (HARMONY-106) java.text.DecimalFormat does not parse infinite values correctly

     [ http://issues.apache.org/jira/browse/HARMONY-106?page=all ]
     
Nathan Beyer resolved HARMONY-106:
----------------------------------

    Resolution: Fixed

Applied at r419424. Please check that it was applied as expected. Unfortunately, that test isn't being run because of other test failures at the moment.

> java.text.DecimalFormat does not parse infinite values correctly
> ----------------------------------------------------------------
>
>          Key: HARMONY-106
>          URL: http://issues.apache.org/jira/browse/HARMONY-106
>      Project: Harmony
>         Type: Bug

>     Reporter: Richard Liang
>     Assignee: Nathan Beyer
>  Attachments: text.src.diff
>
> In Java 1.4.2 Spec of java.text.DecimalFormat.parse(String, ParsePosition), it's said:
> Values that cannot fit into a Long are returned as Doubles. This includes values with a fractional part, infinite values, NaN, and the value -0.0.
> The test cases will fail if excuting under Harmony and pass on RI:
>     //  Test whether DecimalFormat can parse Positive infinity correctly
>     public void testParseInfinityBigDecimalFalse() {
>         DecimalFormat format = (DecimalFormat) DecimalFormat.getInstance();
>         DecimalFormatSymbols symbols = new DecimalFormatSymbols();
>         Number number = format.parse(symbols.getInfinity(), new ParsePosition(0));
>         assertTrue(number instanceof Double);
>         assertTrue(Double.isInfinite(number.doubleValue()));
>     }
>     // Test whether DecimalFormat can parse Negative infinity correctly
>     public void testParseMinusInfinityBigDecimalFalse() {
>         DecimalFormat format = (DecimalFormat) DecimalFormat.getInstance();
>         DecimalFormatSymbols symbols = new DecimalFormatSymbols();
>         Number number = format.parse("-" + symbols.getInfinity(),
>                 new ParsePosition(0));
>         assertTrue(number instanceof Double);
>         assertTrue(Double.isInfinite(number.doubleValue()));
>     }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira