aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2016-12-24 16:26:10 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2016-12-24 16:26:10 +0000
commit1260b3bff1855161ec5f129695cb690356d72ca8 (patch)
tree7c4c884a280ddb5db3fd504cf94e412141aa6f16
parent955e2d2a825aabc06e2e1f8abd391b1839467442 (diff)
downloadjackcess-1260b3bff1855161ec5f129695cb690356d72ca8.tar.gz
jackcess-1260b3bff1855161ec5f129695cb690356d72ca8.zip
use isNull
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/exprs@1075 f203690c-595d-4dc9-a70b-905162fa7fd2
-rw-r--r--src/main/java/com/healthmarketscience/jackcess/impl/expr/BuiltinOperators.java7
-rw-r--r--src/main/java/com/healthmarketscience/jackcess/impl/expr/Expressionator.java4
2 files changed, 7 insertions, 4 deletions
diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/BuiltinOperators.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/BuiltinOperators.java
index 322fb7e..c295208 100644
--- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/BuiltinOperators.java
+++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/BuiltinOperators.java
@@ -36,6 +36,9 @@ public class BuiltinOperators
private static final String DIV_BY_ZERO = "/ by zero";
public static final Value NULL_VAL = new BaseValue() {
+ @Override public boolean isNull() {
+ return true;
+ }
public Type getType() {
return Type.NULL;
}
@@ -488,11 +491,11 @@ public class BuiltinOperators
}
public static Value isNull(Value param1) {
- return toValue(param1.getType() == Value.Type.NULL);
+ return toValue(param1.isNull());
}
public static Value isNotNull(Value param1) {
- return toValue(param1.getType() == Value.Type.NULL);
+ return toValue(!param1.isNull());
}
public static Value like(Value param1, Pattern pattern) {
diff --git a/src/main/java/com/healthmarketscience/jackcess/impl/expr/Expressionator.java b/src/main/java/com/healthmarketscience/jackcess/impl/expr/Expressionator.java
index d1d5968..5a9686f 100644
--- a/src/main/java/com/healthmarketscience/jackcess/impl/expr/Expressionator.java
+++ b/src/main/java/com/healthmarketscience/jackcess/impl/expr/Expressionator.java
@@ -1319,7 +1319,7 @@ public class Expressionator
public Object evalDefault() {
Value val = eval(null);
- if(val.getType() == Value.Type.NULL) {
+ if(val.isNull()) {
return null;
}
@@ -1331,7 +1331,7 @@ public class Expressionator
public Boolean evalCondition(RowContext ctx) {
Value val = eval(ctx);
- if(val.getType() == Value.Type.NULL) {
+ if(val.isNull()) {
return null;
}