From e48af31cedecdae5a62cab1ddab147530084d546 Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Tue, 25 Aug 2020 21:48:00 +0900 Subject: [PATCH] Polish See gh-23081 --- .../org/springframework/boot/actuate/trace/http/Include.java | 1 - .../SharedMetadataReaderFactoryContextInitializer.java | 2 +- .../org/springframework/boot/loader/tools/Repackager.java | 4 ++-- .../boot/testsupport/classpath/ForkedClassPath.java | 2 +- .../boot/context/config/ConfigFileApplicationListener.java | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/trace/http/Include.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/trace/http/Include.java index b0016fc923..86e0ae5d3a 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/trace/http/Include.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/trace/http/Include.java @@ -57,7 +57,6 @@ public enum Include { PRINCIPAL, /** - * * Include the remote address. */ REMOTE_ADDRESS, diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/SharedMetadataReaderFactoryContextInitializer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/SharedMetadataReaderFactoryContextInitializer.java index c22df6eb09..1d4dec1b11 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/SharedMetadataReaderFactoryContextInitializer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/SharedMetadataReaderFactoryContextInitializer.java @@ -76,7 +76,7 @@ class SharedMetadataReaderFactoryContextInitializer static class CachingMetadataReaderFactoryPostProcessor implements BeanDefinitionRegistryPostProcessor, PriorityOrdered { - private ConfigurableApplicationContext context; + private final ConfigurableApplicationContext context; CachingMetadataReaderFactoryPostProcessor(ConfigurableApplicationContext context) { this.context = context; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java index f4879363be..75987c3502 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/Repackager.java @@ -101,8 +101,8 @@ public class Repackager extends Packager { public void repackage(File destination, Libraries libraries, LaunchScript launchScript, FileTime lastModifiedTime) throws IOException { Assert.isTrue(destination != null && !destination.isDirectory(), "Invalid destination"); - getLayout(); // get layout early - if (lastModifiedTime != null && getLayout() instanceof War) { + Layout layout = getLayout(); // get layout early + if (lastModifiedTime != null && layout instanceof War) { throw new IllegalStateException("Reproducible repackaging is not supported with war packaging"); } destination = destination.getAbsoluteFile(); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/classpath/ForkedClassPath.java b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/classpath/ForkedClassPath.java index 4b2f8f85ee..30168fa77f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/classpath/ForkedClassPath.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/classpath/ForkedClassPath.java @@ -25,7 +25,7 @@ import java.lang.annotation.Target; import org.junit.jupiter.api.extension.ExtendWith; /** - * Annotation used to fork the classpath. This can be helpful were neither + * Annotation used to fork the classpath. This can be helpful where neither * {@link ClassPathExclusions} or {@link ClassPathOverrides} are needed, but just a copy * of the classpath. * 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 ea3b0bde5d..eac7244bcc 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 class ConfigFileApplicationListener implements EnvironmentPostProcessor, */ private static class PropertySourceOrderingPostProcessor implements BeanFactoryPostProcessor, Ordered { - private ConfigurableApplicationContext context; + private final ConfigurableApplicationContext context; PropertySourceOrderingPostProcessor(ConfigurableApplicationContext context) { this.context = context;