diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2024-04-11 15:09:55 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2024-04-11 21:04:22 +0200 |
commit | 2d6bbe0b8bff09d105b77161c1d26a00ce43bf0c (patch) | |
tree | f9948a9904d837960887e81a956b29f92d918002 /document | |
parent | 6923743ed320ce339727ad57f6fc2da5f82f5e3f (diff) |
Unify on List.of
Diffstat (limited to 'document')
-rw-r--r--[-rwxr-xr-x] | document/src/main/java/com/yahoo/document/FieldPath.java | 5 | ||||
-rw-r--r-- | document/src/main/java/com/yahoo/vespaxmlparser/VespaXMLUpdateReader.java | 12 |
2 files changed, 13 insertions, 4 deletions
diff --git a/document/src/main/java/com/yahoo/document/FieldPath.java b/document/src/main/java/com/yahoo/document/FieldPath.java index b78e48d2b41..7596e359d99 100755..100644 --- a/document/src/main/java/com/yahoo/document/FieldPath.java +++ b/document/src/main/java/com/yahoo/document/FieldPath.java @@ -1,7 +1,6 @@ // Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.document; -import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; @@ -19,7 +18,7 @@ public class FieldPath implements Iterable<FieldPathEntry> { * Constructs an empty path. */ public FieldPath() { - list = Collections.emptyList(); + list = List.of(); } /** @@ -109,7 +108,7 @@ public class FieldPath implements Iterable<FieldPathEntry> { FieldPathEntry.Type type = entry.getType(); switch (type) { case STRUCT_FIELD: - if (out.length() > 0) { + if (!out.isEmpty()) { out.append("."); } Field field = entry.getFieldRef(); diff --git a/document/src/main/java/com/yahoo/vespaxmlparser/VespaXMLUpdateReader.java b/document/src/main/java/com/yahoo/vespaxmlparser/VespaXMLUpdateReader.java index 656fb8dd033..334a994ebe8 100644 --- a/document/src/main/java/com/yahoo/vespaxmlparser/VespaXMLUpdateReader.java +++ b/document/src/main/java/com/yahoo/vespaxmlparser/VespaXMLUpdateReader.java @@ -1,7 +1,17 @@ // Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespaxmlparser; -import com.yahoo.document.*; +import com.yahoo.document.ArrayDataType; +import com.yahoo.document.DataType; +import com.yahoo.document.DocumentId; +import com.yahoo.document.DocumentType; +import com.yahoo.document.DocumentTypeManager; +import com.yahoo.document.DocumentUpdate; +import com.yahoo.document.Field; +import com.yahoo.document.FieldPath; +import com.yahoo.document.MapDataType; +import com.yahoo.document.NumericDataType; +import com.yahoo.document.WeightedSetDataType; import com.yahoo.document.datatypes.Array; import com.yahoo.document.datatypes.FieldValue; import com.yahoo.document.datatypes.IntegerFieldValue; |