diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/logging/LoggersEndpointAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/logging/LoggersEndpointAutoConfiguration.java index cecac6970c5..1cfb4dd0edc 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/logging/LoggersEndpointAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/logging/LoggersEndpointAutoConfiguration.java @@ -49,7 +49,6 @@ public class LoggersEndpointAutoConfiguration { return new LoggersEndpoint(loggingSystem); } - static class OnEnabledLoggingSystemCondition extends SpringBootCondition { @Override @@ -66,4 +65,5 @@ public class LoggersEndpointAutoConfiguration { } } + } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementChildContextConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementChildContextConfiguration.java index 0501133940f..f6b3ead3420 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementChildContextConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/servlet/ServletManagementChildContextConfiguration.java @@ -126,8 +126,8 @@ class ServletManagementChildContextConfiguration { implements WebServerFactoryCustomizer { @Override - public void customize(TomcatServletWebServerFactory serverFactory) { - AccessLogValve accessLogValve = findAccessLogValve(serverFactory); + public void customize(TomcatServletWebServerFactory factory) { + AccessLogValve accessLogValve = findAccessLogValve(factory); if (accessLogValve == null) { return; } @@ -135,8 +135,8 @@ class ServletManagementChildContextConfiguration { } private AccessLogValve findAccessLogValve( - TomcatServletWebServerFactory serverFactory) { - for (Valve engineValve : serverFactory.getEngineValves()) { + TomcatServletWebServerFactory factory) { + for (Valve engineValve : factory.getEngineValves()) { if (engineValve instanceof AccessLogValve) { return (AccessLogValve) engineValve; } @@ -150,9 +150,9 @@ class ServletManagementChildContextConfiguration { implements WebServerFactoryCustomizer { @Override - public void customize(UndertowServletWebServerFactory serverFactory) { - serverFactory.setAccessLogPrefix( - customizePrefix(serverFactory.getAccessLogPrefix())); + public void customize(UndertowServletWebServerFactory factory) { + factory.setAccessLogPrefix( + customizePrefix(factory.getAccessLogPrefix())); } } diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/logging/LoggersEndpointAutoConfigurationTests.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/logging/LoggersEndpointAutoConfigurationTests.java index f840f7275a6..7851f81dfac 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/logging/LoggersEndpointAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/logging/LoggersEndpointAutoConfigurationTests.java @@ -56,11 +56,10 @@ public class LoggersEndpointAutoConfigurationTests { @Test public void runWithNoneLoggerEndpointShouldNotHaveEndpointBean() { this.contextRunner - .withSystemProperties("org.springframework.boot.logging.LoggingSystem=none") + .withSystemProperties( + "org.springframework.boot.logging.LoggingSystem=none") .run((context) -> { - System.out.println(context.getBean(LoggingSystem.class)); - assertThat(context) - .doesNotHaveBean(LoggersEndpoint.class); + assertThat(context).doesNotHaveBean(LoggersEndpoint.class); }); } 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 e24e0414e29..83cdb29c348 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 @@ -211,8 +211,8 @@ public class WebMvcMetricsFilter extends OncePerRequestFilter { private void record(TimingContext timingContext, HttpServletResponse response, HttpServletRequest request, Object handlerObject, Throwable exception) { Timer.Sample timerSample = timingContext.getTimerSample(); - Supplier> tags = () -> this.tagsProvider.getTags(request, - response, handlerObject, exception); + Supplier> tags = () -> this.tagsProvider.getTags(request, response, + handlerObject, exception); for (Timed annotation : timingContext.getAnnotations()) { stop(timerSample, tags, Timer.builder(annotation, this.metricName)); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/RedisCacheConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/RedisCacheConfiguration.java index 34658089bb0..dfee662c1a3 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/RedisCacheConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/cache/RedisCacheConfiguration.java @@ -69,7 +69,8 @@ class RedisCacheConfiguration { public RedisCacheManager cacheManager(RedisConnectionFactory redisConnectionFactory, ResourceLoader resourceLoader) { RedisCacheManagerBuilder builder = RedisCacheManager - .builder(redisConnectionFactory).cacheDefaults(determineConfiguration(resourceLoader.getClassLoader())); + .builder(redisConnectionFactory) + .cacheDefaults(determineConfiguration(resourceLoader.getClassLoader())); List cacheNames = this.cacheProperties.getCacheNames(); if (!cacheNames.isEmpty()) { builder.initialCacheNames(new LinkedHashSet<>(cacheNames)); @@ -85,8 +86,8 @@ class RedisCacheConfiguration { Redis redisProperties = this.cacheProperties.getRedis(); org.springframework.data.redis.cache.RedisCacheConfiguration config = org.springframework.data.redis.cache.RedisCacheConfiguration .defaultCacheConfig(); - config = config.serializeValuesWith(SerializationPair.fromSerializer( - new JdkSerializationRedisSerializer(classLoader))); + config = config.serializeValuesWith(SerializationPair + .fromSerializer(new JdkSerializationRedisSerializer(classLoader))); if (redisProperties.getTimeToLive() != null) { config = config.entryTtl(redisProperties.getTimeToLive()); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/HttpEncodingAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/HttpEncodingAutoConfiguration.java index 0498519dd32..b5519e7d87a 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/HttpEncodingAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/HttpEncodingAutoConfiguration.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. @@ -78,9 +78,9 @@ public class HttpEncodingAutoConfiguration { } @Override - public void customize(ConfigurableServletWebServerFactory webServerFactory) { + public void customize(ConfigurableServletWebServerFactory factory) { if (this.properties.getMapping() != null) { - webServerFactory.setLocaleCharsetMappings(this.properties.getMapping()); + factory.setLocaleCharsetMappings(this.properties.getMapping()); } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerAutoConfigurationTests.java index 00ff26a75e7..b1ce100b6a8 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/ReactiveWebServerAutoConfigurationTests.java @@ -119,7 +119,7 @@ public class ReactiveWebServerAutoConfigurationTests { @Bean public WebServerFactoryCustomizer reactiveWebServerCustomizer() { - return (server) -> server.setPort(9000); + return (factory) -> factory.setPort(9000); } } diff --git a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/context/embedded/TomcatLegacyCookieProcessorExample.java b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/context/embedded/TomcatLegacyCookieProcessorExample.java index 49dae603256..13d3ee3800e 100644 --- a/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/context/embedded/TomcatLegacyCookieProcessorExample.java +++ b/spring-boot-project/spring-boot-docs/src/main/java/org/springframework/boot/context/embedded/TomcatLegacyCookieProcessorExample.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. @@ -39,7 +39,7 @@ public class TomcatLegacyCookieProcessorExample { // tag::customizer[] @Bean public WebServerFactoryCustomizer cookieProcessorCustomizer() { - return (serverFactory) -> serverFactory.addContextCustomizers( + return (factory) -> factory.addContextCustomizers( (context) -> context.setCookieProcessor(new LegacyCookieProcessor())); } // end::customizer[] diff --git a/spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReport.java b/spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReport.java index 778c7a7f0ed..66dbffd8ca2 100644 --- a/spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReport.java +++ b/spring-boot-project/spring-boot-properties-migrator/src/main/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReport.java @@ -89,8 +89,9 @@ class PropertiesMigrationReport { return deprecation.getShortReason(); } if (StringUtils.hasText(deprecation.getReplacement())) { - return String.format("Reason: Replacement key '%s' uses an incompatible " - + "target type", deprecation.getReplacement()); + return String.format( + "Reason: Replacement key '%s' uses an incompatible " + "target type", + deprecation.getReplacement()); } return "none"; } 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 aee490daf64..a37aa1f4ed9 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 @@ -118,7 +118,7 @@ class PropertiesMigrationReporter { } private boolean isCompatibleType(String currentType, String replacementType) { - if (replacementType == null || currentType == null) { + if (replacementType == null || currentType == null) { return false; } if (replacementType.equals(currentType)) { @@ -126,20 +126,19 @@ class PropertiesMigrationReporter { } if (replacementType.equals(Duration.class.getName()) && (currentType.equals(Long.class.getName()) - || currentType.equals(Integer.class.getName()))) { + || currentType.equals(Integer.class.getName()))) { return true; } return false; } private String detectMapValueReplacementType(String fullId) { - int i = fullId.lastIndexOf('.'); - if (i != -1) { - ConfigurationMetadataProperty property = this.allProperties.get( - fullId.substring(0, i)); + int lastDot = fullId.lastIndexOf('.'); + if (lastDot != -1) { + ConfigurationMetadataProperty property = this.allProperties + .get(fullId.substring(0, lastDot)); String type = property.getType(); - if (type != null - && type.startsWith(Map.class.getName())) { + if (type != null && type.startsWith(Map.class.getName())) { int lastComma = type.lastIndexOf(','); if (lastComma != -1) { return type.substring(lastComma + 1, type.length() - 1).trim(); diff --git a/spring-boot-project/spring-boot-properties-migrator/src/test/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporterTests.java b/spring-boot-project/spring-boot-properties-migrator/src/test/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporterTests.java index 1bf1ea30beb..0ccc88ec74a 100644 --- a/spring-boot-project/spring-boot-properties-migrator/src/test/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporterTests.java +++ b/spring-boot-project/spring-boot-properties-migrator/src/test/java/org/springframework/boot/context/properties/migrator/PropertiesMigrationReporterTests.java @@ -125,8 +125,7 @@ public class PropertiesMigrationReporterTests { content.put("test.cache-seconds", 50); content.put("test.time-to-live-ms", 1234L); content.put("test.ttl", 5678L); - propertySources.addFirst( - new MapPropertySource("test", content)); + propertySources.addFirst(new MapPropertySource("test", content)); assertThat(propertySources).hasSize(2); String report = createWarningReport( loadRepository("metadata/type-conversion-metadata.json")); diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/endpoint/incremental/IncrementalEndpoint.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/endpoint/incremental/IncrementalEndpoint.java index df3fcf4f2b0..c701153a81f 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/endpoint/incremental/IncrementalEndpoint.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/endpoint/incremental/IncrementalEndpoint.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/web/server/WebServerFactoryCustomizer.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerFactoryCustomizer.java index 405e09697c2..bcdc81b4468 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerFactoryCustomizer.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerFactoryCustomizer.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. @@ -41,8 +41,8 @@ public interface WebServerFactoryCustomizer { /** * Customize the specified {@link WebServerFactory}. - * @param server the server to customize + * @param factory the web server factory to customize */ - void customize(T server); + void customize(T factory); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/PropertyMapperTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/PropertyMapperTests.java index b383b95dea4..2ebb70434ab 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/PropertyMapperTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/PropertyMapperTests.java @@ -151,8 +151,8 @@ public class PropertyMapperTests { @Test public void whenInstanceOfWhenValueIsNotTargetTypeShouldNotMatch() { - this.map.from(() -> (Number) 123L).whenInstanceOf(Double.class) - .toCall(Assert::fail); + Supplier supplier = () -> 123L; + this.map.from(supplier).whenInstanceOf(Double.class).toCall(Assert::fail); } @Test diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessorTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessorTests.java index 71739ab40c2..9a401485a09 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessorTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/server/WebServerFactoryCustomizerBeanPostProcessorTests.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. @@ -185,7 +185,7 @@ public class WebServerFactoryCustomizerBeanPostProcessorTests { private boolean called; @Override - public void customize(T server) { + public void customize(T factory) { this.called = true; }