The valueOf methods in Float and Double convert (essentially) strings of floating-point literals into floating-point values. The set of accepted strings does *not* include simple integer strings like "45". However, in clear violation of the specification, the current implementation accepts such strings instead of throwing a NumberFormatException.
- duplicates
-
JDK-4096613 Float and Double.valueOf(String) don't throw NumberFormatException.
-
- Closed
-
- relates to
-
JDK-4705734 {Float, Double}.valueOf use broken test for whitespace characters
-
- Resolved
-