Skip to content

Apache Lucene open-source search software

SOLR-5264 removing deprecated "oneOrMany" method from trunk

Shawn Heiseya68586a03634
diff --git a/solr/core/src/java/org/apache/solr/update/processor/FieldMutatingUpdateProcessorFactory.java b/solr/core/src/java/org/apache/solr/update/processor/FieldMutatingUpdateProcessorFactory.java
index 9c4dc2aeecf..68f0c19ef87 100644
--- a/solr/core/src/java/org/apache/solr/update/processor/FieldMutatingUpdateProcessorFactory.java
+++ b/solr/core/src/java/org/apache/solr/update/processor/FieldMutatingUpdateProcessorFactory.java
@@ -243,47 +243,6 @@ public abstract class FieldMutatingUpdateProcessorFactory
}
- /**
- * Removes all instance of the key from NamedList, returning the Set of
- * Strings that key referred to. Throws an error if the key didn't refer
- * to one or more strings (or arrays of strings)
- * @exception SolrException invalid arr/str structure.
- * @deprecated Replaced by {@link NamedList#removeConfigArgs(String)}. Will be
- * removed in version 5.0.
- */
- @Deprecated
- public static Collection<String> oneOrMany(final NamedList args, final String key) {
- List<String> result = new ArrayList<String>(args.size() / 2);
- final String err = "init arg '" + key + "' must be a string "
- + "(ie: 'str'), or an array (ie: 'arr') containing strings; found: ";
-
- for (Object o = args.remove(key); null != o; o = args.remove(key)) {
- if (o instanceof String) {
- result.add((String)o);
- continue;
- }
-
- if (o instanceof Object[]) {
- o = Arrays.asList((Object[]) o);
- }
-
- if (o instanceof Collection) {
- for (Object item : (Collection)o) {
- if (! (item instanceof String)) {
- throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, err + item.getClass());
- }
- result.add((String)item);
- }
- continue;
- }
-
- // who knows what the hell we have
- throw new SolrException(SolrException.ErrorCode.SERVER_ERROR, err + o.getClass());
- }
-
- return result;
- }
-
/**
* Removes the first instance of the key from NamedList, returning the Boolean
* that key referred to, or null if the key is not specified.