From 8189b45196a5ba92aa9d4888f4b469d48a66953a Mon Sep 17 00:00:00 2001 From: James Ahlborn Date: Sat, 31 Jan 2015 19:41:54 +0000 Subject: [PATCH] handle input String boolean values git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@911 f203690c-595d-4dc9-a70b-905162fa7fd2 --- .../healthmarketscience/jackcess/impl/ColumnImpl.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/ColumnImpl.java b/src/main/java/com/healthmarketscience/jackcess/impl/ColumnImpl.java index 2b05b83..0565caf 100644 --- a/src/main/java/com/healthmarketscience/jackcess/impl/ColumnImpl.java +++ b/src/main/java/com/healthmarketscience/jackcess/impl/ColumnImpl.java @@ -1418,7 +1418,7 @@ public class ColumnImpl implements Column, Comparable { { 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 { * @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()); } /** -- 2.39.5