Hi,
I have a Spring Boot Project running on Java 16 and using Jedis 2.8.0 (redis.clients:jedis:2.8.0).
Jedis scan method throws java.lang.IndexOutOfBoundsException when I scan using a pattern.
Below is the code snippet:
Jedis jedis = new Jedis();
String key ="My Search String"
String cursor = "0";
ScanParams sp = new ScanParams();
sp.match("*" + key + "*");
sp.count(1000);
do {
ScanResult<String> ret = jedis.scan(cursor, sp);
.............More Logic .......................................
} while (!cursor.equals("0"));
Below is the error stack:
java.lang.IndexOutOfBoundsException: Index 1 out of bounds for length 1
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64) ~[na:na]
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70) ~[na:na]
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266) ~[na:na]
at java.base/java.util.Objects.checkIndex(Objects.java:359) ~[na:na]
at java.base/java.util.ArrayList.get(ArrayList.java:427) ~[na:na]
at redis.clients.jedis.Jedis.scan(Jedis.java:3137) ~[jedis-2.8.0.jar:na]
The solution was working fine.
I hope someone can help me .
Thank you.