diff options
author | James Ahlborn <jtahlborn@yahoo.com> | 2015-01-31 19:41:54 +0000 |
---|---|---|
committer | James Ahlborn <jtahlborn@yahoo.com> | 2015-01-31 19:41:54 +0000 |
commit | 8189b45196a5ba92aa9d4888f4b469d48a66953a (patch) | |
tree | 0882c762f09289fbdacc6a90952b31a43450ed5b /src | |
parent | 95d0db424ea8dfb4cc00657cddb8bbf12fe1579d (diff) | |
download | jackcess-8189b45196a5ba92aa9d4888f4b469d48a66953a.tar.gz jackcess-8189b45196a5ba92aa9d4888f4b469d48a66953a.zip |
handle input String boolean values
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/trunk@911 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/healthmarketscience/jackcess/impl/ColumnImpl.java | 9 |
1 files 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<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()); } /** |