mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-05 00:56:58 +08:00
Polish
This commit is contained in:
parent
9b72cc41ab
commit
0fd1c89889
|
@ -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() {
|
||||
|
|
|
@ -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<ContainerConfigAssert,
|
|||
return this.actual.extractingJsonPathArrayValue("$.processes[?(@.type=='%s')]", type)
|
||||
.singleElement()
|
||||
.extracting("command", "args")
|
||||
.flatMap((list) -> (list != null) ? ((List<?>) list).stream().map(Objects::toString).toList()
|
||||
: Collections.emptyList());
|
||||
.flatMap(this::getArgs);
|
||||
}
|
||||
|
||||
private Collection<String> getArgs(Object obj) {
|
||||
if (obj instanceof List<?> list) {
|
||||
return list.stream().map(Objects::toString).toList();
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user