You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@solr.apache.org by no...@apache.org on 2021/05/03 01:49:16 UTC

[solr] branch jira/solr15337_1 updated: fixing test errors

This is an automated email from the ASF dual-hosted git repository.

noble pushed a commit to branch jira/solr15337_1
in repository https://gitbox.apache.org/repos/asf/solr.git


The following commit(s) were added to refs/heads/jira/solr15337_1 by this push:
     new 76f36a8  fixing test errors
76f36a8 is described below

commit 76f36a8e1a4f0b7574fd50343a81de35a63b6ec3
Author: noblepaul <no...@gmail.com>
AuthorDate: Mon May 3 11:49:02 2021 +1000

    fixing test errors
---
 .../core/src/java/org/apache/solr/schema/IndexSchema.java | 15 +++++++--------
 .../solrj/src/java/org/apache/solr/common/ConfigNode.java |  7 -------
 2 files changed, 7 insertions(+), 15 deletions(-)

diff --git a/solr/core/src/java/org/apache/solr/schema/IndexSchema.java b/solr/core/src/java/org/apache/solr/schema/IndexSchema.java
index 402c951..c410998 100644
--- a/solr/core/src/java/org/apache/solr/schema/IndexSchema.java
+++ b/solr/core/src/java/org/apache/solr/schema/IndexSchema.java
@@ -513,9 +513,9 @@ public class IndexSchema {
       // load the Field Types
       final FieldTypePluginLoader typeLoader = new FieldTypePluginLoader(this, fieldTypes, schemaAware);
 
-      List<ConfigNode> fTypes = rootNode.children(null, FIELDTYPE_KEYS);
+      List<ConfigNode> fTypes = rootNode.getAll(null, FIELDTYPE_KEYS);
       ConfigNode types = rootNode.child(TYPES);
-      if(types != null) fTypes.addAll(types.children(null, FIELDTYPE_KEYS));
+      if(types != null) fTypes.addAll(types.getAll(null, FIELDTYPE_KEYS));
       typeLoader.load(solrClassLoader, fTypes);
 
       // load the fields
@@ -647,10 +647,10 @@ public class IndexSchema {
     
     ArrayList<DynamicField> dFields = new ArrayList<>();
 
-    List<ConfigNode> nodes = n.children(null,  FIELD_KEYS);
+    List<ConfigNode> nodes = n.getAll(null,  FIELD_KEYS);
     ConfigNode child = n.child(FIELDS);
     if(child != null) {
-      nodes.addAll(child.children(null, FIELD_KEYS));
+      nodes.addAll(child.getAll(null, FIELD_KEYS));
     }
 
     for (ConfigNode node : nodes) {
@@ -730,12 +730,11 @@ public class IndexSchema {
    * Loads the copy fields
    */
   protected synchronized void loadCopyFields(ConfigNode n) {
-    List<ConfigNode> nodes = n.children(COPY_FIELD);
+    List<ConfigNode> nodes = n.getAll(COPY_FIELD);
     ConfigNode f = n.child(FIELDS);
     if (f != null) {
-      List<ConfigNode> c = f.children(COPY_FIELD);
-      if (nodes.isEmpty()) nodes = c;
-      else nodes.addAll(c);
+      nodes = new ArrayList<>(nodes);
+      nodes.addAll(f.getAll(COPY_FIELD));
     }
     for (ConfigNode node : nodes) {
 
diff --git a/solr/solrj/src/java/org/apache/solr/common/ConfigNode.java b/solr/solrj/src/java/org/apache/solr/common/ConfigNode.java
index 6df860e..5d9f131 100644
--- a/solr/solrj/src/java/org/apache/solr/common/ConfigNode.java
+++ b/solr/solrj/src/java/org/apache/solr/common/ConfigNode.java
@@ -129,9 +129,6 @@ public interface ConfigNode {
     return getAll(test, nodeNames == null ? Collections.emptySet() : new HashSet<>(Arrays.asList(nodeNames)));
   }
 
-  default List<ConfigNode> children(Predicate<ConfigNode> test, Set<String> matchNames) {
-    return getAll(test, matchNames);
-  }
   /**Iterate through child nodes with the names and return all the matching children
    * @param matchNames names of tags to be returned
    * @param  test check for the nodes to be returned
@@ -150,10 +147,6 @@ public interface ConfigNode {
     return getAll(null, Collections.singleton(name));
   }
 
-  default List<ConfigNode> children(String name) {
-    return getAll(null, Collections.singleton(name));
-  }
-
   default boolean exists() { return true; }
   default boolean isNull() { return false; }