diff --git a/gradle.properties b/gradle.properties index f2e892a26..66da45e04 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ log4jVersion = 1.2.16 slf4jVersion = 1.6.4 # Common libraries -springVersion = 3.1.0.RELEASE +springVersion = 3.1.1.RELEASE jacksonVersion = 1.8.6 # Testing @@ -13,7 +13,7 @@ junitVersion = 4.8.1 mockitoVersion = 1.8.5 # Drivers -jedisVersion = 2.0.0 +jedisVersion = 2.1.0 jredisVersion = 03122010 rjcVersion= 0.6.4 @@ -21,7 +21,7 @@ rjcVersion= 0.6.4 ## OSGi ranges spring.range = "[3.1.0, 4.0.0)" -jedis.range = "[2.0.0, 2.0.0]" +jedis.range = "[2.1.0, 2.1.0]" jackson.range = "[1.6, 2.0.0)" rjc.range = "[0.6.4, 0.6.4]" diff --git a/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnection.java b/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnection.java index bd764940b..ccd926bcd 100644 --- a/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnection.java +++ b/src/main/java/org/springframework/data/redis/connection/jedis/JedisConnection.java @@ -1021,7 +1021,14 @@ public class JedisConnection implements RedisConnection { if (isPipelined()) { throw new UnsupportedOperationException(); } - return (jedis.getbit(key, offset) == 0 ? Boolean.FALSE : Boolean.TRUE); + // compatibility check for Jedis 2.0.0 + Object getBit = jedis.getbit(key, offset); + // Jedis 2.0 + if (getBit instanceof Long) { + return (((Long)getBit) == 0 ? Boolean.FALSE : Boolean.TRUE); + } + // Jedis 2.1 + return ((Boolean) getBit); } catch (Exception ex) { throw convertJedisAccessException(ex); } @@ -1846,7 +1853,7 @@ public class JedisConnection implements RedisConnection { if (isPipelined()) { throw new UnsupportedOperationException(); } - throw new UnsupportedOperationException(); + return jedis.zrevrangeByScore(key, max, min, (int) offset, (int) count); } catch (Exception ex) { throw convertJedisAccessException(ex); } @@ -1861,7 +1868,7 @@ public class JedisConnection implements RedisConnection { if (isPipelined()) { throw new UnsupportedOperationException(); } - throw new UnsupportedOperationException(); + return jedis.zrevrangeByScore(key, max, min); } catch (Exception ex) { throw convertJedisAccessException(ex); } @@ -1876,7 +1883,8 @@ public class JedisConnection implements RedisConnection { if (isPipelined()) { throw new UnsupportedOperationException(); } - throw new UnsupportedOperationException(); + return JedisUtils.convertJedisTuple(jedis.zrevrangeByScoreWithScores(key, max, min, (int) offset, + (int) count)); } catch (Exception ex) { throw convertJedisAccessException(ex); } @@ -1891,7 +1899,7 @@ public class JedisConnection implements RedisConnection { if (isPipelined()) { throw new UnsupportedOperationException(); } - throw new UnsupportedOperationException(); + return JedisUtils.convertJedisTuple(jedis.zrevrangeByScoreWithScores(key, max, min)); } catch (Exception ex) { throw convertJedisAccessException(ex); }