From 90f9447e18e1e79a834ef3b74ff95f1236e1972b Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Fri, 5 Sep 2014 15:29:41 -0700 Subject: [PATCH] Solr: Remove deprecated Analyzer constructor call The default changed to use the current version, with an optional call to setVersion() if the version should be changed. In this case it should not be. Change-Id: Id87515185ccf7d640ad80dd2972e0d13617df8a3 --- .../main/java/com/google/gerrit/solr/SolrChangeIndex.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/gerrit-solr/src/main/java/com/google/gerrit/solr/SolrChangeIndex.java b/gerrit-solr/src/main/java/com/google/gerrit/solr/SolrChangeIndex.java index 96ba032080..9e9f103a90 100644 --- a/gerrit-solr/src/main/java/com/google/gerrit/solr/SolrChangeIndex.java +++ b/gerrit-solr/src/main/java/com/google/gerrit/solr/SolrChangeIndex.java @@ -50,7 +50,6 @@ import com.google.inject.Provider; import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.analysis.util.CharArraySet; import org.apache.lucene.search.Query; -import org.apache.lucene.util.Version; import org.apache.solr.client.solrj.SolrQuery; import org.apache.solr.client.solrj.SolrQuery.SortClause; import org.apache.solr.client.solrj.SolrServer; @@ -108,13 +107,8 @@ class SolrChangeIndex implements ChangeIndex, LifecycleListener { throw new IllegalStateException("index.url must be supplied"); } - // Version is only used to determine the list of stop words used by the - // analyzer, so use the latest version rather than trying to match the Solr - // server version. - @SuppressWarnings("deprecation") - Version v = Version.LUCENE_CURRENT; queryBuilder = new QueryBuilder( - schema, new StandardAnalyzer(v, CharArraySet.EMPTY_SET)); + schema, new StandardAnalyzer(CharArraySet.EMPTY_SET)); base = Strings.nullToEmpty(base); openIndex = new CloudSolrServer(url);