From 6d01bc915b049957c4a871a53ff29a543aa446f7 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Fri, 28 Jun 2019 12:05:35 -0700 Subject: [PATCH] Make intermediate classes of public classes public Backport gh-12590 to 1.5.x and also pick up a few classes that were missed. This commit also makes a few properties bound classes public. Closes gh-17337 --- .../springframework/boot/actuate/cloudfoundry/Token.java | 3 ++- .../springframework/boot/actuate/metrics/buffer/Buffer.java | 5 +++-- .../boot/actuate/metrics/buffer/Buffers.java | 6 +++++- .../boot/actuate/metrics/writer/MetricMessage.java | 5 +++-- .../autoconfigure/condition/AbstractNestedCondition.java | 3 ++- .../restdocs/RestDocsMockMvcBuilderCustomizer.java | 5 +++-- .../boot/web/servlet/AbstractFilterRegistrationBean.java | 5 +++-- 7 files changed, 21 insertions(+), 11 deletions(-) diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cloudfoundry/Token.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cloudfoundry/Token.java index 034a9de1e4..e1dce52e3c 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cloudfoundry/Token.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/cloudfoundry/Token.java @@ -28,8 +28,9 @@ import org.springframework.util.StringUtils; * The JSON web token provided with each request that originates from Cloud Foundry. * * @author Madhura Bhave + * @since 1.5.22 */ -class Token { +public class Token { private static final Charset UTF_8 = Charset.forName("UTF-8"); diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/buffer/Buffer.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/buffer/Buffer.java index b930d39e95..3efb5ad46b 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/buffer/Buffer.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/buffer/Buffer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 the original author or authors. + * Copyright 2012-2019 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. @@ -22,8 +22,9 @@ package org.springframework.boot.actuate.metrics.buffer; * @param the value type * @author Dave Syer * @author Phillip Webb + * @since 1.5.22 */ -abstract class Buffer { +public abstract class Buffer { private volatile long timestamp; diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/buffer/Buffers.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/buffer/Buffers.java index 59e42f46db..c86f163a14 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/buffer/Buffers.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/buffer/Buffers.java @@ -30,12 +30,16 @@ import org.springframework.lang.UsesJava8; * @author Dave Syer * @author Phillip Webb * @param the buffer type + * @since 1.5.22 */ @UsesJava8 -abstract class Buffers> { +public abstract class Buffers> { private final ConcurrentHashMap buffers = new ConcurrentHashMap(); + Buffers() { + } + public void forEach(final Predicate predicate, final BiConsumer consumer) { this.buffers.forEach(new BiConsumer() { diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/writer/MetricMessage.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/writer/MetricMessage.java index 11c5df169c..aeb0062f2f 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/writer/MetricMessage.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/metrics/writer/MetricMessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2019 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. @@ -24,8 +24,9 @@ import org.springframework.messaging.support.MessageBuilder; * A metric message sent via Spring Integration. * * @author Phillip Webb + * @since 1.5.22 */ -class MetricMessage { +public class MetricMessage { private static final String METRIC_NAME = "metricName"; diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/AbstractNestedCondition.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/AbstractNestedCondition.java index 6e57181e41..ccce68767a 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/AbstractNestedCondition.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/AbstractNestedCondition.java @@ -40,8 +40,9 @@ import org.springframework.util.MultiValueMap; * Abstract base class for nested conditions. * * @author Phillip Webb + * @since 1.5.22 */ -abstract class AbstractNestedCondition extends SpringBootCondition implements ConfigurationCondition { +public abstract class AbstractNestedCondition extends SpringBootCondition implements ConfigurationCondition { private final ConfigurationPhase configurationPhase; diff --git a/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsMockMvcBuilderCustomizer.java b/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsMockMvcBuilderCustomizer.java index 6bf04ad0d3..f9a9923dae 100644 --- a/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsMockMvcBuilderCustomizer.java +++ b/spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/restdocs/RestDocsMockMvcBuilderCustomizer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 the original author or authors. + * Copyright 2012-2019 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. @@ -27,8 +27,9 @@ import org.springframework.util.StringUtils; * A {@link MockMvcBuilderCustomizer} that configures Spring REST Docs. * * @author Andy Wilkinson + * @since 1.5.22 */ -class RestDocsMockMvcBuilderCustomizer implements InitializingBean, MockMvcBuilderCustomizer { +public class RestDocsMockMvcBuilderCustomizer implements InitializingBean, MockMvcBuilderCustomizer { private final MockMvcRestDocumentationConfigurer delegate; diff --git a/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java b/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java index 6a09a32690..95cef4f2a8 100644 --- a/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java +++ b/spring-boot/src/main/java/org/springframework/boot/web/servlet/AbstractFilterRegistrationBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 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,8 +39,9 @@ import org.springframework.util.Assert; * Servlet 3.0+ container. * * @author Phillip Webb + * @since 1.5.22 */ -abstract class AbstractFilterRegistrationBean extends RegistrationBean { +public abstract class AbstractFilterRegistrationBean extends RegistrationBean { /** * Filters that wrap the servlet request should be ordered less than or equal to this.