You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by dj...@apache.org on 2005/07/16 01:26:15 UTC
svn commit: r219260 -
/incubator/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/types/BigIntegerDecimal.java
Author: djd
Date: Fri Jul 15 16:26:12 2005
New Revision: 219260
URL: http://svn.apache.org/viewcvs?rev=219260&view=rev
Log:
DERBY-447 - merge 209845 from trunk. Fix getBoolean() on DECIMAL in JSR169.
Modified:
incubator/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/types/BigIntegerDecimal.java
Modified: incubator/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/types/BigIntegerDecimal.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/types/BigIntegerDecimal.java?rev=219260&r1=219259&r2=219260&view=diff
==============================================================================
--- incubator/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/types/BigIntegerDecimal.java (original)
+++ incubator/derby/code/branches/10.1/java/engine/org/apache/derby/iapi/types/BigIntegerDecimal.java Fri Jul 15 16:26:12 2005
@@ -98,6 +98,15 @@
return NumberDataType.normalizeDOUBLE(Double.parseDouble(getString()));
}
+ // 0 or null is false, all else is true
+ public boolean getBoolean()
+ {
+ if (isNull())
+ return false;
+
+ BigInteger bi = new BigInteger(data2c);
+ return bi.compareTo(java.math.BigInteger.ZERO) != 0;
+ }
/**
* Set the value from a String, the format is