Skip to content

Commit 8d93dc4

Browse files
committed
Merge branch '5.3.x'
2 parents ceea00f + b06d267 commit 8d93dc4

File tree

17 files changed

+75
-71
lines changed

17 files changed

+75
-71
lines changed

spring-context-support/src/main/java/org/springframework/cache/jcache/config/JCacheConfigurer.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,8 +26,7 @@
2626
* <p>To be implemented by classes annotated with
2727
* {@link org.springframework.cache.annotation.EnableCaching} that wish
2828
* or need to specify explicitly how exception caches are resolved for
29-
* annotation-driven cache management. Consider extending {@link JCacheConfigurerSupport},
30-
* which provides a stub implementation of all interface methods.
29+
* annotation-driven cache management.
3130
*
3231
* <p>See {@link org.springframework.cache.annotation.EnableCaching} for
3332
* general examples and context; see {@link #exceptionCacheResolver()} for
@@ -36,7 +35,6 @@
3635
* @author Stephane Nicoll
3736
* @since 4.1
3837
* @see CachingConfigurer
39-
* @see JCacheConfigurerSupport
4038
* @see org.springframework.cache.annotation.EnableCaching
4139
*/
4240
public interface JCacheConfigurer extends CachingConfigurer {
@@ -60,6 +58,8 @@ public interface JCacheConfigurer extends CachingConfigurer {
6058
* See {@link org.springframework.cache.annotation.EnableCaching} for more complete examples.
6159
*/
6260
@Nullable
63-
CacheResolver exceptionCacheResolver();
61+
default CacheResolver exceptionCacheResolver() {
62+
return null;
63+
}
6464

6565
}

spring-context-support/src/test/java/org/springframework/cache/jcache/JCacheEhCacheAnnotationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@
2626
import org.junit.jupiter.api.Test;
2727

2828
import org.springframework.beans.factory.annotation.Autowired;
29-
import org.springframework.cache.annotation.CachingConfigurerSupport;
29+
import org.springframework.cache.annotation.CachingConfigurer;
3030
import org.springframework.cache.annotation.EnableCaching;
3131
import org.springframework.cache.interceptor.KeyGenerator;
3232
import org.springframework.cache.interceptor.SimpleKeyGenerator;
@@ -104,7 +104,7 @@ public void testEvictAllEarlyWithTransaction() {
104104

105105
@Configuration
106106
@EnableCaching
107-
static class EnableCachingConfig extends CachingConfigurerSupport {
107+
static class EnableCachingConfig implements CachingConfigurer {
108108

109109
@Autowired
110110
CachingProvider cachingProvider;

spring-context-support/src/test/java/org/springframework/cache/jcache/config/JCacheJavaConfigTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -180,7 +180,7 @@ public CacheResolver exceptionCacheResolver() {
180180

181181
@Configuration
182182
@EnableCaching
183-
public static class EmptyConfigSupportConfig extends JCacheConfigurerSupport {
183+
public static class EmptyConfigSupportConfig implements JCacheConfigurer {
184184
@Bean
185185
public CacheManager cm() {
186186
return new NoOpCacheManager();
@@ -190,7 +190,7 @@ public CacheManager cm() {
190190

191191
@Configuration
192192
@EnableCaching
193-
static class FullCachingConfigSupport extends JCacheConfigurerSupport {
193+
static class FullCachingConfigSupport implements JCacheConfigurer {
194194

195195
@Override
196196
@Bean
@@ -220,7 +220,7 @@ public CacheResolver exceptionCacheResolver() {
220220

221221
@Configuration
222222
@EnableCaching
223-
static class NoExceptionCacheResolverConfig extends JCacheConfigurerSupport {
223+
static class NoExceptionCacheResolverConfig implements JCacheConfigurer {
224224

225225
@Override
226226
@Bean

spring-context-support/src/test/java/org/springframework/cache/jcache/interceptor/JCacheErrorHandlerTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,7 +34,7 @@
3434
import org.springframework.cache.annotation.EnableCaching;
3535
import org.springframework.cache.interceptor.CacheErrorHandler;
3636
import org.springframework.cache.interceptor.SimpleKeyGenerator;
37-
import org.springframework.cache.jcache.config.JCacheConfigurerSupport;
37+
import org.springframework.cache.jcache.config.JCacheConfigurer;
3838
import org.springframework.cache.support.SimpleCacheManager;
3939
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
4040
import org.springframework.context.annotation.Bean;
@@ -141,7 +141,7 @@ public void clearFail() {
141141

142142
@Configuration
143143
@EnableCaching
144-
static class Config extends JCacheConfigurerSupport {
144+
static class Config implements JCacheConfigurer {
145145

146146
@Bean
147147
@Override

spring-context-support/src/test/java/org/springframework/cache/jcache/interceptor/JCacheKeyGeneratorTests.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -34,7 +34,7 @@
3434
import org.springframework.cache.interceptor.KeyGenerator;
3535
import org.springframework.cache.interceptor.SimpleKey;
3636
import org.springframework.cache.interceptor.SimpleKeyGenerator;
37-
import org.springframework.cache.jcache.config.JCacheConfigurerSupport;
37+
import org.springframework.cache.jcache.config.JCacheConfigurer;
3838
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
3939
import org.springframework.context.annotation.Bean;
4040
import org.springframework.context.annotation.Configuration;
@@ -97,7 +97,7 @@ public void getFiltered() {
9797

9898
@Configuration
9999
@EnableCaching
100-
static class Config extends JCacheConfigurerSupport {
100+
static class Config implements JCacheConfigurer {
101101

102102
@Bean
103103
@Override
@@ -151,7 +151,7 @@ private void expect(Object... params) {
151151
@Override
152152
public Object generate(Object target, Method method, Object... params) {
153153
assertThat(Arrays.equals(expectedParams, params)).as("Unexpected parameters: expected: "
154-
+ Arrays.toString(this.expectedParams) + " but got: " + Arrays.toString(params)).isTrue();
154+
+ Arrays.toString(this.expectedParams) + " but got: " + Arrays.toString(params)).isTrue();
155155
return new SimpleKey(params);
156156
}
157157
}

spring-context/src/main/java/org/springframework/cache/annotation/CachingConfigurer.java

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,8 +26,7 @@
2626
* Interface to be implemented by @{@link org.springframework.context.annotation.Configuration
2727
* Configuration} classes annotated with @{@link EnableCaching} that wish or need to
2828
* specify explicitly how caches are resolved and how keys are generated for annotation-driven
29-
* cache management. Consider extending {@link CachingConfigurerSupport}, which provides a
30-
* stub implementation of all interface methods.
29+
* cache management.
3130
*
3231
* <p>See @{@link EnableCaching} for general examples and context; see
3332
* {@link #cacheManager()}, {@link #cacheResolver()} and {@link #keyGenerator()}
@@ -37,7 +36,6 @@
3736
* @author Stephane Nicoll
3837
* @since 3.1
3938
* @see EnableCaching
40-
* @see CachingConfigurerSupport
4139
*/
4240
public interface CachingConfigurer {
4341

@@ -64,7 +62,9 @@ public interface CachingConfigurer {
6462
* See @{@link EnableCaching} for more complete examples.
6563
*/
6664
@Nullable
67-
CacheManager cacheManager();
65+
default CacheManager cacheManager() {
66+
return null;
67+
}
6868

6969
/**
7070
* Return the {@link CacheResolver} bean to use to resolve regular caches for
@@ -89,7 +89,9 @@ public interface CachingConfigurer {
8989
* See {@link EnableCaching} for more complete examples.
9090
*/
9191
@Nullable
92-
CacheResolver cacheResolver();
92+
default CacheResolver cacheResolver() {
93+
return null;
94+
}
9395

9496
/**
9597
* Return the key generator bean to use for annotation-driven cache management.
@@ -110,7 +112,9 @@ public interface CachingConfigurer {
110112
* See @{@link EnableCaching} for more complete examples.
111113
*/
112114
@Nullable
113-
KeyGenerator keyGenerator();
115+
default KeyGenerator keyGenerator() {
116+
return null;
117+
}
114118

115119
/**
116120
* Return the {@link CacheErrorHandler} to use to handle cache-related errors.
@@ -133,6 +137,8 @@ public interface CachingConfigurer {
133137
* See @{@link EnableCaching} for more complete examples.
134138
*/
135139
@Nullable
136-
CacheErrorHandler errorHandler();
140+
default CacheErrorHandler errorHandler() {
141+
return null;
142+
}
137143

138144
}

spring-context/src/main/java/org/springframework/scheduling/annotation/AsyncConfigurer.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,19 +28,13 @@
2828
* {@link AsyncUncaughtExceptionHandler} instance used to process exception thrown from
2929
* async method with {@code void} return type.
3030
*
31-
* <p>Consider using {@link AsyncConfigurerSupport} providing default implementations for
32-
* both methods if only one element needs to be customized. Furthermore, backward compatibility
33-
* of this interface will be insured in case new customization options are introduced
34-
* in the future.
35-
*
3631
* <p>See @{@link EnableAsync} for usage examples.
3732
*
3833
* @author Chris Beams
3934
* @author Stephane Nicoll
4035
* @since 3.1
4136
* @see AbstractAsyncConfiguration
4237
* @see EnableAsync
43-
* @see AsyncConfigurerSupport
4438
*/
4539
public interface AsyncConfigurer {
4640

spring-context/src/test/java/org/springframework/cache/CacheReproTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@
2828
import org.springframework.cache.annotation.CachePut;
2929
import org.springframework.cache.annotation.Cacheable;
3030
import org.springframework.cache.annotation.Caching;
31-
import org.springframework.cache.annotation.CachingConfigurerSupport;
31+
import org.springframework.cache.annotation.CachingConfigurer;
3232
import org.springframework.cache.annotation.EnableCaching;
3333
import org.springframework.cache.concurrent.ConcurrentMapCache;
3434
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
@@ -306,7 +306,7 @@ public Object getNeverCache(String key) {
306306

307307
@Configuration
308308
@EnableCaching
309-
public static class Spr13081Config extends CachingConfigurerSupport {
309+
public static class Spr13081Config implements CachingConfigurer {
310310

311311
@Bean
312312
@Override

spring-context/src/test/java/org/springframework/cache/config/EnableCachingIntegrationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,7 +26,7 @@
2626
import org.springframework.cache.CacheManager;
2727
import org.springframework.cache.annotation.CacheConfig;
2828
import org.springframework.cache.annotation.Cacheable;
29-
import org.springframework.cache.annotation.CachingConfigurerSupport;
29+
import org.springframework.cache.annotation.CachingConfigurer;
3030
import org.springframework.cache.annotation.EnableCaching;
3131
import org.springframework.context.ConfigurableApplicationContext;
3232
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
@@ -137,7 +137,7 @@ private Cache getCache() {
137137

138138

139139
@Configuration
140-
static class SharedConfig extends CachingConfigurerSupport {
140+
static class SharedConfig implements CachingConfigurer {
141141

142142
@Override
143143
@Bean

spring-context/src/test/java/org/springframework/cache/config/EnableCachingTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
2323
import org.springframework.beans.factory.NoUniqueBeanDefinitionException;
2424
import org.springframework.cache.CacheManager;
25-
import org.springframework.cache.annotation.CachingConfigurerSupport;
25+
import org.springframework.cache.annotation.CachingConfigurer;
2626
import org.springframework.cache.annotation.EnableCaching;
2727
import org.springframework.cache.interceptor.CacheErrorHandler;
2828
import org.springframework.cache.interceptor.CacheInterceptor;
@@ -150,7 +150,7 @@ public void bothSetOnlyResolverIsUsed() {
150150

151151
@Configuration
152152
@EnableCaching
153-
static class EnableCachingConfig extends CachingConfigurerSupport {
153+
static class EnableCachingConfig implements CachingConfigurer {
154154

155155
@Override
156156
@Bean
@@ -227,7 +227,7 @@ public CacheManager cm2() {
227227

228228
@Configuration
229229
@EnableCaching
230-
static class MultiCacheManagerConfigurer extends CachingConfigurerSupport {
230+
static class MultiCacheManagerConfigurer implements CachingConfigurer {
231231

232232
@Bean
233233
public CacheManager cm1() {
@@ -253,7 +253,7 @@ public KeyGenerator keyGenerator() {
253253

254254
@Configuration
255255
@EnableCaching
256-
static class EmptyConfigSupportConfig extends CachingConfigurerSupport {
256+
static class EmptyConfigSupportConfig implements CachingConfigurer {
257257

258258
@Bean
259259
public CacheManager cm() {
@@ -264,7 +264,7 @@ public CacheManager cm() {
264264

265265
@Configuration
266266
@EnableCaching
267-
static class FullCachingConfig extends CachingConfigurerSupport {
267+
static class FullCachingConfig implements CachingConfigurer {
268268

269269
@Override
270270
@Bean

spring-context/src/test/java/org/springframework/cache/config/ExpressionCachingIntegrationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2016 the original author or authors.
2+
* Copyright 2002-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
2020

2121
import org.springframework.cache.CacheManager;
2222
import org.springframework.cache.annotation.CachePut;
23-
import org.springframework.cache.annotation.CachingConfigurerSupport;
23+
import org.springframework.cache.annotation.CachingConfigurer;
2424
import org.springframework.cache.annotation.EnableCaching;
2525
import org.springframework.cache.concurrent.ConcurrentMapCacheManager;
2626
import org.springframework.context.ConfigurableApplicationContext;
@@ -122,7 +122,7 @@ public String getId() {
122122

123123
@Configuration
124124
@EnableCaching
125-
static class SharedConfig extends CachingConfigurerSupport {
125+
static class SharedConfig implements CachingConfigurer {
126126

127127
@Override
128128
@Bean

spring-context/src/test/java/org/springframework/cache/interceptor/CacheErrorHandlerTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -28,7 +28,7 @@
2828
import org.springframework.cache.annotation.CacheEvict;
2929
import org.springframework.cache.annotation.CachePut;
3030
import org.springframework.cache.annotation.Cacheable;
31-
import org.springframework.cache.annotation.CachingConfigurerSupport;
31+
import org.springframework.cache.annotation.CachingConfigurer;
3232
import org.springframework.cache.annotation.EnableCaching;
3333
import org.springframework.cache.support.SimpleCacheManager;
3434
import org.springframework.cache.support.SimpleValueWrapper;
@@ -170,7 +170,7 @@ public void clearFailProperException() {
170170

171171
@Configuration
172172
@EnableCaching
173-
static class Config extends CachingConfigurerSupport {
173+
static class Config implements CachingConfigurer {
174174

175175
@Bean
176176
@Override

0 commit comments

Comments
 (0)