Message1564

Author pekka.klarck
Recipients
Date 2007-05-10.00:02:13
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
The reason for this odd behavior is that when float is created from a string java.lang.Double.valueOf is used and it allows so called format specifiers ("d" or "D" for double and "f" or "F" for float) at the end of the value. For more details see http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Double.html#valueOf(java.lang.String)

Attached patch simply throws a NumberFormatException if the string value ends with "d" or "f" (case insensitive) before even calling Double.valueOf (which will throw same exception for otherwise invalid strings). Formats like "1e5" are not affected by the change so unless there are some weird, but valid, float formats that end with "d" or "f" this fix ought to be ok. 
File Added: float.patch
History
Date User Action Args
2008-02-20 17:17:48adminlinkissue1708080 messages
2008-02-20 17:17:48admincreate