You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by to...@apache.org on 2016/11/28 08:26:47 UTC

[2/2] lucene-solr:master: SOLR-8871 - removed suppress for forbidden API, added locale to toUpperCase

SOLR-8871 - removed suppress for forbidden API, added locale to toUpperCase


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/c36ec0b7
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/c36ec0b7
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/c36ec0b7

Branch: refs/heads/master
Commit: c36ec0b75e06295143601e76de9b71c20295fb7d
Parents: 641294a
Author: Tommaso Teofili <to...@apache.org>
Authored: Mon Nov 28 09:22:36 2016 +0100
Committer: Tommaso Teofili <to...@apache.org>
Committed: Mon Nov 28 09:22:36 2016 +0100

----------------------------------------------------------------------
 .../processor/ClassificationUpdateProcessorFactory.java      | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c36ec0b7/solr/core/src/java/org/apache/solr/update/processor/ClassificationUpdateProcessorFactory.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/update/processor/ClassificationUpdateProcessorFactory.java b/solr/core/src/java/org/apache/solr/update/processor/ClassificationUpdateProcessorFactory.java
index cbe571b..8341ad4 100644
--- a/solr/core/src/java/org/apache/solr/update/processor/ClassificationUpdateProcessorFactory.java
+++ b/solr/core/src/java/org/apache/solr/update/processor/ClassificationUpdateProcessorFactory.java
@@ -17,12 +17,13 @@
 
 package org.apache.solr.update.processor;
 
+import java.util.Locale;
+
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.search.Query;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.params.SolrParams;
 import org.apache.solr.common.util.NamedList;
-import org.apache.solr.common.util.SuppressForbidden;
 import org.apache.solr.request.SolrQueryRequest;
 import org.apache.solr.response.SolrQueryResponse;
 import org.apache.solr.schema.IndexSchema;
@@ -60,7 +61,6 @@ public class ClassificationUpdateProcessorFactory extends UpdateRequestProcessor
   private SolrParams params;
   private ClassificationUpdateProcessorParams classificationParams;
 
-  @SuppressForbidden(reason = "Need toUpperCase to match algorithm enum value")
   @Override
   public void init(final NamedList args) {
     if (args != null) {
@@ -86,10 +86,10 @@ public class ClassificationUpdateProcessorFactory extends UpdateRequestProcessor
       String algorithmString = params.get(ALGORITHM_PARAM);
       Algorithm classificationAlgorithm;
       try {
-        if (algorithmString == null || Algorithm.valueOf(algorithmString.toUpperCase()) == null) {
+        if (algorithmString == null || Algorithm.valueOf(algorithmString.toUpperCase(Locale.ROOT)) == null) {
           classificationAlgorithm = DEFAULT_ALGORITHM;
         } else {
-          classificationAlgorithm = Algorithm.valueOf(algorithmString.toUpperCase());
+          classificationAlgorithm = Algorithm.valueOf(algorithmString.toUpperCase(Locale.ROOT));
         }
       } catch (IllegalArgumentException e) {
         throw new SolrException