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/12/05 12:17:27 UTC

[4/5] lucene-solr:branch_6x: SOLR-8871 - removed suppress for forbidden API, added locale to toUpperCase (cherry picked from commit c36ec0b)

SOLR-8871 - removed suppress for forbidden API, added locale to toUpperCase
(cherry picked from commit c36ec0b)


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

Branch: refs/heads/branch_6x
Commit: 7a44b8ed7b6b0c1214544f0c572433deb2f665f7
Parents: cf90d08
Author: Tommaso Teofili <to...@apache.org>
Authored: Mon Nov 28 09:22:36 2016 +0100
Committer: Tommaso Teofili <to...@apache.org>
Committed: Mon Dec 5 13:05:37 2016 +0100

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


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/7a44b8ed/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 9a9ba0c..f6f215f 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
@@ -16,12 +16,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;
@@ -59,7 +60,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) {
@@ -85,10 +85,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