db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thoralf Rickert" <thoralf.rick...@cadooz.de>
Subject AW: [village] Value.asDouble uses Integer.valueOf to parse strings
Date Wed, 19 Apr 2006 12:49:12 GMT
Hmm, yes, I think so.

It should be "return Double.valueOf((String)valueObject).doubleValue()"

But I'm not sure, what happens with the conversion of NaN in a primitive double value...

T.

> -----Urspr√ľngliche Nachricht-----
> Von: Jonathan Purvis [mailto:jon@reeltwo.com] 
> Gesendet: Mittwoch, 19. April 2006 06:32
> An: torque-dev@db.apache.org
> Betreff: [village] Value.asDouble uses Integer.valueOf to 
> parse strings
> 
> 
> I got this exception from Village:
> 
> Caused by: com.workingdogs.village.DataSetException: Bad conversion:
> java.lang.NumberFormatException: For input string: "NaN"
> 	at com.workingdogs.village.Value.asDouble(Value.java:1046)
> 
> It didn't make any sense to me, so i looked at the source 
> code and the Value.asDouble method really does say:
>             else if (isString())
>             {
>                 return Integer.valueOf((String) 
> valueObject).doubleValue();
>             }
> 
> (As found at
> <http://svn.softwareforge.de/svn/opensource/village/trunk/src/
java/com/workingdogs/village/Value.java>)

Is there a reason for this or is it just a copy'n'paste bug?


Regards,

       Jon



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message