diff --git a/gradle.properties b/gradle.properties index d47f8499726..a88fd3056b6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,7 @@ kotlinVersion=2.2.21 mavenVersion=3.9.10 mockitoVersion=5.20.0 nativeBuildToolsVersion=0.11.4 -nullabilityPluginVersion=0.0.10 +nullabilityPluginVersion=0.0.11 snakeYamlVersion=2.5 springFrameworkVersion=7.0.3 springFramework60xVersion=6.0.23 diff --git a/module/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java b/module/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java index 17fd9a0282b..8cc8d95e6ab 100644 --- a/module/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java +++ b/module/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/web/server/ManagementServerProperties.java @@ -107,10 +107,10 @@ public class ManagementServerProperties { @Contract("!null -> !null") private @Nullable String cleanBasePath(@Nullable String basePath) { - String candidate = null; - if (StringUtils.hasLength(basePath)) { - candidate = basePath.strip(); + if (basePath == null) { + return null; } + String candidate = basePath.strip(); if (StringUtils.hasText(candidate)) { if (!candidate.startsWith("/")) { candidate = "/" + candidate; diff --git a/module/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/SpringBootTestRandomPortContextCustomizer.java b/module/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/SpringBootTestRandomPortContextCustomizer.java index e43ca14a349..e106535bba1 100644 --- a/module/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/SpringBootTestRandomPortContextCustomizer.java +++ b/module/spring-boot-web-server/src/main/java/org/springframework/boot/web/server/context/SpringBootTestRandomPortContextCustomizer.java @@ -111,7 +111,7 @@ class SpringBootTestRandomPortContextCustomizer implements ContextCustomizer { private static final Integer ZERO = Integer.valueOf(0); boolean isFixed(MapPropertySource source, Port port) { - return !ZERO.equals(get(source, port, null)); + return !ZERO.equals(get(source, port)); } boolean isConfigured(PropertySource source, Port port) { @@ -121,14 +121,13 @@ class SpringBootTestRandomPortContextCustomizer implements ContextCustomizer { @Contract("_, _, !null -> !null") @Nullable Integer get(PropertySources sources, Port port, @Nullable Integer defaultValue) { return sources.stream() - .map((source) -> get(source, port, defaultValue)) + .map((source) -> get(source, port)) .filter(Objects::nonNull) .findFirst() .orElse(defaultValue); } - @Contract("_, _, !null -> !null") - @Nullable Integer get(PropertySource source, Port port, @Nullable Integer defaultValue) { + @Nullable Integer get(PropertySource source, Port port) { Object value = source.getProperty(port.property()); if (value == null || ClassUtils.isAssignableValue(Integer.class, value)) { return (Integer) value;