NKC fix for int64

Change-Id: I60b3ec3f15921093b1fa11ac9fc157b7930f4e4d
Reviewed-on: https://asterix-gerrit.ics.uci.edu/329
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Ian Maxon <imaxon@apache.org>
Reviewed-by: Yingyi Bu <buyingyi@gmail.com>
diff --git a/hyracks/hyracks-dataflow-common/src/main/java/edu/uci/ics/hyracks/dataflow/common/data/normalizers/Integer64NormalizedKeyComputerFactory.java b/hyracks/hyracks-dataflow-common/src/main/java/edu/uci/ics/hyracks/dataflow/common/data/normalizers/Integer64NormalizedKeyComputerFactory.java
index bcff79f..1608327 100644
--- a/hyracks/hyracks-dataflow-common/src/main/java/edu/uci/ics/hyracks/dataflow/common/data/normalizers/Integer64NormalizedKeyComputerFactory.java
+++ b/hyracks/hyracks-dataflow-common/src/main/java/edu/uci/ics/hyracks/dataflow/common/data/normalizers/Integer64NormalizedKeyComputerFactory.java
@@ -34,7 +34,7 @@
             public int normalize(byte[] bytes, int start, int length) {
                 long value = LongPointable.getLong(bytes, start);
                 int highValue = (int) (value >> 32);
-                if (highValue > 0) {
+                if (value > Integer.MAX_VALUE) {
                     /**
                      * larger than Integer.MAX
                      */
@@ -42,7 +42,7 @@
                     highNmk >>= 2;
                     highNmk |= POSTIVE_LONG_MASK;
                     return highNmk;
-                } else if (highValue == 0) {
+                } else if (value >=0 && value <= Integer.MAX_VALUE) {
                     /**
                      * smaller than Integer.MAX but >=0
                      */