Repository: atlas
Updated Branches:
  refs/heads/branch-0.8 44b3949b6 -> 92b4216a9


ATLAS-2184: fixed isNull/notNull in-memory predicates to handle empty value

Signed-off-by: Madhan Neethiraj <[email protected]>
(cherry picked from commit dd7eb14e47ae999464a4ab07d4e62be6f634e5ae)


Project: http://git-wip-us.apache.org/repos/asf/atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/atlas/commit/92b4216a
Tree: http://git-wip-us.apache.org/repos/asf/atlas/tree/92b4216a
Diff: http://git-wip-us.apache.org/repos/asf/atlas/diff/92b4216a

Branch: refs/heads/branch-0.8
Commit: 92b4216a9ea0c278a77cdfc0889a81ec8562b970
Parents: 44b3949
Author: apoorvnaik <[email protected]>
Authored: Tue Oct 3 14:40:13 2017 -0700
Committer: Madhan Neethiraj <[email protected]>
Committed: Tue Oct 3 15:03:02 2017 -0700

----------------------------------------------------------------------
 .../apache/atlas/discovery/SearchProcessor.java   | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/atlas/blob/92b4216a/repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java
----------------------------------------------------------------------
diff --git 
a/repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java 
b/repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java
index ba0cd8a..019fd17 100644
--- a/repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java
+++ b/repository/src/main/java/org/apache/atlas/discovery/SearchProcessor.java
@@ -467,40 +467,40 @@ public abstract class SearchProcessor {
                     break;
                 case AtlasBaseTypeDef.ATLAS_TYPE_SHORT:
                     attrClass = Short.class;
-                    attrValue = attrVal == null ? null : 
Short.parseShort(attrVal);
+                    attrValue = StringUtils.isEmpty(attrVal) ? null : 
Short.parseShort(attrVal);
                     break;
                 case AtlasBaseTypeDef.ATLAS_TYPE_INT:
                     attrClass = Integer.class;
-                    attrValue = attrVal == null ? null : 
Integer.parseInt(attrVal);
+                    attrValue = StringUtils.isEmpty(attrVal) ? null : 
Integer.parseInt(attrVal);
                     break;
                 case AtlasBaseTypeDef.ATLAS_TYPE_BIGINTEGER:
                     attrClass = BigInteger.class;
-                    attrValue = attrVal == null ? null : new 
BigInteger(attrVal);
+                    attrValue = StringUtils.isEmpty(attrVal) ? null : new 
BigInteger(attrVal);
                     break;
                 case AtlasBaseTypeDef.ATLAS_TYPE_BOOLEAN:
                     attrClass = Boolean.class;
-                    attrValue = attrVal == null ? null : 
Boolean.parseBoolean(attrVal);
+                    attrValue = StringUtils.isEmpty(attrVal) ? null : 
Boolean.parseBoolean(attrVal);
                     break;
                 case AtlasBaseTypeDef.ATLAS_TYPE_BYTE:
                     attrClass = Byte.class;
-                    attrValue = attrVal == null ? null : 
Byte.parseByte(attrVal);
+                    attrValue = StringUtils.isEmpty(attrVal) ? null : 
Byte.parseByte(attrVal);
                     break;
                 case AtlasBaseTypeDef.ATLAS_TYPE_LONG:
                 case AtlasBaseTypeDef.ATLAS_TYPE_DATE:
                     attrClass = Long.class;
-                    attrValue = attrVal == null ? null : 
Long.parseLong(attrVal);
+                    attrValue = StringUtils.isEmpty(attrVal) ? null : 
Long.parseLong(attrVal);
                     break;
                 case AtlasBaseTypeDef.ATLAS_TYPE_FLOAT:
                     attrClass = Float.class;
-                    attrValue = attrVal == null ? null : 
Float.parseFloat(attrVal);
+                    attrValue = StringUtils.isEmpty(attrVal) ? null : 
Float.parseFloat(attrVal);
                     break;
                 case AtlasBaseTypeDef.ATLAS_TYPE_DOUBLE:
                     attrClass = Double.class;
-                    attrValue = attrVal == null ? null : 
Double.parseDouble(attrVal);
+                    attrValue = StringUtils.isEmpty(attrVal) ? null : 
Double.parseDouble(attrVal);
                     break;
                 case AtlasBaseTypeDef.ATLAS_TYPE_BIGDECIMAL:
                     attrClass = BigDecimal.class;
-                    attrValue = attrVal == null ? null : new 
BigDecimal(attrVal);
+                    attrValue = StringUtils.isEmpty(attrVal) ? null : new 
BigDecimal(attrVal);
                     break;
                 default:
                     if (attrType instanceof AtlasEnumType) {

Reply via email to