diff --git a/spring-context-support/src/main/java/org/springframework/cache/caffeine/CaffeineCache.java b/spring-context-support/src/main/java/org/springframework/cache/caffeine/CaffeineCache.java index 34dc622f8b..a19884b19c 100644 --- a/spring-context-support/src/main/java/org/springframework/cache/caffeine/CaffeineCache.java +++ b/spring-context-support/src/main/java/org/springframework/cache/caffeine/CaffeineCache.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,6 +35,7 @@ import org.springframework.util.Assert; * @author Juergen Hoeller * @author Stephane Nicoll * @since 4.3 + * @see CaffeineCacheManager */ public class CaffeineCache extends AbstractValueAdaptingCache { diff --git a/spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheCache.java b/spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheCache.java index 26ea8929d3..4309fa73a2 100644 --- a/spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheCache.java +++ b/spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheCache.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,6 +34,7 @@ import org.springframework.util.Assert; * @author Juergen Hoeller * @author Stephane Nicoll * @since 3.1 + * @see EhCacheCacheManager */ public class EhCacheCache implements Cache { diff --git a/spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheCacheManager.java b/spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheCacheManager.java index 709404e6f2..f3e58a55b2 100644 --- a/spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheCacheManager.java +++ b/spring-context-support/src/main/java/org/springframework/cache/ehcache/EhCacheCacheManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,6 +34,7 @@ import org.springframework.util.Assert; * @author Juergen Hoeller * @author Stephane Nicoll * @since 3.1 + * @see EhCacheCache */ public class EhCacheCacheManager extends AbstractTransactionSupportingCacheManager { diff --git a/spring-context-support/src/main/java/org/springframework/cache/jcache/JCacheCache.java b/spring-context-support/src/main/java/org/springframework/cache/jcache/JCacheCache.java index 73c6176a5e..84d2e3f9bc 100644 --- a/spring-context-support/src/main/java/org/springframework/cache/jcache/JCacheCache.java +++ b/spring-context-support/src/main/java/org/springframework/cache/jcache/JCacheCache.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ import org.springframework.util.Assert; * @author Juergen Hoeller * @author Stephane Nicoll * @since 3.2 + * @see JCacheCacheManager */ public class JCacheCache extends AbstractValueAdaptingCache { diff --git a/spring-context-support/src/main/java/org/springframework/cache/jcache/JCacheCacheManager.java b/spring-context-support/src/main/java/org/springframework/cache/jcache/JCacheCacheManager.java index 08c2b0ec27..e4feb09554 100644 --- a/spring-context-support/src/main/java/org/springframework/cache/jcache/JCacheCacheManager.java +++ b/spring-context-support/src/main/java/org/springframework/cache/jcache/JCacheCacheManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,6 +36,7 @@ import org.springframework.util.Assert; * @author Juergen Hoeller * @author Stephane Nicoll * @since 3.2 + * @see JCacheCache */ public class JCacheCacheManager extends AbstractTransactionSupportingCacheManager { diff --git a/spring-context/src/main/java/org/springframework/cache/concurrent/ConcurrentMapCacheManager.java b/spring-context/src/main/java/org/springframework/cache/concurrent/ConcurrentMapCacheManager.java index 817ebf3871..aea913288d 100644 --- a/spring-context/src/main/java/org/springframework/cache/concurrent/ConcurrentMapCacheManager.java +++ b/spring-context/src/main/java/org/springframework/cache/concurrent/ConcurrentMapCacheManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -190,9 +190,7 @@ public class ConcurrentMapCacheManager implements CacheManager, BeanClassLoaderA */ protected Cache createConcurrentMapCache(String name) { SerializationDelegate actualSerialization = (isStoreByValue() ? this.serialization : null); - return new ConcurrentMapCache(name, new ConcurrentHashMap<>(256), - isAllowNullValues(), actualSerialization); - + return new ConcurrentMapCache(name, new ConcurrentHashMap<>(256), isAllowNullValues(), actualSerialization); } } diff --git a/spring-context/src/main/java/org/springframework/cache/support/NoOpCache.java b/spring-context/src/main/java/org/springframework/cache/support/NoOpCache.java index e3e54862a8..6c814ff18e 100644 --- a/spring-context/src/main/java/org/springframework/cache/support/NoOpCache.java +++ b/spring-context/src/main/java/org/springframework/cache/support/NoOpCache.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,7 @@ import org.springframework.util.Assert; * @author Costin Leau * @author Stephane Nicoll * @since 4.3.4 + * @see NoOpCacheManager */ public class NoOpCache implements Cache { diff --git a/spring-context/src/main/java/org/springframework/cache/support/NoOpCacheManager.java b/spring-context/src/main/java/org/springframework/cache/support/NoOpCacheManager.java index 1fe5d9a055..0b3137b885 100644 --- a/spring-context/src/main/java/org/springframework/cache/support/NoOpCacheManager.java +++ b/spring-context/src/main/java/org/springframework/cache/support/NoOpCacheManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ import org.springframework.lang.Nullable; * @author Costin Leau * @author Stephane Nicoll * @since 3.1 - * @see CompositeCacheManager + * @see NoOpCache */ public class NoOpCacheManager implements CacheManager { diff --git a/spring-context/src/test/java/org/springframework/cache/CacheReproTests.java b/spring-context/src/test/java/org/springframework/cache/CacheReproTests.java index 05e8215114..4c81623f50 100644 --- a/spring-context/src/test/java/org/springframework/cache/CacheReproTests.java +++ b/spring-context/src/test/java/org/springframework/cache/CacheReproTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -393,7 +393,6 @@ public class CacheReproTests { public TestBean insertItem(TestBean item) { return item; } - } diff --git a/spring-context/src/test/java/org/springframework/cache/concurrent/ConcurrentMapCacheManagerTests.java b/spring-context/src/test/java/org/springframework/cache/concurrent/ConcurrentMapCacheManagerTests.java index 6c82b1b988..811b55bb8f 100644 --- a/spring-context/src/test/java/org/springframework/cache/concurrent/ConcurrentMapCacheManagerTests.java +++ b/spring-context/src/test/java/org/springframework/cache/concurrent/ConcurrentMapCacheManagerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,18 +33,15 @@ public class ConcurrentMapCacheManagerTests { public void testDynamicMode() { CacheManager cm = new ConcurrentMapCacheManager(); Cache cache1 = cm.getCache("c1"); - boolean condition2 = cache1 instanceof ConcurrentMapCache; - assertThat(condition2).isTrue(); + assertThat(cache1 instanceof ConcurrentMapCache).isTrue(); Cache cache1again = cm.getCache("c1"); assertThat(cache1).isSameAs(cache1again); Cache cache2 = cm.getCache("c2"); - boolean condition1 = cache2 instanceof ConcurrentMapCache; - assertThat(condition1).isTrue(); + assertThat(cache2 instanceof ConcurrentMapCache).isTrue(); Cache cache2again = cm.getCache("c2"); assertThat(cache2).isSameAs(cache2again); Cache cache3 = cm.getCache("c3"); - boolean condition = cache3 instanceof ConcurrentMapCache; - assertThat(condition).isTrue(); + assertThat(cache3 instanceof ConcurrentMapCache).isTrue(); Cache cache3again = cm.getCache("c3"); assertThat(cache3).isSameAs(cache3again); @@ -74,13 +71,11 @@ public class ConcurrentMapCacheManagerTests { public void testStaticMode() { ConcurrentMapCacheManager cm = new ConcurrentMapCacheManager("c1", "c2"); Cache cache1 = cm.getCache("c1"); - boolean condition3 = cache1 instanceof ConcurrentMapCache; - assertThat(condition3).isTrue(); + assertThat(cache1 instanceof ConcurrentMapCache).isTrue(); Cache cache1again = cm.getCache("c1"); assertThat(cache1).isSameAs(cache1again); Cache cache2 = cm.getCache("c2"); - boolean condition2 = cache2 instanceof ConcurrentMapCache; - assertThat(condition2).isTrue(); + assertThat(cache2 instanceof ConcurrentMapCache).isTrue(); Cache cache2again = cm.getCache("c2"); assertThat(cache2).isSameAs(cache2again); Cache cache3 = cm.getCache("c3"); @@ -97,12 +92,10 @@ public class ConcurrentMapCacheManagerTests { cm.setAllowNullValues(false); Cache cache1x = cm.getCache("c1"); - boolean condition1 = cache1x instanceof ConcurrentMapCache; - assertThat(condition1).isTrue(); + assertThat(cache1x instanceof ConcurrentMapCache).isTrue(); assertThat(cache1x != cache1).isTrue(); Cache cache2x = cm.getCache("c2"); - boolean condition = cache2x instanceof ConcurrentMapCache; - assertThat(condition).isTrue(); + assertThat(cache2x instanceof ConcurrentMapCache).isTrue(); assertThat(cache2x != cache2).isTrue(); Cache cache3x = cm.getCache("c3"); assertThat(cache3x).isNull(); @@ -126,16 +119,14 @@ public class ConcurrentMapCacheManagerTests { ConcurrentMapCacheManager cm = new ConcurrentMapCacheManager("c1", "c2"); assertThat(cm.isStoreByValue()).isFalse(); Cache cache1 = cm.getCache("c1"); - boolean condition1 = cache1 instanceof ConcurrentMapCache; - assertThat(condition1).isTrue(); - assertThat(((ConcurrentMapCache)cache1).isStoreByValue()).isFalse(); + assertThat(cache1 instanceof ConcurrentMapCache).isTrue(); + assertThat(((ConcurrentMapCache) cache1).isStoreByValue()).isFalse(); cache1.put("key", "value"); cm.setStoreByValue(true); assertThat(cm.isStoreByValue()).isTrue(); Cache cache1x = cm.getCache("c1"); - boolean condition = cache1x instanceof ConcurrentMapCache; - assertThat(condition).isTrue(); + assertThat(cache1x instanceof ConcurrentMapCache).isTrue(); assertThat(cache1x != cache1).isTrue(); assertThat(cache1x.get("key")).isNull(); } diff --git a/spring-context/src/test/java/org/springframework/cache/concurrent/ConcurrentMapCacheTests.java b/spring-context/src/test/java/org/springframework/cache/concurrent/ConcurrentMapCacheTests.java index 96715e5e3c..4e8a9d3fbc 100644 --- a/spring-context/src/test/java/org/springframework/cache/concurrent/ConcurrentMapCacheTests.java +++ b/spring-context/src/test/java/org/springframework/cache/concurrent/ConcurrentMapCacheTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,8 +36,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException * @author Juergen Hoeller * @author Stephane Nicoll */ -public class ConcurrentMapCacheTests - extends AbstractValueAdaptingCacheTests { +public class ConcurrentMapCacheTests extends AbstractValueAdaptingCacheTests { protected ConcurrentMap nativeCache; @@ -49,12 +48,11 @@ public class ConcurrentMapCacheTests @BeforeEach - public void setUp() throws Exception { + public void setup() { this.nativeCache = new ConcurrentHashMap<>(); this.cache = new ConcurrentMapCache(CACHE_NAME, this.nativeCache, true); this.nativeCacheNoNull = new ConcurrentHashMap<>(); - this.cacheNoNull = new ConcurrentMapCache(CACHE_NAME_NO_NULL, - this.nativeCacheNoNull, false); + this.cacheNoNull = new ConcurrentMapCache(CACHE_NAME_NO_NULL, this.nativeCacheNoNull, false); this.cache.clear(); } @@ -73,6 +71,7 @@ public class ConcurrentMapCacheTests return this.nativeCache; } + @Test public void testIsStoreByReferenceByDefault() { assertThat(this.cache.isStoreByValue()).isFalse(); diff --git a/spring-core/src/main/java/org/springframework/core/ReactiveTypeDescriptor.java b/spring-core/src/main/java/org/springframework/core/ReactiveTypeDescriptor.java index ad6e99fcf0..035ac1b56a 100644 --- a/spring-core/src/main/java/org/springframework/core/ReactiveTypeDescriptor.java +++ b/spring-core/src/main/java/org/springframework/core/ReactiveTypeDescriptor.java @@ -105,7 +105,7 @@ public final class ReactiveTypeDescriptor { * Whether the underlying operation is deferred and needs to be started * explicitly, e.g. via subscribing (or similar), or whether it is triggered * without the consumer having any control. - * @since 5.1.16 + * @since 5.2.7 */ public boolean isDeferred() { return this.deferred; @@ -169,7 +169,7 @@ public final class ReactiveTypeDescriptor { * non-deferred, async type such as {@link java.util.concurrent.CompletableFuture}. * @param type the reactive type * @param emptySupplier a supplier of an empty-value instance of the reactive type - * @since 5.1.16 + * @since 5.2.7 */ public static ReactiveTypeDescriptor nonDeferredAsyncValue(Class type, Supplier emptySupplier) { return new ReactiveTypeDescriptor(type, false, false, emptySupplier, false);