From c99e9cd77f21fac52073f871b64d4f1f3481f852 Mon Sep 17 00:00:00 2001 From: John Blum Date: Tue, 23 May 2023 08:46:06 -0700 Subject: [PATCH] Edit and cleanup Javadoc. Resolves #2586 --- .../data/redis/cache/RedisCache.java | 6 +- .../redis/cache/RedisCacheConfiguration.java | 15 +- .../data/redis/connection/RedisCommands.java | 16 +- .../data/redis/core/RedisCallback.java | 15 +- .../AbstractConnectionIntegrationTests.java | 204 +++++++++--------- 5 files changed, 135 insertions(+), 121 deletions(-) diff --git a/src/main/java/org/springframework/data/redis/cache/RedisCache.java b/src/main/java/org/springframework/data/redis/cache/RedisCache.java index c5a51464e..e6332a063 100644 --- a/src/main/java/org/springframework/data/redis/cache/RedisCache.java +++ b/src/main/java/org/springframework/data/redis/cache/RedisCache.java @@ -38,17 +38,19 @@ import org.springframework.util.ObjectUtils; import org.springframework.util.ReflectionUtils; /** - * {@link org.springframework.cache.Cache} implementation using for Redis as underlying store. + * {@link org.springframework.cache.Cache} implementation using for Redis as the underlying store for cache data. *

* Use {@link RedisCacheManager} to create {@link RedisCache} instances. * * @author Christoph Strobl * @author Mark Paluch * @author Piotr Mionskowski + * @author John Blum * @see RedisCacheConfiguration * @see RedisCacheWriter * @since 2.0 */ +@SuppressWarnings("unused") public class RedisCache extends AbstractValueAdaptingCache { private static final byte[] BINARY_NULL_VALUE = RedisSerializer.java().serialize(NullValue.INSTANCE); @@ -130,6 +132,7 @@ public class RedisCache extends AbstractValueAdaptingCache { return getSynchronized(key, valueLoader); } + @Nullable @SuppressWarnings("unchecked") private synchronized T getSynchronized(Object key, Callable valueLoader) { @@ -396,5 +399,4 @@ public class RedisCache extends AbstractValueAdaptingCache { // allow contextual cache names by computing the key prefix on every call. return cacheConfig.getKeyPrefixFor(name) + key; } - } diff --git a/src/main/java/org/springframework/data/redis/cache/RedisCacheConfiguration.java b/src/main/java/org/springframework/data/redis/cache/RedisCacheConfiguration.java index df008ef78..0801b2883 100644 --- a/src/main/java/org/springframework/data/redis/cache/RedisCacheConfiguration.java +++ b/src/main/java/org/springframework/data/redis/cache/RedisCacheConfiguration.java @@ -32,13 +32,15 @@ import org.springframework.lang.Nullable; import org.springframework.util.Assert; /** - * Immutable {@link RedisCacheConfiguration} helps customizing {@link RedisCache} behaviour such as caching - * {@literal null} values, cache key prefixes and binary serialization.
- * Start with {@link RedisCacheConfiguration#defaultCacheConfig()} and customize {@link RedisCache} behaviour from there - * on. + * Immutable {@link RedisCacheConfiguration} used to customize {@link RedisCache} behaviour, such as caching + * {@literal null} values, computing cache key prefixes and handling binary serialization. + *

+ * Start with {@link RedisCacheConfiguration#defaultCacheConfig()} and customize {@link RedisCache} behaviour + * from that point on. * * @author Christoph Strobl * @author Mark Paluch + * @author John Blum * @since 2.0 */ public class RedisCacheConfiguration { @@ -358,7 +360,10 @@ public class RedisCacheConfiguration { } /** - * Registers default cache key converters. The following converters get registered: + * Registers default cache {@link Converter key converters}. + *

+ * The following converters get registered: + *

*