lucene-solr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yo...@apache.org
Subject svn commit: r801981 - in /lucene/solr/trunk/src/java/org/apache/solr: handler/component/ request/ search/function/ util/
Date Fri, 07 Aug 2009 12:54:26 GMT
Author: yonik
Date: Fri Aug  7 12:54:26 2009
New Revision: 801981

URL: http://svn.apache.org/viewvc?rev=801981&view=rev
Log:
SOLR-1338: use StringHelper.intern()

Modified:
    lucene/solr/trunk/src/java/org/apache/solr/handler/component/QueryElevationComponent.java
    lucene/solr/trunk/src/java/org/apache/solr/handler/component/TermsComponent.java
    lucene/solr/trunk/src/java/org/apache/solr/request/JSONResponseWriter.java
    lucene/solr/trunk/src/java/org/apache/solr/search/function/FileFloatSource.java
    lucene/solr/trunk/src/java/org/apache/solr/util/HighFrequencyDictionary.java

Modified: lucene/solr/trunk/src/java/org/apache/solr/handler/component/QueryElevationComponent.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/handler/component/QueryElevationComponent.java?rev=801981&r1=801980&r2=801981&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/handler/component/QueryElevationComponent.java
(original)
+++ lucene/solr/trunk/src/java/org/apache/solr/handler/component/QueryElevationComponent.java
Fri Aug  7 12:54:26 2009
@@ -43,6 +43,7 @@
 import org.apache.lucene.index.IndexReader;
 import org.apache.lucene.index.Term;
 import org.apache.lucene.search.*;
+import org.apache.lucene.util.StringHelper;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.params.SolrParams;
 import org.apache.solr.common.util.DOMUtil;
@@ -155,7 +156,7 @@
       throw new SolrException( SolrException.ErrorCode.SERVER_ERROR, 
           "QueryElevationComponent requires the schema to have a uniqueKeyField" );
     }
-    idField = sf.getName().intern();
+    idField = StringHelper.intern(sf.getName());
     
     forceElevation = initArgs.getBool( FORCE_ELEVATION, forceElevation );
     try {

Modified: lucene/solr/trunk/src/java/org/apache/solr/handler/component/TermsComponent.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/handler/component/TermsComponent.java?rev=801981&r1=801980&r2=801981&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/handler/component/TermsComponent.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/handler/component/TermsComponent.java Fri Aug
 7 12:54:26 2009
@@ -18,6 +18,7 @@
 
 import org.apache.lucene.index.Term;
 import org.apache.lucene.index.TermEnum;
+import org.apache.lucene.util.StringHelper;
 import org.apache.solr.common.SolrException;
 import org.apache.solr.common.params.CommonParams;
 import org.apache.solr.common.params.SolrParams;
@@ -62,7 +63,7 @@
         String prefix = params.get(TermsParams.TERMS_PREFIX_STR);
         boolean raw = params.getBool(TermsParams.TERMS_RAW, false);
         for (int j = 0; j < fields.length; j++) {
-          String field = fields[j].intern();
+          String field = StringHelper.intern(fields[j]);
           FieldType ft = raw ? null : rb.req.getSchema().getFieldTypeNoEx(field);
           if (ft==null) ft = new StrField();
 

Modified: lucene/solr/trunk/src/java/org/apache/solr/request/JSONResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/request/JSONResponseWriter.java?rev=801981&r1=801980&r2=801981&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/request/JSONResponseWriter.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/request/JSONResponseWriter.java Fri Aug  7
12:54:26 2009
@@ -19,6 +19,7 @@
 
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.Fieldable;
+import org.apache.lucene.util.StringHelper;
 import org.apache.solr.common.SolrDocument;
 import org.apache.solr.common.SolrDocumentList;
 import org.apache.solr.common.params.CommonParams;
@@ -78,7 +79,7 @@
 
   public JSONWriter(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) {
     super(writer, req, rsp);
-    namedListStyle = req.getParams().get(JSON_NL_STYLE, JSON_NL_FLAT).intern();
+    namedListStyle = StringHelper.intern(req.getParams().get(JSON_NL_STYLE, JSON_NL_FLAT));
     wrapperFunction = req.getParams().get(JSON_WRAPPER_FUNCTION);
   }
 

Modified: lucene/solr/trunk/src/java/org/apache/solr/search/function/FileFloatSource.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/search/function/FileFloatSource.java?rev=801981&r1=801980&r2=801981&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/search/function/FileFloatSource.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/search/function/FileFloatSource.java Fri Aug
 7 12:54:26 2009
@@ -20,6 +20,7 @@
 import org.apache.lucene.index.TermDocs;
 import org.apache.lucene.index.TermEnum;
 import org.apache.lucene.index.Term;
+import org.apache.lucene.util.StringHelper;
 import org.apache.solr.core.SolrCore;
 import org.apache.solr.schema.SchemaField;
 import org.apache.solr.schema.FieldType;
@@ -206,7 +207,7 @@
 
     BufferedReader r = new BufferedReader(new InputStreamReader(is));
 
-    String idName = ffs.keyField.getName().intern();
+    String idName = StringHelper.intern(ffs.keyField.getName());
     FieldType idType = ffs.keyField.getType();
     boolean sorted=true;   // assume sorted until we discover it's not
 

Modified: lucene/solr/trunk/src/java/org/apache/solr/util/HighFrequencyDictionary.java
URL: http://svn.apache.org/viewvc/lucene/solr/trunk/src/java/org/apache/solr/util/HighFrequencyDictionary.java?rev=801981&r1=801980&r2=801981&view=diff
==============================================================================
--- lucene/solr/trunk/src/java/org/apache/solr/util/HighFrequencyDictionary.java (original)
+++ lucene/solr/trunk/src/java/org/apache/solr/util/HighFrequencyDictionary.java Fri Aug 
7 12:54:26 2009
@@ -24,6 +24,7 @@
 import org.apache.lucene.index.Term;
 import org.apache.lucene.index.TermEnum;
 import org.apache.lucene.search.spell.Dictionary;
+import org.apache.lucene.util.StringHelper;
 
 /**
  * HighFrequencyDictionary: terms taken from the given field
@@ -45,7 +46,7 @@
 
   public HighFrequencyDictionary(IndexReader reader, String field, float thresh) {
     this.reader = reader;
-    this.field = field.intern();
+    this.field = StringHelper.intern(field);
     this.thresh = thresh;
   }
 
@@ -108,7 +109,7 @@
         String currentField = actualTerm.field();
 
         // if the next word doesn't have the same field return false
-        if (currentField != field) {
+        if (currentField != field) {   // intern'd comparison
           actualTerm = null;
           return false;
         }



Mime
View raw message