Commit 6777a437 authored by Stephane Nicoll's avatar Stephane Nicoll

Merge pull request #17832 from succezlijunyi

* pr/17832:
  Simplify some code

Closes gh-17832
parents 835108e5 844a8d80
...@@ -131,8 +131,7 @@ public class ConfigurationPropertiesReportEndpoint implements ApplicationContext ...@@ -131,8 +131,7 @@ public class ConfigurationPropertiesReportEndpoint implements ApplicationContext
private Map<String, Object> getConfigurationPropertiesBeans(ApplicationContext context, private Map<String, Object> getConfigurationPropertiesBeans(ApplicationContext context,
ConfigurationBeanFactoryMetadata beanFactoryMetadata) { ConfigurationBeanFactoryMetadata beanFactoryMetadata) {
Map<String, Object> beans = new HashMap<>(); Map<String, Object> beans = new HashMap<>(context.getBeansWithAnnotation(ConfigurationProperties.class));
beans.putAll(context.getBeansWithAnnotation(ConfigurationProperties.class));
if (beanFactoryMetadata != null) { if (beanFactoryMetadata != null) {
beans.putAll(beanFactoryMetadata.getBeansWithFactoryAnnotation(ConfigurationProperties.class)); beans.putAll(beanFactoryMetadata.getBeansWithFactoryAnnotation(ConfigurationProperties.class));
} }
......
...@@ -332,8 +332,7 @@ public abstract class AbstractWebFluxEndpointHandlerMapping extends RequestMappi ...@@ -332,8 +332,7 @@ public abstract class AbstractWebFluxEndpointHandlerMapping extends RequestMappi
} }
private Map<String, Object> getArguments(ServerWebExchange exchange, Map<String, String> body) { private Map<String, Object> getArguments(ServerWebExchange exchange, Map<String, String> body) {
Map<String, Object> arguments = new LinkedHashMap<>(); Map<String, Object> arguments = new LinkedHashMap<>(getTemplateVariables(exchange));
arguments.putAll(getTemplateVariables(exchange));
if (body != null) { if (body != null) {
arguments.putAll(body); arguments.putAll(body);
} }
......
...@@ -310,8 +310,7 @@ public abstract class AbstractWebMvcEndpointHandlerMapping extends RequestMappin ...@@ -310,8 +310,7 @@ public abstract class AbstractWebMvcEndpointHandlerMapping extends RequestMappin
} }
private Map<String, Object> getArguments(HttpServletRequest request, Map<String, String> body) { private Map<String, Object> getArguments(HttpServletRequest request, Map<String, String> body) {
Map<String, Object> arguments = new LinkedHashMap<>(); Map<String, Object> arguments = new LinkedHashMap<>(getTemplateVariables(request));
arguments.putAll(getTemplateVariables(request));
String matchAllRemainingPathSegmentsVariable = this.operation.getRequestPredicate() String matchAllRemainingPathSegmentsVariable = this.operation.getRequestPredicate()
.getMatchAllRemainingPathSegmentsVariable(); .getMatchAllRemainingPathSegmentsVariable();
if (matchAllRemainingPathSegmentsVariable != null) { if (matchAllRemainingPathSegmentsVariable != null) {
......
...@@ -40,8 +40,7 @@ public final class Info { ...@@ -40,8 +40,7 @@ public final class Info {
private final Map<String, Object> details; private final Map<String, Object> details;
private Info(Builder builder) { private Info(Builder builder) {
Map<String, Object> content = new LinkedHashMap<>(); Map<String, Object> content = new LinkedHashMap<>(builder.content);
content.putAll(builder.content);
this.details = Collections.unmodifiableMap(content); this.details = Collections.unmodifiableMap(content);
} }
......
...@@ -126,7 +126,7 @@ class StartupInfoLogger { ...@@ -126,7 +126,7 @@ class StartupInfoLogger {
} }
private void appendPid(StringBuilder message) { private void appendPid(StringBuilder message) {
append(message, "with PID ", () -> new ApplicationPid()); append(message, "with PID ", ApplicationPid::new);
} }
private void appendContext(StringBuilder message) { private void appendContext(StringBuilder message) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment