Skip to content

Conversation

@vsop-479
Copy link
Contributor

Description

@github-actions
Copy link
Contributor

This PR does not have an entry in lucene/CHANGES.txt. Consider adding one. If the PR doesn't need a changelog entry, then add the skip-changelog label to it and you will stop receiving this reminder on future updates to the PR.

@github-actions
Copy link
Contributor

This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the [email protected] list. Thank you for your contribution!

@github-actions github-actions bot added the Stale label Jun 26, 2025
@github-actions github-actions bot removed the Stale label Oct 1, 2025
@github-actions
Copy link
Contributor

This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the [email protected] list. Thank you for your contribution!

Copy link
Contributor

@uschindler uschindler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, I think this was an oversight.

Anyways we should remove and deprecated CollectionUtil, see comment here:

public static <K, V> HashMap<K, V> newHashMap(int size) {
// This should be replaced with HashMap.newHashMap when lucene moves to jdk19 minimum version
return new HashMap<>((int) (size / 0.75f) + 1);
}

We're on Java 19 since long time! :-) So both Lucene 10 and Main can use the JDK provided method. Let's open a PR!

@uschindler uschindler added this to the 10.4.0 milestone Dec 22, 2025
@uschindler
Copy link
Contributor

Let's backport this to 10.x

@github-actions github-actions bot removed the Stale label Dec 23, 2025
@vsop-479
Copy link
Contributor Author

We're on Java 19 since long time! :-) So both Lucene 10 and Main can use the JDK provided method. Let's open a PR!

OK, I will do it.

@vsop-479 vsop-479 merged commit 247b96e into apache:main Dec 23, 2025
8 checks passed
@vsop-479 vsop-479 deleted the fix_map_size branch December 23, 2025 08:32
@uschindler
Copy link
Contributor

Hi,
I think we should add an extra buffer of 1 entries to the has map, because the code later adds 1 extra default entries to the map, so it will be resized.

https://github.com/vsop-479/lucene-fork/blob/f0be57db06f3ba821dd12815c8a55e3ea2757888/lucene/analysis/common/src/java/org/apache/lucene/analysis/custom/CustomAnalyzer.java#L596

@vsop-479
Copy link
Contributor Author

vsop-479 commented Dec 23, 2025

I think we should add an extra buffer of 1 entries to the has map, because the code later adds 1 extra default entries to the map, so it will be resized.

OK, I will fix it.

@vsop-479
Copy link
Contributor Author

I think we should add an extra buffer of 1 entries to the has map, because the code later adds 1 extra default entries to the map, so it will be resized.

Added with #15517.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants