From 96c0e4783b0210fc926a83a5e72f87bea1003408 Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Fri, 8 Jul 2022 16:14:04 +0200 Subject: [PATCH] Polish ShutdownEndpoint --- .../boot/actuate/context/ShutdownEndpoint.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/ShutdownEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/ShutdownEndpoint.java index 116c24b723b..412bbfad59b 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/ShutdownEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/ShutdownEndpoint.java @@ -16,7 +16,6 @@ package org.springframework.boot.actuate.context; -import java.util.Collections; import java.util.Map; import org.springframework.beans.BeansException; @@ -37,11 +36,9 @@ import org.springframework.context.ConfigurableApplicationContext; @Endpoint(id = "shutdown", enableByDefault = false) public class ShutdownEndpoint implements ApplicationContextAware { - private static final Map NO_CONTEXT_MESSAGE = Collections - .unmodifiableMap(Collections.singletonMap("message", "No context to shutdown.")); + private static final Map NO_CONTEXT_MESSAGE = Map.of("message", "No context to shutdown."); - private static final Map SHUTDOWN_MESSAGE = Collections - .unmodifiableMap(Collections.singletonMap("message", "Shutting down, bye...")); + private static final Map SHUTDOWN_MESSAGE = Map.of("message", "Shutting down, bye..."); private ConfigurableApplicationContext context;