Remove one usage of MapBuilder#immutableMap

It was causing the build to fail.
This commit is contained in:
Nik Everett 2015-10-05 08:52:09 -04:00
parent f484290e5e
commit dd8edd4015
1 changed files with 4 additions and 6 deletions

View File

@ -25,7 +25,6 @@ import org.apache.lucene.analysis.core.StopFilter;
import org.apache.lucene.analysis.ja.JapaneseAnalyzer;
import org.apache.lucene.analysis.util.CharArraySet;
import org.apache.lucene.search.suggest.analyzing.SuggestStopFilter;
import org.elasticsearch.common.collect.MapBuilder;
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.inject.assistedinject.Assisted;
import org.elasticsearch.common.settings.Settings;
@ -36,8 +35,10 @@ import org.elasticsearch.index.settings.IndexSettings;
import java.util.Map;
import java.util.Set;
public class JapaneseStopTokenFilterFactory extends AbstractTokenFilterFactory{
import static java.util.Collections.singletonMap;
public class JapaneseStopTokenFilterFactory extends AbstractTokenFilterFactory{
private static final Map<String, Set<?>> NAMED_STOP_WORDS = singletonMap("_japanese_", JapaneseAnalyzer.getDefaultStopSet());
private final CharArraySet stopWords;
@ -50,10 +51,7 @@ public class JapaneseStopTokenFilterFactory extends AbstractTokenFilterFactory{
super(index, indexSettings, name, settings);
this.ignoreCase = settings.getAsBoolean("ignore_case", false);
this.removeTrailing = settings.getAsBoolean("remove_trailing", true);
Map<String, Set<?>> namedStopWords = MapBuilder.<String, Set<?>>newMapBuilder()
.put("_japanese_", JapaneseAnalyzer.getDefaultStopSet())
.immutableMap();
this.stopWords = Analysis.parseWords(env, settings, "stopwords", JapaneseAnalyzer.getDefaultStopSet(), namedStopWords, ignoreCase);
this.stopWords = Analysis.parseWords(env, settings, "stopwords", JapaneseAnalyzer.getDefaultStopSet(), NAMED_STOP_WORDS, ignoreCase);
}
@Override