commit | beda74a6745e5a4d6cc0e35ad9bbaa298b9f52b3 | [log] [tgz] |
---|---|---|
author | Diego Zambelli Sessona <diego.sessona@gmail.com> | Thu Jul 13 12:52:09 2023 +0100 |
committer | Diego Zambelli Sessona <diego.sessona@gmail.com> | Mon Jul 17 09:19:55 2023 +0000 |
tree | 691778299161ae1a721d5d4a4c9e94a8b7fd7608 | |
parent | 606d4868d6150069abfa78fe873302ee6c684d91 [diff] |
Remove double brace initialization The build of this module was failing due to not being compliant with the errorprone setting, in particular with double brace initalization [1]. This can also be seen on the CI [2]. [1]: https://errorprone.info/bugpattern/DoubleBraceInitialization [2]: https://gerrit-ci.gerritforge.com/view/Plugins-stable-3.7/job/module-index-elasticsearch-bazel-stable-3.7/ Bug: Issue 291102095 Release-Notes: skip Change-Id: Id07f8688a4e68c0998dcf57c77f035b1e0ebc11d
diff --git a/src/main/java/com/google/gerrit/elasticsearch/ElasticSetting.java b/src/main/java/com/google/gerrit/elasticsearch/ElasticSetting.java index c054da6..2fcfc90 100644 --- a/src/main/java/com/google/gerrit/elasticsearch/ElasticSetting.java +++ b/src/main/java/com/google/gerrit/elasticsearch/ElasticSetting.java
@@ -16,7 +16,6 @@ import com.google.common.collect.ImmutableMap; import com.google.gson.annotations.SerializedName; -import java.util.HashMap; import java.util.Map; class ElasticSetting { @@ -60,12 +59,7 @@ FieldProperties analyzer = new FieldProperties(); analyzer.customWithCharFilter = customAnalyzer; - analyzer.keywordTokenizer = - new HashMap<>() { - { - put("tokenizer", "keyword"); - } - }; + analyzer.keywordTokenizer = ImmutableMap.of("tokenizer", "keyword"); fields.put("analyzer", analyzer); return this; }