Skip to content

Commit 7527913

Browse files
Fix broken id parsing for unsigned long value
1 parent 0d552ec commit 7527913

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

src/main/java/org/springframework/data/redis/connection/jedis/JedisClusterHashCommands.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ protected ScanIteration<Entry<byte[], byte[]>> doScan(CursorId cursorId, ScanOpt
280280
ScanParams params = JedisConverters.toScanParams(options);
281281

282282
ScanResult<Entry<byte[], byte[]>> result = connection.getCluster().hscan(key,
283-
JedisConverters.toBytes(Long.toUnsignedString(cursorId)),
283+
JedisConverters.toBytes(cursorId),
284284
params);
285285
return new ScanIteration<>(CursorId.of(result.getCursor()), result.getResult());
286286
}

src/main/java/org/springframework/data/redis/core/Cursor.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ public static CursorId of(long cursorId) {
121121
if (cursorId == 0) {
122122
return INITIAL;
123123
}
124-
125-
return of(Long.toString(cursorId));
124+
return of(Long.toUnsignedString(cursorId));
126125
}
127126

128127
/**

src/main/java/org/springframework/data/redis/core/ScanCursor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public CursorId getId() {
234234

235235
@Override
236236
public long getCursorId() {
237-
return Long.parseLong(getId().getCursorId());
237+
return Long.parseUnsignedLong(getId().getCursorId());
238238
}
239239

240240
@Override

0 commit comments

Comments
 (0)