diff --git a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java index 12aaa67ca6f..e63c0db5b2d 100644 --- a/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java +++ b/hbase-common/src/main/java/org/apache/hadoop/hbase/util/Bytes.java @@ -2068,7 +2068,7 @@ public class Bytes implements Comparable { int high = arr.length - 1; KeyValue.KeyOnlyKeyValue r = new KeyValue.KeyOnlyKeyValue(); while (low <= high) { - int mid = (low+high) >>> 1; + int mid = low + ((high - low) >> 1); // we have to compare in this order, because the comparator order // has special logic when the 'left side' is a special key. r.setKey(arr[mid], 0, arr[mid].length);