From 482de5a9f063ecf6b06918e0e05e80bd152a9874 Mon Sep 17 00:00:00 2001 From: Erick Erickson Date: Fri, 22 Nov 2013 13:00:20 +0000 Subject: [PATCH] SOLR-5491: Testing for extra properties should use startsWith rather than indexOf git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1544518 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/solr/cloud/OverseerCollectionProcessor.java | 2 +- .../java/org/apache/solr/handler/admin/CollectionsHandler.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java b/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java index c0c7a93601b..64e34f4ec96 100644 --- a/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java +++ b/solr/core/src/java/org/apache/solr/cloud/OverseerCollectionProcessor.java @@ -1309,7 +1309,7 @@ public class OverseerCollectionProcessor implements Runnable, ClosableThread { private void addPropertyParams(ZkNodeProps message, ModifiableSolrParams params) { // Now add the property.key=value pairs for (String key : message.keySet()) { - if (key.indexOf(COLL_PROP_PREFIX) != -1) { + if (key.startsWith(COLL_PROP_PREFIX)) { params.set(key, message.getStr(key)); } } diff --git a/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java b/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java index 5d539c0ad65..83b773424b2 100644 --- a/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java +++ b/solr/core/src/java/org/apache/solr/handler/admin/CollectionsHandler.java @@ -379,7 +379,7 @@ public class CollectionsHandler extends RequestHandlerBase { Iterator iter = params.getParameterNamesIterator(); while (iter.hasNext()) { String param = iter.next(); - if (param.indexOf(OverseerCollectionProcessor.COLL_PROP_PREFIX) != -1) { + if (param.startsWith(OverseerCollectionProcessor.COLL_PROP_PREFIX)) { props.put(param, params.get(param)); } }