Skip to content

Commit 467dab1

Browse files
move to jpsecify
1 parent ddd841b commit 467dab1

File tree

331 files changed

+1013
-1596
lines changed

Some content is hidden

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

331 files changed

+1013
-1596
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*/
1616
package org.springframework.data.redis;
1717

18+
import org.jspecify.annotations.Nullable;
1819
import org.springframework.dao.DataAccessException;
19-
import org.springframework.lang.Nullable;
2020

2121
/**
2222
* Potentially translates an {@link Exception} into appropriate {@link DataAccessException}.

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

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

18+
import org.jspecify.annotations.Nullable;
1819
import org.springframework.core.convert.converter.Converter;
1920
import org.springframework.dao.DataAccessException;
20-
import org.springframework.lang.Nullable;
2121

2222
/**
2323
* {@link PassThroughExceptionTranslationStrategy} returns {@literal null} for unknown {@link Exception}s.
@@ -34,9 +34,8 @@ public PassThroughExceptionTranslationStrategy(Converter<Exception, DataAccessEx
3434
this.converter = converter;
3535
}
3636

37-
@Nullable
3837
@Override
39-
public DataAccessException translate(Exception e) {
38+
public @Nullable DataAccessException translate(Exception e) {
4039
return this.converter.convert(e);
4140
}
4241

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
*/
1616
package org.springframework.data.redis;
1717

18+
import org.jspecify.annotations.Nullable;
1819
import org.springframework.dao.UncategorizedDataAccessException;
19-
import org.springframework.lang.Nullable;
2020

