From 768e7c07e663ab96ce58dd238cdd3f1d1efa5802 Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Tue, 23 Jan 2018 01:24:16 +0900 Subject: [PATCH] Polish Closes gh-11720 --- .../autoconfigure/security/reactive/EndpointRequest.java | 2 +- .../endpoint/annotation/AbstractDiscoveredEndpoint.java | 2 +- .../endpoint/jmx/annotation/DiscoveredJmxOperation.java | 2 +- .../endpoint/annotation/EndpointDiscovererTests.java | 2 +- .../invoke/reflect/OperationMethodParameterTests.java | 2 +- .../invoke/reflect/ReflectiveOperationInvokerTests.java | 4 ++-- .../boot/actuate/endpoint/web/WebEndpointResponseTests.java | 2 +- .../boot/devtools/filewatch/FileSystemWatcher.java | 2 +- .../src/main/asciidoc/appendix-application-properties.adoc | 2 +- .../src/main/asciidoc/spring-boot-features.adoc | 6 +++--- .../test/web/RandomPortTestRestTemplateExampleTests.java | 2 +- .../boot/test/web/RandomPortWebTestClientExampleTests.java | 2 +- .../InvalidConfigurationPropertyValueFailureAnalyzer.java | 2 +- .../boot/context/properties/bind/MapBinderTests.java | 5 ++--- .../boot/diagnostics/FailureAnalyzersTests.java | 2 +- .../webflux/SampleSecureWebFluxCustomSecurityTests.java | 2 +- 16 files changed, 20 insertions(+), 21 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequest.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequest.java index 380b45027b..c2e8f12b1d 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequest.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequest.java @@ -55,7 +55,7 @@ public final class EndpointRequest { * {@link EndpointServerWebExchangeMatcher#excluding(Class...) excluding} method can * be used to further remove specific endpoints if required. For example: *
-	 * EndpointServerWebExchangeMatcher.toAnyEndpoint().excluding(ShutdownEndpoint.class)
+	 * EndpointRequest.toAnyEndpoint().excluding(ShutdownEndpoint.class)
 	 * 
* @return the configured {@link ServerWebExchangeMatcher} */ diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/AbstractDiscoveredEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/AbstractDiscoveredEndpoint.java index d3ad933614..20ebc02178 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/AbstractDiscoveredEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/annotation/AbstractDiscoveredEndpoint.java @@ -40,7 +40,7 @@ public abstract class AbstractDiscoveredEndpoint private final Object endpointBean; /** - * Create a mew {@link AbstractDiscoveredEndpoint} instance. + * Create a new {@link AbstractDiscoveredEndpoint} instance. * @param discoverer the discoverer that discovered the endpoint * @param endpointBean the primary source bean * @param id the ID of the endpoint diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/annotation/DiscoveredJmxOperation.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/annotation/DiscoveredJmxOperation.java index 08cb765214..49aec8cd5d 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/annotation/DiscoveredJmxOperation.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/annotation/DiscoveredJmxOperation.java @@ -45,7 +45,7 @@ import org.springframework.util.StringUtils; * A discovered {@link JmxOperation JMX operation}. * * @author Stephane Nicoll - * @author Philip Webb + * @author Phillip Webb */ class DiscoveredJmxOperation extends AbstractDiscoveredOperation implements JmxOperation { diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscovererTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscovererTests.java index 8b83cfa5af..2f381081c8 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscovererTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/annotation/EndpointDiscovererTests.java @@ -161,7 +161,7 @@ public class EndpointDiscovererTests { } @Test - public void getEndpointsWhenTtlSetByIdAndIdDoesntMatchShouldNotCacheInvokeCalls() { + public void getEndpointsWhenTtlSetByIdAndIdDoesNotMatchShouldNotCacheInvokeCalls() { load(TestEndpointConfiguration.class, (context) -> { TestEndpointDiscoverer discoverer = new TestEndpointDiscoverer(context, (endpointId) -> (endpointId.equals("foo") ? 500L : 0L)); diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParameterTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParameterTests.java index ebf5e8aab7..fb95661ce2 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParameterTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/OperationMethodParameterTests.java @@ -43,7 +43,7 @@ public class OperationMethodParameterTests { } @Test - public void getTypeShouldReturnTyoe() { + public void getTypeShouldReturnType() { OperationMethodParameter parameter = new OperationMethodParameter("name", this.method.getParameters()[0]); assertThat(parameter.getType()).isEqualTo(String.class); diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/ReflectiveOperationInvokerTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/ReflectiveOperationInvokerTests.java index ac7f7ab1f5..c6e14c7a55 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/ReflectiveOperationInvokerTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/invoke/reflect/ReflectiveOperationInvokerTests.java @@ -73,7 +73,7 @@ public class ReflectiveOperationInvokerTests { } @Test - public void createWhenParamaterValueMapperIsNullShouldThrowException() { + public void createWhenParameterValueMapperIsNullShouldThrowException() { this.thrown.expect(IllegalArgumentException.class); this.thrown.expectMessage("ParameterValueMapper must not be null"); new ReflectiveOperationInvoker(this.target, this.operationMethod, null); @@ -88,7 +88,7 @@ public class ReflectiveOperationInvokerTests { } @Test - public void invokeWhenMissingNonNullableArgmentShouldThrowException() { + public void invokeWhenMissingNonNullableArgumentShouldThrowException() { ReflectiveOperationInvoker invoker = new ReflectiveOperationInvoker(this.target, this.operationMethod, this.parameterValueMapper); this.thrown.expect(MissingParametersException.class); diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/WebEndpointResponseTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/WebEndpointResponseTests.java index 5fa5441507..84f0b355d1 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/WebEndpointResponseTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/WebEndpointResponseTests.java @@ -49,7 +49,7 @@ public class WebEndpointResponseTests { } @Test - public void createWhithBodyAndStatusShouldReturnStatusAndBody() { + public void createWithBodyAndStatusShouldReturnStatusAndBody() { WebEndpointResponse response = new WebEndpointResponse<>("body", 500); assertThat(response.getStatus()).isEqualTo(500); assertThat(response.getBody()).isEqualTo("body"); diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSystemWatcher.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSystemWatcher.java index e0e1a6e413..3fdb6c6b03 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSystemWatcher.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/filewatch/FileSystemWatcher.java @@ -186,7 +186,7 @@ public class FileSystemWatcher { * @param remainingScans the number of remaining scans */ void stopAfter(int remainingScans) { - Thread thread = null; + Thread thread; synchronized (this.monitor) { thread = this.watchThread; if (thread != null) { diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index 57ac8b7d3f..086cb801db 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -1225,7 +1225,7 @@ content into your application. Rather, pick only the properties that you need. management.endpoint.loggers.cache.time-to-live=0ms # Maximum time that a response can be cached. management.endpoint.loggers.enabled= # Whether to enable the loggers endpoint. - # REQUEST MAPPING ENDPOINT ({sc-spring-boot-actuator}/web/MappingsEndpoint.{sc-ext}[MappingsEndpoint]) + # REQUEST MAPPING ENDPOINT ({sc-spring-boot-actuator}/web/mappings/MappingsEndpoint.{sc-ext}[MappingsEndpoint]) management.endpoint.mappings.cache.time-to-live=0ms # Maximum time that a response can be cached. management.endpoint.mappings.enabled= # Whether to enable the mappings endpoint. diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 00173447ef..395df5fdec 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -2391,7 +2391,7 @@ following example: } @GetMapping("/{user}/customers") - Flux getUserCustomers(@PathVariable Long user) { + public Flux getUserCustomers(@PathVariable Long user) { // ... } @@ -2437,7 +2437,7 @@ actual handling of the requests, as shown in the following example: } ---- -WebFlux is part of the Spring Framework. and detailed information is available in its +WebFlux is part of the Spring Framework and detailed information is available in its {spring-reference}web-reactive.html#webflux-fn[reference documentation]. TIP: You can define as many `RouterFunction` beans as you like to modularize the @@ -6313,7 +6313,7 @@ Often, `@WebFluxTest` is limited to a single controller and used in combination `@MockBean` annotation to provide mock implementations for required collaborators. `@WebFluxTest` also auto-configures -{spring-reference}testing.html#webtestclient[`WebTestClient`]`WebTestClient`, which offers +{spring-reference}testing.html#webtestclient[`WebTestClient`], which offers a powerful way to quickly test WebFlux controllers without needing to start a full HTTP server. diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/test/web/RandomPortTestRestTemplateExampleTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/test/web/RandomPortTestRestTemplateExampleTests.java index d712c7056a..7d04c6496c 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/test/web/RandomPortTestRestTemplateExampleTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/test/web/RandomPortTestRestTemplateExampleTests.java @@ -42,4 +42,4 @@ public class RandomPortTestRestTemplateExampleTests { } } -// tag::test-random-port[] +// end::test-random-port[] diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/test/web/RandomPortWebTestClientExampleTests.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/test/web/RandomPortWebTestClientExampleTests.java index fca09e7f52..2122fbebb4 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/test/web/RandomPortWebTestClientExampleTests.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/test/web/RandomPortWebTestClientExampleTests.java @@ -41,4 +41,4 @@ public class RandomPortWebTestClientExampleTests { } } -// tag::test-random-port[] +// end::test-random-port[] diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/InvalidConfigurationPropertyValueFailureAnalyzer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/InvalidConfigurationPropertyValueFailureAnalyzer.java index ea4bfc3015..a7b0c61621 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/InvalidConfigurationPropertyValueFailureAnalyzer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/diagnostics/analyzer/InvalidConfigurationPropertyValueFailureAnalyzer.java @@ -36,7 +36,7 @@ import org.springframework.core.env.PropertySource; import org.springframework.util.StringUtils; /** - * A {@link FailureAnalyzer} that performs analysis of failures caused by a + * A {@link FailureAnalyzer} that performs analysis of failures caused by an * {@link InvalidConfigurationPropertyValueException}. * * @author Stephane Nicoll diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/MapBinderTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/MapBinderTests.java index e7e4e046e2..749b5717f7 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/MapBinderTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/MapBinderTests.java @@ -610,9 +610,8 @@ public class MapBinderTests { @Override public Map convert(String s) { - Map map = new HashMap<>(); - StringUtils.commaDelimitedListToSet(s).forEach((k) -> map.put(k, "")); - return map; + return StringUtils.commaDelimitedListToSet(s).stream() + .collect(Collectors.toMap((k) -> k, (k) -> "")); } } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/FailureAnalyzersTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/FailureAnalyzersTests.java index 5e648742f9..6e82dfd06a 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/FailureAnalyzersTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/FailureAnalyzersTests.java @@ -65,7 +65,7 @@ public class FailureAnalyzersTests { } @Test - public void environmentIsInjectedIntEnvironmentAwareFailureAnalyzers() { + public void environmentIsInjectedIntoEnvironmentAwareFailureAnalyzers() { RuntimeException failure = new RuntimeException(); analyzeAndReport("basic.factories", failure); verify(failureAnalyzer).setEnvironment(any(Environment.class)); diff --git a/spring-boot-samples/spring-boot-sample-secure-webflux/src/test/java/sample/secure/webflux/SampleSecureWebFluxCustomSecurityTests.java b/spring-boot-samples/spring-boot-sample-secure-webflux/src/test/java/sample/secure/webflux/SampleSecureWebFluxCustomSecurityTests.java index 985e53aa49..f53607efa7 100644 --- a/spring-boot-samples/spring-boot-sample-secure-webflux/src/test/java/sample/secure/webflux/SampleSecureWebFluxCustomSecurityTests.java +++ b/spring-boot-samples/spring-boot-sample-secure-webflux/src/test/java/sample/secure/webflux/SampleSecureWebFluxCustomSecurityTests.java @@ -97,7 +97,7 @@ public class SampleSecureWebFluxCustomSecurityTests { } @Bean - SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) { + public SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) { http.authorizeExchange().matchers(EndpointRequest.to("health", "info")) .permitAll().matchers(EndpointRequest.toAnyEndpoint()) .hasRole("ACTUATOR")