Skip to content

Fix skipping structured extra values in array-shaped builders - #6377

Closed
wozhenbang2004 wants to merge 2 commits into
FasterXML:3.1from
wozhenbang2004:fix/array-builder-extra-values-6374
Closed

wozhenbang2004 wants to merge 2 commits into
FasterXML:3.1from
wozhenbang2004:fix/array-builder-extra-values-6374

Conversation

@wozhenbang2004

Copy link
Copy Markdown
Contributor

Fixes #6374 on the Jackson 3.x line (targeting 3.1 for forward merging).

Both array-shaped builder deserialization paths are already positioned on the first extra value when they enter the skip loop. Advancing first can enter a structured extra value and mistake its closing array token for the end of the builder array. Skip the current value before advancing, matching the existing non-builder array deserializer.

Regression coverage exercises vanilla and active-view deserialization, root values with trailing-token checks, nested collection/object values, scalar and structured extras, @JsonIgnoreProperties(ignoreUnknown = true), and strict-mode rejection controls.

Validation on JDK 17: isolated fork red/green run.

  • Unmodified 3.1 (baf2388): 6 regression errors, with 2 strict-mode controls passing.
  • With only the two skip-loop changes: all 82 tests passed with ./mvnw -B -ntp test '-Dtest=Builder*Test,POJOAsArrayTest', including all 8 new parameterized cases.

The temporary validation workflow is not included in this PR. This patch does not include the separate 2.x backport.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 81.79% 📈 +0.000%
Branches branches 75.46% 📉 -0.020%

Coverage data generated from JaCoCo test results

@gitar-bot

gitar-bot Bot commented Nov 3, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Changing array-builder skip loops to consume extra values first affects parser positioning; an error could misalign nested values and later fields.

Fixes array-shaped builder deserialization so structured extra values are skipped before advancing, preventing their closing array token from being mistaken for the end of the builder array. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@cowtowncoder

Copy link
Copy Markdown
Member

Re-created as #6391 for some re-work; will add credits for @wozhenbang2004 as fixer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.1 cla-received PR already covered by CLA (optional label)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants