harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paulex Yang (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-106) java.text.DecimalFormat does not parse infinite values correctly
Date Mon, 10 Apr 2006 09:24:58 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-106?page=comments#action_12373828 ] 

Paulex Yang commented on HARMONY-106:
-------------------------------------

This bug should has been fixed by JIRA-205's patch, because the DecimalFormat is rewritten
by wrapping ICU4J . So I suggest to mark this test as "resolved".

> 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

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


Mime
View raw message