lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject lucene-solr git commit: Fix more locale bugs in SQL handler ans streams
Date Tue, 09 Feb 2016 07:33:01 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/master e78002bdc -> 8dddd88d3


Fix more locale bugs in SQL handler ans streams


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

Branch: refs/heads/master
Commit: 8dddd88d3054596b7afb536429b42792145fdffe
Parents: e78002b
Author: Uwe Schindler <uschindler@apache.org>
Authored: Tue Feb 9 08:32:48 2016 +0100
Committer: Uwe Schindler <uschindler@apache.org>
Committed: Tue Feb 9 08:32:48 2016 +0100

----------------------------------------------------------------------
 .../core/src/java/org/apache/solr/handler/SQLHandler.java | 10 +++++-----
 .../solr/client/solrj/io/stream/CloudSolrStream.java      |  4 +---
 2 files changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8dddd88d/solr/core/src/java/org/apache/solr/handler/SQLHandler.java
----------------------------------------------------------------------
diff --git a/solr/core/src/java/org/apache/solr/handler/SQLHandler.java b/solr/core/src/java/org/apache/solr/handler/SQLHandler.java
index a017f58..fe83187 100644
--- a/solr/core/src/java/org/apache/solr/handler/SQLHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/SQLHandler.java
@@ -165,13 +165,13 @@ public class SQLHandler extends RequestHandlerBase implements SolrCoreAware
{
 
       TupleStream sqlStream = null;
 
-      if(sqlVistor.table.toUpperCase(Locale.getDefault()).contains("_CATALOGS_")) {
+      if(sqlVistor.table.toUpperCase(Locale.ROOT).contains("_CATALOGS_")) {
         if (!sqlVistor.fields.contains("TABLE_CAT")) {
           throw new IOException("When querying _CATALOGS_, fields must contain column TABLE_CAT");
         }
 
         sqlStream = new CatalogsStream(defaultZkhost);
-      } else if(sqlVistor.table.toUpperCase(Locale.getDefault()).contains("_SCHEMAS_")) {
+      } else if(sqlVistor.table.toUpperCase(Locale.ROOT).contains("_SCHEMAS_")) {
         if (!sqlVistor.fields.contains("TABLE_SCHEM") || !sqlVistor.fields.contains("TABLE_CATALOG"))
{
           throw new IOException("When querying _SCHEMAS_, fields must contain both TABLE_SCHEM
and TABLE_CATALOG");
         }
@@ -657,7 +657,7 @@ public class SQLHandler extends RequestHandlerBase implements SolrCoreAware
{
       }
 
 
-      if(!sortItem.getOrdering().toString().toLowerCase(Locale.getDefault()).contains(direction.toLowerCase(Locale.getDefault())))
{
+      if(!sortItem.getOrdering().toString().toLowerCase(Locale.ROOT).contains(direction.toLowerCase(Locale.ROOT)))
{
         return false;
       }
     }
@@ -838,7 +838,7 @@ public class SQLHandler extends RequestHandlerBase implements SolrCoreAware
{
   }
 
   private static String ascDesc(String s) {
-    if(s.toLowerCase(Locale.getDefault()).contains("desc")) {
+    if(s.toLowerCase(Locale.ROOT).contains("desc")) {
       return "desc";
     } else {
       return "asc";
@@ -846,7 +846,7 @@ public class SQLHandler extends RequestHandlerBase implements SolrCoreAware
{
   }
 
   private static ComparatorOrder ascDescComp(String s) {
-    if(s.toLowerCase(Locale.getDefault()).contains("desc")) {
+    if(s.toLowerCase(Locale.ROOT).contains("desc")) {
       return ComparatorOrder.DESCENDING;
     } else {
       return ComparatorOrder.ASCENDING;

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8dddd88d/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CloudSolrStream.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CloudSolrStream.java
b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CloudSolrStream.java
index 730097f..1f194e4 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CloudSolrStream.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/io/stream/CloudSolrStream.java
@@ -300,11 +300,9 @@ public class CloudSolrStream extends TupleStream implements Expressible
{
       Collection<Slice> slices = clusterState.getActiveSlices(this.collection);
 
       if(slices == null) {
-
-        String colLower = this.collection.toLowerCase(Locale.getDefault());
         //Try case insensitive match
         for(String col : clusterState.getCollections()) {
-          if(col.toLowerCase(Locale.getDefault()).equals(colLower)) {
+          if(col.equalsIgnoreCase(this.collection)) {
             slices = clusterState.getActiveSlices(col);
             break;
           }


Mime
View raw message