Skip to content

Commit 7d19aa6

Browse files
committed
Merge branch '2.0.x'
2 parents cd8ab4d + 6de479f commit 7d19aa6

File tree

125 files changed

+312
-210
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+312
-210
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryWebEndpointServletHandlerMapping.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ public Object handle(HttpServletRequest request, Map<String, String> body) {
134134
}
135135
return this.delegate.handle(request, body);
136136
}
137+
137138
}
138139

139140
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
*
3232
* @author Phillip Webb
3333
* @author Andy Wilkinson
34-
*
3534
* @since 2.0.0
3635
*/
3736
@Configuration

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/MeterRegistryConfigurer.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
import org.springframework.boot.util.LambdaSafe;
2929

3030
/**
31-
* Configurer to apply {@link MeterRegistryCustomizer customizers},
32-
* {@link MeterFilter filters}, {@link MeterBinder binders} and {@link Metrics#addRegistry
33-
* global registration} to {@link MeterRegistry meter registries}. This configurer
34-
* intentionally skips {@link CompositeMeterRegistry} with the assumptions that the
35-
* registries it contains are beans and will be customized directly.
31+
* Configurer to apply {@link MeterRegistryCustomizer customizers}, {@link MeterFilter
32+
* filters}, {@link MeterBinder binders} and {@link Metrics#addRegistry global
33+
* registration} to {@link MeterRegistry meter registries}. This configurer intentionally
34+
* skips {@link CompositeMeterRegistry} with the assumptions that the registries it
35+
* contains are beans and will be customized directly.
3636
*
3737
* @author Jon Schneider
3838
* @author Phillip Webb

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequest.java

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -165,35 +165,40 @@ public EndpointRequestMatcher excludingLinks() {
165165
}
166166

167167
@Override
168-
protected void initialized(Supplier<WebApplicationContext> webApplicationContext) {
168+
protected void initialized(
169+
Supplier<WebApplicationContext> webApplicationContext) {
169170
this.delegate = createDelegate(webApplicationContext);
170171
}
171172

172173
private RequestMatcher createDelegate(
173174
Supplier<WebApplicationContext> webApplicationContext) {
174175
try {
175176
WebApplicationContext context = webApplicationContext.get();
176-
PathMappedEndpoints pathMappedEndpoints = context.getBean(PathMappedEndpoints.class);
177-
DispatcherServletPathProvider pathProvider = context.getBean(DispatcherServletPathProvider.class);
177+
PathMappedEndpoints pathMappedEndpoints = context
178+
.getBean(PathMappedEndpoints.class);
179+
DispatcherServletPathProvider pathProvider = context
180+
.getBean(DispatcherServletPathProvider.class);
178181
return createDelegate(pathMappedEndpoints, pathProvider.getServletPath());
179182
}
180183
catch (NoSuchBeanDefinitionException ex) {
181184
return EMPTY_MATCHER;
182185
}
183186
}
184187

185-
private RequestMatcher createDelegate(PathMappedEndpoints pathMappedEndpoints, String servletPath) {
188+
private RequestMatcher createDelegate(PathMappedEndpoints pathMappedEndpoints,
189+
String servletPath) {
186190
Set<String> paths = new LinkedHashSet<>();
187191
if (this.includes.isEmpty()) {
188192
paths.addAll(pathMappedEndpoints.getAllPaths());
189193
}
190194
streamPaths(this.includes, pathMappedEndpoints).forEach(paths::add);
191195
streamPaths(this.excludes, pathMappedEndpoints).forEach(paths::remove);
192-
List<RequestMatcher> delegateMatchers = getDelegateMatchers(servletPath, paths);
196+
List<RequestMatcher> delegateMatchers = getDelegateMatchers(servletPath,
197+
paths);
193198
if (this.includeLinks
194199
&& StringUtils.hasText(pathMappedEndpoints.getBasePath())) {
195-
delegateMatchers.add(
196-
new AntPathRequestMatcher(servletPath + pathMappedEndpoints.getBasePath()));
200+
delegateMatchers.add(new AntPathRequestMatcher(
201+
servletPath + pathMappedEndpoints.getBasePath()));
197202
}
198203
return new OrRequestMatcher(delegateMatchers);
199204
}
@@ -221,8 +226,10 @@ private String getEndpointId(Class<?> source) {
221226
return annotation.id();
222227
}
223228

224-
private List<RequestMatcher> getDelegateMatchers(String servletPath, Set<String> paths) {
225-
return paths.stream().map((path) -> new AntPathRequestMatcher(servletPath + path + "/**"))
229+
private List<RequestMatcher> getDelegateMatchers(String servletPath,
230+
Set<String> paths) {
231+
return paths.stream()
232+
.map((path) -> new AntPathRequestMatcher(servletPath + path + "/**"))
226233
.collect(Collectors.toList());
227234
}
228235

@@ -247,19 +254,23 @@ private LinksRequestMatcher() {
247254
}
248255

249256
@Override
250-
protected void initialized(Supplier<WebApplicationContext> webApplicationContext) {
257+
protected void initialized(
258+
Supplier<WebApplicationContext> webApplicationContext) {
251259
try {
252260
WebApplicationContext context = webApplicationContext.get();
253-
WebEndpointProperties properties = context.getBean(WebEndpointProperties.class);
254-
DispatcherServletPathProvider pathProvider = context.getBean(DispatcherServletPathProvider.class);
261+
WebEndpointProperties properties = context
262+
.getBean(WebEndpointProperties.class);
263+
DispatcherServletPathProvider pathProvider = context
264+
.getBean(DispatcherServletPathProvider.class);
255265
this.delegate = createDelegate(pathProvider.getServletPath(), properties);
256266
}
257267
catch (NoSuchBeanDefinitionException ex) {
258268
this.delegate = EMPTY_MATCHER;
259269
}
260270
}
261271

262-
private RequestMatcher createDelegate(String path, WebEndpointProperties properties) {
272+
private RequestMatcher createDelegate(String path,
273+
WebEndpointProperties properties) {
263274
if (StringUtils.hasText(properties.getBasePath())) {
264275
return new AntPathRequestMatcher(path + properties.getBasePath());
265276
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/health/HealthEndpointAutoConfigurationTests.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,5 @@ public ReactiveHealthIndicator reactiveHealthIndicator() {
124124
}
125125

126126
}
127+
127128
}

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/signalfx/SignalFxMetricsExportAutoConfigurationTests.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ public void autoConfiguresWithAnAccessToken() {
7171
@Test
7272
public void autoConfigurationCanBeDisabled() {
7373
this.contextRunner.withUserConfiguration(BaseConfiguration.class)
74-
.withPropertyValues(
75-
"management.metrics.export.signalfx.enabled=false")
74+
.withPropertyValues("management.metrics.export.signalfx.enabled=false")
7675
.run((context) -> assertThat(context)
7776
.doesNotHaveBean(SignalFxMeterRegistry.class)
7877
.doesNotHaveBean(SignalFxConfig.class));

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/simple/SimplePropertiesTests.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import static org.assertj.core.api.Assertions.assertThat;
2323

2424
/**
25-
*
2625
* @author Stephane Nicoll
2726
*/
2827
public class SimplePropertiesTests {

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequestTests.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,13 @@ public void toAnyEndpointShouldNotMatchOtherPath() {
7575
@Test
7676
public void toAnyEndpointWhenServletPathNotEmptyShouldMatch() {
7777
RequestMatcher matcher = EndpointRequest.toAnyEndpoint();
78-
assertMatcher(matcher, "/actuator", "/spring").matches("/spring", "/actuator/foo");
79-
assertMatcher(matcher, "/actuator", "/spring").matches("/spring", "/actuator/bar");
78+
assertMatcher(matcher, "/actuator", "/spring").matches("/spring",
79+
"/actuator/foo");
80+
assertMatcher(matcher, "/actuator", "/spring").matches("/spring",
81+
"/actuator/bar");
8082
assertMatcher(matcher, "/actuator", "/spring").matches("/spring", "/actuator");
81-
assertMatcher(matcher, "/actuator", "/spring").doesNotMatch("/spring", "/actuator/baz");
83+
assertMatcher(matcher, "/actuator", "/spring").doesNotMatch("/spring",
84+
"/actuator/baz");
8285
assertMatcher(matcher, "/actuator", "/spring").doesNotMatch("", "/actuator/foo");
8386
}
8487

@@ -128,7 +131,8 @@ public void toLinksWhenBasePathEmptyShouldNotMatch() {
128131
@Test
129132
public void toLinksWhenServletPathNotEmptyShouldNotMatch() {
130133
RequestMatcher matcher = EndpointRequest.toLinks();
131-
RequestMatcherAssert assertMatcher = assertMatcher(matcher, "/actuator", "/spring");
134+
RequestMatcherAssert assertMatcher = assertMatcher(matcher, "/actuator",
135+
"/spring");
132136
assertMatcher.matches("/spring/actuator");
133137
}
134138

@@ -197,7 +201,8 @@ private RequestMatcherAssert assertMatcher(RequestMatcher matcher, String basePa
197201
return assertMatcher(matcher, mockPathMappedEndpoints(basePath));
198202
}
199203

200-
private RequestMatcherAssert assertMatcher(RequestMatcher matcher, String basePath, String servletPath) {
204+
private RequestMatcherAssert assertMatcher(RequestMatcher matcher, String basePath,
205+
String servletPath) {
201206
return assertMatcher(matcher, mockPathMappedEndpoints(basePath), servletPath);
202207
}
203208

@@ -232,7 +237,8 @@ private RequestMatcherAssert assertMatcher(RequestMatcher matcher,
232237
properties.setBasePath(pathMappedEndpoints.getBasePath());
233238
}
234239
}
235-
context.registerBean(DispatcherServletPathProvider.class, () -> () -> servletPath);
240+
DispatcherServletPathProvider pathProvider = () -> servletPath;
241+
context.registerBean(DispatcherServletPathProvider.class, () -> pathProvider);
236242
return assertThat(new RequestMatcherAssert(context, matcher));
237243
}
238244

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/MockServletWebServerFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfigurationTests.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ public void contextShouldNotConfigureRequestContextFilterWhenRequestContextListe
6565

6666
@Test
6767
public void contextShouldConfigureDispatcherServletPathProviderWithEmptyPath() {
68-
this.contextRunner.withUserConfiguration(WebMvcEndpointChildContextConfiguration.class)
69-
.run((context) -> assertThat(context.getBean(DispatcherServletPathProvider.class)
70-
.getServletPath()).isEmpty());
68+
this.contextRunner
69+
.withUserConfiguration(WebMvcEndpointChildContextConfiguration.class)
70+
.run((context) -> assertThat(context
71+
.getBean(DispatcherServletPathProvider.class).getServletPath())
72+
.isEmpty());
7173
}
7274

7375
static class ExistingConfig {

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/beans/BeansEndpoint.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ public class BeansEndpoint {
4444
/**
4545
* Creates a new {@code BeansEndpoint} that will describe the beans in the given
4646
* {@code context} and all of its ancestors.
47-
*
4847
* @param context the application context
4948
* @see ConfigurableApplicationContext#getParent()
5049
*/

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpoint.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,7 @@ public void serializeAsField(Object pojo, JsonGenerator jgen,
335335
}
336336
super.serializeAsField(pojo, jgen, provider, writer);
337337
}
338+
338339
}
339340

340341
/**

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/MissingParametersException.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,5 @@ public MissingParametersException(Set<OperationParameter> missingParameters) {
5151
public Set<OperationParameter> getMissingParameters() {
5252
return this.missingParameters;
5353
}
54+
5455
}

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/EndpointMBean.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ private Object invoke(JmxOperation operation, Object[] params)
107107
return this.responseMapper.mapResponse(result);
108108
}
109109
catch (InvalidEndpointRequestException ex) {
110-
throw new ReflectionException(new IllegalArgumentException(
111-
ex.getMessage()), ex.getMessage());
110+
throw new ReflectionException(new IllegalArgumentException(ex.getMessage()),
111+
ex.getMessage());
112112
}
113113
catch (Exception ex) {
114114
throw new MBeanException(translateIfNecessary(ex), ex.getMessage());

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/jmx/annotation/DiscoveredJmxOperation.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,4 +210,5 @@ public static Class<?> get(Class<?> source) {
210210
}
211211

212212
}
213+
213214
}

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointMapping.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ public class EndpointMapping {
3030

3131
/**
3232
* Creates a new {@code EndpointMapping} using the given {@code path}.
33-
*
3433
* @param path the path
3534
*/
3635
public EndpointMapping(String path) {

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/DiscoveredWebEndpoint.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,5 @@ class DiscoveredWebEndpoint extends AbstractDiscoveredEndpoint<WebOperation>
4444
public String getRootPath() {
4545
return this.rootPath;
4646
}
47+
4748
}

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ protected interface ReactiveWebOperation {
251251

252252
Mono<ResponseEntity<Object>> handle(ServerWebExchange exchange,
253253
Map<String, String> body);
254+
254255
}
255256

256257
/**

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/health/CompositeReactiveHealthIndicator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/logging/LoggersEndpoint.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/management/HeapDumpWebEndpoint.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/MetricsEndpoint.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ public static final class ListNamesResponse {
173173
public Set<String> getNames() {
174174
return this.names;
175175
}
176+
176177
}
177178

178179
/**
@@ -228,6 +229,7 @@ public String getTag() {
228229
public Set<String> getValues() {
229230
return this.values;
230231
}
232+
231233
}
232234

233235
/**

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/export/prometheus/PrometheusScrapeEndpoint.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/client/DefaultRestTemplateExchangeTagsProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2017 the original author or authors.
2+
* Copyright 2012-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/MetricsWebFilter.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,17 @@ public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) {
6161
private Publisher<Void> filter(ServerWebExchange exchange, Mono<Void> call) {
6262
long start = System.nanoTime();
6363
ServerHttpResponse response = exchange.getResponse();
64-
return call.doOnSuccess((done) -> success(exchange, start))
65-
.doOnError((cause) -> {
66-
if (response.isCommitted()) {
67-
error(exchange, start, cause);
68-
}
69-
else {
70-
response.beforeCommit(() -> {
71-
error(exchange, start, cause);
72-
return Mono.empty();
73-
});
74-
}
64+
return call.doOnSuccess((done) -> success(exchange, start)).doOnError((cause) -> {
65+
if (response.isCommitted()) {
66+
error(exchange, start, cause);
67+
}
68+
else {
69+
response.beforeCommit(() -> {
70+
error(exchange, start, cause);
71+
return Mono.empty();
7572
});
73+
}
74+
});
7675
}
7776

7877
private void success(ServerWebExchange exchange, long start) {

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/MappingDescriptionProvider.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ public interface MappingDescriptionProvider {
3131

3232
/**
3333
* Returns the name of the mappings described by this provider.
34-
*
3534
* @return the name of the mappings
3635
*/
3736
String getMappingName();

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/FilterRegistrationMappingDescription.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public FilterRegistrationMappingDescription(FilterRegistration filterRegistratio
4040

4141
/**
4242
* Returns the servlet name mappings for the registered filter.
43-
*
4443
* @return the mappings
4544
*/
4645
public Collection<String> getServletNameMappings() {
@@ -49,7 +48,6 @@ public Collection<String> getServletNameMappings() {
4948

5049
/**
5150
* Returns the URL pattern mappings for the registered filter.
52-
*
5351
* @return the mappings
5452
*/
5553
public Collection<String> getUrlPatternMappings() {

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/web/mappings/servlet/RegistrationMappingDescription.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public RegistrationMappingDescription(T registration) {
4040

4141
/**
4242
* Returns the name of the registered Filter or Servlet.
43-
*
4443
* @return the name
4544
*/
4645
public String getName() {
@@ -49,7 +48,6 @@ public String getName() {
4948

5049
/**
5150
* Returns the class name of the registered Filter or Servlet.
52-
*
5351
* @return the class name
5452
*/
5553
public String getClassName() {

0 commit comments

Comments
 (0)