commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rand McNeely" <>
Subject [lang]
Date Tue, 02 Jul 2002 03:16:00 GMT

One of the tests is actually failing (createNumber(String) 3) on JDK
1.4.  If I am understanding the intentions of createNumber, it should
return a Double when passed "1234.5D" but it is returning a Float.  It
looks like Float.valueOf(String) is not throwing a NumberFormatException
for "1234.5D" as you would expect (Long.valueOf(String) will throw an
exception for "12345L") - a small inconsistency in the JDK.

Should we modify the logic to first check for F's or D's before the
indiscriminately calling createFloat and createDouble?


View raw message