Skip to content

Preserve immutable builder updates for unwrapped properties - #6372

Merged
cowtowncoder merged 10 commits into
FasterXML:3.xfrom
wozhenbang2004:fix/immutable-unwrapped-builders
Nov 3, 2026
Merged

cowtowncoder merged 10 commits into
FasterXML:3.xfrom
wozhenbang2004:fix/immutable-unwrapped-builders

Conversation

@wozhenbang2004

Copy link
Copy Markdown
Contributor

UnwrappedPropertyHandler calls deserializeAndSet, discarding replacement instances returned by immutable builder methods. Default and property-based builders therefore finish with null unwrapped values.

Add a builder-specific entry point that preserves each returned instance and shares the existing view/empty-content handling. Ordinary bean setters retain their existing behavior. Also initialize creator continuation state from the already-buffered entries, so USE_NULL_FOR_EMPTY_UNWRAPPED does not drop content read before the creator completes. Existing continuation signatures are preserved.

Six regression tests cover default builders, creator parameters before/after unwrapped input, view filtering, absent content for both creator/default builders, and a mutable bean setter returning a non-bean value. The test-only baseline reproduces lost values in the default and creator cases.

The final full fork workflow passes on Java 17 (Ubuntu and Windows), 21 and 25: 7,618 tests, no failures or errors.

Regression control: https://github.com/wozhenbang2004/jackson-databind/actions/runs/41316189424
Passing final build: https://github.com/wozhenbang2004/jackson-databind/actions/runs/41317960786

@cowtowncoder cowtowncoder added cla-received PR already covered by CLA (optional label) 3.x Issues to be only tackled for Jackson 3.x, not 2.x labels Nov 1, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 83.07% 📈 +0.000%
Branches branches 77.27% 📈 +0.020%

Coverage data generated from JaCoCo test results

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 82.83% 📉 -0.240%
Branches branches 76.83% 📉 -0.420%

Coverage data generated from JaCoCo test results

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 83.08% 📈 +0.010%
Branches branches 77.27% 📈 +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 · Builder unwrapped-property processing now retains returned instances and buffered creator fields; regressions could mispopulate deserialized immutable objects.

Fixes immutable builder handling for unwrapped properties in UnwrappedPropertyHandler so replacement instances returned by builder methods are preserved instead of being discarded, and carries buffered unwrapped content across creator completion. 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

@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 83.07% 📈 +0.000%
Branches branches 77.27% 📈 +0.020%

Coverage data generated from JaCoCo test results

@cowtowncoder
cowtowncoder merged commit 9cb6aa1 into FasterXML:3.x Nov 3, 2026
7 checks passed
@cowtowncoder cowtowncoder added this to the 3.3.0 milestone Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.x Issues to be only tackled for Jackson 3.x, not 2.x cla-received PR already covered by CLA (optional label)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants