-
Bug
-
Resolution: Fixed
-
P3
-
1.0.2, 1.1, 1.2.0
-
1.2
-
generic, sparc
-
generic, solaris_2.4
-
Not verified
JLS says explictitly in 20.10.16 that Double.valueOf(String) does not allow
a d, D, f or F appearing after the number in the string. However, this was
allowed in 1.0.2 and programmers may expect this to work by analogy with the
syntax of float/double literals in Java. Since there doesn't seem to be a
strong reason to break compatibility here, 1.1 beta-3 has been fixed to allow
this, and the spec now needs to be changed to say that any one of these four
letters appearing after the number is acceptable and is simply ignored.
(Float.valueOf() has the same issue in 20.9.17.)
a d, D, f or F appearing after the number in the string. However, this was
allowed in 1.0.2 and programmers may expect this to work by analogy with the
syntax of float/double literals in Java. Since there doesn't seem to be a
strong reason to break compatibility here, 1.1 beta-3 has been fixed to allow
this, and the spec now needs to be changed to say that any one of these four
letters appearing after the number is acceptable and is simply ignored.
(Float.valueOf() has the same issue in 20.9.17.)
- duplicates
-
JDK-4218649 Float.valueOf () parses "1.d" but not "1.d2"
-
- Closed
-
-
JDK-4015336 Method Double.valueOf(String s) doesnot throw NumberformatException for DigitStr
-
- Closed
-
- relates to
-
JDK-4023081 ambiguous Float(String s) constructor spec
-
- Closed
-