From f363fe7dd13a76b48d412c9968387bc2afa75fcf Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Tue, 17 Jul 2018 04:19:36 +0900 Subject: [PATCH 1/2] Polish See gh-13790 --- .../ServletEndpointManagementContextConfiguration.java | 8 +++----- .../web/client/RestTemplateMetricsAutoConfiguration.java | 4 ++-- .../AbstractDependsOnBeanFactoryPostProcessor.java | 6 ++++++ .../autoconfigure/flyway/FlywayAutoConfiguration.java | 8 ++++---- .../HazelcastJpaDependencyAutoConfiguration.java | 2 +- .../liquibase/LiquibaseAutoConfiguration.java | 2 +- 6 files changed, 17 insertions(+), 13 deletions(-) diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.java index 6d1bab9ae3..9c97916609 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.java @@ -81,11 +81,9 @@ public class ServletEndpointManagementContextConfiguration { private Set getServletPaths(WebEndpointProperties properties, DispatcherServletPathProvider servletPathProvider) { - Set servletPaths = servletPathProvider.getServletPaths(); - return servletPaths.stream().map((p) -> { - String path = cleanServletPath(p); - return path + properties.getBasePath(); - }).collect(Collectors.toSet()); + return servletPathProvider.getServletPaths().stream() + .map((p) -> cleanServletPath(p) + properties.getBasePath()) + .collect(Collectors.toSet()); } private String cleanServletPath(String servletPath) { diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/RestTemplateMetricsAutoConfiguration.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/RestTemplateMetricsAutoConfiguration.java index 7ec4df10de..5999245e29 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/RestTemplateMetricsAutoConfiguration.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/web/client/RestTemplateMetricsAutoConfiguration.java @@ -82,12 +82,12 @@ public class RestTemplateMetricsAutoConfiguration { } /** - * {@link MeterFilter} to deny further client requests and log a warning. + * {@link MeterFilter} to deny further URI tags and log a warning. */ private static class MaximumUriTagsReachedMeterFilter implements MeterFilter { private final Logger logger = LoggerFactory - .getLogger(RestTemplateMetricsAutoConfiguration.class); + .getLogger(MaximumUriTagsReachedMeterFilter.class); private final String metricName; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AbstractDependsOnBeanFactoryPostProcessor.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AbstractDependsOnBeanFactoryPostProcessor.java index e9b72b49f0..236d465d31 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AbstractDependsOnBeanFactoryPostProcessor.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AbstractDependsOnBeanFactoryPostProcessor.java @@ -58,6 +58,12 @@ public abstract class AbstractDependsOnBeanFactoryPostProcessor this.dependsOn = dependsOn; } + /** + * Create an instance with target bean class and dependencies. + * @param beanClass target bean class + * @param dependsOn dependencies + * @since 2.0.4 + */ protected AbstractDependsOnBeanFactoryPostProcessor(Class beanClass, String... dependsOn) { this(beanClass, null, dependsOn); 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 98dd49b525..b29ad5853f 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 @@ -206,7 +206,7 @@ public class FlywayAutoConfiguration { } /** - * Additional configuration to ensure that {@link JdbcOperations} beans depend-on + * Additional configuration to ensure that {@link JdbcOperations} beans depend on * the {@code flywayInitializer} bean. */ @Configuration @@ -240,16 +240,16 @@ public class FlywayAutoConfiguration { } /** - * Additional configuration to ensure that {@link JdbcOperations} beans depend-on the + * Additional configuration to ensure that {@link JdbcOperations} beans depend on the * {@code flyway} bean. */ @Configuration @ConditionalOnClass(JdbcOperations.class) @ConditionalOnBean(JdbcOperations.class) - protected static class FlywayJdbcDependencyConfiguration + protected static class FlywayJdbcOperationsDependencyConfiguration extends JdbcOperationsDependsOnPostProcessor { - public FlywayJdbcDependencyConfiguration() { + public FlywayJdbcOperationsDependencyConfiguration() { super("flyway"); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfiguration.java index ff49c9ffe5..2f3a3590b9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfiguration.java @@ -33,7 +33,7 @@ import org.springframework.orm.jpa.AbstractEntityManagerFactoryBean; import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; /** - * Additional configuration to ensure that {@link EntityManagerFactory} beans depend-on + * Additional configuration to ensure that {@link EntityManagerFactory} beans depend on * the {@code hazelcastInstance} bean. * * @author Stephane Nicoll diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java index e1e4500afe..f970ac492c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java @@ -192,7 +192,7 @@ public class LiquibaseAutoConfiguration { } /** - * Additional configuration to ensure that {@link JdbcOperations} beans depend-on the + * Additional configuration to ensure that {@link JdbcOperations} beans depend on the * liquibase bean. */ @Configuration From 8095ee4a5b8d8610ee8b4d3c020c2cae936bf80a Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Tue, 17 Jul 2018 10:04:00 +0200 Subject: [PATCH 2/2] Polish contribution See gh-13790 --- .../boot/autoconfigure/flyway/FlywayAutoConfiguration.java | 6 +++--- .../hazelcast/HazelcastJpaDependencyAutoConfiguration.java | 2 +- .../autoconfigure/liquibase/LiquibaseAutoConfiguration.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) 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 b29ad5853f..811184b432 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 @@ -191,7 +191,7 @@ public class FlywayAutoConfiguration { /** * Additional configuration to ensure that {@link EntityManagerFactory} beans - * depend-on the {@code flywayInitializer} bean. + * depend on the {@code flywayInitializer} bean. */ @Configuration @ConditionalOnClass(LocalContainerEntityManagerFactoryBean.class) @@ -224,8 +224,8 @@ public class FlywayAutoConfiguration { } /** - * Additional configuration to ensure that {@link EntityManagerFactory} beans - * depend-on the {@code flyway} bean. + * Additional configuration to ensure that {@link EntityManagerFactory} beans depend + * on the {@code flyway} bean. */ @Configuration @ConditionalOnClass(LocalContainerEntityManagerFactoryBean.class) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfiguration.java index 2f3a3590b9..d5c1a8594b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/hazelcast/HazelcastJpaDependencyAutoConfiguration.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-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java index f970ac492c..554010b7a5 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java @@ -176,8 +176,8 @@ public class LiquibaseAutoConfiguration { } /** - * Additional configuration to ensure that {@link EntityManagerFactory} beans - * depend-on the liquibase bean. + * Additional configuration to ensure that {@link EntityManagerFactory} beans depend + * on the liquibase bean. */ @Configuration @ConditionalOnClass(LocalContainerEntityManagerFactoryBean.class)