]> source.dussan.org Git - jackcess.git/commitdiff
handle input String boolean values
authorJames Ahlborn <jtahlborn@yahoo.com>
Sat, 31 Jan 2015 19:41:54 +0000 (19:41 +0000)
committerJames Ahlborn <jtahlborn@yahoo.com>
Sat, 31 Jan 2015 19:41:54 +0000 (19:41 +0000)
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@911 f203690c-595d-4dc9-a70b-905162fa7fd2

src/main/java/com/healthmarketscience/jackcess/impl/ColumnImpl.java

index 2b05b83b1278113e8449903659090063ad792860..0565cafe8779f8140b06379ee87ec27be373e493 100644 (file)
@@ -1418,7 +1418,7 @@ public class ColumnImpl implements Column, Comparable<ColumnImpl> {
   {
     if(value == null) {
       return BigDecimal.ZERO;
-    } if(value instanceof Number) {
+    } else if(value instanceof Number) {
       return (Number)value;
     }
     return Double.valueOf(value.toString());
@@ -1501,7 +1501,12 @@ public class ColumnImpl implements Column, Comparable<ColumnImpl> {
    * @usage _advanced_method_
    */
   public static boolean toBooleanValue(Object obj) {
-    return ((obj != null) && ((Boolean)obj).booleanValue());
+    if(obj == null) {
+      return false;
+    } else if(obj instanceof Boolean) {
+      return ((Boolean)obj).booleanValue();
+    }
+    return Boolean.parseBoolean(obj.toString());
   }
   
   /**