Polish
This commit is contained in:
parent
cc9a5b72e1
commit
88b184ca23
|
@ -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);
|
||||
|
|
|
@ -51,7 +51,7 @@ public enum StaticResourceLocation {
|
|||
*/
|
||||
FAVICON("/**/favicon.ico");
|
||||
|
||||
private String[] patterns;
|
||||
private final String[] patterns;
|
||||
|
||||
StaticResourceLocation(String... patterns) {
|
||||
this.patterns = patterns;
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 {
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue