Polish
This commit is contained in:
parent
0a9f6a712c
commit
b2e65f665a
|
|
@ -115,10 +115,7 @@ class JsonValueWriter {
|
|||
throw new UncheckedIOException(ex);
|
||||
}
|
||||
}
|
||||
else if (value instanceof Path p) {
|
||||
writeString(p.toString());
|
||||
}
|
||||
else if (value instanceof Iterable<?> iterable) {
|
||||
else if (value instanceof Iterable<?> iterable && canWriteAsArray(iterable)) {
|
||||
writeArray(iterable::forEach);
|
||||
}
|
||||
else if (ObjectUtils.isArray(value)) {
|
||||
|
|
@ -135,6 +132,10 @@ class JsonValueWriter {
|
|||
}
|
||||
}
|
||||
|
||||
private <V> boolean canWriteAsArray(Iterable<?> iterable) {
|
||||
return !(iterable instanceof Path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Start a new {@link Series} (JSON object or array).
|
||||
* @param series the series to start
|
||||
|
|
|
|||
Loading…
Reference in New Issue