Message1564
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 |
|
Date |
User |
Action |
Args |
2008-02-20 17:17:48 | admin | link | issue1708080 messages |
2008-02-20 17:17:48 | admin | create | |
|