From 88b184ca23549b87de282ee10bf6b43d5fa98b06 Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Tue, 20 Feb 2018 05:47:01 +0900 Subject: [PATCH] Polish --- .../web/servlet/WebMvcMetricsFilter.java | 6 +++--- .../security/StaticResourceLocation.java | 2 +- .../security/reactive/PathRequest.java | 2 +- .../reactive/StaticResourceRequest.java | 2 +- .../security/servlet/PathRequest.java | 2 +- .../reactive/StaticResourceRequestTests.java | 6 ++---- .../asciidoc/production-ready-features.adoc | 2 +- .../ApplicationContextAssertTests.java | 2 +- .../endpoint/SpecificEndpoint.java | 2 +- .../IncrementalSpecificEndpoint.java | 2 +- .../boot/loader/tools/JarWriter.java | 4 ++-- .../netty/NettyReactiveWebServerFactory.java | 2 +- .../ConfigurationPropertiesTests.java | 20 +++++++++---------- .../properties/bind/BindableTests.java | 2 +- 14 files changed, 27 insertions(+), 29 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java index 4beb9dad91..033b7cbd1d 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/servlet/WebMvcMetricsFilter.java @@ -113,8 +113,8 @@ public class WebMvcMetricsFilter extends OncePerRequestFilter { private void filterAndRecordMetrics(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) - throws IOException, ServletException, NestedServletException { - Object handler = null; + throws IOException, ServletException { + Object handler; try { handler = getHandler(request); } @@ -149,7 +149,7 @@ public class WebMvcMetricsFilter extends OncePerRequestFilter { private void filterAndRecordMetrics(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain, Object handler) - throws IOException, ServletException, NestedServletException { + throws IOException, ServletException { TimingContext timingContext = TimingContext.get(request); if (timingContext == null) { timingContext = startAndAttachTimingContext(request, handler); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/StaticResourceLocation.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/StaticResourceLocation.java index a2bd404d28..f6d72cfcfe 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/StaticResourceLocation.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/StaticResourceLocation.java @@ -51,7 +51,7 @@ public enum StaticResourceLocation { */ FAVICON("/**/favicon.ico"); - private String[] patterns; + private final String[] patterns; StaticResourceLocation(String... patterns) { this.patterns = patterns; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/PathRequest.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/PathRequest.java index 395ad96645..93786c3410 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/PathRequest.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/PathRequest.java @@ -33,7 +33,7 @@ public final class PathRequest { /** * Returns a {@link StaticResourceRequest} that can be used to create a matcher for - * {@link StaticResourceLocation Locations}. + * {@link StaticResourceLocation locations}. * @return a {@link StaticResourceRequest} */ public static StaticResourceRequest toStaticResources() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequest.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequest.java index bb2b2d85b4..d059261efb 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequest.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequest.java @@ -90,7 +90,7 @@ public final class StaticResourceRequest { /** * The server web exchange matcher used to match against resource - * {@link StaticResourceLocation Locations}. + * {@link StaticResourceLocation locations}. */ public static final class StaticResourceServerWebExchange implements ServerWebExchangeMatcher { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/PathRequest.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/PathRequest.java index 865af6cff6..a12ed21603 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/PathRequest.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/servlet/PathRequest.java @@ -38,7 +38,7 @@ public final class PathRequest { /** * Returns a {@link StaticResourceRequest} that can be used to create a matcher for - * {@link StaticResourceLocation Locations}. + * {@link StaticResourceLocation locations}. * @return a {@link StaticResourceRequest} */ public static StaticResourceRequest toStaticResources() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequestTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequestTests.java index 7806c8a4ff..ca02bc9428 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequestTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/StaticResourceRequestTests.java @@ -90,12 +90,10 @@ public class StaticResourceRequestTests { this.resourceRequest.atCommonLocations().excluding(null); } - private StaticResourceRequestTests.RequestMatcherAssert assertMatcher( - ServerWebExchangeMatcher matcher) { + private RequestMatcherAssert assertMatcher(ServerWebExchangeMatcher matcher) { StaticWebApplicationContext context = new StaticWebApplicationContext(); context.registerBean(ServerProperties.class); - return assertThat( - new StaticResourceRequestTests.RequestMatcherAssert(context, matcher)); + return assertThat(new RequestMatcherAssert(context, matcher)); } private static class RequestMatcherAssert implements AssertDelegateTarget { 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 8910710d92..be3de0a2e7 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 @@ -1339,7 +1339,7 @@ provided: [source,properties,indent=0] ---- - management.metrics.export.signalfx.acesss-token=YOUR_ACCESS_TOKEN + management.metrics.export.signalfx.access-token=YOUR_ACCESS_TOKEN ---- You can also change the interval at which metrics are sent to SignalFx: diff --git a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertTests.java b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertTests.java index 0b9629acd6..db2b60eafb 100644 --- a/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertTests.java +++ b/spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/context/assertj/ApplicationContextAssertTests.java @@ -260,7 +260,7 @@ public class ApplicationContextAssertTests { } @Test - public void getBeanOfTypeWhenInParentWithLimtedScopeShouldReturnNullAssert() { + public void getBeanOfTypeWhenInParentWithLimitedScopeShouldReturnNullAssert() { this.parent.registerSingleton("foo", Foo.class); assertThat(getAssert(this.context)).getBean(Foo.class, Scope.NO_ANCESTORS) .isNull(); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/endpoint/SpecificEndpoint.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/endpoint/SpecificEndpoint.java index b142bbb8cb..244c3385f8 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/endpoint/SpecificEndpoint.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/endpoint/SpecificEndpoint.java @@ -21,7 +21,7 @@ import org.springframework.boot.configurationsample.ReadOperation; import org.springframework.lang.Nullable; /** - * An meta-annotated endpoint similar to {@code @WebEndpoint} or {@code @JmxEndpoint} in + * A meta-annotated endpoint similar to {@code @WebEndpoint} or {@code @JmxEndpoint} in * Spring Boot. Also with a package private read operation that has an optional argument. * * @author Stephane Nicoll diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/endpoint/incremental/IncrementalSpecificEndpoint.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/endpoint/incremental/IncrementalSpecificEndpoint.java index 368133db27..81c3e7cd9f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/endpoint/incremental/IncrementalSpecificEndpoint.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/endpoint/incremental/IncrementalSpecificEndpoint.java @@ -19,7 +19,7 @@ package org.springframework.boot.configurationsample.endpoint.incremental; import org.springframework.boot.configurationsample.MetaEndpoint; /** - * An meta-annotated endpoint similar to {@code @WebEndpoint} or {@code @JmxEndpoint} in + * A meta-annotated endpoint similar to {@code @WebEndpoint} or {@code @JmxEndpoint} in * Spring Boot. * * @author Stephane Nicoll diff --git a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JarWriter.java b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JarWriter.java index fa0463936f..f1feef75ad 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JarWriter.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JarWriter.java @@ -47,7 +47,7 @@ import org.apache.commons.compress.archivers.jar.JarArchiveOutputStream; import org.apache.commons.compress.archivers.zip.UnixStat; /** - * Writes JAR content, ensuring valid directory entries are always create and duplicate + * Writes JAR content, ensuring valid directory entries are always created and duplicate * items are ignored. * * @author Phillip Webb @@ -247,7 +247,7 @@ public class JarWriter implements LoaderClassesWriter, AutoCloseable { } /** - * Perform the actual write of a {@link JarEntry}. All other {@code write} methods + * Perform the actual write of a {@link JarEntry}. All other write methods * delegate to this one. * @param entry the entry to write * @param entryWriter the entry writer or {@code null} if there is no content diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactory.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactory.java index 6e8d9383fd..fb33f5ac42 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactory.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactory.java @@ -92,7 +92,7 @@ public class NettyReactiveWebServerFactory extends AbstractReactiveWebServerFact /** * Set the maximum amount of time that should be waited when starting or stopping the * server. - * @param lifecycleTimeout the lefecycle timeout + * @param lifecycleTimeout the lifecycle timeout */ public void setLifecycleTimeout(Duration lifecycleTimeout) { this.lifecycleTimeout = lifecycleTimeout; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java index cd32be94ff..7348bfed50 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/ConfigurationPropertiesTests.java @@ -275,15 +275,15 @@ public class ConfigurationPropertiesTests { } @Test - public void loadWhenPrefixedPropertiesDecalredAsBeanShouldBind() { - load(PrefixPropertiesDecalredAsBeanConfiguration.class, "spring.foo.name=foo"); + public void loadWhenPrefixedPropertiesDeclaredAsBeanShouldBind() { + load(PrefixPropertiesDeclaredAsBeanConfiguration.class, "spring.foo.name=foo"); PrefixProperties bean = this.context.getBean(PrefixProperties.class); assertThat(((BasicProperties) bean).name).isEqualTo("foo"); } @Test - public void loadWhenPrefixedPropertiesDecalredAsAnnotationValueShouldBind() { - load(PrefixPropertiesDecalredAsAnnotationValueConfiguration.class, + public void loadWhenPrefixedPropertiesDeclaredAsAnnotationValueShouldBind() { + load(PrefixPropertiesDeclaredAsAnnotationValueConfiguration.class, "spring.foo.name=foo"); PrefixProperties bean = this.context.getBean( "spring.foo-" + PrefixProperties.class.getName(), PrefixProperties.class); @@ -291,8 +291,8 @@ public class ConfigurationPropertiesTests { } @Test - public void loadWhenMultiplePrefixedPropertiesDecalredAsAnnotationValueShouldBind() { - load(MultiplePrefixPropertiesDecalredAsAnnotationValueConfiguration.class, + public void loadWhenMultiplePrefixedPropertiesDeclaredAsAnnotationValueShouldBind() { + load(MultiplePrefixPropertiesDeclaredAsAnnotationValueConfiguration.class, "spring.foo.name=foo", "spring.bar.name=bar"); PrefixProperties bean1 = this.context.getBean(PrefixProperties.class); AnotherPrefixProperties bean2 = this.context @@ -510,7 +510,7 @@ public class ConfigurationPropertiesTests { } @Test - public void loadWhenOverridingPropertiesWithPlaceholderResolutionInEnvionmentShouldBindWithOverride() { + public void loadWhenOverridingPropertiesWithPlaceholderResolutionInEnvironmentShouldBindWithOverride() { MutablePropertySources sources = this.context.getEnvironment() .getPropertySources(); sources.addFirst(new SystemEnvironmentPropertySource("system", @@ -790,7 +790,7 @@ public class ConfigurationPropertiesTests { @Configuration @EnableConfigurationProperties - static class PrefixPropertiesDecalredAsBeanConfiguration { + static class PrefixPropertiesDeclaredAsBeanConfiguration { @Bean public PrefixProperties prefixProperties() { @@ -801,14 +801,14 @@ public class ConfigurationPropertiesTests { @Configuration @EnableConfigurationProperties(PrefixProperties.class) - static class PrefixPropertiesDecalredAsAnnotationValueConfiguration { + static class PrefixPropertiesDeclaredAsAnnotationValueConfiguration { } @Configuration @EnableConfigurationProperties({ PrefixProperties.class, AnotherPrefixProperties.class }) - static class MultiplePrefixPropertiesDecalredAsAnnotationValueConfiguration { + static class MultiplePrefixPropertiesDeclaredAsAnnotationValueConfiguration { } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindableTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindableTests.java index 3133767b34..798551c76b 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindableTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BindableTests.java @@ -142,7 +142,7 @@ public class BindableTests { } @Test - public void getAnnotationWhenMatchShouldReuturnAnnotation() { + public void getAnnotationWhenMatchShouldReturnAnnotation() { Test annotation = AnnotationUtils.synthesizeAnnotation(Test.class); assertThat(Bindable.of(String.class).withAnnotations(annotation) .getAnnotation(Test.class)).isSameAs(annotation);