Skip to content

Commit 157a0f8

Browse files
is this really done
1 parent 63e3bbc commit 157a0f8

File tree

64 files changed

+525
-550
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+525
-550
lines changed

src/main/java/org/springframework/data/redis/ClusterRedirectException.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import java.io.Serial;
1919

20+
import org.jspecify.annotations.Nullable;
2021
import org.springframework.dao.DataRetrievalFailureException;
2122

2223
/**
@@ -44,7 +45,7 @@ public class ClusterRedirectException extends DataRetrievalFailureException {
4445
* @param targetPort the port on the host.
4546
* @param e the root cause from the data access API in use.
4647
*/
47-
public ClusterRedirectException(int slot, String targetHost, int targetPort, Throwable e) {
48+
public ClusterRedirectException(int slot, String targetHost, int targetPort, @Nullable Throwable e) {
4849

4950
super("Redirect: slot %s to %s:%s.".formatted(slot, targetHost, targetPort), e);
5051

src/main/java/org/springframework/data/redis/ClusterStateFailureException.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import java.io.Serial;
1919

20+
import org.jspecify.annotations.Nullable;
2021
import org.springframework.dao.DataAccessResourceFailureException;
2122

2223
/**
@@ -38,7 +39,7 @@ public class ClusterStateFailureException extends DataAccessResourceFailureExcep
3839
*
3940
* @param msg the detail message.
4041
*/
41-
public ClusterStateFailureException(String msg) {
42+
public ClusterStateFailureException(@Nullable String msg) {
4243
super(msg);
4344
}
4445

@@ -48,7 +49,7 @@ public ClusterStateFailureException(String msg) {
4849
* @param msg the detail message.
4950
* @param cause the nested exception.
5051
*/
51-
public ClusterStateFailureException(String msg, Throwable cause) {
52+
public ClusterStateFailureException(@Nullable String msg, @Nullable Throwable cause) {
5253
super(msg, cause);
5354
}
5455

src/main/java/org/springframework/data/redis/RedisConnectionFailureException.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package org.springframework.data.redis;
1717

18+
import org.jspecify.annotations.Nullable;
1819
import org.springframework.dao.DataAccessResourceFailureException;
1920

2021
/**
@@ -27,15 +28,15 @@ public class RedisConnectionFailureException extends DataAccessResourceFailureEx
2728
/**
2829
* @param msg the detail message.
2930
*/
30-
public RedisConnectionFailureException(String msg) {
31+
public RedisConnectionFailureException(@Nullable String msg) {
3132
super(msg);
3233
}
3334

3435
/**
3536
* @param msg the detail message.
3637
* @param cause the nested exception.
3738
*/
38-
public RedisConnectionFailureException(String msg, Throwable cause) {
39+
public RedisConnectionFailureException(@Nullable String msg, @Nullable Throwable cause) {
3940
super(msg, cause);
4041
}
4142

src/main/java/org/springframework/data/redis/RedisSystemException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class RedisSystemException extends UncategorizedDataAccessException {
2929
* @param msg the detail message.
3030
* @param cause the root cause from the data access API in use.
3131
*/
32-
public RedisSystemException(String msg, @Nullable Throwable cause) {
32+
public RedisSystemException(@Nullable String msg, @Nullable Throwable cause) {
3333
super(msg, cause);
3434
}
3535

src/main/java/org/springframework/data/redis/cache/DefaultRedisCacheWriter.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ public byte[] get(String name, byte[] key, @Nullable Duration ttl) {
143143
}
144144

145145

146+
@SuppressWarnings("NullAway")
146147
private byte @Nullable[] doGet(RedisConnection connection, String name, byte[] key, @Nullable Duration ttl) {
147148

148149
byte[] result = shouldExpireWithin(ttl) ? connection.stringCommands().getEx(key, Expiration.from(ttl))
@@ -241,6 +242,7 @@ public void put(String name, byte[] key, byte[] value, @Nullable Duration ttl) {
241242

242243
}
243244

245+
@SuppressWarnings("NullAway")
244246
private void doPut(RedisConnection connection, String name, byte[] key, byte[] value, @Nullable Duration ttl) {
245247

246248
if (shouldExpireWithin(ttl)) {
@@ -265,6 +267,7 @@ public CompletableFuture<Void> store(String name, byte[] key, byte[] value, @Nul
265267
}
266268

267269
@Override
270+
@SuppressWarnings("NullAway")
268271
public byte[] putIfAbsent(String name, byte[] key, byte[] value, @Nullable Duration ttl) {
269272

270273
Assert.notNull(name, "Name must not be null");
@@ -538,6 +541,7 @@ public boolean isSupported() {
538541
}
539542

540543
@Override
544+
@SuppressWarnings("NullAway")
541545
public CompletableFuture<byte[]> retrieve(String name, byte[] key, @Nullable Duration ttl) {
542546

543547
return doWithConnection(connection -> {
@@ -572,6 +576,7 @@ private Mono<Boolean> doStoreWithLocking(String name, byte[] key, byte[] value,
572576
unused -> doUnlock(name, connection));
573577
}
574578

579+
@SuppressWarnings("NullAway")
575580
private Mono<Boolean> doStore(byte[] cacheKey, byte[] value, @Nullable Duration ttl,
576581
ReactiveRedisConnection connection) {
577582

src/main/java/org/springframework/data/redis/cache/RedisCache.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ private Duration getTimeToLive(Object key, @Nullable Object value) {
197197
}
198198

199199
@Override
200+
@SuppressWarnings("NullAway")
200201
public void put(Object key, @Nullable Object value) {
201202

202203
Object cacheValue = processAndCheckValue(value);
@@ -210,6 +211,7 @@ public void put(Object key, @Nullable Object value) {
210211
}
211212

212213
@Override
214+
@SuppressWarnings("NullAway")
213215
public @Nullable ValueWrapper putIfAbsent(Object key, @Nullable Object value) {
214216

215217
Object cacheValue = preProcessCacheValue(value);
@@ -269,7 +271,7 @@ public CompletableFuture<ValueWrapper> retrieve(Object key) {
269271
}
270272

271273
@Override
272-
@SuppressWarnings("unchecked")
274+
@SuppressWarnings({"unchecked", "NullAway"})
273275
public <T> CompletableFuture<T> retrieve(Object key, Supplier<CompletableFuture<T>> valueLoader) {
274276

275277
return retrieve(key).thenCompose(wrapper -> {

src/main/java/org/springframework/data/redis/connection/AbstractRedisConnection.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public boolean hasRedisSentinelConfigured() {
6363
return this.sentinelConfiguration != null;
6464
}
6565

66+
@SuppressWarnings("NullAway")
6667
private RedisNode selectActiveSentinel() {
6768

6869
Assert.state(hasRedisSentinelConfigured(), "Sentinel configuration missing");

src/main/java/org/springframework/data/redis/connection/ClusterCommandExecutor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ public <S, T> MultiNodeResult<T> executeCommandAsyncOnNodes(ClusterCommandCallba
239239
return collectResults(futures);
240240
}
241241

242+
@SuppressWarnings("NullAway")
242243
<T> MultiNodeResult<T> collectResults(Map<NodeExecution, Future<NodeResult<T>>> futures) {
243244

244245
MultiNodeResult<T> result = new MultiNodeResult<>();

src/main/java/org/springframework/data/redis/connection/ReactiveKeyCommands.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class CopyCommand extends KeyCommand {
5959
private final boolean replace;
6060
private final @Nullable Integer database;
6161

62-
public CopyCommand(ByteBuffer key, @Nullable ByteBuffer target, boolean replace, @Nullable Integer database) {
62+
public CopyCommand(@Nullable ByteBuffer key, @Nullable ByteBuffer target, boolean replace, @Nullable Integer database) {
6363
super(key);
6464
this.target = target;
6565
this.replace = replace;
@@ -324,7 +324,7 @@ class RenameCommand extends KeyCommand {
324324

325325
private @Nullable ByteBuffer newKey;
326326

327-
private RenameCommand(ByteBuffer key, @Nullable ByteBuffer newKey) {
327+
private RenameCommand(@Nullable ByteBuffer key, @Nullable ByteBuffer newKey) {
328328

329329
super(key);
330330

@@ -901,7 +901,7 @@ class MoveCommand extends KeyCommand {
901901

902902
private @Nullable Integer database;
903903

904-
private MoveCommand(ByteBuffer key, @Nullable Integer database) {
904+
private MoveCommand(@Nullable ByteBuffer key, @Nullable Integer database) {
905905

906906
super(key);
907907

src/main/java/org/springframework/data/redis/connection/ReactiveListCommands.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,7 +1396,7 @@ class RPopLPushCommand extends KeyCommand {
13961396

13971397
private final @Nullable ByteBuffer destination;
13981398

1399-
private RPopLPushCommand(ByteBuffer key, @Nullable ByteBuffer destination) {
1399+
private RPopLPushCommand(@Nullable ByteBuffer key, @Nullable ByteBuffer destination) {
14001400

14011401
super(key);
14021402
this.destination = destination;
@@ -1476,7 +1476,7 @@ class BRPopLPushCommand extends KeyCommand {
14761476
private final @Nullable ByteBuffer destination;
14771477
private final Duration timeout;
14781478

1479-
private BRPopLPushCommand(ByteBuffer key, @Nullable ByteBuffer destination, Duration timeout) {
1479+
private BRPopLPushCommand(@Nullable ByteBuffer key, @Nullable ByteBuffer destination, Duration timeout) {
14801480

14811481
super(key);
14821482

0 commit comments

Comments
 (0)