diff options
author | jonmv <venstad@gmail.com> | 2024-06-08 17:08:20 +0200 |
---|---|---|
committer | jonmv <venstad@gmail.com> | 2024-06-08 17:08:20 +0200 |
commit | b649fb3a4b38290bb85f03c3d71eb79a780b3408 (patch) | |
tree | aeafdbc4236386928bd3444e8499322037e2e33f | |
parent | 1478e54ecaffe8fffcbfdaf7fc853fb1578a36c5 (diff) |
Static import
-rw-r--r-- | vespajlib/src/main/java/ai/vespa/json/Json.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/vespajlib/src/main/java/ai/vespa/json/Json.java b/vespajlib/src/main/java/ai/vespa/json/Json.java index 99ce9290be2..01bd5c2dc19 100644 --- a/vespajlib/src/main/java/ai/vespa/json/Json.java +++ b/vespajlib/src/main/java/ai/vespa/json/Json.java @@ -28,6 +28,7 @@ import java.util.stream.StreamSupport; import static com.yahoo.slime.Type.ARRAY; import static com.yahoo.slime.Type.STRING; +import static java.util.stream.Collectors.joining; /** * A {@link Slime} wrapper that throws {@link InvalidJsonException} on missing members or invalid types. @@ -165,8 +166,7 @@ public class Json implements Iterable<Json> { private void requirePresent() { if (isMissing()) throw createMissingMemberException(); } private InvalidJsonException createInvalidTypeException(Type... expected) { - var expectedTypesString = Arrays.stream(expected).map(this::toString) - .collect(java.util.stream.Collectors.joining("' or '", "'", "'")); + var expectedTypesString = Arrays.stream(expected).map(this::toString).collect(joining("' or '", "'", "'")); var pathString = path.isEmpty() ? "JSON" : "JSON member '%s'".formatted(path); return new InvalidJsonException( "Expected %s to be a %s but got '%s'" |