From 9793ce2c5642e0d17abb157acb3b722976577c6b Mon Sep 17 00:00:00 2001 From: Rui Gu Date: Fri, 20 May 2016 14:03:48 +0100 Subject: [PATCH] Fixed ClassCastException thrown from SortedSet add method --- src/main/java/org/redisson/RedissonList.java | 4 ++-- src/main/java/org/redisson/client/protocol/RedisCommands.java | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/redisson/RedissonList.java b/src/main/java/org/redisson/RedissonList.java index 5678e9d98..e8e46c490 100644 --- a/src/main/java/org/redisson/RedissonList.java +++ b/src/main/java/org/redisson/RedissonList.java @@ -568,12 +568,12 @@ public class RedissonList extends RedissonExpirable implements RList { @Override public Future addAfterAsync(V elementToFind, V element) { - return commandExecutor.writeAsync(getName(), codec, RedisCommands.LINSERT, getName(), "AFTER", elementToFind, element); + return commandExecutor.writeAsync(getName(), codec, RedisCommands.LINSERT_INT, getName(), "AFTER", elementToFind, element); } @Override public Future addBeforeAsync(V elementToFind, V element) { - return commandExecutor.writeAsync(getName(), codec, RedisCommands.LINSERT, getName(), "BEFORE", elementToFind, element); + return commandExecutor.writeAsync(getName(), codec, RedisCommands.LINSERT_INT, getName(), "BEFORE", elementToFind, element); } @Override diff --git a/src/main/java/org/redisson/client/protocol/RedisCommands.java b/src/main/java/org/redisson/client/protocol/RedisCommands.java index edd4b8424..d6252e221 100644 --- a/src/main/java/org/redisson/client/protocol/RedisCommands.java +++ b/src/main/java/org/redisson/client/protocol/RedisCommands.java @@ -143,7 +143,8 @@ public interface RedisCommands { RedisCommand LREM_SINGLE = new RedisCommand("LREM", new BooleanReplayConvertor(), 3); RedisStrictCommand LREM = new RedisStrictCommand("LREM", 3); RedisCommand LINDEX = new RedisCommand("LINDEX"); - RedisCommand LINSERT = new RedisCommand("LINSERT", new IntegerReplayConvertor(), 3, ValueType.OBJECTS); + RedisCommand LINSERT = new RedisCommand("LINSERT", 3, ValueType.OBJECTS); + RedisCommand LINSERT_INT = new RedisCommand("LINSERT", new IntegerReplayConvertor(), 3, ValueType.OBJECTS); RedisStrictCommand LLEN_INT = new RedisStrictCommand("LLEN", new IntegerReplayConvertor()); RedisStrictCommand LLEN = new RedisStrictCommand("LLEN"); RedisStrictCommand LTRIM = new RedisStrictCommand("LTRIM", new VoidReplayConvertor());