From a46e047c5d6ecee286c6c31b5dd5dd5cbbe88733 Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Fri, 26 Jan 2018 22:38:50 +0900 Subject: [PATCH] Polish Closes gh-11792 --- .../boot/actuate/endpoint/invoke/ParameterValueMapper.java | 2 +- .../actuate/endpoint/web/annotation/ControllerEndpoint.java | 4 ++-- .../endpoint/web/annotation/ControllerEndpointDiscoverer.java | 3 +-- .../endpoint/web/annotation/ExposableControllerEndpoint.java | 2 +- .../endpoint/web/annotation/RestControllerEndpoint.java | 2 +- .../web/reactive/ControllerEndpointHandlerMapping.java | 4 ++-- .../web/servlet/AbstractWebMvcEndpointHandlerMapping.java | 2 +- .../web/servlet/ControllerEndpointHandlerMapping.java | 4 ++-- .../boot/actuate/web/trace/HttpExchangeTracer.java | 2 +- .../web/annotation/ServletEndpointDiscovererTests.java | 2 +- .../boot/actuate/web/trace/HttpExchangeTracerTests.java | 4 ++-- .../src/main/asciidoc/production-ready-features.adoc | 4 ++-- .../boot/gradle/tasks/bundling/BootArchiveSupport.java | 2 +- 13 files changed, 18 insertions(+), 19 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/ParameterValueMapper.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/ParameterValueMapper.java index 28fca89ad2..fa7acae82a 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/ParameterValueMapper.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/ParameterValueMapper.java @@ -28,7 +28,7 @@ public interface ParameterValueMapper { /** * A {@link ParameterValueMapper} that does nothing. */ - ParameterValueMapper NONE = (paramere, value) -> value; + ParameterValueMapper NONE = (parameter, value) -> value; /** * Map the specified {@code input} parameter to the given {@code parameterType}. diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpoint.java index e9342307af..e03af9854c 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpoint.java @@ -33,7 +33,7 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; /** - * Identifies a type as being a rest endpoint that is only exposed over Spring MVC or + * Identifies a type as being an endpoint that is only exposed over Spring MVC or * Spring WebFlux. Mapped methods must be annotated with {@link GetMapping @GetMapping}, * {@link PostMapping @PostMapping}, {@link DeleteMapping @DeleteMapping}, etc annotations * rather than {@link ReadOperation @ReadOperation}, @@ -46,7 +46,7 @@ import org.springframework.web.bind.annotation.PostMapping; * @author Phillip Webb * @since 2.0.0 * @see WebEndpoint - * @see ControllerEndpoint + * @see RestControllerEndpoint */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpointDiscoverer.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpointDiscoverer.java index dcef55afd1..04512eaed2 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpointDiscoverer.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpointDiscoverer.java @@ -20,7 +20,6 @@ import java.util.Collection; import java.util.Collections; import org.springframework.boot.actuate.endpoint.EndpointFilter; -import org.springframework.boot.actuate.endpoint.ExposableEndpoint; import org.springframework.boot.actuate.endpoint.Operation; import org.springframework.boot.actuate.endpoint.annotation.DiscoveredOperationMethod; import org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer; @@ -32,7 +31,7 @@ import org.springframework.core.annotation.AnnotatedElementUtils; import org.springframework.util.Assert; /** - * {@link EndpointDiscoverer} for {@link ExposableEndpoint controller endpoints}. + * {@link EndpointDiscoverer} for {@link ExposableControllerEndpoint controller endpoints}. * * @author Phillip Webb * @since 2.0.0 diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ExposableControllerEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ExposableControllerEndpoint.java index 40efe4265b..b511e3489b 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ExposableControllerEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ExposableControllerEndpoint.java @@ -24,7 +24,7 @@ import org.springframework.web.bind.annotation.RequestMapping; /** * Information describing an endpoint that can be exposed over Spring MVC or Spring * WebFlux. Mappings should be discovered directly from {@link #getController()} and - * {@link #getOperations() operation} should always return an empty collection. + * {@link #getOperations()} should always return an empty collection. * * @author Phillip Webb * @since 2.0.0 diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RestControllerEndpoint.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RestControllerEndpoint.java index ebf03026a5..5bd3b34de0 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RestControllerEndpoint.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RestControllerEndpoint.java @@ -34,7 +34,7 @@ import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.ResponseBody; /** - * Identifies a type as being an rest endpoint that is only exposed over Spring MVC or + * Identifies a type as being a REST endpoint that is only exposed over Spring MVC or * Spring WebFlux. Mapped methods must be annotated with {@link GetMapping @GetMapping}, * {@link PostMapping @PostMapping}, {@link DeleteMapping @DeleteMapping}, etc annotations * rather than {@link ReadOperation @ReadOperation}, diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMapping.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMapping.java index 2753ebcff0..7fe4f04cf3 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMapping.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMapping.java @@ -55,7 +55,7 @@ public class ControllerEndpointHandlerMapping extends RequestMappingHandlerMappi * Create a new {@link ControllerEndpointHandlerMapping} instance providing mappings * for the specified endpoints. * @param endpointMapping the base mapping for all endpoints - * @param endpoints the web endpoints operations + * @param endpoints the web endpoints * @param corsConfiguration the CORS configuration for the endpoints or {@code null} */ public ControllerEndpointHandlerMapping(EndpointMapping endpointMapping, @@ -72,7 +72,7 @@ public class ControllerEndpointHandlerMapping extends RequestMappingHandlerMappi private Map getHandlers( Collection endpoints) { Map handlers = new LinkedHashMap<>(); - endpoints.stream() + endpoints .forEach((endpoint) -> handlers.put(endpoint.getController(), endpoint)); return Collections.unmodifiableMap(handlers); } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java index bfae89e9cd..0b6714d61a 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/AbstractWebMvcEndpointHandlerMapping.java @@ -83,7 +83,7 @@ public abstract class AbstractWebMvcEndpointHandlerMapping * Creates a new {@code WebEndpointHandlerMapping} that provides mappings for the * operations of the given {@code webEndpoints}. * @param endpointMapping the base mapping for all endpoints - * @param endpoints the web endpoints operations + * @param endpoints the web endpoints * @param endpointMediaTypes media types consumed and produced by the endpoints */ public AbstractWebMvcEndpointHandlerMapping(EndpointMapping endpointMapping, diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMapping.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMapping.java index c84a510743..98d8858c5b 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMapping.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMapping.java @@ -55,7 +55,7 @@ public class ControllerEndpointHandlerMapping extends RequestMappingHandlerMappi * Create a new {@link ControllerEndpointHandlerMapping} instance providing mappings * for the specified endpoints. * @param endpointMapping the base mapping for all endpoints - * @param endpoints the web endpoints operations + * @param endpoints the web endpoints * @param corsConfiguration the CORS configuration for the endpoints or {@code null} */ public ControllerEndpointHandlerMapping(EndpointMapping endpointMapping, @@ -73,7 +73,7 @@ public class ControllerEndpointHandlerMapping extends RequestMappingHandlerMappi private Map getHandlers( Collection endpoints) { Map handlers = new LinkedHashMap<>(); - endpoints.stream() + endpoints .forEach((endpoint) -> handlers.put(endpoint.getController(), endpoint)); return Collections.unmodifiableMap(handlers); } diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/HttpExchangeTracer.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/HttpExchangeTracer.java index 7e24ae51ce..a5d1cb3933 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/HttpExchangeTracer.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/trace/HttpExchangeTracer.java @@ -62,7 +62,7 @@ public class HttpExchangeTracer { * Ends the tracing of the exchange that is being concluded by sending the given * {@code response}. * @param trace the trace for the exchange - * @param response the response the concludes the exchange + * @param response the response that concludes the exchange * @param principal a supplier for the exchange's principal * @param sessionId a supplier for the id of the exchange's session */ diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpointDiscovererTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpointDiscovererTests.java index 99b52d5b95..61ef143c86 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpointDiscovererTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpointDiscovererTests.java @@ -112,7 +112,7 @@ public class ServletEndpointDiscovererTests { } @Test - public void getEndpointWhenEndpoinSuppliesNullShouldThrowException() { + public void getEndpointWhenEndpointSuppliesNullShouldThrowException() { load(TestServletEndpointSupplierOfNull.class, (discoverer) -> { this.thrown.expect(IllegalStateException.class); this.thrown.expectMessage("must not supply null"); diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/trace/HttpExchangeTracerTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/trace/HttpExchangeTracerTests.java index e50d6cd25d..829b161afe 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/trace/HttpExchangeTracerTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/web/trace/HttpExchangeTracerTests.java @@ -142,7 +142,7 @@ public class HttpExchangeTracerTests { public void mixedCaseCookieHeaderIsNotIncludedByDefault() { HttpTrace trace = new HttpExchangeTracer(EnumSet.of(Include.REQUEST_HEADERS)) .receivedRequest(createRequest(Collections.singletonMap( - mixedCase(HttpHeaders.COOKIE), Arrays.asList("valuet")))); + mixedCase(HttpHeaders.COOKIE), Arrays.asList("value")))); Request request = trace.getRequest(); assertThat(request.getHeaders()).isEmpty(); } @@ -285,7 +285,7 @@ public class HttpExchangeTracerTests { } @Test - public void timeTakedCanBeIncluded() { + public void timeTakenCanBeIncluded() { HttpTrace trace = new HttpTrace(createRequest()); new HttpExchangeTracer(EnumSet.of(Include.TIME_TAKEN)).sendingResponse(trace, createResponse(), null, null); diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc index 07538dfbad..dd7efcf922 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc @@ -151,7 +151,7 @@ use the following additional endpoints: |Yes |`jolokia` -|Exposes JMX beans over HTTP (when Jolokia is on the classpath, not availble for WebFlux). +|Exposes JMX beans over HTTP (when Jolokia is on the classpath, not available for WebFlux). |Yes |`logfile` @@ -1023,7 +1023,7 @@ The Jolokia endpoint can then be exposed by adding `jolokia` or `*` to the ==== Customizing Jolokia Jolokia has a number of settings that you would traditionally configure by setting servlet parameters. With Spring Boot, you can use your `application.properties` file. To do so, -prefix the parameter with `management.endpont.jolokia.config.`, as shown in the following +prefix the parameter with `management.endpoint.jolokia.config.`, as shown in the following example: [source,properties,indent=0] diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java index 7e31cf4faf..0e54d8ac78 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/tasks/bundling/BootArchiveSupport.java @@ -142,7 +142,7 @@ class BootArchiveSupport { Map detailsByPath = new TreeMap<>(); stream.process((details) -> detailsByPath.put(details.getRelativePath(), details)); - detailsByPath.values().stream().forEach(action::processFile); + detailsByPath.values().forEach(action::processFile); }); }