From 7bd285dd93ffee8778fa07b9b0cb48b438bc001b Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 3 Aug 2017 14:39:46 +0100 Subject: [PATCH] Polish --- .../jms/activemq/ActiveMQConnectionFactoryCustomizer.java | 1 + .../autoconfigure/quartz/SchedulerFactoryBeanCustomizer.java | 1 + .../security/SpringBootWebSecurityConfiguration.java | 2 +- .../web/servlet/DefaultServletWebServerFactoryCustomizer.java | 4 ++-- .../boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java | 4 ++-- .../boot/autoconfigure/condition/ConditionalOnBeanTests.java | 2 +- .../springframework/boot/gradle/plugin/JavaPluginAction.java | 2 +- .../boot/testsupport/web/servlet/MockServletWebServer.java | 1 + .../org/springframework/boot/SpringBootExceptionReporter.java | 1 + .../boot/context/annotation/DeterminableImports.java | 1 + .../java/org/springframework/boot/origin/OriginLookup.java | 1 + .../java/org/springframework/boot/origin/OriginProvider.java | 1 + .../boot/web/server/WebServerFactoryCustomizer.java | 1 + 13 files changed, 15 insertions(+), 7 deletions(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryCustomizer.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryCustomizer.java index e42e4e03ff..f04e9ae9fb 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryCustomizer.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jms/activemq/ActiveMQConnectionFactoryCustomizer.java @@ -25,6 +25,7 @@ import org.apache.activemq.ActiveMQConnectionFactory; * @author Stephane Nicoll * @since 1.5.5 */ +@FunctionalInterface public interface ActiveMQConnectionFactoryCustomizer { /** diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/quartz/SchedulerFactoryBeanCustomizer.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/quartz/SchedulerFactoryBeanCustomizer.java index d1d7492e7f..f5c909623a 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/quartz/SchedulerFactoryBeanCustomizer.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/quartz/SchedulerFactoryBeanCustomizer.java @@ -26,6 +26,7 @@ import org.springframework.scheduling.quartz.SchedulerFactoryBean; * @author Vedran Pavic * @since 2.0.0 */ +@FunctionalInterface public interface SchedulerFactoryBeanCustomizer { /** diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SpringBootWebSecurityConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SpringBootWebSecurityConfiguration.java index 0439bb0e59..fce4bd0804 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SpringBootWebSecurityConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/SpringBootWebSecurityConfiguration.java @@ -228,7 +228,7 @@ public class SpringBootWebSecurityConfiguration { @Override protected void configure(HttpSecurity http) throws Exception { - http.requestMatcher(request -> false); + http.requestMatcher((request) -> false); } } diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DefaultServletWebServerFactoryCustomizer.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DefaultServletWebServerFactoryCustomizer.java index 5f2330273a..31e711a88a 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DefaultServletWebServerFactoryCustomizer.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/DefaultServletWebServerFactoryCustomizer.java @@ -446,8 +446,8 @@ public class DefaultServletWebServerFactoryCustomizer private static void customizeMaxHttpPostSize( UndertowServletWebServerFactory factory, final long maxHttpPostSize) { - factory.addBuilderCustomizers((builder -> builder - .setServerOption(UndertowOptions.MAX_ENTITY_SIZE, maxHttpPostSize))); + factory.addBuilderCustomizers((builder) -> builder + .setServerOption(UndertowOptions.MAX_ENTITY_SIZE, maxHttpPostSize)); } } diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java index 8dae849857..9132448dc8 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/amqp/RabbitAutoConfigurationTests.java @@ -170,7 +170,7 @@ public class RabbitAutoConfigurationTests { this.contextRunner.withUserConfiguration(TestConfiguration.class) .withPropertyValues("spring.rabbitmq.publisher-confirms=true", "spring.rabbitmq.publisher-returns=true") - .run(context -> { + .run((context) -> { CachingConnectionFactory connectionFactory = context .getBean(CachingConnectionFactory.class); RabbitTemplate rabbitTemplate = context.getBean(RabbitTemplate.class); @@ -238,7 +238,7 @@ public class RabbitAutoConfigurationTests { this.contextRunner.withUserConfiguration(TestConfiguration.class) .withPropertyValues("spring.rabbitmq.template.mandatory:false", "spring.rabbitmq.publisher-returns=true") - .run(context -> { + .run((context) -> { RabbitTemplate rabbitTemplate = context.getBean(RabbitTemplate.class); assertThat(getMandatory(rabbitTemplate)).isFalse(); }); diff --git a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnBeanTests.java b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnBeanTests.java index 617c46b592..adc57e66a7 100644 --- a/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnBeanTests.java +++ b/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/condition/ConditionalOnBeanTests.java @@ -120,7 +120,7 @@ public class ConditionalOnBeanTests { WithPropertyPlaceholderClassName.class, OnBeanClassConfiguration.class) .withPropertyValues("mybeanclass=java.lang.String") - .run(context -> assertThat(context).hasNotFailed()); + .run((context) -> assertThat(context).hasNotFailed()); } @Test diff --git a/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java b/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java index 03316c79df..9156863f83 100644 --- a/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java +++ b/spring-boot-tools/spring-boot-gradle-plugin/src/main/java/org/springframework/boot/gradle/plugin/JavaPluginAction.java @@ -113,7 +113,7 @@ final class JavaPluginAction implements PluginApplicationAction { } private void configureUtf8Encoding(Project project) { - project.afterEvaluate(evaluated -> evaluated.getTasks() + project.afterEvaluate((evaluated) -> evaluated.getTasks() .withType(JavaCompile.class, (compile) -> { if (compile.getOptions().getEncoding() == null) { compile.getOptions().setEncoding("UTF-8"); diff --git a/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/MockServletWebServer.java b/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/MockServletWebServer.java index 75df408649..9037dccc6b 100644 --- a/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/MockServletWebServer.java +++ b/spring-boot-tools/spring-boot-test-support/src/main/java/org/springframework/boot/testsupport/web/servlet/MockServletWebServer.java @@ -214,6 +214,7 @@ public abstract class MockServletWebServer { /** * Initializer (usually implement by adapting {@code Initializer}). */ + @FunctionalInterface protected interface Initializer { void onStartup(ServletContext context) throws ServletException; diff --git a/spring-boot/src/main/java/org/springframework/boot/SpringBootExceptionReporter.java b/spring-boot/src/main/java/org/springframework/boot/SpringBootExceptionReporter.java index 3f2528bbe9..3d57a85ce7 100644 --- a/spring-boot/src/main/java/org/springframework/boot/SpringBootExceptionReporter.java +++ b/spring-boot/src/main/java/org/springframework/boot/SpringBootExceptionReporter.java @@ -30,6 +30,7 @@ import org.springframework.core.io.support.SpringFactoriesLoader; * @since 2.0.0 * @see ApplicationContextAware */ +@FunctionalInterface public interface SpringBootExceptionReporter { /** diff --git a/spring-boot/src/main/java/org/springframework/boot/context/annotation/DeterminableImports.java b/spring-boot/src/main/java/org/springframework/boot/context/annotation/DeterminableImports.java index 647f06c6b4..0f993ef39d 100644 --- a/spring-boot/src/main/java/org/springframework/boot/context/annotation/DeterminableImports.java +++ b/spring-boot/src/main/java/org/springframework/boot/context/annotation/DeterminableImports.java @@ -40,6 +40,7 @@ import org.springframework.core.type.AnnotationMetadata; * @author Andy Wilkinson * @since 1.5.0 */ +@FunctionalInterface public interface DeterminableImports { /** diff --git a/spring-boot/src/main/java/org/springframework/boot/origin/OriginLookup.java b/spring-boot/src/main/java/org/springframework/boot/origin/OriginLookup.java index 2859178c0b..95fff46bd1 100644 --- a/spring-boot/src/main/java/org/springframework/boot/origin/OriginLookup.java +++ b/spring-boot/src/main/java/org/springframework/boot/origin/OriginLookup.java @@ -24,6 +24,7 @@ package org.springframework.boot.origin; * @author Phillip Webb * @since 2.0.0 */ +@FunctionalInterface public interface OriginLookup { /** diff --git a/spring-boot/src/main/java/org/springframework/boot/origin/OriginProvider.java b/spring-boot/src/main/java/org/springframework/boot/origin/OriginProvider.java index 19306277de..ebf3d9fe33 100644 --- a/spring-boot/src/main/java/org/springframework/boot/origin/OriginProvider.java +++ b/spring-boot/src/main/java/org/springframework/boot/origin/OriginProvider.java @@ -23,6 +23,7 @@ package org.springframework.boot.origin; * @since 2.0.0 * @see Origin */ +@FunctionalInterface public interface OriginProvider { /** diff --git a/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerFactoryCustomizer.java b/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerFactoryCustomizer.java index 5c8f9b6a83..405e09697c 100644 --- a/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerFactoryCustomizer.java +++ b/spring-boot/src/main/java/org/springframework/boot/web/server/WebServerFactoryCustomizer.java @@ -36,6 +36,7 @@ import org.springframework.beans.factory.config.BeanPostProcessor; * @since 2.0.0 * @see WebServerFactoryCustomizerBeanPostProcessor */ +@FunctionalInterface public interface WebServerFactoryCustomizer { /**