Skip to content

fix: preserve typed Map parsing with allowlisted container @type - #7898

Open
mvanhorn wants to merge 1 commit into
alibaba:mainfrom
mvanhorn:fix/7886-typed-map-autotype-container
Open

mvanhorn wants to merge 1 commit into
alibaba:mainfrom
mvanhorn:fix/7886-typed-map-autotype-container

Conversation

@mvanhorn

Copy link
Copy Markdown

What this PR does / why we need it?

It addresses the behavior reported in issue #7886.

This change edits core/src/main/java/com/alibaba/fastjson2/reader/ObjectReaderImplMapTyped.java. The edited code sits in ObjectReaderImplMapTyped. Across 2 files the diff adds 75 lines and removes 3.

Tests for the fastjson2 ObjectReaderImplMapTyped change live in core/src/test/java/com/alibaba/fastjson2/reader/ObjectReaderImplMapTypedTest.java.
The targeted tests for the fastjson2 ObjectReaderImplMapTyped change pass locally.
Ran ./mvnw clean test in a Linux container (eclipse-temurin:21-jdk) for the fastjson2 ObjectReaderImplMapTyped change; 63 tests passed.
The tests in core/src/test/java/com/alibaba/fastjson2/reader/ObjectReaderImplMapTypedTest.java fail without the fix in the fastjson2 ObjectReaderImplMapTyped change (checked by reverting the source changes).

Fixes #7886

Summary of your change

Covered in the summary above.

Please indicate you've done the following:

  • Made sure tests are passing and test coverage is added if needed.
  • Made sure commit message follow the rule of Conventional Commits specification.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed.

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

1 participant