mandrean opened a new pull request, #3654: URL: https://github.com/apache/fory/pull/3654
## Why? Compatible mode can deserialize newer payloads where an older reader has removed a map-subclass field. For map subclasses such as `TreeMap<String, String>`, compatible metadata may preserve the skipped field as `Map<Object, Object>`, so declared map chunks can be read with the wrong key/value serializers and fail while skipping the removed field. Fixes #3652. ## What does this PR do? - Recovers declared key/value serializers from the actual map serializer when compatible metadata only exposes `Map<Object, Object>`. - Applies that recovery to normal map chunks and null-key/null-value chunks. - Wires the same recovery through generated map readers. - Adds a compatible-mode regression covering removed `TreeMap<String, String>` subclass fields, including null value and null key chunk cases, across async/codegen combinations. ## Related issues - Fixes #3652 ## AI Contribution Checklist <!-- Full requirements and disclosure template: https://github.com/apache/fory/blob/main/AI_POLICY.md#9-contributor-checklist-for-ai-assisted-prs --> - [x] Substantial AI assistance was used in this PR: `no` - [x] If `yes`, I included a completed [AI Contribution Checklist](https://github.com/apache/fory/blob/main/AI_POLICY.md#9-contributor-checklist-for-ai-assisted-prs) in this PR description and the required `AI Usage Disclosure`. N/A. - [x] If `yes`, my PR description includes the required `ai_review` summary and screenshot evidence of the final clean AI review results from both fresh reviewers on the current PR diff or current HEAD after the latest code changes. N/A. <!-- If substantial AI assistance = `yes`, paste the completed checklist and disclosure block here, including the final ai_review summary and screenshot evidence from both fresh reviewers on the current PR diff or current HEAD after the latest code changes. --> ## Does this PR introduce any user-facing change? No user-facing behavior change beyond fixing compatible deserialization of removed map-subclass fields. - [ ] Does this PR introduce any public API change? - [ ] Does this PR introduce any binary protocol compatibility change? This is a reader-side deserialization fix. It does not change map flags, writer paths, type ids, metadata layout, or the binary protocol. ## Benchmark N/A. This PR does not change serialization format or hot write paths. Validation run: - `mvn -T16 -pl fory-core -am test -Dtest=org.apache.fory.serializer.CompatibleSerializerTest#testCompatibleModeSkipsRemovedTreeMapSubclassField -Dsurefire.failIfNoSpecifiedTests=false` - `mvn -T16 -pl fory-core -am test -Dtest=org.apache.fory.serializer.CompatibleSerializerTest,org.apache.fory.serializer.collection.MapSerializersTest -Dsurefire.failIfNoSpecifiedTests=false` - `mvn -T16 -pl fory-core spotless:check checkstyle:check` - `python ./ci/run_ci.py java --version graalvm` with local GraalVM 21 native-image build and binary execution GitHub CI also passed GraalVM 17, 21, and 25 for this branch. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
