From a64e161428031f289d88796bd72917e5d66efa37 Mon Sep 17 00:00:00 2001 From: zhangshuai Date: Fri, 12 Jul 2024 15:49:09 +0800 Subject: [PATCH] Modify the judgment that reads a response as empty to isEmpty method. --- src/main/java/redis/clients/jedis/util/RedisInputStream.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/redis/clients/jedis/util/RedisInputStream.java b/src/main/java/redis/clients/jedis/util/RedisInputStream.java index a0dad9d437..f7e320f164 100644 --- a/src/main/java/redis/clients/jedis/util/RedisInputStream.java +++ b/src/main/java/redis/clients/jedis/util/RedisInputStream.java @@ -14,6 +14,7 @@ import java.io.IOException; import java.io.InputStream; import java.math.BigInteger; + import redis.clients.jedis.exceptions.JedisConnectionException; /** @@ -84,7 +85,7 @@ public String readLine() { } final String reply = sb.toString(); - if (reply.length() == 0) { + if (reply.isEmpty()) { throw new JedisConnectionException("It seems like server has closed the connection."); }