commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <>
Subject Re: [lang]
Date Tue, 02 Jul 2002 19:26:08 GMT
Yes, it looks like the intention of the code is to return the correct type,
and thus it should treat the letters f, d, l as more important than trusting
the java methods. Both cases should be handled. Both should drop back to
BigDeciomal/BigInteger as appropriate.

Can you fix the class, expanding on the javadoc to explain how it works? I'd
rather hold off on the test just until it runs without errors ;-)


----- Original Message -----
From: "Rand McNeely" <>
To: "'Jakarta Commons Developers List'" <>
Sent: Tuesday, July 02, 2002 4:16 AM
Subject: [lang]

> 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?
> Rand


> --
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message