mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Polish contribution
See gh-36463
This commit is contained in:
parent
d59cec9e01
commit
cc77b8ace1
@ -47,13 +47,14 @@ class ConfigDataLocationBindHandler extends AbstractBindHandler {
|
|||||||
if (result instanceof List) {
|
if (result instanceof List) {
|
||||||
return ((List<Object>) result).stream()
|
return ((List<Object>) result).stream()
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.map(e -> (e instanceof ConfigDataLocation) ? withOrigin(context, (ConfigDataLocation) e) : e)
|
.map((element) -> (element instanceof ConfigDataLocation)
|
||||||
|
? withOrigin(context, (ConfigDataLocation) element) : element)
|
||||||
.collect(Collectors.toCollection(ArrayList::new));
|
.collect(Collectors.toCollection(ArrayList::new));
|
||||||
}
|
}
|
||||||
if (result instanceof ConfigDataLocation[]) {
|
if (result instanceof ConfigDataLocation[]) {
|
||||||
return Arrays.stream((ConfigDataLocation[]) result)
|
return Arrays.stream((ConfigDataLocation[]) result)
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.map(e -> withOrigin(context, e))
|
.map((element) -> withOrigin(context, element))
|
||||||
.toArray(ConfigDataLocation[]::new);
|
.toArray(ConfigDataLocation[]::new);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
Loading…
Reference in New Issue
Block a user