diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/JavaBeanBinder.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/JavaBeanBinder.java index 4134cc58e4..44af313086 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/JavaBeanBinder.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/JavaBeanBinder.java @@ -392,11 +392,9 @@ class JavaBeanBinder implements DataObjectBinder { } private boolean isUninitializedKotlinProperty(Exception ex) { - if (ex instanceof InvocationTargetException ite) { - return "kotlin.UninitializedPropertyAccessException" - .equals(ite.getTargetException().getClass().getName()); - } - return false; + return (ex instanceof InvocationTargetException invocationTargetException) + && "kotlin.UninitializedPropertyAccessException" + .equals(invocationTargetException.getTargetException().getClass().getName()); } boolean isSettable() { diff --git a/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/assertions/ContainerConfigAssert.java b/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/assertions/ContainerConfigAssert.java index e8dffb4b16..3c0368813b 100644 --- a/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/assertions/ContainerConfigAssert.java +++ b/spring-boot-system-tests/spring-boot-image-tests/src/systemTest/java/org/springframework/boot/image/assertions/ContainerConfigAssert.java @@ -16,6 +16,7 @@ package org.springframework.boot.image.assertions; +import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; @@ -106,8 +107,14 @@ public class ContainerConfigAssert extends AbstractAssert (list != null) ? ((List) list).stream().map(Objects::toString).toList() - : Collections.emptyList()); + .flatMap(this::getArgs); + } + + private Collection getArgs(Object obj) { + if (obj instanceof List list) { + return list.stream().map(Objects::toString).toList(); + } + return Collections.emptyList(); } }