Skip to content

Commit

Permalink
Merge branch '5.3.x'
Browse files Browse the repository at this point in the history
# Conflicts:
#	build.gradle
  • Loading branch information
jhoeller committed Dec 15, 2021
2 parents e15bed7 + 31a4c27 commit 9dc5c9f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ configure(allprojects) { project ->
exclude group: "stax", name: "stax-api"
}
dependency "org.ogce:xpp3:1.1.6"
dependency "org.yaml:snakeyaml:1.29"
dependency "org.yaml:snakeyaml:1.30"

dependency "com.h2database:h2:1.4.200"
dependency "com.github.ben-manes.caffeine:caffeine:3.0.5"
Expand Down Expand Up @@ -183,7 +183,7 @@ configure(allprojects) { project ->
}
entry 'mockito-junit-jupiter'
}
dependency "io.mockk:mockk:1.12.0"
dependency "io.mockk:mockk:1.12.1"

dependency("net.sourceforge.htmlunit:htmlunit:2.55.0") {
exclude group: "commons-logging", name: "commons-logging"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public abstract class AbstractCachingConfiguration implements ImportAware {
@Override
public void setImportMetadata(AnnotationMetadata importMetadata) {
this.enableCaching = AnnotationAttributes.fromMap(
importMetadata.getAnnotationAttributes(EnableCaching.class.getName(), false));
importMetadata.getAnnotationAttributes(EnableCaching.class.getName()));
if (this.enableCaching == null) {
throw new IllegalArgumentException(
"@EnableCaching is not present on importing class " + importMetadata.getClassName());
Expand All @@ -76,7 +76,7 @@ public void setImportMetadata(AnnotationMetadata importMetadata) {

@Autowired
void setConfigurers(ObjectProvider<CachingConfigurer> configurers) {
Supplier<CachingConfigurer> cachingConfigurer = () -> {
Supplier<CachingConfigurer> configurer = () -> {
List<CachingConfigurer> candidates = configurers.stream().collect(Collectors.toList());
if (CollectionUtils.isEmpty(candidates)) {
return null;
Expand All @@ -89,7 +89,7 @@ void setConfigurers(ObjectProvider<CachingConfigurer> configurers) {
}
return candidates.get(0);
};
useCachingConfigurer(new CachingConfigurerSupplier(cachingConfigurer));
useCachingConfigurer(new CachingConfigurerSupplier(configurer));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ static AnnotationAttributes attributesFor(AnnotatedTypeMetadata metadata, Class<

@Nullable
static AnnotationAttributes attributesFor(AnnotatedTypeMetadata metadata, String annotationClassName) {
return AnnotationAttributes.fromMap(metadata.getAnnotationAttributes(annotationClassName, false));
return AnnotationAttributes.fromMap(metadata.getAnnotationAttributes(annotationClassName));
}

static Set<AnnotationAttributes> attributesForRepeatable(AnnotationMetadata metadata,
Expand All @@ -314,10 +314,10 @@ static Set<AnnotationAttributes> attributesForRepeatable(
Set<AnnotationAttributes> result = new LinkedHashSet<>();

// Direct annotation present?
addAttributesIfNotNull(result, metadata.getAnnotationAttributes(annotationClassName, false));
addAttributesIfNotNull(result, metadata.getAnnotationAttributes(annotationClassName));

// Container annotation present?
Map<String, Object> container = metadata.getAnnotationAttributes(containerClassName, false);
Map<String, Object> container = metadata.getAnnotationAttributes(containerClassName);
if (container != null && container.containsKey("value")) {
for (Map<String, Object> containedAttributes : (Map<String, Object>[]) container.get("value")) {
addAttributesIfNotNull(result, containedAttributes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public abstract class AbstractAsyncConfiguration implements ImportAware {
@Override
public void setImportMetadata(AnnotationMetadata importMetadata) {
this.enableAsync = AnnotationAttributes.fromMap(
importMetadata.getAnnotationAttributes(EnableAsync.class.getName(), false));
importMetadata.getAnnotationAttributes(EnableAsync.class.getName()));
if (this.enableAsync == null) {
throw new IllegalArgumentException(
"@EnableAsync is not present on importing class " + importMetadata.getClassName());
Expand All @@ -71,7 +71,7 @@ public void setImportMetadata(AnnotationMetadata importMetadata) {
*/
@Autowired
void setConfigurers(ObjectProvider<AsyncConfigurer> configurers) {
Supplier<AsyncConfigurer> asyncConfigurer = SingletonSupplier.of(() -> {
Supplier<AsyncConfigurer> configurer = SingletonSupplier.of(() -> {
List<AsyncConfigurer> candidates = configurers.stream().collect(Collectors.toList());
if (CollectionUtils.isEmpty(candidates)) {
return null;
Expand All @@ -81,14 +81,14 @@ void setConfigurers(ObjectProvider<AsyncConfigurer> configurers) {
}
return candidates.get(0);
});
this.executor = adapt(asyncConfigurer, AsyncConfigurer::getAsyncExecutor);
this.exceptionHandler = adapt(asyncConfigurer, AsyncConfigurer::getAsyncUncaughtExceptionHandler);
this.executor = adapt(configurer, AsyncConfigurer::getAsyncExecutor);
this.exceptionHandler = adapt(configurer, AsyncConfigurer::getAsyncUncaughtExceptionHandler);
}

private <T> Supplier<T> adapt(Supplier<AsyncConfigurer> supplier, Function<AsyncConfigurer, T> provider) {
return () -> {
AsyncConfigurer asyncConfigurer = supplier.get();
return (asyncConfigurer != null) ? provider.apply(asyncConfigurer) : null;
AsyncConfigurer configurer = supplier.get();
return (configurer != null ? provider.apply(configurer) : null);
};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2021 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.
Expand Down Expand Up @@ -57,7 +57,7 @@ public abstract class AbstractTransactionManagementConfiguration implements Impo
@Override
public void setImportMetadata(AnnotationMetadata importMetadata) {
this.enableTx = AnnotationAttributes.fromMap(
importMetadata.getAnnotationAttributes(EnableTransactionManagement.class.getName(), false));
importMetadata.getAnnotationAttributes(EnableTransactionManagement.class.getName()));
if (this.enableTx == null) {
throw new IllegalArgumentException(
"@EnableTransactionManagement is not present on importing class " + importMetadata.getClassName());
Expand Down

0 comments on commit 9dc5c9f

Please sign in to comment.