Fixed - RTopicAsync.addListenerAsync() method uses wrong generic pattern for MessageListener object.

pull/3899/head^2
Nikita Koksharov 2 years ago
parent 718c31d0ef
commit a737053942

@ -106,7 +106,7 @@ public class RedissonTopic implements RTopic {
@Override
public <M> int addListener(Class<M> type, MessageListener<? extends M> listener) {
RFuture<Integer> future = addListenerAsync(type, (MessageListener<M>) listener);
RFuture<Integer> future = addListenerAsync(type, listener);
return commandExecutor.get(future.toCompletableFuture());
}
@ -117,8 +117,8 @@ public class RedissonTopic implements RTopic {
}
@Override
public <M> RFuture<Integer> addListenerAsync(Class<M> type, MessageListener<M> listener) {
PubSubMessageListener<M> pubSubListener = new PubSubMessageListener<>(type, listener, name);
public <M> RFuture<Integer> addListenerAsync(Class<M> type, MessageListener<? extends M> listener) {
PubSubMessageListener<M> pubSubListener = new PubSubMessageListener<>(type, (MessageListener<M>) listener, name);
return addListenerAsync(pubSubListener);
}

@ -54,7 +54,7 @@ public interface RTopicAsync {
* @return locally unique listener id
* @see org.redisson.api.listener.MessageListener
*/
<M> RFuture<Integer> addListenerAsync(Class<M> type, MessageListener<M> listener);
<M> RFuture<Integer> addListenerAsync(Class<M> type, MessageListener<? extends M> listener);
/**
* Removes the listener by <code>id</code> for listening this topic

Loading…
Cancel
Save