db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brendan Miller" <bmil...@dotster.com>
Subject BigDecimal(Double.doubleValue()) patch for Village
Date Mon, 26 Nov 2007 16:49:41 GMT

I don't know about anyone else, but the Village trunk does not compile
here.  You cannot instantiate a BigDecimal from a Double directly.

A small contribution, I know, but I am trying to resolve the Village/Oracle DATE 
issues I brought up last week on torque-user myself.

Here is the patch:

Index: src/java/com/workingdogs/village/Value.java
===================================================================
--- src/java/com/workingdogs/village/Value.java (revision 598338)
+++ src/java/com/workingdogs/village/Value.java (working copy)
@@ -383,7 +383,7 @@
                 return (BigDecimal) valueObject;
             }
             else if ( isDouble() ) {
-                return new BigDecimal((Double) valueObject );
+                return new BigDecimal(((Double) valueObject).doubleValue());
             }
             else if ( isFloat() ) 
             {
@@ -428,7 +428,7 @@
             }
             else if ( isDouble() )
             {
-                return new BigDecimal((Double) valueObject ).setScale(scale);
+                return new BigDecimal(((Double) valueObject).doubleValue()).setScale(scale);
             } 
             else if ( isFloat() ) 
             {


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