harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Hindess (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HARMONY-489) new Double("1E+-20") should throw exception but doesn't
Date Mon, 22 May 2006 18:58:30 GMT
     [ http://issues.apache.org/jira/browse/HARMONY-489?page=all ]

Mark Hindess updated HARMONY-489:
---------------------------------

    Attachment: double.parse.problem.diff

Patch with test and fix.


> new Double("1E+-20") should throw exception but doesn't
> -------------------------------------------------------
>
>          Key: HARMONY-489
>          URL: http://issues.apache.org/jira/browse/HARMONY-489
>      Project: Harmony
>         Type: Bug

>   Components: Classlib
>     Reporter: Mark Hindess
>     Priority: Minor
>  Attachments: double.parse.problem.diff
>
> The statement "new Double("1E+-20");" should throw a NumberFormatException, but the parser
contains a special case which causes it to skip the '+' and then accept the valid string '-20'.
 Unfortunately removing the special case wouldn't help because '1E+20' is valid but '+20'
fails parseInt.  Therefore I think another check is required to prevent the '-' being accepted.
> I also note that the RI throws NumberFormatException containing the original string where
as Harmony would propogate the exception thrown by parseInt which would contain the exponent
substring only.  I'll also correct this in my patch.

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