On Fri, Jan 7, 2011 at 10:47 PM, hoss...@apache.org wrote:
+ public static final SetString EMPTY_STRING_SET = Collections.emptySet();
+
I don't know about this commit... i see a lot of EMPTY set's and maps
defined statically here.
There is no advantage to doing this, even the javadocs explain:
Implementation note: Implementations of this method need not create a
separate (Set|Map|List) object for each call. Using this method is
likely to have comparable cost to using the like-named field. (Unlike
this method, the field does not provide type safety.)
I think we should be using the Collection methods, for example on your
first file:
Index: solr/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.java
===
--- solr/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.java
(revision
1056691)
+++ solr/src/java/org/apache/solr/handler/AnalysisRequestHandlerBase.java
(working
copy)
@@ -47,8 +47,6 @@
*/
public abstract class AnalysisRequestHandlerBase extends RequestHandlerBase {
- public static final SetString EMPTY_STRING_SET = Collections.emptySet();
-
public void handleRequestBody(SolrQueryRequest req,
SolrQueryResponse rsp) throws Exception {
rsp.add(analysis, doAnalysis(req));
}
@@ -343,7 +341,7 @@
*
*/
public AnalysisContext(String fieldName, FieldType fieldType,
Analyzer analyzer) {
- this(fieldName, fieldType, analyzer, EMPTY_STRING_SET);
+ this(fieldName, fieldType, analyzer, Collections.StringemptySet());
}
/**
I
-
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org