diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/ContextIdApplicationContextInitializer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/ContextIdApplicationContextInitializer.java index f8aae8e15ecd..f7e6e0ceeeeb 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/ContextIdApplicationContextInitializer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/ContextIdApplicationContextInitializer.java @@ -72,7 +72,7 @@ private String getApplicationId(ConfigurableEnvironment environment) { /** * The ID of a context. */ - class ContextId { + static class ContextId { private final AtomicLong children = new AtomicLong(0); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java index 1b0176655f2a..b33937b87a72 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java @@ -259,7 +259,7 @@ public void setSearchNames(String names) { * {@link BeanFactoryPostProcessor} to re-order our property sources below any * {@code @PropertySource} items added by the {@link ConfigurationClassPostProcessor}. */ - private class PropertySourceOrderingPostProcessor implements BeanFactoryPostProcessor, Ordered { + private static class PropertySourceOrderingPostProcessor implements BeanFactoryPostProcessor, Ordered { private ConfigurableApplicationContext context; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/info/InfoProperties.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/info/InfoProperties.java index 17cb79691124..18e5bc951bc2 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/info/InfoProperties.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/info/InfoProperties.java @@ -121,7 +121,7 @@ public void remove() { /** * Property entry. */ - public final class Entry { + public static final class Entry { private final String key; diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/java/JavaLoggingSystem.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/java/JavaLoggingSystem.java index 0b04ee775175..e79b75100693 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/java/JavaLoggingSystem.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/java/JavaLoggingSystem.java @@ -168,7 +168,7 @@ public void cleanUp() { this.configuredLoggers.clear(); } - private final class ShutdownHandler implements Runnable { + private static final class ShutdownHandler implements Runnable { @Override public void run() { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java index 154030c62ca9..872204b3b2ad 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/util/LambdaSafe.java @@ -283,12 +283,10 @@ private Callbacks(Class callbackType, Collection callbackInstanc * @param invoker the invoker used to invoke the callback */ public void invoke(Consumer invoker) { - this.callbackInstances.forEach((callbackInstance) -> { - invoke(callbackInstance, () -> { - invoker.accept(callbackInstance); - return null; - }); - }); + this.callbackInstances.forEach((callbackInstance) -> invoke(callbackInstance, () -> { + invoker.accept(callbackInstance); + return null; + })); } /**