diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebEndpointDiscoverer.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebEndpointDiscoverer.java index d0585c31e9..110da408f8 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebEndpointDiscoverer.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebEndpointDiscoverer.java @@ -51,8 +51,7 @@ public class CloudFoundryWebEndpointDiscoverer extends WebEndpointDiscoverer { */ public CloudFoundryWebEndpointDiscoverer(ApplicationContext applicationContext, ParameterValueMapper parameterValueMapper, - EndpointMediaTypes endpointMediaTypes, - PathMapper endpointPathMapper, + EndpointMediaTypes endpointMediaTypes, PathMapper endpointPathMapper, Collection invokerAdvisors, Collection> filters) { super(applicationContext, parameterValueMapper, endpointMediaTypes, diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/MappingWebEndpointPathMapper.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/MappingWebEndpointPathMapper.java index bbd8d5a256..6f4c1d078a 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/MappingWebEndpointPathMapper.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/MappingWebEndpointPathMapper.java @@ -21,8 +21,8 @@ import java.util.Map; import org.springframework.boot.actuate.endpoint.web.PathMapper; /** - * A {@link PathMapper} implementation that uses a simple {@link Map} to - * determine the endpoint path. + * A {@link PathMapper} implementation that uses a simple {@link Map} to determine the + * endpoint path. * * @author Stephane Nicoll */ diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsRegistrarConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsRegistrarConfiguration.java index cc6db5fb91..96de0bbf21 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsRegistrarConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsRegistrarConfiguration.java @@ -65,8 +65,8 @@ class CacheMetricsRegistrarConfiguration { @Bean public CacheMetricsRegistrar cacheMetricsRegistrar() { - return new CacheMetricsRegistrar(this.registry, - this.properties.getMetricName(), this.binderProviders); + return new CacheMetricsRegistrar(this.registry, this.properties.getMetricName(), + this.binderProviders); } @PostConstruct diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebEndpointDiscovererTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebEndpointDiscovererTests.java index 9dfdbb28e9..e11c5aac55 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebEndpointDiscovererTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/CloudFoundryWebEndpointDiscovererTests.java @@ -68,8 +68,8 @@ public class CloudFoundryWebEndpointDiscovererTests { this.load((id) -> null, (id) -> id, configuration, consumer); } - private void load(Function timeToLive, - PathMapper endpointPathMapper, Class configuration, + private void load(Function timeToLive, PathMapper endpointPathMapper, + Class configuration, Consumer consumer) { AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext( configuration); diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityInterceptorTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityInterceptorTests.java index 6c89c56e7c..4a431425e3 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityInterceptorTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/reactive/ReactiveCloudFoundrySecurityInterceptorTests.java @@ -54,8 +54,8 @@ public class ReactiveCloudFoundrySecurityInterceptorTests { @Before public void setup() { MockitoAnnotations.initMocks(this); - this.interceptor = new CloudFoundrySecurityInterceptor( - this.tokenValidator, this.securityService, "my-app-id"); + this.interceptor = new CloudFoundrySecurityInterceptor(this.tokenValidator, + this.securityService, "my-app-id"); } @Test @@ -90,8 +90,8 @@ public class ReactiveCloudFoundrySecurityInterceptorTests { @Test public void preHandleWhenApplicationIdIsNullShouldReturnError() { - this.interceptor = new CloudFoundrySecurityInterceptor( - this.tokenValidator, this.securityService, null); + this.interceptor = new CloudFoundrySecurityInterceptor(this.tokenValidator, + this.securityService, null); MockServerWebExchange request = MockServerWebExchange .from(MockServerHttpRequest.get("/a") .header(HttpHeaders.AUTHORIZATION, "bearer " + mockAccessToken()) @@ -105,8 +105,8 @@ public class ReactiveCloudFoundrySecurityInterceptorTests { @Test public void preHandleWhenCloudFoundrySecurityServiceIsNullShouldReturnError() { - this.interceptor = new CloudFoundrySecurityInterceptor( - this.tokenValidator, null, "my-app-id"); + this.interceptor = new CloudFoundrySecurityInterceptor(this.tokenValidator, null, + "my-app-id"); MockServerWebExchange request = MockServerWebExchange.from(MockServerHttpRequest .get("/a").header(HttpHeaders.AUTHORIZATION, mockAccessToken()).build()); StepVerifier.create(this.interceptor.preHandle(request, "/a")) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsConfigurationTests.java index 43d4d5811f..c8e9ed97ee 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/cache/CacheMetricsConfigurationTests.java @@ -58,8 +58,7 @@ public class CacheMetricsConfigurationTests { @Test public void autoConfiguredCacheManagerWithCustomMetricName() { this.contextRunner - .withPropertyValues( - "management.metrics.cache.metric-name=custom.name", + .withPropertyValues("management.metrics.cache.metric-name=custom.name", "spring.cache.type=caffeine", "spring.cache.cache-names=cache1") .run((context) -> { MeterRegistry registry = context.getBean(MeterRegistry.class); diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/MissingParametersException.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/MissingParametersException.java index d02fb43131..29eb5c651c 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/MissingParametersException.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/invoke/MissingParametersException.java @@ -38,9 +38,9 @@ public final class MissingParametersException extends InvalidEndpointRequestExce super("Failed to invoke operation because the following required " + "parameters were missing: " + StringUtils.collectionToCommaDelimitedString(missingParameters), - "Missing parameters: " + missingParameters.stream() - .map(OperationParameter::getName) - .collect(Collectors.joining(","))); + "Missing parameters: " + + missingParameters.stream().map(OperationParameter::getName) + .collect(Collectors.joining(","))); this.missingParameters = missingParameters; } 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 e03af9854c..9471960195 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,8 +33,8 @@ import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; /** - * 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}, + * 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}, * {@link WriteOperation @WriteOperation}, {@link DeleteOperation @DeleteOperation}. 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 04512eaed2..112a509224 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 @@ -31,7 +31,8 @@ import org.springframework.core.annotation.AnnotatedElementUtils; import org.springframework.util.Assert; /** - * {@link EndpointDiscoverer} for {@link ExposableControllerEndpoint 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/reactive/AbstractWebFluxEndpointHandlerMapping.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java index 91e7d9f4db..1bdcab9343 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/AbstractWebFluxEndpointHandlerMapping.java @@ -288,8 +288,8 @@ public abstract class AbstractWebFluxEndpointHandlerMapping private Mono> handleResult(Publisher result, HttpMethod httpMethod) { return Mono.from(result).map(this::toResponseEntity) - .onErrorMap(InvalidEndpointRequestException.class, (ex) -> - new ResponseStatusException(HttpStatus.BAD_REQUEST, + .onErrorMap(InvalidEndpointRequestException.class, + (ex) -> new ResponseStatusException(HttpStatus.BAD_REQUEST, ex.getReason())) .defaultIfEmpty(new ResponseEntity<>(httpMethod == HttpMethod.GET ? HttpStatus.NOT_FOUND : HttpStatus.NO_CONTENT)); 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 7fe4f04cf3..712b7a6af9 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 @@ -72,8 +72,7 @@ public class ControllerEndpointHandlerMapping extends RequestMappingHandlerMappi private Map getHandlers( Collection endpoints) { Map handlers = new LinkedHashMap<>(); - endpoints - .forEach((endpoint) -> handlers.put(endpoint.getController(), endpoint)); + 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/ControllerEndpointHandlerMapping.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMapping.java index 98d8858c5b..9e38326f7a 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 @@ -73,8 +73,7 @@ public class ControllerEndpointHandlerMapping extends RequestMappingHandlerMappi private Map getHandlers( Collection endpoints) { Map handlers = new LinkedHashMap<>(); - endpoints - .forEach((endpoint) -> handlers.put(endpoint.getController(), endpoint)); + 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/metrics/web/reactive/server/RouterFunctionMetrics.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/RouterFunctionMetrics.java index e8f3615a1e..da1c9b869a 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/RouterFunctionMetrics.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/web/reactive/server/RouterFunctionMetrics.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -75,12 +75,12 @@ public class RouterFunctionMetrics { Iterable tags) { return (request, next) -> { final long start = System.nanoTime(); - return next.handle(request).doOnSuccess(response -> { + return next.handle(request).doOnSuccess((response) -> { Iterable allTags = Tags.concat(tags, this.defaultTags.apply(request, response)); this.registry.timer(name, allTags).record(System.nanoTime() - start, TimeUnit.NANOSECONDS); - }).doOnError(error -> { + }).doOnError((error) -> { // FIXME how do we get the response under an error condition? Iterable allTags = Tags.concat(tags, this.defaultTags.apply(request, null)); diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/beans/BeansEndpointTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/beans/BeansEndpointTests.java index 34e5dbb658..fe93b0b554 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/beans/BeansEndpointTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/beans/BeansEndpointTests.java @@ -99,7 +99,7 @@ public class BeansEndpointTests { parentRunner.run((parent) -> { new ApplicationContextRunner() .withUserConfiguration(EndpointConfiguration.class).withParent(parent) - .run(child -> { + .run((child) -> { ApplicationBeans result = child.getBean(BeansEndpoint.class).beans(); assertThat(result.getContexts().get(parent.getId()).getBeans()) .containsKey("bean"); diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointParentTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointParentTests.java index e2b6e4eca4..306bb165c3 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointParentTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/context/properties/ConfigurationPropertiesReportEndpointParentTests.java @@ -42,7 +42,7 @@ public class ConfigurationPropertiesReportEndpointParentTests { .run((parent) -> { new ApplicationContextRunner() .withUserConfiguration(ClassConfigurationProperties.class) - .withParent(parent).run(child -> { + .withParent(parent).run((child) -> { ConfigurationPropertiesReportEndpoint endpoint = child .getBean(ConfigurationPropertiesReportEndpoint.class); ApplicationConfigurationProperties applicationProperties = endpoint @@ -65,7 +65,7 @@ public class ConfigurationPropertiesReportEndpointParentTests { new ApplicationContextRunner() .withUserConfiguration( BeanMethodConfigurationProperties.class) - .withParent(parent).run(child -> { + .withParent(parent).run((child) -> { ConfigurationPropertiesReportEndpoint endpoint = child .getBean(ConfigurationPropertiesReportEndpoint.class); ApplicationConfigurationProperties applicationProperties = endpoint diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/AbstractWebEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/AbstractWebEndpointIntegrationTests.java index 1ab71f71b3..b11c119cb0 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/AbstractWebEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/AbstractWebEndpointIntegrationTests.java @@ -159,9 +159,8 @@ public abstract class AbstractWebEndpointIntegrationTests { - WebTestClient.BodyContentSpec body = client.get() - .uri("/query?two=two").exchange().expectStatus().isBadRequest() - .expectBody(); + WebTestClient.BodyContentSpec body = client.get().uri("/query?two=two") + .exchange().expectStatus().isBadRequest().expectBody(); validateErrorBody(body, HttpStatus.BAD_REQUEST, "/endpoints/query", "Missing parameters: one"); }); @@ -282,9 +281,8 @@ public abstract class AbstractWebEndpointIntegrationTests { - WebTestClient.BodyContentSpec body = client.get() - .uri("/requiredparameters").exchange().expectStatus().isBadRequest() - .expectBody(); + WebTestClient.BodyContentSpec body = client.get().uri("/requiredparameters") + .exchange().expectStatus().isBadRequest().expectBody(); validateErrorBody(body, HttpStatus.BAD_REQUEST, "/endpoints/requiredparameters", "Missing parameters: foo"); }); @@ -334,9 +332,8 @@ public abstract class AbstractWebEndpointIntegrationTests matchCounts = new HashMap<>(); for (WebOperationRequestPredicate predicate : predicates) { matchCounts.put(predicate, Stream.of(matchers) - .filter(matcher -> matcher.matches(predicate)).count()); + .filter((matcher) -> matcher.matches(predicate)).count()); } - return matchCounts.values().stream().noneMatch(count -> count != 1); + return matchCounts.values().stream().noneMatch((count) -> count != 1); }, Arrays.toString(matchers)); } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/integration/SpringIntegrationMetricsIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/integration/SpringIntegrationMetricsIntegrationTests.java index c2301d1bac..00d8c25504 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/integration/SpringIntegrationMetricsIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/metrics/integration/SpringIntegrationMetricsIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -100,7 +100,7 @@ public class SpringIntegrationMetricsIntegrationTests { (e) -> e.id("toJson")) .handle(String.class, this::fahrenheitToCelsius, (e) -> e.id("temperatureConverter")) - .transform(this::extractResult, e -> e.id("toResponse")); + .transform(this::extractResult, (e) -> e.id("toResponse")); } private double extractResult(String json) { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java index 5ce8b0b5d5..926cd08839 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java @@ -157,7 +157,7 @@ public class FlywayAutoConfiguration { private String getProperty(Supplier property, Supplier defaultValue) { String value = property.get(); - return value == null ? defaultValue.get() : value; + return (value == null ? defaultValue.get() : value); } private void checkLocationExists(String... locations) { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/jetty/JettyCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/jetty/JettyCustomizer.java index dcaadc6196..b266e381f9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/jetty/JettyCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/jetty/JettyCustomizer.java @@ -57,16 +57,19 @@ public final class JettyCustomizer { propertyMapper.from(jettyProperties::getSelectors).whenNonNull() .to(factory::setSelectors); propertyMapper.from(serverProperties::getMaxHttpHeaderSize) - .when(JettyCustomizer::isPositive).to(maxHttpHeaderSize -> - customizeMaxHttpHeaderSize(factory, maxHttpHeaderSize)); + .when(JettyCustomizer::isPositive) + .to((maxHttpHeaderSize) -> customizeMaxHttpHeaderSize(factory, + maxHttpHeaderSize)); propertyMapper.from(jettyProperties::getMaxHttpPostSize) .when(JettyCustomizer::isPositive) - .to(maxHttpPostSize -> customizeMaxHttpPostSize(factory, maxHttpPostSize)); + .to((maxHttpPostSize) -> customizeMaxHttpPostSize(factory, + maxHttpPostSize)); propertyMapper.from(serverProperties::getConnectionTimeout).whenNonNull() - .to(connectionTimeout -> customizeConnectionTimeout(factory, connectionTimeout)); + .to((connectionTimeout) -> customizeConnectionTimeout(factory, + connectionTimeout)); propertyMapper.from(jettyProperties::getAccesslog) .when(ServerProperties.Jetty.Accesslog::isEnabled) - .to(accesslog -> customizeAccessLog(factory, accesslog)); + .to((accesslog) -> customizeAccessLog(factory, accesslog)); } private static boolean isPositive(Integer value) { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/tomcat/TomcatCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/tomcat/TomcatCustomizer.java index 6840d1b5db..e5f0f599b7 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/tomcat/TomcatCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/tomcat/TomcatCustomizer.java @@ -58,29 +58,35 @@ public final class TomcatCustomizer { customizeRemoteIpValve(serverProperties, environment, factory); propertyMapper.from(tomcatProperties::getMaxThreads) .when(TomcatCustomizer::isPositive) - .to(maxThreads -> customizeMaxThreads(factory, tomcatProperties.getMaxThreads())); + .to((maxThreads) -> customizeMaxThreads(factory, + tomcatProperties.getMaxThreads())); propertyMapper.from(tomcatProperties::getMinSpareThreads) .when(TomcatCustomizer::isPositive) - .to(minSpareThreads -> customizeMinThreads(factory, minSpareThreads)); - propertyMapper.from(() -> determineMaxHttpHeaderSize(serverProperties, tomcatProperties)) + .to((minSpareThreads) -> customizeMinThreads(factory, minSpareThreads)); + propertyMapper + .from(() -> determineMaxHttpHeaderSize(serverProperties, + tomcatProperties)) .when(TomcatCustomizer::isPositive) - .to(maxHttpHeaderSize -> customizeMaxHttpHeaderSize(factory, maxHttpHeaderSize)); + .to((maxHttpHeaderSize) -> customizeMaxHttpHeaderSize(factory, + maxHttpHeaderSize)); propertyMapper.from(tomcatProperties::getMaxHttpPostSize) - .when(maxHttpPostSize -> maxHttpPostSize != 0) - .to(maxHttpPostSize -> customizeMaxHttpPostSize(factory, maxHttpPostSize)); + .when((maxHttpPostSize) -> maxHttpPostSize != 0) + .to((maxHttpPostSize) -> customizeMaxHttpPostSize(factory, + maxHttpPostSize)); propertyMapper.from(tomcatProperties::getAccesslog) .when(ServerProperties.Tomcat.Accesslog::isEnabled) - .to(enabled -> customizeAccessLog(tomcatProperties, factory)); + .to((enabled) -> customizeAccessLog(tomcatProperties, factory)); propertyMapper.from(tomcatProperties::getUriEncoding).whenNonNull() .to(factory::setUriEncoding); propertyMapper.from(serverProperties::getConnectionTimeout).whenNonNull() - .to(connectionTimeout -> customizeConnectionTimeout(factory, connectionTimeout)); + .to((connectionTimeout) -> customizeConnectionTimeout(factory, + connectionTimeout)); propertyMapper.from(tomcatProperties::getMaxConnections) .when(TomcatCustomizer::isPositive) - .to(maxConnections -> customizeMaxConnections(factory, maxConnections)); + .to((maxConnections) -> customizeMaxConnections(factory, maxConnections)); propertyMapper.from(tomcatProperties::getAcceptCount) .when(TomcatCustomizer::isPositive) - .to(acceptCount -> customizeAcceptCount(factory, acceptCount)); + .to((acceptCount) -> customizeAcceptCount(factory, acceptCount)); customizeStaticResources(serverProperties.getTomcat().getResource(), factory); } @@ -234,4 +240,5 @@ public final class TomcatCustomizer { }); }); } + } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/undertow/UndertowCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/undertow/UndertowCustomizer.java index 5c92bc7f7f..0c855f93a4 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/undertow/UndertowCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/embedded/undertow/UndertowCustomizer.java @@ -63,21 +63,21 @@ public final class UndertowCustomizer { .to(factory::setAccessLogSuffix); propertyMapper.from(accesslogProperties::isRotate) .to(factory::setAccessLogRotate); - propertyMapper.from(() -> - getOrDeduceUseForwardHeaders(serverProperties, environment)).to( - factory::setUseForwardHeaders); + propertyMapper + .from(() -> getOrDeduceUseForwardHeaders(serverProperties, environment)) + .to(factory::setUseForwardHeaders); propertyMapper.from(serverProperties::getMaxHttpHeaderSize) .when(UndertowCustomizer::isPositive) - .to(maxHttpHeaderSize -> - customizeMaxHttpHeaderSize(factory, maxHttpHeaderSize)); + .to((maxHttpHeaderSize) -> customizeMaxHttpHeaderSize(factory, + maxHttpHeaderSize)); propertyMapper.from(undertowProperties::getMaxHttpPostSize) .when(UndertowCustomizer::isPositive) - .to(maxHttpPostSize -> - customizeMaxHttpPostSize(factory, maxHttpPostSize)); + .to((maxHttpPostSize) -> customizeMaxHttpPostSize(factory, + maxHttpPostSize)); propertyMapper.from(serverProperties::getConnectionTimeout) - .to(connectionTimeout -> - customizeConnectionTimeout(factory, connectionTimeout)); - factory.addDeploymentInfoCustomizers(deploymentInfo -> deploymentInfo + .to((connectionTimeout) -> customizeConnectionTimeout(factory, + connectionTimeout)); + factory.addDeploymentInfoCustomizers((deploymentInfo) -> deploymentInfo .setEagerFilterInit(undertowProperties.isEagerFilterInit())); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/DefaultReactiveWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/DefaultReactiveWebServerFactoryCustomizer.java index bac4b73803..b84acacb8b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/DefaultReactiveWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/DefaultReactiveWebServerFactoryCustomizer.java @@ -67,14 +67,14 @@ public class DefaultReactiveWebServerFactoryCustomizer map.from(this.serverProperties::getSsl).to(factory::setSsl); map.from(this.serverProperties::getCompression).to(factory::setCompression); map.from(this.serverProperties::getHttp2).to(factory::setHttp2); - map.from(() -> factory).whenInstanceOf(TomcatReactiveWebServerFactory.class) - .to(tomcatFactory -> TomcatCustomizer.customizeTomcat( - this.serverProperties, this.environment, tomcatFactory)); - map.from(() -> factory).whenInstanceOf(JettyReactiveWebServerFactory.class) - .to(jettyFactory -> JettyCustomizer.customizeJetty(this.serverProperties, + map.from(() -> factory).whenInstanceOf(TomcatReactiveWebServerFactory.class).to( + (tomcatFactory) -> TomcatCustomizer.customizeTomcat(this.serverProperties, + this.environment, tomcatFactory)); + map.from(() -> factory).whenInstanceOf(JettyReactiveWebServerFactory.class).to( + (jettyFactory) -> JettyCustomizer.customizeJetty(this.serverProperties, this.environment, jettyFactory)); map.from(() -> factory).whenInstanceOf(UndertowReactiveWebServerFactory.class) - .to(undertowFactory -> UndertowCustomizer.customizeUndertow( + .to((undertowFactory) -> UndertowCustomizer.customizeUndertow( this.serverProperties, this.environment, undertowFactory)); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DefaultServletWebServerFactoryCustomizer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DefaultServletWebServerFactoryCustomizer.java index 8d69626229..dc5f50b3ec 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DefaultServletWebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DefaultServletWebServerFactoryCustomizer.java @@ -83,17 +83,17 @@ public class DefaultServletWebServerFactoryCustomizer map.from(this.serverProperties::getHttp2).to(factory::setHttp2); map.from(this.serverProperties::getServerHeader).to(factory::setServerHeader); map.from(() -> factory).whenInstanceOf(TomcatServletWebServerFactory.class) - .to(tomcatFactory -> { + .to((tomcatFactory) -> { TomcatCustomizer.customizeTomcat(this.serverProperties, this.environment, tomcatFactory); TomcatServletCustomizer.customizeTomcat(this.serverProperties, this.environment, tomcatFactory); }); - map.from(() -> factory).whenInstanceOf(JettyServletWebServerFactory.class) - .to(jettyFactory -> JettyCustomizer.customizeJetty(this.serverProperties, + map.from(() -> factory).whenInstanceOf(JettyServletWebServerFactory.class).to( + (jettyFactory) -> JettyCustomizer.customizeJetty(this.serverProperties, this.environment, jettyFactory)); map.from(() -> factory).whenInstanceOf(UndertowServletWebServerFactory.class) - .to(undertowFactory -> UndertowCustomizer.customizeUndertow( + .to((undertowFactory) -> UndertowCustomizer.customizeUndertow( this.serverProperties, this.environment, undertowFactory)); map.from(this.serverProperties.getServlet()::getContextParameters) .to(factory::setInitParameters); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraRepositoriesAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraRepositoriesAutoConfigurationTests.java index c03ede1aac..ccdad72d83 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraRepositoriesAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/cassandra/CassandraRepositoriesAutoConfigurationTests.java @@ -60,11 +60,12 @@ public class CassandraRepositoriesAutoConfigurationTests { @Test public void testDefaultRepositoryConfiguration() { - this.contextRunner.withUserConfiguration(TestConfiguration.class).run((context) -> { - assertThat(context).hasSingleBean(CityRepository.class); - assertThat(context).hasSingleBean(Cluster.class); - assertThat(getInitialEntitySet(context)).hasSize(1); - }); + this.contextRunner.withUserConfiguration(TestConfiguration.class) + .run((context) -> { + assertThat(context).hasSingleBean(CityRepository.class); + assertThat(context).hasSingleBean(Cluster.class); + assertThat(getInitialEntitySet(context)).hasSize(1); + }); } @Test diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveRepositoriesAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveRepositoriesAutoConfigurationTests.java index 3d16158772..b37744de1e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveRepositoriesAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoReactiveRepositoriesAutoConfigurationTests.java @@ -58,16 +58,17 @@ public class MongoReactiveRepositoriesAutoConfigurationTests { @Test public void testDefaultRepositoryConfiguration() { - this.contextRunner.withUserConfiguration(TestConfiguration.class).run((context) -> { - assertThat(context).hasSingleBean(ReactiveCityRepository.class); - assertThat(context).hasSingleBean(MongoClient.class); - MongoMappingContext mappingContext = context - .getBean(MongoMappingContext.class); - @SuppressWarnings("unchecked") - Set> entities = (Set>) ReflectionTestUtils - .getField(mappingContext, "initialEntitySet"); - assertThat(entities).hasSize(1); - }); + this.contextRunner.withUserConfiguration(TestConfiguration.class) + .run((context) -> { + assertThat(context).hasSingleBean(ReactiveCityRepository.class); + assertThat(context).hasSingleBean(MongoClient.class); + MongoMappingContext mappingContext = context + .getBean(MongoMappingContext.class); + @SuppressWarnings("unchecked") + Set> entities = (Set>) ReflectionTestUtils + .getField(mappingContext, "initialEntitySet"); + assertThat(entities).hasSize(1); + }); } @Test diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoRepositoriesAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoRepositoriesAutoConfigurationTests.java index d4da50297e..5a001ba213 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoRepositoriesAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/mongo/MongoRepositoriesAutoConfigurationTests.java @@ -53,16 +53,17 @@ public class MongoRepositoriesAutoConfigurationTests { @Test public void testDefaultRepositoryConfiguration() { - this.contextRunner.withUserConfiguration(TestConfiguration.class).run((context) -> { - assertThat(context).hasSingleBean(CityRepository.class); - assertThat(context).hasSingleBean(MongoClient.class); - MongoMappingContext mappingContext = context - .getBean(MongoMappingContext.class); - @SuppressWarnings("unchecked") - Set> entities = (Set>) ReflectionTestUtils - .getField(mappingContext, "initialEntitySet"); - assertThat(entities).hasSize(1); - }); + this.contextRunner.withUserConfiguration(TestConfiguration.class) + .run((context) -> { + assertThat(context).hasSingleBean(CityRepository.class); + assertThat(context).hasSingleBean(MongoClient.class); + MongoMappingContext mappingContext = context + .getBean(MongoMappingContext.class); + @SuppressWarnings("unchecked") + Set> entities = (Set>) ReflectionTestUtils + .getField(mappingContext, "initialEntitySet"); + assertThat(entities).hasSize(1); + }); } @Test @@ -80,8 +81,9 @@ public class MongoRepositoriesAutoConfigurationTests { @Test public void autoConfigurationShouldNotKickInEvenIfManualConfigDidNotCreateAnyRepositories() { - this.contextRunner.withUserConfiguration(SortOfInvalidCustomConfiguration.class).run( - (context) -> assertThat(context).doesNotHaveBean(CityRepository.class)); + this.contextRunner.withUserConfiguration(SortOfInvalidCustomConfiguration.class) + .run((context) -> assertThat(context) + .doesNotHaveBean(CityRepository.class)); } @Test diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/AuthenticationManagerConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/AuthenticationManagerConfigurationTests.java index 3e33ccfb35..511463ef9f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/AuthenticationManagerConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/servlet/AuthenticationManagerConfigurationTests.java @@ -74,7 +74,8 @@ public class AuthenticationManagerConfigurationTests { this.contextRunner .withUserConfiguration(TestConfigWithClientRegistrationRepository.class, AuthenticationManagerConfiguration.class) - .run(((context) -> assertThat(context).doesNotHaveBean(InMemoryUserDetailsManager.class))); + .run(((context) -> assertThat(context) + .doesNotHaveBean(InMemoryUserDetailsManager.class))); } private void testPasswordEncoding(Class configClass, String providedPassword, diff --git a/spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java b/spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java index dc365a4521..8fc28340ec 100644 --- a/spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java +++ b/spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporter.java @@ -70,8 +70,8 @@ class PropertiesMigrationReporter { return report; } properties.forEach((name, candidates) -> { - PropertySource propertySource = mapPropertiesWithReplacement(report, - name, candidates); + PropertySource propertySource = mapPropertiesWithReplacement(report, name, + candidates); if (propertySource != null) { this.environment.getPropertySources().addBefore(name, propertySource); } @@ -84,8 +84,8 @@ class PropertiesMigrationReporter { List properties) { List renamed = new ArrayList<>(); List unsupported = new ArrayList<>(); - properties.forEach((property) -> - (isRenamed(property) ? renamed : unsupported).add(property)); + properties.forEach((property) -> (isRenamed(property) ? renamed : unsupported) + .add(property)); report.add(name, renamed, unsupported); if (renamed.isEmpty()) { return null; @@ -133,7 +133,7 @@ class PropertiesMigrationReporter { List candidates = this.allProperties.values() .stream().filter(filter).collect(Collectors.toList()); getPropertySourcesAsMap().forEach((name, source) -> { - candidates.forEach(metadata -> { + candidates.forEach((metadata) -> { ConfigurationProperty configurationProperty = source .getConfigurationProperty( ConfigurationPropertyName.of(metadata.getId())); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java index b9735a94b6..78de970d92 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessorTests.java @@ -359,8 +359,8 @@ public class ConfigurationMetadataAnnotationProcessorTests { @Test public void annotatedGetter() { ConfigurationMetadata metadata = compile(AnnotatedGetter.class); - assertThat(metadata).has(Metadata.withGroup("specific") - .fromSource(AnnotatedGetter.class)); + assertThat(metadata) + .has(Metadata.withGroup("specific").fromSource(AnnotatedGetter.class)); assertThat(metadata).has(Metadata.withProperty("specific.name", String.class) .fromSource(AnnotatedGetter.class)); } 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 0e54d8ac78..2e09aae254 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 @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. 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 a7b0c61621..1a2c524ac8 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 @@ -94,8 +94,8 @@ class InvalidConfigurationPropertyValueFailureAnalyzer private void appendReason(StringBuilder message, InvalidConfigurationPropertyValueException cause) { if (StringUtils.hasText(cause.getReason())) { - message.append(String.format(" Validation failed for the following " - + "reason:%n%n")); + message.append(String + .format(" Validation failed for the following " + "reason:%n%n")); message.append(cause.getReason()); } else { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/InvalidConfigurationPropertyValueFailureAnalyzerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/InvalidConfigurationPropertyValueFailureAnalyzerTests.java index 563fe7d675..c8a5ab6a13 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/InvalidConfigurationPropertyValueFailureAnalyzerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/diagnostics/analyzer/InvalidConfigurationPropertyValueFailureAnalyzerTests.java @@ -75,8 +75,7 @@ public class InvalidConfigurationPropertyValueFailureAnalyzerTests { InvalidConfigurationPropertyValueException failure = new InvalidConfigurationPropertyValueException( "test.property", "invalid", null); FailureAnalysis analysis = performAnalysis(failure); - assertThat(analysis.getAction()) - .contains("Review the value of the property."); + assertThat(analysis.getAction()).contains("Review the value of the property."); assertThat(analysis.getDescription()).contains("No reason was provided.") .doesNotContain("Additionally, this property is also set"); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jdbc/metadata/AbstractDataSourcePoolMetadataTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jdbc/metadata/AbstractDataSourcePoolMetadataTests.java index e401cb349f..7acc9a42e8 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jdbc/metadata/AbstractDataSourcePoolMetadataTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jdbc/metadata/AbstractDataSourcePoolMetadataTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -74,7 +74,7 @@ public abstract class AbstractDataSourcePoolMetadataTests) (connection) -> { - jdbcTemplate.execute((ConnectionCallback) connection1 -> { + jdbcTemplate.execute((ConnectionCallback) (connection1) -> { assertThat(getDataSourceMetadata().getActive()).isEqualTo(2); assertThat(getDataSourceMetadata().getUsage()).isEqualTo(1.0f); return null; diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/server/AbstractReactiveWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/server/AbstractReactiveWebServerFactoryTests.java index 9369811233..b88a4c51f4 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/server/AbstractReactiveWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/reactive/server/AbstractReactiveWebServerFactoryTests.java @@ -143,7 +143,7 @@ public abstract class AbstractReactiveWebServerFactoryTests { protected ReactorClientHttpConnector buildTrustAllSslConnector() { return new ReactorClientHttpConnector( - (options) -> options.sslSupport(sslContextBuilder -> { + (options) -> options.sslSupport((sslContextBuilder) -> { sslContextBuilder.sslProvider(SslProvider.JDK) .trustManager(InsecureTrustManagerFactory.INSTANCE); })); @@ -180,7 +180,7 @@ public abstract class AbstractReactiveWebServerFactoryTests { .getInstance(KeyManagerFactory.getDefaultAlgorithm()); clientKeyManagerFactory.init(clientKeyStore, "password".toCharArray()); return new ReactorClientHttpConnector( - (options) -> options.sslSupport(sslContextBuilder -> { + (options) -> options.sslSupport((sslContextBuilder) -> { sslContextBuilder.sslProvider(SslProvider.JDK) .trustManager(InsecureTrustManagerFactory.INSTANCE) .keyManager(clientKeyManagerFactory); diff --git a/spring-boot-samples/spring-boot-sample-actuator-custom-security/src/test/java/sample/actuator/customsecurity/ManagementPortAndPathSampleActuatorApplicationTests.java b/spring-boot-samples/spring-boot-sample-actuator-custom-security/src/test/java/sample/actuator/customsecurity/ManagementPortAndPathSampleActuatorApplicationTests.java index de1c3e7637..7313677c08 100644 --- a/spring-boot-samples/spring-boot-sample-actuator-custom-security/src/test/java/sample/actuator/customsecurity/ManagementPortAndPathSampleActuatorApplicationTests.java +++ b/spring-boot-samples/spring-boot-sample-actuator-custom-security/src/test/java/sample/actuator/customsecurity/ManagementPortAndPathSampleActuatorApplicationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,8 @@ import static org.assertj.core.api.Assertions.assertThat; */ @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT, properties = { - "management.server.port=0", "management.server.servlet.context-path=/management" }) + "management.server.port=0", + "management.server.servlet.context-path=/management" }) public class ManagementPortAndPathSampleActuatorApplicationTests { @LocalServerPort diff --git a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java index fdb83291f8..d8c1988a9a 100644 --- a/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java +++ b/spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -97,8 +97,7 @@ class ApplicationBuilder { return resourcesJar; } - private void writePom(File appFolder, File resourcesJar) - throws IOException { + private void writePom(File appFolder, File resourcesJar) throws IOException { Map context = new HashMap<>(); context.put("packaging", this.packaging); context.put("container", this.container);