diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/appoptics/AppOpticsProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/appoptics/AppOpticsProperties.java index e32c0c2f5d..218ad92e7b 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/appoptics/AppOpticsProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/appoptics/AppOpticsProperties.java @@ -33,17 +33,17 @@ public class AppOpticsProperties extends StepRegistryProperties { /** * URI to ship metrics to. */ - public String uri = "https://api.appoptics.com/v1/measurements"; + private String uri = "https://api.appoptics.com/v1/measurements"; /** * AppOptics API token. */ - public String apiToken; + private String apiToken; /** * Tag that will be mapped to "@host" when shipping metrics to AppOptics. */ - public String hostTag = "instance"; + private String hostTag = "instance"; /** * Number of measurements per request to use for this backend. If more measurements diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/system/DiskSpaceHealthIndicatorProperties.java b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/system/DiskSpaceHealthIndicatorProperties.java index 32cc54b2fc..c323c8287b 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/system/DiskSpaceHealthIndicatorProperties.java +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/system/DiskSpaceHealthIndicatorProperties.java @@ -58,7 +58,8 @@ public class DiskSpaceHealthIndicatorProperties { } public void setThreshold(DataSize threshold) { - Assert.isTrue(!threshold.isNegative(), "threshold must be greater than 0"); + Assert.isTrue(!threshold.isNegative(), + "threshold must be greater than or equal to 0"); this.threshold = threshold; } diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/MvcWebEndpointIntegrationTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/MvcWebEndpointIntegrationTests.java index a7aac7de5c..aa9306e3dd 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/MvcWebEndpointIntegrationTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/MvcWebEndpointIntegrationTests.java @@ -116,9 +116,9 @@ public class MvcWebEndpointIntegrationTests extends assertThat(getMatchResult("/spring.do")).isNull(); } - private RequestMatchResult getMatchResult(String s) { + private RequestMatchResult getMatchResult(String servletPath) { MockHttpServletRequest request = new MockHttpServletRequest(); - request.setServletPath(s); + request.setServletPath(servletPath); AnnotationConfigServletWebServerApplicationContext context = createApplicationContext(); context.register(TestEndpointConfiguration.class); context.refresh(); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnBeanCondition.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnBeanCondition.java index fc49d7a93b..b819b2f9bf 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnBeanCondition.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnBeanCondition.java @@ -426,12 +426,7 @@ class OnBeanCondition extends FilteringSpringBootCondition } private boolean hasAtLeastOne(List... lists) { - for (List list : lists) { - if (!list.isEmpty()) { - return true; - } - } - return false; + return Arrays.stream(lists).anyMatch((list) -> !list.isEmpty()); } protected String annotationName() { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jBookmarkManagementConfiguration.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jBookmarkManagementConfiguration.java index e3efca1507..d3751cb8ec 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jBookmarkManagementConfiguration.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jBookmarkManagementConfiguration.java @@ -36,11 +36,10 @@ import org.springframework.web.context.WebApplicationContext; /** * Provides a {@link BookmarkManager} for Neo4j's bookmark support based on Caffeine if - * available. Depending on the applications kind (web or not) the bookmark manager will be - * bound to the application or the request, as recommend by Spring Data Neo4j. + * available. Depending on the application's type (web or not) the bookmark manager will + * be bound to the application or the request, as recommend by Spring Data Neo4j. * * @author Michael Simons - * @since 2.1.0 */ @Configuration @ConditionalOnClass({ Caffeine.class, CaffeineCacheManager.class }) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java index 23ae86a07d..72aa67f64e 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/ServerProperties.java @@ -330,7 +330,7 @@ public class ServerProperties { private DataSize maxHttpPostSize = DataSize.ofMegabytes(2); /** - * Maximum size in bytes of the HTTP message header. + * Maximum size of the HTTP message header. */ private DataSize maxHttpHeaderSize = DataSize.ofBytes(0); diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/DeferredLog.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/DeferredLog.java index 5ac65e0f1d..8d6a9054e3 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/DeferredLog.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/DeferredLog.java @@ -151,6 +151,7 @@ public class DeferredLog implements Log { /** * Switch from deferred logging to immediate logging to the specified destination. * @param destination the new log destination + * @since 2.1.0 */ public void switchTo(Class destination) { switchTo(LogFactory.getLog(destination)); @@ -159,6 +160,7 @@ public class DeferredLog implements Log { /** * Switch from deferred logging to immediate logging to the specified destination. * @param destination the new log destination + * @since 2.1.0 */ public void switchTo(Log destination) { synchronized (this.lines) { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/json/AbstractJsonParserTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/json/AbstractJsonParserTests.java index 78a2b993ee..6b50aa3803 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/json/AbstractJsonParserTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/json/AbstractJsonParserTests.java @@ -167,7 +167,7 @@ public abstract class AbstractJsonParserTests { } @Test - public void escapeQuote() { + public void escapeDoubleQuote() { String input = "{\"foo\": \"\\\"bar\\\"\"}"; Map map = this.parser.parseMap(input); assertThat(map.get("foo")).isEqualTo("\"bar\"");