fix(java): preserve LinkedHashMap access-order during serialization by EthCas · Pull Request #4188 · apache/fory · GitHub
Skip to content

fix(java): preserve LinkedHashMap access-order during serialization - #4188

Open
EthCas wants to merge 3 commits into
apache:mainfrom
EthCas:fix/3965-linkedhashmap-access-order
Open

EthCas wants to merge 3 commits into
apache:mainfrom
EthCas:fix/3965-linkedhashmap-access-order

Conversation

@EthCas

@EthCas EthCas commented Oct 18, 2026 •

Copy link
Copy Markdown

Why?

Serializing and deserializing a LinkedHashMap with access-order enabled can lose its access-order behaviour. This change fixes that behaviour.

What does this PR do?

  • Preserves the access-order setting when serializing and deserializing LinkedHashMap instances in Java native mode.
  • Adds a regression test that verifies the iteration order remains consistent after accessing entries in the original and deserialized maps.

Related issues

Fixes #3965

AI Contribution Checklist

  • Substantial AI assistance was used in this PR: no

  • Does this PR introduce any public API change? no

  • Does this PR introduce any binary protocol compatibility change? Yes. The Java-native serialization format now includes an additional accessOrder boolean

Benchmark

No performance testing was done for this PR

@EthCas
EthCas requested a review from chaokunyang as a code owner October 18, 2026 13:52

This branch has not been deployed

No deployments
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.

Access ordered LinkedHashMap not preserved following deserialisation.

1 participant