2121
/**
2222
* Exception thrown when we can't classify a Redis exception into one of Spring generic data access exceptions.

src/main/java/org/springframework/data/redis/aot/RedisRuntimeHints.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import java.util.Arrays;
1919
import java.util.function.Consumer;
2020

21+
import org.jspecify.annotations.Nullable;
2122
import org.springframework.aot.hint.MemberCategory;
2223
import org.springframework.aot.hint.RuntimeHints;
2324
import org.springframework.aot.hint.RuntimeHintsRegistrar;
@@ -50,7 +51,6 @@
5051
import org.springframework.data.redis.repository.query.RedisPartTreeQuery;
5152
import org.springframework.data.redis.repository.query.RedisQueryCreator;
5253
import org.springframework.data.redis.repository.support.RedisRepositoryFactoryBean;
53-
import org.springframework.lang.Nullable;
5454
import org.springframework.util.ClassUtils;
5555

5656
/**

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import java.util.function.Function;
2929
import java.util.function.Supplier;
3030

31+
import org.jspecify.annotations.Nullable;
3132
import org.springframework.dao.PessimisticLockingFailureException;
3233
import org.springframework.data.redis.connection.ReactiveRedisConnection;
3334
import org.springframework.data.redis.connection.ReactiveRedisConnectionFactory;
@@ -38,7 +39,6 @@
3839
import org.springframework.data.redis.connection.RedisStringCommands.SetOption;
3940
import org.springframework.data.redis.core.types.Expiration;
4041
import org.springframework.data.redis.util.ByteUtils;
41-
import org.springframework.lang.Nullable;
4242
import org.springframework.util.Assert;
4343
import org.springframework.util.ClassUtils;
4444
import org.springframework.util.ObjectUtils;
@@ -142,8 +142,8 @@ public byte[] get(String name, byte[] key, @Nullable Duration ttl) {
142142
return execute(name, connection -> doGet(connection, name, key, ttl));
143143
}
144144

145-
@Nullable
146-
private byte[] doGet(RedisConnection connection, String name, byte[] key, @Nullable Duration ttl) {
145+
146+
private byte @Nullable[] doGet(RedisConnection connection, String name, byte[] key, @Nullable Duration ttl) {
147147

148148
byte[] result = shouldExpireWithin(ttl) ? connection.stringCommands().getEx(key, Expiration.from(ttl))
149149
: connection.stringCommands().get(key);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
import java.time.Duration;
1919

20+
import org.jspecify.annotations.Nullable;
2021
import org.springframework.data.redis.cache.RedisCacheWriter.TtlFunction;
21-
import org.springframework.lang.Nullable;
2222

2323
/**
2424
* {@link TtlFunction} implementation returning the given, predetermined {@link Duration} used for per cache entry

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import java.time.Instant;
1919
import java.util.concurrent.TimeUnit;
2020

21-
import org.springframework.lang.Nullable;
21+
import org.jspecify.annotations.Nullable;
2222
import org.springframework.util.ObjectUtils;
2323

2424
/**

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import java.util.concurrent.CompletableFuture;
2828
import java.util.function.Supplier;
2929

30+
import org.jspecify.annotations.Nullable;
3031
import org.springframework.cache.Cache;
3132
import org.springframework.cache.support.AbstractValueAdaptingCache;
3233
import org.springframework.cache.support.NullValue;
@@ -37,7 +38,6 @@
3738
import org.springframework.data.redis.serializer.RedisSerializationContext;
3839
import org.springframework.data.redis.serializer.RedisSerializer;
3940
import org.springframework.data.redis.util.ByteUtils;
40-
import org.springframework.lang.Nullable;
4141
import org.springframework.util.Assert;
4242
import org.springframework.util.ObjectUtils;
4343
import org.springframework.util.ReflectionUtils;
@@ -311,8 +311,7 @@ private Object processAndCheckValue(@Nullable Object value) {
311311
* @param value can be {@literal null}.
312312
* @return preprocessed value. Can be {@literal null}.
313313
*/
314-
@Nullable
315-
protected Object preProcessCacheValue(@Nullable Object value) {
314+
protected @Nullable Object preProcessCacheValue(@Nullable Object value) {
316315
return value != null ? value : isAllowNullValues() ? NullValue.INSTANCE : null;
317316
}
318317

@@ -351,8 +350,7 @@ protected byte[] serializeCacheValue(Object value) {
351350
* {@link RedisSerializationContext.SerializationPair}; can be {@literal null}.
352351
* @see RedisCacheConfiguration#getValueSerializationPair()
353352
*/
354-
@Nullable
355-
protected Object deserializeCacheValue(byte[] value) {
353+
protected @Nullable Object deserializeCacheValue(byte[] value) {
356354

357355
if (isAllowNullValues() && ObjectUtils.nullSafeEquals(value, BINARY_NULL_VALUE)) {
358356
return NullValue.INSTANCE;
@@ -425,8 +423,7 @@ private CompletableFuture<ValueWrapper> retrieveValue(Object key) {
425423
.thenApply(this::toValueWrapper);
426424
}
427425

428-
@Nullable
429-
private Object nullSafeDeserializedStoreValue(@Nullable byte[] value) {
426+
private @Nullable Object nullSafeDeserializedStoreValue(byte @Nullable[] value) {
430427
return value != null ? fromStoreValue(deserializeCacheValue(value)) : null;
431428
}
432429

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.time.Duration;
2020
import java.util.function.Consumer;
2121

22+
import org.jspecify.annotations.Nullable;
2223
import org.springframework.cache.Cache;
2324
import org.springframework.cache.interceptor.SimpleKey;
2425
import org.springframework.core.convert.ConversionService;
@@ -28,7 +29,6 @@
2829
import org.springframework.data.redis.serializer.RedisSerializationContext.SerializationPair;
2930
import org.springframework.data.redis.serializer.RedisSerializer;
3031
import org.springframework.format.support.DefaultFormattingConversionService;
31-
import org.springframework.lang.Nullable;
3232
import org.springframework.util.Assert;
3333

3434
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
import java.util.Optional;
2424
import java.util.Set;
2525

26+
import org.jspecify.annotations.Nullable;
2627
import org.springframework.cache.Cache;
2728
import org.springframework.cache.CacheManager;
2829
import org.springframework.cache.transaction.AbstractTransactionSupportingCacheManager;
2930
import org.springframework.data.redis.connection.RedisConnectionFactory;
30-
import org.springframework.lang.Nullable;
3131
import org.springframework.util.Assert;
3232

3333
/**

0 commit comments

Comments
 (0)