fix analysis-icu to not use shaded APIs
This commit is contained in:
parent
23b6847b5c
commit
da054171ca
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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<Class<? extends Module>> modules() {
|
||||
return ImmutableList.<Class<? extends Module>>of(IcuIndicesAnalysisModule.class);
|
||||
Collection<Class<? extends Module>> classes = new ArrayList<>();
|
||||
classes.add(IcuIndicesAnalysisModule.class);
|
||||
return classes;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue