diff --git a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/mail/MailHealthIndicator.java b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/mail/MailHealthIndicator.java index 08da5072a5b..afd67045f7f 100644 --- a/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/mail/MailHealthIndicator.java +++ b/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/mail/MailHealthIndicator.java @@ -39,8 +39,8 @@ public class MailHealthIndicator extends AbstractHealthIndicator { @Override protected void doHealthCheck(Builder builder) throws Exception { int port = this.mailSender.getPort(); - builder.withDetail("location", (port == JavaMailSenderImpl.DEFAULT_PORT) ? this.mailSender.getHost() - : this.mailSender.getHost() + ":" + this.mailSender.getPort()); + builder.withDetail("location", (port != JavaMailSenderImpl.DEFAULT_PORT) + ? this.mailSender.getHost() + ":" + this.mailSender.getPort() : this.mailSender.getHost()); this.mailSender.testConnection(); builder.up(); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/r2dbc/R2dbcProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/r2dbc/R2dbcProperties.java index fb662fba690..e07b1dd0a06 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/r2dbc/R2dbcProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/r2dbc/R2dbcProperties.java @@ -138,8 +138,6 @@ public class R2dbcProperties { /** * Minimal number of idle connections. - * - * @since 2.7.12 */ private int minIdle = 0; @@ -163,8 +161,6 @@ public class R2dbcProperties { /** * Maximum time to validate a connection from the pool. By default, wait * indefinitely. - * - * @since 2.7.12 */ private Duration maxValidationTime; diff --git a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java index 0f806c8b6dd..8073cba7956 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/main/java/org/springframework/boot/buildpack/platform/docker/DockerApi.java @@ -33,6 +33,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.stream.Collectors; import org.apache.commons.compress.archivers.tar.TarArchiveEntry; @@ -121,16 +122,16 @@ public class DockerApi { return this.jsonStream; } - private URI buildUrl(String path, Collection params) { - return buildUrl(path, StringUtils.toStringArray(params)); + private URI buildUrl(String path, Collection params) { + return buildUrl(path, (params != null) ? params.toArray() : null); } - private URI buildUrl(String path, String... params) { + private URI buildUrl(String path, Object... params) { try { URIBuilder builder = new URIBuilder("/" + API_VERSION + path); int param = 0; while (param < params.length) { - builder.addParameter(params[param++], params[param++]); + builder.addParameter(Objects.toString(params[param++]), Objects.toString(params[param++])); } return builder.build(); } @@ -190,7 +191,7 @@ public class DockerApi { throws IOException { Assert.notNull(reference, "Reference must not be null"); Assert.notNull(listener, "Listener must not be null"); - URI createUri = buildUrl("/images/create", "fromImage", reference.toString()); + URI createUri = buildUrl("/images/create", "fromImage", reference); DigestCaptureUpdateListener digestCapture = new DigestCaptureUpdateListener(); listener.onStart(); try { @@ -348,14 +349,9 @@ public class DockerApi { Assert.notNull(sourceReference, "SourceReference must not be null"); Assert.notNull(targetReference, "TargetReference must not be null"); String tag = targetReference.getTag(); - URI uri; - if (tag == null) { - uri = buildUrl("/images/" + sourceReference + "/tag", "repo", targetReference.toString()); - } - else { - uri = buildUrl("/images/" + sourceReference + "/tag", "repo", - targetReference.inTaglessForm().toString(), "tag", tag); - } + String path = "/images/" + sourceReference + "/tag"; + URI uri = (tag != null) ? buildUrl(path, "repo", targetReference.inTaglessForm(), "tag", tag) + : buildUrl(path, "repo", targetReference); http().post(uri).close(); } @@ -437,7 +433,7 @@ public class DockerApi { public void logs(ContainerReference reference, UpdateListener listener) throws IOException { Assert.notNull(reference, "Reference must not be null"); Assert.notNull(listener, "Listener must not be null"); - String[] params = { "stdout", "1", "stderr", "1", "follow", "1" }; + Object[] params = { "stdout", "1", "stderr", "1", "follow", "1" }; URI uri = buildUrl("/containers/" + reference + "/logs", params); listener.onStart(); try {