diff --git a/src/main/java/org/elasticsearch/index/analysis/IcuCollationTokenFilterFactory.java b/src/main/java/org/elasticsearch/index/analysis/IcuCollationTokenFilterFactory.java index 2460fd7a911..2890d135cd2 100644 --- a/src/main/java/org/elasticsearch/index/analysis/IcuCollationTokenFilterFactory.java +++ b/src/main/java/org/elasticsearch/index/analysis/IcuCollationTokenFilterFactory.java @@ -23,7 +23,6 @@ import com.ibm.icu.text.Collator; import com.ibm.icu.text.RuleBasedCollator; import com.ibm.icu.util.ULocale; import org.apache.lucene.analysis.TokenStream; -import org.elasticsearch.common.base.Charsets; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.inject.assistedinject.Assisted; import org.elasticsearch.common.io.Streams; @@ -34,6 +33,7 @@ import org.elasticsearch.index.Index; import org.elasticsearch.index.settings.IndexSettings; import java.io.IOException; +import java.nio.charset.Charset; import java.nio.file.Files; /** @@ -60,7 +60,7 @@ public class IcuCollationTokenFilterFactory extends AbstractTokenFilterFactory { if (rules != null) { Exception failureToResolve = null; try { - rules = Streams.copyToString(Files.newBufferedReader(environment.configFile().resolve(rules), Charsets.UTF_8)); + rules = Streams.copyToString(Files.newBufferedReader(environment.configFile().resolve(rules), Charset.forName("UTF-8"))); } catch (FailedToResolveConfigException | IOException | SecurityException e) { failureToResolve = e; } diff --git a/src/main/java/org/elasticsearch/plugin/analysis/icu/AnalysisICUPlugin.java b/src/main/java/org/elasticsearch/plugin/analysis/icu/AnalysisICUPlugin.java index a1cafe6508c..be73376fd24 100644 --- a/src/main/java/org/elasticsearch/plugin/analysis/icu/AnalysisICUPlugin.java +++ b/src/main/java/org/elasticsearch/plugin/analysis/icu/AnalysisICUPlugin.java @@ -19,13 +19,13 @@ package org.elasticsearch.plugin.analysis.icu; -import org.elasticsearch.common.collect.ImmutableList; import org.elasticsearch.common.inject.Module; import org.elasticsearch.index.analysis.AnalysisModule; import org.elasticsearch.index.analysis.IcuAnalysisBinderProcessor; import org.elasticsearch.indices.analysis.IcuIndicesAnalysisModule; import org.elasticsearch.plugins.AbstractPlugin; +import java.util.ArrayList; import java.util.Collection; /** @@ -45,7 +45,9 @@ public class AnalysisICUPlugin extends AbstractPlugin { @Override public Collection> modules() { - return ImmutableList.>of(IcuIndicesAnalysisModule.class); + Collection> classes = new ArrayList<>(); + classes.add(IcuIndicesAnalysisModule.class); + return classes; } /**