Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
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.