From ed412af138c557e944b4abcdec2d3832da83bc60 Mon Sep 17 00:00:00 2001 From: izeye Date: Fri, 15 Apr 2022 23:38:27 +0900 Subject: [PATCH] Polish See gh-30695 --- .../boot/build/devtools/DocumentDevtoolsPropertyDefaults.java | 2 +- .../thymeleaf/ThymeleafReactiveAutoConfigurationTests.java | 3 +-- .../devtools/env/DevToolsPropertyDefaultsPostProcessor.java | 3 ++- .../MyDataElasticsearchTests.java | 2 +- .../spring-boot-gradle-plugin/src/docs/asciidoc/running.adoc | 2 +- .../boot/testsupport/gradle/testkit/GradleBuild.java | 2 +- ...utuallyExclusiveConfigurationPropertiesFailureAnalyzer.java | 2 +- .../context/MissingWebServerFactoryBeanFailureAnalyzer.java | 2 +- .../reactive/context/ReactiveWebServerApplicationContext.java | 2 +- .../servlet/context/ServletWebServerApplicationContext.java | 2 +- .../java/org/springframework/boot/SpringBootVersionTests.java | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/buildSrc/src/main/java/org/springframework/boot/build/devtools/DocumentDevtoolsPropertyDefaults.java b/buildSrc/src/main/java/org/springframework/boot/build/devtools/DocumentDevtoolsPropertyDefaults.java index bb9ac2d525..ef86b4a7ff 100644 --- a/buildSrc/src/main/java/org/springframework/boot/build/devtools/DocumentDevtoolsPropertyDefaults.java +++ b/buildSrc/src/main/java/org/springframework/boot/build/devtools/DocumentDevtoolsPropertyDefaults.java @@ -41,7 +41,7 @@ import org.gradle.api.tasks.TaskAction; */ public class DocumentDevtoolsPropertyDefaults extends DefaultTask { - private Configuration devtools; + private final Configuration devtools; private final RegularFileProperty outputFile; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafReactiveAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafReactiveAutoConfigurationTests.java index a6ee093c1b..873fc0b0bf 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafReactiveAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/thymeleaf/ThymeleafReactiveAutoConfigurationTests.java @@ -96,8 +96,7 @@ class ThymeleafReactiveAutoConfigurationTests { MediaType.APPLICATION_ATOM_XML, new MediaType("application", "javascript"), new MediaType("application", "ecmascript"), new MediaType("text", "javascript"), new MediaType("text", "ecmascript"), MediaType.APPLICATION_JSON, - new MediaType("text", "css"), MediaType.TEXT_PLAIN, MediaType.TEXT_EVENT_STREAM) - .satisfies(System.out::println)); + new MediaType("text", "css"), MediaType.TEXT_PLAIN, MediaType.TEXT_EVENT_STREAM)); } @Test diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/env/DevToolsPropertyDefaultsPostProcessor.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/env/DevToolsPropertyDefaultsPostProcessor.java index a55b6de3d6..bf245863c2 100755 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/env/DevToolsPropertyDefaultsPostProcessor.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/env/DevToolsPropertyDefaultsPostProcessor.java @@ -18,6 +18,7 @@ package org.springframework.boot.devtools.env; import java.io.IOException; import java.io.InputStream; +import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Properties; @@ -74,7 +75,7 @@ public class DevToolsPropertyDefaultsPostProcessor implements EnvironmentPostPro for (String name : properties.stringPropertyNames()) { map.put(name, properties.getProperty(name)); } - PROPERTIES = map; + PROPERTIES = Collections.unmodifiableMap(map); } @Override diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringdataelasticsearch/MyDataElasticsearchTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringdataelasticsearch/MyDataElasticsearchTests.java index 42fc3f903c..d2c0190773 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringdataelasticsearch/MyDataElasticsearchTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/docs/features/testing/springbootapplications/autoconfiguredspringdataelasticsearch/MyDataElasticsearchTests.java @@ -20,7 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.autoconfigure.data.elasticsearch.DataElasticsearchTest; @DataElasticsearchTest -public class MyDataElasticsearchTests { +class MyDataElasticsearchTests { @Autowired @SuppressWarnings("unused") diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/running.adoc b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/running.adoc index 7853abde10..5dea267260 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/running.adoc +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/docs/asciidoc/running.adoc @@ -123,7 +123,7 @@ The preceding example sets the value of the `example` project property to `custo [[running-your-application.reloading-resources]] == Reloading Resources If devtools has been added to your project it will automatically monitor your application's classpath for changes. -Note that modified files need to be recompiled for the classpath to update inorder to trigger reloading with devtools. +Note that modified files need to be recompiled for the classpath to update in order to trigger reloading with devtools. For more details on using devtools, refer to {spring-boot-reference}#using.devtools.restart[this section of the reference documentation]. Alternatively, you can configure `bootRun` such that your application's static resources are loaded from their source location: diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-test-support/src/main/java/org/springframework/boot/testsupport/gradle/testkit/GradleBuild.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-test-support/src/main/java/org/springframework/boot/testsupport/gradle/testkit/GradleBuild.java index b9ecb49186..7268df47aa 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-test-support/src/main/java/org/springframework/boot/testsupport/gradle/testkit/GradleBuild.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-test-support/src/main/java/org/springframework/boot/testsupport/gradle/testkit/GradleBuild.java @@ -184,7 +184,7 @@ public class GradleBuild { buildOutput = buildOutput.replaceAll(message, ""); } } - assertThat(buildOutput).doesNotContain("Deprecated").doesNotContain("deprecated"); + assertThat(buildOutput).doesNotContainIgnoringCase("deprecated"); } return result; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/MutuallyExclusiveConfigurationPropertiesFailureAnalyzer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/MutuallyExclusiveConfigurationPropertiesFailureAnalyzer.java index cc1b638cf3..56bac16c92 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/MutuallyExclusiveConfigurationPropertiesFailureAnalyzer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/MutuallyExclusiveConfigurationPropertiesFailureAnalyzer.java @@ -37,7 +37,7 @@ import org.springframework.core.env.Environment; import org.springframework.core.env.PropertySource; /** - * A {@link FailureAnalyzer} that performs analysis of failures caused by an + * A {@link FailureAnalyzer} that performs analysis of failures caused by a * {@link MutuallyExclusiveConfigurationPropertiesException}. * * @author Andy Wilkinson diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/MissingWebServerFactoryBeanFailureAnalyzer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/MissingWebServerFactoryBeanFailureAnalyzer.java index bea77b2cfb..d27cdd7861 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/MissingWebServerFactoryBeanFailureAnalyzer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/context/MissingWebServerFactoryBeanFailureAnalyzer.java @@ -24,7 +24,7 @@ import org.springframework.boot.diagnostics.FailureAnalyzer; import org.springframework.core.annotation.Order; /** - * A {@link FailureAnalyzer} that performs analysis of failures caused by an + * A {@link FailureAnalyzer} that performs analysis of failures caused by a * {@link MissingWebServerFactoryBeanException}. * * @author Guirong Hu diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ReactiveWebServerApplicationContext.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ReactiveWebServerApplicationContext.java index 8871149c10..f21b87e392 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ReactiveWebServerApplicationContext.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/reactive/context/ReactiveWebServerApplicationContext.java @@ -107,7 +107,7 @@ public class ReactiveWebServerApplicationContext extends GenericReactiveWebAppli // Use bean names so that we don't consider the hierarchy String[] beanNames = getBeanFactory().getBeanNamesForType(ReactiveWebServerFactory.class); if (beanNames.length == 0) { - throw new MissingWebServerFactoryBeanException(this.getClass(), ReactiveWebServerFactory.class, + throw new MissingWebServerFactoryBeanException(getClass(), ReactiveWebServerFactory.class, WebApplicationType.REACTIVE); } if (beanNames.length > 1) { diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContext.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContext.java index 0fcb28d5f5..1a6090b500 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContext.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/servlet/context/ServletWebServerApplicationContext.java @@ -209,7 +209,7 @@ public class ServletWebServerApplicationContext extends GenericWebApplicationCon // Use bean names so that we don't consider the hierarchy String[] beanNames = getBeanFactory().getBeanNamesForType(ServletWebServerFactory.class); if (beanNames.length == 0) { - throw new MissingWebServerFactoryBeanException(this.getClass(), ServletWebServerFactory.class, + throw new MissingWebServerFactoryBeanException(getClass(), ServletWebServerFactory.class, WebApplicationType.SERVLET); } if (beanNames.length > 1) { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringBootVersionTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringBootVersionTests.java index 9e6995b3b5..887413c25c 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringBootVersionTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/SpringBootVersionTests.java @@ -31,7 +31,7 @@ import static org.assertj.core.api.Assertions.assertThat; * * @author Andy Wilkinson */ -public class SpringBootVersionTests { +class SpringBootVersionTests { @Test void getVersionShouldReturnVersionMatchingGradleProperties() throws IOException {