diff --git a/config/checkstyle/checkstyle-suppressions.xml b/config/checkstyle/checkstyle-suppressions.xml index 74d14e278a8..929c586a5c9 100644 --- a/config/checkstyle/checkstyle-suppressions.xml +++ b/config/checkstyle/checkstyle-suppressions.xml @@ -63,6 +63,7 @@ + diff --git a/config/checkstyle/import-control.xml b/config/checkstyle/import-control.xml index 2040ef93af2..a174fdf0a92 100644 --- a/config/checkstyle/import-control.xml +++ b/config/checkstyle/import-control.xml @@ -13,6 +13,11 @@ + + + + + diff --git a/core/spring-boot/src/main/java/org/springframework/boot/ssl/FixedTrustManagerFactory.java b/core/spring-boot/src/main/java/org/springframework/boot/ssl/FixedTrustManagerFactory.java index 44135e7a3a2..b13f715a662 100644 --- a/core/spring-boot/src/main/java/org/springframework/boot/ssl/FixedTrustManagerFactory.java +++ b/core/spring-boot/src/main/java/org/springframework/boot/ssl/FixedTrustManagerFactory.java @@ -24,8 +24,6 @@ import javax.net.ssl.TrustManager; import javax.net.ssl.TrustManagerFactory; import javax.net.ssl.TrustManagerFactorySpi; -import org.springframework.boot.SpringBootVersion; - /** * {@link TrustManagerFactory} which uses a fixed set of {@link TrustManager * TrustManagers}. @@ -34,9 +32,7 @@ import org.springframework.boot.SpringBootVersion; */ final class FixedTrustManagerFactory extends TrustManagerFactory { - private static final Provider PROVIDER = new Provider("FixedTrustManagerFactory", SpringBootVersion.getVersion(), - "") { - }; + private static final Provider PROVIDER = new FixedTrustManagerFactoryProvider(); private FixedTrustManagerFactory(FixedTrustManagersSpi spi, String algorithm) { super(spi, PROVIDER, algorithm); @@ -70,4 +66,12 @@ final class FixedTrustManagerFactory extends TrustManagerFactory { } + private static class FixedTrustManagerFactoryProvider extends Provider { + + FixedTrustManagerFactoryProvider() { + super("FixedTrustManagerFactory", SpringBootProviderVersion.get(), ""); + } + + } + } diff --git a/core/spring-boot/src/main/javaTemplates/org/springframework/boot/ssl/SpringBootProviderVersion.java b/core/spring-boot/src/main/javaTemplates/org/springframework/boot/ssl/SpringBootProviderVersion.java new file mode 100644 index 00000000000..b08cac40146 --- /dev/null +++ b/core/spring-boot/src/main/javaTemplates/org/springframework/boot/ssl/SpringBootProviderVersion.java @@ -0,0 +1,37 @@ +/* + * Copyright 2012-present 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. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.boot.ssl; + +/** + * Exposes the Spring Boot version for SSL Provider use. + * + * @author Phillip Webb + */ +final class SpringBootProviderVersion { + + private SpringBootProviderVersion() { + } + + /** + * Return the full version string of the present Spring Boot codebase. + * @return the version of Spring Boot + */ + static String get() { + return "${springBootVersion}"; + } + +}