diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-10-11 12:35:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-11 12:35:13 +0200 |
commit | 9e5c9398c8141d59d3c07aba9198fa3dc43b56a0 (patch) | |
tree | f674f7ac06fca2bba8faebaa3cdf098e73fbc0c2 /document/src/main | |
parent | c5415130877801316c9c380330c644f3b9f615c8 (diff) | |
parent | 9922b8c1681a817d9a9c84d3a967a5120e8c0599 (diff) |
Merge pull request #28850 from vespa-engine/jonmv/concrete-document-field-validation
Jonmv/concrete document field validation
Diffstat (limited to 'document/src/main')
4 files changed, 14 insertions, 14 deletions
diff --git a/document/src/main/java/com/yahoo/document/annotation/ListAnnotationContainer.java b/document/src/main/java/com/yahoo/document/annotation/ListAnnotationContainer.java index 6ef36f0013a..c2c22558a32 100644 --- a/document/src/main/java/com/yahoo/document/annotation/ListAnnotationContainer.java +++ b/document/src/main/java/com/yahoo/document/annotation/ListAnnotationContainer.java @@ -10,10 +10,10 @@ import java.util.ListIterator; import java.util.NoSuchElementException; /** - * @author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a> + * @author Einar M R Rosenvinge */ public class ListAnnotationContainer extends IteratingAnnotationContainer { - private final List<Annotation> annotations = new LinkedList<Annotation>(); + private final List<Annotation> annotations = new LinkedList<>(); @Override void annotateAll(Collection<Annotation> annotations) { @@ -55,7 +55,7 @@ public class ListAnnotationContainer extends IteratingAnnotationContainer { private boolean nextCalled = false; AnnotationIterator(ListIterator<Annotation> baseIt, IdentityHashMap<SpanNode, SpanNode> nodes) { - this.base = new PeekableListIterator<Annotation>(baseIt); + this.base = new PeekableListIterator(baseIt); this.nodes = nodes; } diff --git a/document/src/main/java/com/yahoo/document/annotation/SpanNodeParent.java b/document/src/main/java/com/yahoo/document/annotation/SpanNodeParent.java index 167ce4589da..a4d178e6925 100644 --- a/document/src/main/java/com/yahoo/document/annotation/SpanNodeParent.java +++ b/document/src/main/java/com/yahoo/document/annotation/SpanNodeParent.java @@ -6,7 +6,7 @@ import com.yahoo.document.datatypes.StringFieldValue; /** * An interface to be implemented by classes that can be parents of SpanNodes. * - * @author <a href="mailto:einarmr@yahoo-inc.com">Einar M R Rosenvinge</a> + * @author Einar M R Rosenvinge * @see SpanNode#getParent() */ public interface SpanNodeParent { @@ -15,12 +15,12 @@ public interface SpanNodeParent { * * @return the SpanTree of this, if it belongs to a SpanTree, otherwise null. */ - public SpanTree getSpanTree(); + SpanTree getSpanTree(); /** * Returns the StringFieldValue that this node belongs to, if any. * * @return the StringFieldValue that this node belongs to, if any, otherwise null. */ - public StringFieldValue getStringFieldValue(); + StringFieldValue getStringFieldValue(); } diff --git a/document/src/main/java/com/yahoo/document/annotation/SpanTree.java b/document/src/main/java/com/yahoo/document/annotation/SpanTree.java index 3dc27171d8c..f785cf3b3ec 100644 --- a/document/src/main/java/com/yahoo/document/annotation/SpanTree.java +++ b/document/src/main/java/com/yahoo/document/annotation/SpanTree.java @@ -22,7 +22,7 @@ import java.util.Map; /** * A SpanTree holds a root node of a tree of SpanNodes, and a List of Annotations pointing to these nodes - * or each other. It also has a name. + * or each other. It also has a name. * * @author Einar M R Rosenvinge * @see com.yahoo.document.annotation.SpanNode @@ -36,7 +36,7 @@ public class SpanTree implements Iterable<Annotation>, SpanNodeParent, Comparabl private StringFieldValue stringFieldValue; /** - * WARNING! Only to be used by deserializers! Creates an empty SpanTree instance. + * WARNING! Only to be used by deserializers! Creates an empty SpanTree instance. */ public SpanTree() { } @@ -65,8 +65,8 @@ public class SpanTree implements Iterable<Annotation>, SpanNodeParent, Comparabl public SpanTree(SpanTree otherToCopy) { name = otherToCopy.name; setRoot(copySpan(otherToCopy.root)); - List<Annotation> annotationsToCopy = new ArrayList<Annotation>(otherToCopy.getAnnotations()); - List<Annotation> newAnnotations = new ArrayList<Annotation>(annotationsToCopy.size()); + List<Annotation> annotationsToCopy = new ArrayList<>(otherToCopy.getAnnotations()); + List<Annotation> newAnnotations = new ArrayList<>(annotationsToCopy.size()); for (Annotation otherAnnotationToCopy : annotationsToCopy) { newAnnotations.add(new Annotation(otherAnnotationToCopy)); @@ -153,7 +153,7 @@ public class SpanTree implements Iterable<Annotation>, SpanNodeParent, Comparabl } private IdentityHashMap<Annotation, Integer> getAnnotations(List<Annotation> annotationsToCopy) { - IdentityHashMap<Annotation, Integer> map = new IdentityHashMap<Annotation, Integer>(); + IdentityHashMap<Annotation, Integer> map = new IdentityHashMap<>(); for (int i = 0; i < annotationsToCopy.size(); i++) { map.put(annotationsToCopy.get(i), i); } @@ -162,7 +162,7 @@ public class SpanTree implements Iterable<Annotation>, SpanNodeParent, Comparabl private List<SpanNode> getSpanNodes() { - ArrayList<SpanNode> nodes = new ArrayList<SpanNode>(); + ArrayList<SpanNode> nodes = new ArrayList<>(); nodes.add(root); Iterator<SpanNode> it = root.childIteratorRecursive(); while (it.hasNext()) { @@ -172,7 +172,7 @@ public class SpanTree implements Iterable<Annotation>, SpanNodeParent, Comparabl } private static IdentityHashMap<SpanNode, Integer> getSpanNodes(SpanTree otherToCopy) { - IdentityHashMap<SpanNode, Integer> map = new IdentityHashMap<SpanNode, Integer>(); + IdentityHashMap<SpanNode, Integer> map = new IdentityHashMap<>(); int spanNodeCounter = 0; map.put(otherToCopy.getRoot(), spanNodeCounter++); Iterator<SpanNode> it = otherToCopy.getRoot().childIteratorRecursive(); diff --git a/document/src/main/java/com/yahoo/document/datatypes/StringFieldValue.java b/document/src/main/java/com/yahoo/document/datatypes/StringFieldValue.java index 797d89226f3..8b4b94f6bbf 100644 --- a/document/src/main/java/com/yahoo/document/datatypes/StringFieldValue.java +++ b/document/src/main/java/com/yahoo/document/datatypes/StringFieldValue.java @@ -106,7 +106,7 @@ public class StringFieldValue extends FieldValue { } /** - * Sets a new value for this StringFieldValue. NOTE that doing so will clear all span trees from this value, + * Sets a new value for this StringFieldValue. NOTE that doing so will clear all span trees from this value, * since they most certainly will not make sense for a new string value. * * @param o the new String to assign to this. An argument of null is equal to calling clear(). |