diff --git a/redisson/src/main/java/org/redisson/RedissonObject.java b/redisson/src/main/java/org/redisson/RedissonObject.java index ea946a5d0..e237c5e40 100644 --- a/redisson/src/main/java/org/redisson/RedissonObject.java +++ b/redisson/src/main/java/org/redisson/RedissonObject.java @@ -629,7 +629,7 @@ public abstract class RedissonObject implements RObject { protected final void removeListeners() { for (Map.Entry> entry : listeners.entrySet()) { for (Integer id : entry.getValue()) { - removeListener(id, name); + removeListener(id, entry.getKey()); } } } @@ -653,7 +653,7 @@ public abstract class RedissonObject implements RObject { if (listener instanceof DeletedObjectListener) { return addListenerAsync("__keyevent@*:del", (DeletedObjectListener) listener, DeletedObjectListener::onDeleted); } - throw new IllegalArgumentException(); + throw new IllegalArgumentException("This type of listener can't be added to this object"); } @Override