Skip to content

Backport "Deprecate MapOps.KeySet, replace with private (and more performant) strict/lazy KeySet implementations" to 3.8.1#24957

Merged
WojciechMazur merged 7 commits intorelease-3.8.1from
release-3.8.1_backport-24767
Jan 13, 2026
Merged

Backport "Deprecate MapOps.KeySet, replace with private (and more performant) strict/lazy KeySet implementations" to 3.8.1#24957
WojciechMazur merged 7 commits intorelease-3.8.1from
release-3.8.1_backport-24767

Conversation

@WojciechMazur
Copy link
Copy Markdown
Contributor

Backports #24767 to the 3.8.1-RC1.

PR submitted by the release tooling.
[skip ci]

natsukagami and others added 7 commits January 13, 2026 10:24
We need a data structure that both acts like a Set (queries membership efficiently), and has a stable iteration order.
LinkedHashSet seems to fit this criteria.

[Cherry-picked 5fcd43b]
LinkedHashMap's `keySet` has always been returning a LinkedKeySet, a private data structure that was extended from the
generic MapOps.KeySet. Recently MapOps.KeySet was changed to a strict data structure, so we change the `keySet` method to
use the lazy wrapper instead. Unfortunately we cannot change the hierarchy of `LinkedKeySet`, but the API never said we have to use it.

[Cherry-picked d3ccb6d]
…base implementation

This partially reverts `KeySet` and `GenKeySet` to their pre-capture-check implementation,
with some unsafe annotations and a deprecation notice. This should cause MiMa to be happy with
the previous implementations.

[Cherry-picked 9a6a1fa][modified]
@WojciechMazur WojciechMazur requested a review from a team as a code owner January 13, 2026 09:37
Base automatically changed from release-3.8.1_backport-24837 to release-3.8.1 January 13, 2026 11:33
@WojciechMazur WojciechMazur merged commit 8ff746d into release-3.8.1 Jan 13, 2026
59 of 60 checks passed
@WojciechMazur WojciechMazur deleted the release-3.8.1_backport-24767 branch January 13, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants