From 081fbd17218968b991714706fb87ab3bfc7c724f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cyanguanghui=E2=80=9D?= Date: Mon, 22 May 2023 23:05:04 +0800 Subject: [PATCH] fix(Rhea): compatible a bug in jdk 11,more info about bug view issue #990. --- .../alipay/sofa/jraft/rhea/client/DefaultRheaIterator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jraft-rheakv/rheakv-core/src/main/java/com/alipay/sofa/jraft/rhea/client/DefaultRheaIterator.java b/jraft-rheakv/rheakv-core/src/main/java/com/alipay/sofa/jraft/rhea/client/DefaultRheaIterator.java index e2b3b4644..95407cf7c 100644 --- a/jraft-rheakv/rheakv-core/src/main/java/com/alipay/sofa/jraft/rhea/client/DefaultRheaIterator.java +++ b/jraft-rheakv/rheakv-core/src/main/java/com/alipay/sofa/jraft/rhea/client/DefaultRheaIterator.java @@ -26,7 +26,6 @@ import com.alipay.sofa.jraft.util.BytesUtil; /** - * * @author jiachun.fjc */ public class DefaultRheaIterator implements RheaIterator { @@ -58,7 +57,8 @@ public DefaultRheaIterator(DefaultRheaKVStore rheaKVStore, byte[] startKey, byte @Override public synchronized boolean hasNext() { if (this.buf.isEmpty()) { - while (this.endKey == null || BytesUtil.compare(this.cursorKey, this.endKey) < 0) { + while (this.endKey == null || (cursorKey != null //fix issue 990 + && BytesUtil.compare(this.cursorKey, this.endKey) < 0)) { final List kvEntries = this.rheaKVStore.singleRegionScan(this.cursorKey, this.endKey, this.bufSize, this.readOnlySafe, this.returnValue); if (kvEntries.isEmpty()) {