diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java index 2b408a72456..d7367ad99c8 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestSeekOptimizations.java @@ -218,10 +218,10 @@ public class TestSeekOptimizations { scan.withStartRow(rowBytes(startRow)); // Adjust for the fact that for multi-row queries the end row is exclusive. - { - final byte[] scannerStopRow = - rowBytes(endRow + (startRow != endRow ? 1 : 0)); - scan.withStopRow(scannerStopRow); + if (startRow != endRow) { + scan.withStopRow(rowBytes(endRow + 1)); + } else { + scan.withStopRow(rowBytes(endRow), true); } final long initialSeekCount = StoreFileScanner.getSeekCount();