Skip to content

Preserve string-keyed map hardening for ConcurrentMap#3042

Open
M0nd0R wants to merge 1 commit into
google:mainfrom
M0nd0R:codex/concurrentmap-string-key-hardening
Open

Preserve string-keyed map hardening for ConcurrentMap#3042
M0nd0R wants to merge 1 commit into
google:mainfrom
M0nd0R:codex/concurrentmap-string-key-hardening

Conversation

@M0nd0R

@M0nd0R M0nd0R commented Jun 25, 2026

Copy link
Copy Markdown

Summary

This change preserves Gson's existing string-keyed map hardening behavior for
ConcurrentMap<String, ...> interface targets.

Map<String, ...> currently uses LinkedTreeMap to avoid hash-table collision
behavior on older runtimes. ConcurrentMap<String, ...> was instead resolved to
ConcurrentHashMap; this change resolves string-keyed concurrent map interface
targets to ConcurrentSkipListMap while preserving ConcurrentHashMap for
non-string keys and explicit ConcurrentHashMap targets.

Tests

  • mise x java@temurin-17 maven@3.9.11 -- mvn -pl gson -Dtest=MapTest test
  • mise x java@temurin-17 maven@3.9.11 -- mvn -pl gson spotless:check

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.

1 participant