Repository navigation
Fix MappingIterator trailing-token checks for root arrays - #6336
king-wwwhhh wants to merge 1 commit into
Conversation
Code Review ✅ Approved🟡 Medium risk · Checking tokens after root-array iteration when FAIL_ON_TRAILING_TOKENS is enabled could reject inputs containing additional root values or malformed trailing data. Adds trailing-token validation for root-level wrapper arrays in VerificationRules No rules evaluated Functional validation Not enabledFor more verification details, comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Fixes #6334.
MappingIteratornow validates content after the closing token of a root-level wrapper array whenFAIL_ON_TRAILING_TOKENSis enabled. A second root value is reported throughDeserializationContext.reportTrailingTokens(), while malformed trailing input raises the parser error instead of being silently ignored.The check is limited to root-level arrays. Nested arrays remain usable with caller-owned parsers, and disabling
FAIL_ON_TRAILING_TOKENSpreserves the previous behavior. Managed parsers are still closed when the trailing-content check fails.Regression coverage includes:
START_ARRAY;Validation:
FullStreamReadTest,ReadValuesTest, andReadValuesLeakTest: 30 passed;jackson-databindmodule: 7,580 passed, 0 failures, 0 errors, 1 pre-existing skip.Local JaCoCo collection was disabled because its Windows agent could not create the workspace output file. Tests ran on Eclipse Temurin 17.0.18. Other OS/JDK combinations were not run locally.
AI assistance: Codex helped investigate, implement, and run the test matrix; the resulting behavior and diff were reviewed against the issue scope.