diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java index 2820777420..5961b2c874 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java @@ -131,8 +131,7 @@ public class ConfigurationPropertiesReportEndpoint implements ApplicationContext private Map getConfigurationPropertiesBeans(ApplicationContext context, ConfigurationBeanFactoryMetadata beanFactoryMetadata) { - Map beans = new HashMap<>(); - beans.putAll(context.getBeansWithAnnotation(ConfigurationProperties.class)); + Map beans = new HashMap<>(context.getBeansWithAnnotation(ConfigurationProperties.class)); if (beanFactoryMetadata != null) { beans.putAll(beanFactoryMetadata.getBeansWithFactoryAnnotation(ConfigurationProperties.class)); } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java index b29f1d9044..cddfa3b369 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java @@ -332,8 +332,7 @@ public abstract class AbstractWebFluxEndpointHandlerMapping extends RequestMappi } private Map getArguments(ServerWebExchange exchange, Map body) { - Map arguments = new LinkedHashMap<>(); - arguments.putAll(getTemplateVariables(exchange)); + Map arguments = new LinkedHashMap<>(getTemplateVariables(exchange)); if (body != null) { arguments.putAll(body); } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java index c26c211c67..abbba127ec 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java @@ -310,8 +310,7 @@ public abstract class AbstractWebMvcEndpointHandlerMapping extends RequestMappin } private Map getArguments(HttpServletRequest request, Map body) { - Map arguments = new LinkedHashMap<>(); - arguments.putAll(getTemplateVariables(request)); + Map arguments = new LinkedHashMap<>(getTemplateVariables(request)); String matchAllRemainingPathSegmentsVariable = this.operation.getRequestPredicate() .getMatchAllRemainingPathSegmentsVariable(); if (matchAllRemainingPathSegmentsVariable != null) { diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/Info.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/Info.java index 2227ac96cc..b43317c63f 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/Info.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/Info.java @@ -40,8 +40,7 @@ public final class Info { private final Map details; private Info(Builder builder) { - Map content = new LinkedHashMap<>(); - content.putAll(builder.content); + Map content = new LinkedHashMap<>(builder.content); this.details = Collections.unmodifiableMap(content); } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/StartupInfoLogger.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/StartupInfoLogger.java index 9655e081a2..8224da5654 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/StartupInfoLogger.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/StartupInfoLogger.java @@ -126,7 +126,7 @@ class StartupInfoLogger { } private void appendPid(StringBuilder message) { - append(message, "with PID ", () -> new ApplicationPid()); + append(message, "with PID ", ApplicationPid::new); } private void appendContext(StringBuilder message) {