diff --git a/src/main/java/redis/clients/jedis/BinaryClient.java b/src/main/java/redis/clients/jedis/BinaryClient.java index 20add01..348160b 100644 --- a/src/main/java/redis/clients/jedis/BinaryClient.java +++ b/src/main/java/redis/clients/jedis/BinaryClient.java @@ -497,8 +497,8 @@ public class BinaryClient extends Connection { public void zcount(final byte[] key, final double min, final double max) { - byte byteArrayMin[] = (min == Double.MIN_VALUE) ? "-inf".getBytes() : toByteArray(min); - byte byteArrayMax[] = (max == Double.MAX_VALUE) ? "+inf".getBytes() : toByteArray(max); + byte byteArrayMin[] = (min == Double.NEGATIVE_INFINITY) ? "-inf".getBytes() : toByteArray(min); + byte byteArrayMax[] = (max == Double.POSITIVE_INFINITY) ? "+inf".getBytes() : toByteArray(max); sendCommand(ZCOUNT, key, byteArrayMin, byteArrayMax); } @@ -506,8 +506,8 @@ public class BinaryClient extends Connection { public void zrangeByScore(final byte[] key, final double min, final double max) { - byte byteArrayMin[] = (min == Double.MIN_VALUE) ? "-inf".getBytes() : toByteArray(min); - byte byteArrayMax[] = (max == Double.MAX_VALUE) ? "+inf".getBytes() : toByteArray(max); + byte byteArrayMin[] = (min == Double.NEGATIVE_INFINITY) ? "-inf".getBytes() : toByteArray(min); + byte byteArrayMax[] = (max == Double.POSITIVE_INFINITY) ? "+inf".getBytes() : toByteArray(max); sendCommand(ZRANGEBYSCORE, key, byteArrayMin, byteArrayMax); } @@ -515,8 +515,8 @@ public class BinaryClient extends Connection { public void zrevrangeByScore(final byte[] key, final double max, final double min) { - byte byteArrayMin[] = (min == Double.MIN_VALUE) ? "-inf".getBytes() : toByteArray(min); - byte byteArrayMax[] = (max == Double.MAX_VALUE) ? "+inf".getBytes() : toByteArray(max); + byte byteArrayMin[] = (min == Double.NEGATIVE_INFINITY) ? "-inf".getBytes() : toByteArray(min); + byte byteArrayMax[] = (max == Double.POSITIVE_INFINITY) ? "+inf".getBytes() : toByteArray(max); sendCommand(ZREVRANGEBYSCORE, key, byteArrayMax, byteArrayMin); } @@ -534,8 +534,8 @@ public class BinaryClient extends Connection { public void zrangeByScore(final byte[] key, final double min, final double max, final int offset, int count) { - byte byteArrayMin[] = (min == Double.MIN_VALUE) ? "-inf".getBytes() : toByteArray(min); - byte byteArrayMax[] = (max == Double.MAX_VALUE) ? "+inf".getBytes() : toByteArray(max); + byte byteArrayMin[] = (min == Double.NEGATIVE_INFINITY) ? "-inf".getBytes() : toByteArray(min); + byte byteArrayMax[] = (max == Double.POSITIVE_INFINITY) ? "+inf".getBytes() : toByteArray(max); sendCommand(ZRANGEBYSCORE, key, byteArrayMin, byteArrayMax, LIMIT.raw, toByteArray(offset), toByteArray(count)); @@ -544,8 +544,8 @@ public class BinaryClient extends Connection { public void zrevrangeByScore(final byte[] key, final double max, final double min, final int offset, int count) { - byte byteArrayMin[] = (min == Double.MIN_VALUE) ? "-inf".getBytes() : toByteArray(min); - byte byteArrayMax[] = (max == Double.MAX_VALUE) ? "+inf".getBytes() : toByteArray(max); + byte byteArrayMin[] = (min == Double.NEGATIVE_INFINITY) ? "-inf".getBytes() : toByteArray(min); + byte byteArrayMax[] = (max == Double.POSITIVE_INFINITY) ? "+inf".getBytes() : toByteArray(max); sendCommand(ZREVRANGEBYSCORE, key, byteArrayMax, byteArrayMin, LIMIT.raw, toByteArray(offset), toByteArray(count)); @@ -554,8 +554,8 @@ public class BinaryClient extends Connection { public void zrangeByScoreWithScores(final byte[] key, final double min, final double max) { - byte byteArrayMin[] = (min == Double.MIN_VALUE) ? "-inf".getBytes() : toByteArray(min); - byte byteArrayMax[] = (max == Double.MAX_VALUE) ? "+inf".getBytes() : toByteArray(max); + byte byteArrayMin[] = (min == Double.NEGATIVE_INFINITY) ? "-inf".getBytes() : toByteArray(min); + byte byteArrayMax[] = (max == Double.POSITIVE_INFINITY) ? "+inf".getBytes() : toByteArray(max); sendCommand(ZRANGEBYSCORE, key, byteArrayMin, byteArrayMax, WITHSCORES.raw); @@ -564,8 +564,8 @@ public class BinaryClient extends Connection { public void zrevrangeByScoreWithScores(final byte[] key, final double max, final double min) { - byte byteArrayMin[] = (min == Double.MIN_VALUE) ? "-inf".getBytes() : toByteArray(min); - byte byteArrayMax[] = (max == Double.MAX_VALUE) ? "+inf".getBytes() : toByteArray(max); + byte byteArrayMin[] = (min == Double.NEGATIVE_INFINITY) ? "-inf".getBytes() : toByteArray(min); + byte byteArrayMax[] = (max == Double.POSITIVE_INFINITY) ? "+inf".getBytes() : toByteArray(max); sendCommand(ZREVRANGEBYSCORE, key, byteArrayMax, byteArrayMin, WITHSCORES.raw); @@ -574,8 +574,8 @@ public class BinaryClient extends Connection { public void zrangeByScoreWithScores(final byte[] key, final double min, final double max, final int offset, final int count) { - byte byteArrayMin[] = (min == Double.MIN_VALUE) ? "-inf".getBytes() : toByteArray(min); - byte byteArrayMax[] = (max == Double.MAX_VALUE) ? "+inf".getBytes() : toByteArray(max); + byte byteArrayMin[] = (min == Double.NEGATIVE_INFINITY) ? "-inf".getBytes() : toByteArray(min); + byte byteArrayMax[] = (max == Double.POSITIVE_INFINITY) ? "+inf".getBytes() : toByteArray(max); sendCommand(ZRANGEBYSCORE, key, byteArrayMin, byteArrayMax, LIMIT.raw, toByteArray(offset), toByteArray(count), @@ -585,8 +585,8 @@ public class BinaryClient extends Connection { public void zrevrangeByScoreWithScores(final byte[] key, final double max, final double min, final int offset, final int count) { - byte byteArrayMin[] = (min == Double.MIN_VALUE) ? "-inf".getBytes() : toByteArray(min); - byte byteArrayMax[] = (max == Double.MAX_VALUE) ? "+inf".getBytes() : toByteArray(max); + byte byteArrayMin[] = (min == Double.NEGATIVE_INFINITY) ? "-inf".getBytes() : toByteArray(min); + byte byteArrayMax[] = (max == Double.POSITIVE_INFINITY) ? "+inf".getBytes() : toByteArray(max); sendCommand(ZREVRANGEBYSCORE, key, byteArrayMax, byteArrayMin, LIMIT.raw, toByteArray(offset), toByteArray(count),