diff --git a/build.gradle b/build.gradle index 852b6ee334..3db0d04aa3 100644 --- a/build.gradle +++ b/build.gradle @@ -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" diff --git a/spring-context/src/main/java/org/springframework/cache/annotation/AbstractCachingConfiguration.java b/spring-context/src/main/java/org/springframework/cache/annotation/AbstractCachingConfiguration.java index 403c6e9dce..d6473e28e6 100644 --- a/spring-context/src/main/java/org/springframework/cache/annotation/AbstractCachingConfiguration.java +++ b/spring-context/src/main/java/org/springframework/cache/annotation/AbstractCachingConfiguration.java @@ -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 configurers) { - Supplier cachingConfigurer = () -> { + Supplier configurer = () -> { List 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)); } /** diff --git a/spring-context/src/main/java/org/springframework/context/annotation/AnnotationConfigUtils.java b/spring-context/src/main/java/org/springframework/context/annotation/AnnotationConfigUtils.java index 9a1a146290..bc5ad2a428 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/AnnotationConfigUtils.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/AnnotationConfigUtils.java @@ -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 attributesForRepeatable(AnnotationMetadata metadata, @@ -314,10 +314,10 @@ public abstract class AnnotationConfigUtils { Set result = new LinkedHashSet<>(); // Direct annotation present? - addAttributesIfNotNull(result, metadata.getAnnotationAttributes(annotationClassName, false)); + addAttributesIfNotNull(result, metadata.getAnnotationAttributes(annotationClassName)); // Container annotation present? - Map container = metadata.getAnnotationAttributes(containerClassName, false); + Map container = metadata.getAnnotationAttributes(containerClassName); if (container != null && container.containsKey("value")) { for (Map containedAttributes : (Map[]) container.get("value")) { addAttributesIfNotNull(result, containedAttributes); diff --git a/spring-context/src/main/java/org/springframework/scheduling/annotation/AbstractAsyncConfiguration.java b/spring-context/src/main/java/org/springframework/scheduling/annotation/AbstractAsyncConfiguration.java index 2558ab5684..53d7749982 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/annotation/AbstractAsyncConfiguration.java +++ b/spring-context/src/main/java/org/springframework/scheduling/annotation/AbstractAsyncConfiguration.java @@ -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 configurers) { - Supplier asyncConfigurer = SingletonSupplier.of(() -> { + Supplier configurer = SingletonSupplier.of(() -> { List 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 Supplier adapt(Supplier supplier, Function provider) { return () -> { - AsyncConfigurer asyncConfigurer = supplier.get(); - return (asyncConfigurer != null) ? provider.apply(asyncConfigurer) : null; + AsyncConfigurer configurer = supplier.get(); + return (configurer != null ? provider.apply(configurer) : null); }; } diff --git a/spring-tx/src/main/java/org/springframework/transaction/annotation/AbstractTransactionManagementConfiguration.java b/spring-tx/src/main/java/org/springframework/transaction/annotation/AbstractTransactionManagementConfiguration.java index 460105d9ea..0e885081fa 100644 --- a/spring-tx/src/main/java/org/springframework/transaction/annotation/AbstractTransactionManagementConfiguration.java +++ b/spring-tx/src/main/java/org/springframework/transaction/annotation/AbstractTransactionManagementConfiguration.java @@ -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());