diff options
author | Jon Bratseth <bratseth@gmail.com> | 2022-06-03 13:46:53 +0200 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2022-06-08 11:45:26 +0200 |
commit | c56ad29c37c3c379409d6f0ba9d460cd66b32e53 (patch) | |
tree | 8c666ae791f2d5eb27ad5018c70ec7c98a14edb9 /config-lib | |
parent | bd23103498e292dad0506caed99c7d496e2deba4 (diff) |
Remove on Vespa 8
Diffstat (limited to 'config-lib')
-rw-r--r-- | config-lib/abi-spec.json | 2 | ||||
-rw-r--r-- | config-lib/src/main/java/com/yahoo/config/InnerNode.java | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/config-lib/abi-spec.json b/config-lib/abi-spec.json index acc4dbbda71..45290714777 100644 --- a/config-lib/abi-spec.json +++ b/config-lib/abi-spec.json @@ -201,7 +201,7 @@ "public boolean equals(java.lang.Object)", "public int hashCode()", "protected final java.util.Map getChildren()", - "protected java.util.Map getChildrenWithVectorsFlattened()", + "protected final java.util.Map getChildrenWithVectorsFlattened()", "protected static java.util.Map getAllDescendantLeafNodes(com.yahoo.config.InnerNode)" ], "fields": [] diff --git a/config-lib/src/main/java/com/yahoo/config/InnerNode.java b/config-lib/src/main/java/com/yahoo/config/InnerNode.java index 3655f877a96..610221094d2 100644 --- a/config-lib/src/main/java/com/yahoo/config/InnerNode.java +++ b/config-lib/src/main/java/com/yahoo/config/InnerNode.java @@ -110,11 +110,10 @@ public abstract class InnerNode extends Node { /** * Returns a flat map of this node's direct children, including all NodeVectors' elements. * Keys are the node name, including index for vector elements, e.g. 'arr[0]'. - * TODO Make final before Vespa 8 as correct order is required */ @SuppressWarnings("unchecked") - protected Map<String, Node> getChildrenWithVectorsFlattened() { - HashMap<String, Node> ret = new LinkedHashMap<>(); + protected final Map<String, Node> getChildrenWithVectorsFlattened() { + Map<String, Node> ret = new LinkedHashMap<>(); Map<String, Object> children = getChildren(); for (Map.Entry<String, Object> childEntry : children.entrySet()) { @@ -131,13 +130,13 @@ public abstract class InnerNode extends Node { return ret; } - private static void addMapEntries(HashMap<String, Node> ret, String name, Map<String, Node> map) { + private static void addMapEntries(Map<String, Node> ret, String name, Map<String, Node> map) { for (Map.Entry<String, Node> entry : map.entrySet()) ret.put(name + "{" + entry.getKey() + "}", entry.getValue()); } - private static void addNodeVectorEntries(HashMap<String, Node> ret, String name, NodeVector<?> vector) { + private static void addNodeVectorEntries(Map<String, Node> ret, String name, NodeVector<?> vector) { for (int j = 0; j < vector.length(); j++) ret.put(name + "[" + j + "]", (Node) vector.get(j)); } @@ -160,7 +159,7 @@ public abstract class InnerNode extends Node { for (Map.Entry<String, Node> childEntry : children.entrySet()) { String name = childEntry.getKey(); String prefixedName = prefix + name; - name=name.replaceAll("\\[.*", ""); + name.replaceAll("\\[.*", ""); Node child = childEntry.getValue(); if (child instanceof LeafNode) { ret.put(prefixedName, (LeafNode<?>) child); |