harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard Liang (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-106) java.text.DecimalFormat does not parse infinite values correctly
Date Thu, 06 Jul 2006 05:57:30 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-106?page=comments#action_12419410 ] 

Richard Liang commented on HARMONY-106:
---------------------------------------

Hello Nathan,

The fix looks good. Thanks a lot.

Richard

> 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


Mime
View raw message