Skip to content

Commit d665977

Browse files
committed
Polishing
1 parent 0b6a54d commit d665977

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public abstract class AbstractCachingConfiguration implements ImportAware {
6767
@Override
6868
public void setImportMetadata(AnnotationMetadata importMetadata) {
6969
this.enableCaching = AnnotationAttributes.fromMap(
70-
importMetadata.getAnnotationAttributes(EnableCaching.class.getName(), false));
70+
importMetadata.getAnnotationAttributes(EnableCaching.class.getName()));
7171
if (this.enableCaching == null) {
7272
throw new IllegalArgumentException(
7373
"@EnableCaching is not present on importing class " + importMetadata.getClassName());
@@ -76,7 +76,7 @@ public void setImportMetadata(AnnotationMetadata importMetadata) {
7676

7777
@Autowired
7878
void setConfigurers(ObjectProvider<CachingConfigurer> configurers) {
79-
Supplier<CachingConfigurer> cachingConfigurer = () -> {
79+
Supplier<CachingConfigurer> configurer = () -> {
8080
List<CachingConfigurer> candidates = configurers.stream().collect(Collectors.toList());
8181
if (CollectionUtils.isEmpty(candidates)) {
8282
return null;
@@ -89,7 +89,7 @@ void setConfigurers(ObjectProvider<CachingConfigurer> configurers) {
8989
}
9090
return candidates.get(0);
9191
};
92-
useCachingConfigurer(new CachingConfigurerSupplier(cachingConfigurer));
92+
useCachingConfigurer(new CachingConfigurerSupplier(configurer));
9393
}
9494

9595
/**

spring-context/src/main/java/org/springframework/context/annotation/AnnotationConfigUtils.java

Lines changed: 4 additions & 4 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.
@@ -282,7 +282,7 @@ static AnnotationAttributes attributesFor(AnnotatedTypeMetadata metadata, Class<
282282

283283
@Nullable
284284
static AnnotationAttributes attributesFor(AnnotatedTypeMetadata metadata, String annotationClassName) {
285-
return AnnotationAttributes.fromMap(metadata.getAnnotationAttributes(annotationClassName, false));
285+
return AnnotationAttributes.fromMap(metadata.getAnnotationAttributes(annotationClassName));
286286
}
287287

288288
static Set<AnnotationAttributes> attributesForRepeatable(AnnotationMetadata metadata,
@@ -298,10 +298,10 @@ static Set<AnnotationAttributes> attributesForRepeatable(
298298
Set<AnnotationAttributes> result = new LinkedHashSet<>();
299299

300300
// Direct annotation present?
301-
addAttributesIfNotNull(result, metadata.getAnnotationAttributes(annotationClassName, false));
301+
addAttributesIfNotNull(result, metadata.getAnnotationAttributes(annotationClassName));
302302

303303
// Container annotation present?
304-
Map<String, Object> container = metadata.getAnnotationAttributes(containerClassName, false);
304+
Map<String, Object> container = metadata.getAnnotationAttributes(containerClassName);
305305
if (container != null && container.containsKey("value")) {
306306
for (Map<String, Object> containedAttributes : (Map<String, Object>[]) container.get("value")) {
307307
addAttributesIfNotNull(result, containedAttributes);

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public abstract class AbstractAsyncConfiguration implements ImportAware {
5959
@Override
6060
public void setImportMetadata(AnnotationMetadata importMetadata) {
6161
this.enableAsync = AnnotationAttributes.fromMap(
62-
importMetadata.getAnnotationAttributes(EnableAsync.class.getName(), false));
62+
importMetadata.getAnnotationAttributes(EnableAsync.class.getName()));
6363
if (this.enableAsync == null) {
6464
throw new IllegalArgumentException(
6565
"@EnableAsync is not present on importing class " + importMetadata.getClassName());
@@ -71,7 +71,7 @@ public void setImportMetadata(AnnotationMetadata importMetadata) {
7171
*/
7272
@Autowired
7373
void setConfigurers(ObjectProvider<AsyncConfigurer> configurers) {
74-
Supplier<AsyncConfigurer> asyncConfigurer = SingletonSupplier.of(() -> {
74+
Supplier<AsyncConfigurer> configurer = SingletonSupplier.of(() -> {
7575
List<AsyncConfigurer> candidates = configurers.stream().collect(Collectors.toList());
7676
if (CollectionUtils.isEmpty(candidates)) {
7777
return null;
@@ -81,14 +81,14 @@ void setConfigurers(ObjectProvider<AsyncConfigurer> configurers) {
8181
}
8282
return candidates.get(0);
8383
});
84-
this.executor = adapt(asyncConfigurer, AsyncConfigurer::getAsyncExecutor);
85-
this.exceptionHandler = adapt(asyncConfigurer, AsyncConfigurer::getAsyncUncaughtExceptionHandler);
84+
this.executor = adapt(configurer, AsyncConfigurer::getAsyncExecutor);
85+
this.exceptionHandler = adapt(configurer, AsyncConfigurer::getAsyncUncaughtExceptionHandler);
8686
}
8787

8888
private <T> Supplier<T> adapt(Supplier<AsyncConfigurer> supplier, Function<AsyncConfigurer, T> provider) {
8989
return () -> {
90-
AsyncConfigurer asyncConfigurer = supplier.get();
91-
return (asyncConfigurer != null) ? provider.apply(asyncConfigurer) : null;
90+
AsyncConfigurer configurer = supplier.get();
91+
return (configurer != null ? provider.apply(configurer) : null);
9292
};
9393
}
9494

spring-tx/src/main/java/org/springframework/transaction/annotation/AbstractTransactionManagementConfiguration.java

Lines changed: 2 additions & 2 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.
@@ -57,7 +57,7 @@ public abstract class AbstractTransactionManagementConfiguration implements Impo
5757
@Override
5858
public void setImportMetadata(AnnotationMetadata importMetadata) {
5959
this.enableTx = AnnotationAttributes.fromMap(
60-
importMetadata.getAnnotationAttributes(EnableTransactionManagement.class.getName(), false));
60+
importMetadata.getAnnotationAttributes(EnableTransactionManagement.class.getName()));
6161
if (this.enableTx == null) {
6262
throw new IllegalArgumentException(
6363
"@EnableTransactionManagement is not present on importing class " + importMetadata.getClassName());

0 commit comments

Comments
 (0)