You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by zh...@apache.org on 2025/12/23 07:58:14 UTC

(lucene) branch branch_10x updated: Fix map size in CustomAnalyzer#paramsToMap. (#14770)

This is an automated email from the ASF dual-hosted git repository.

zhouhui pushed a commit to branch branch_10x
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/branch_10x by this push:
     new 3283e218200 Fix map size in CustomAnalyzer#paramsToMap. (#14770)
3283e218200 is described below

commit 3283e21820097536a4fff2422edce58f3b16b9b5
Author: zhouhui <vs...@163.com>
AuthorDate: Tue Dec 23 14:29:07 2025 +0800

    Fix map size in CustomAnalyzer#paramsToMap. (#14770)
---
 .../src/java/org/apache/lucene/analysis/custom/CustomAnalyzer.java      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/custom/CustomAnalyzer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/custom/CustomAnalyzer.java
index 2c8afef5f2b..71906c220ef 100644
--- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/custom/CustomAnalyzer.java
+++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/custom/CustomAnalyzer.java
@@ -606,7 +606,7 @@ public final class CustomAnalyzer extends Analyzer {
         throw new IllegalArgumentException(
             "Key-value pairs expected, so the number of params must be even.");
       }
-      final Map<String, String> map = CollectionUtil.newHashMap(params.length);
+      final Map<String, String> map = CollectionUtil.newHashMap(params.length / 2);
       for (int i = 0; i < params.length; i += 2) {
         Objects.requireNonNull(params[i], "Key of param may not be null.");
         map.put(params[i], params[i + 1]);