commit
9dc5c9f935
|
@ -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"
|
||||
|
@ -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"
|
||||
|
|
|
@ -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());
|
||||
|
@ -76,7 +76,7 @@ public abstract class AbstractCachingConfiguration implements ImportAware {
|
|||
|
||||
@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;
|
||||
|
@ -89,7 +89,7 @@ public abstract class AbstractCachingConfiguration implements ImportAware {
|
|||
}
|
||||
return candidates.get(0);
|
||||
};
|
||||
useCachingConfigurer(new CachingConfigurerSupplier(cachingConfigurer));
|
||||
useCachingConfigurer(new CachingConfigurerSupplier(configurer));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -298,7 +298,7 @@ public abstract class AnnotationConfigUtils {
|
|||
|
||||
@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,
|
||||
|
@ -314,10 +314,10 @@ public abstract class AnnotationConfigUtils {
|
|||
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);
|
||||
|
|
|
@ -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());
|
||||
|
@ -71,7 +71,7 @@ public abstract class AbstractAsyncConfiguration implements ImportAware {
|
|||
*/
|
||||
@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;
|
||||
|
@ -81,14 +81,14 @@ public abstract class AbstractAsyncConfiguration implements ImportAware {
|
|||
}
|
||||
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);
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue