Fixed - poll methods of RTimeSeries and RScoredSortedSet object return null instead of empty lists.

pull/6384/head
Nikita Koksharov 3 weeks ago
parent 0a638209c4
commit 5b0c0d4194

@ -100,7 +100,7 @@ public class RedissonScoredSortedSet<V> extends RedissonExpirable implements RSc
@Override
public RFuture<Collection<V>> pollFirstAsync(int count) {
if (count <= 0) {
return new CompletableFutureWrapper<>(Collections.emptyList());
return new CompletableFutureWrapper<>(Collections.<V>emptyList());
}
return poll(0, count-1, RedisCommands.EVAL_LIST);
@ -109,7 +109,7 @@ public class RedissonScoredSortedSet<V> extends RedissonExpirable implements RSc
@Override
public RFuture<Collection<V>> pollLastAsync(int count) {
if (count <= 0) {
return new CompletableFutureWrapper<>(Collections.emptyList());
return new CompletableFutureWrapper<>(Collections.<V>emptyList());
}
return poll(-count, -1, RedisCommands.EVAL_LIST);
}
@ -180,7 +180,7 @@ public class RedissonScoredSortedSet<V> extends RedissonExpirable implements RSc
@Override
public RFuture<List<ScoredEntry<V>>> pollFirstEntriesAsync(int count) {
if (count <= 0) {
return new CompletableFutureWrapper<>(Collections.emptyList());
return new CompletableFutureWrapper<>(Collections.<ScoredEntry<V>>emptyList());
}
return pollEntries(0, count-1, RedisCommands.EVAL_LIST_ENTRY);
@ -189,7 +189,7 @@ public class RedissonScoredSortedSet<V> extends RedissonExpirable implements RSc
@Override
public RFuture<List<ScoredEntry<V>>> pollLastEntriesAsync(int count) {
if (count <= 0) {
return new CompletableFutureWrapper<>(Collections.emptyList());
return new CompletableFutureWrapper<>(Collections.<ScoredEntry<V>>emptyList());
}
return pollEntries(-count, -1, RedisCommands.EVAL_LIST_ENTRY);
}

@ -786,7 +786,7 @@ public class RedissonTimeSeries<V, L> extends RedissonExpirable implements RTime
@Override
public RFuture<Collection<V>> pollFirstAsync(int count) {
if (count <= 0) {
return new CompletableFutureWrapper<>(Collections.emptyList());
return new CompletableFutureWrapper<>(Collections.<V>emptyList());
}
return pollAsync(0, count, RedisCommands.EVAL_LIST);
@ -795,7 +795,7 @@ public class RedissonTimeSeries<V, L> extends RedissonExpirable implements RTime
@Override
public RFuture<Collection<V>> pollLastAsync(int count) {
if (count <= 0) {
return new CompletableFutureWrapper<>(Collections.emptyList());
return new CompletableFutureWrapper<>(Collections.<V>emptyList());
}
return pollAsync(-1, count, RedisCommands.EVAL_LIST_REVERSE);
}
@ -808,7 +808,7 @@ public class RedissonTimeSeries<V, L> extends RedissonExpirable implements RTime
@Override
public RFuture<Collection<TimeSeriesEntry<V, L>>> pollFirstEntriesAsync(int count) {
if (count <= 0) {
return new CompletableFutureWrapper<>(Collections.emptyList());
return new CompletableFutureWrapper<>(Collections.<TimeSeriesEntry<V, L>>emptyList());
}
return pollEntriesAsync(0, count, EVAL_ENTRIES);
@ -822,7 +822,7 @@ public class RedissonTimeSeries<V, L> extends RedissonExpirable implements RTime
@Override
public RFuture<Collection<TimeSeriesEntry<V, L>>> pollLastEntriesAsync(int count) {
if (count <= 0) {
return new CompletableFutureWrapper<>(Collections.emptyList());
return new CompletableFutureWrapper<>(Collections.<TimeSeriesEntry<V, L>>emptyList());
}
return pollEntriesAsync(-1, count, EVAL_ENTRIES_REVERSE);
}

Loading…
Cancel
Save