Skip to content

Pin Jackson tree-deserializer delegation behavior (2.x) - #1367

Merged
stevehu merged 2 commits into
2.xfrom
fix/1363-tree-deserializer-contract-2.x
Oct 24, 2026
Merged

stevehu merged 2 commits into
2.xfrom
fix/1363-tree-deserializer-contract-2.x

Conversation

@stevehu

@stevehu stevehu commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

SelectiveTreeDeserializer depends on Jackson implementation classes for tree reads. A Jackson upgrade could compile successfully while changing contextualization, null handling, updates, or type handling for the public mapper factories.

Add 26 regression cases comparing JsonMapperFactory and YamlMapperFactory with stock Jackson. Cover declared tree roots, null/empty/absent values, merge identity and contextual overrides, reader features, custom node factories and decimal scales, polymorphic tree properties including a user-supplied native subtype deserializer, exception messages/locations/cause chains, and native scalar/untyped/POJO binding. Explicit expectations retain the intentional selective-decimal policy. Document the jackson-upgrade JUnit tag and dependency-bump checks in doc/jackson-upgrade-checks.md, linked from the README, and an Unreleased changelog entry.

Validation with Jackson 2.22.1:

  • mvn --batch-mode -Dstyle.color=never clean verify passed on Corretto 8.0.432, 11.0.25, 17.0.13, and 21.0.5. Each run reported 10,447 tests, 31 skipped, zero failures/errors; all 26 new cases passed.
  • Targeted mutation probes detected loss of contextual precision, update delegation, typed-path precision wrapping, and type delegation (2, 6, 2, and 4 failing cases respectively). Mutations were restored; this PR changes only tests and documentation.
  • mvn -Dgroups=jackson-upgrade test passed on JDK 8. The existing precision suites carry the same tag.
  • Diff whitespace checks and the contributor documentation link passed.

Addresses #1363 on 2.x. Completion across supported Jackson lines requires the companion master PR #1366. Remote CI passed for Java 8/11/17/21 and submit-maven.

@stevehu

stevehu commented Oct 23, 2026

Copy link
Copy Markdown
Contributor Author

Independent review of 1a69d06 (scratch build of the head, merge base 746c512). No correctness bugs found; the PR changes tests and docs only. Remote CI is green (Java 8, 11, 17, 21, submit-maven). I ran the targeted tests, not the full build or the full JDK matrix.

Verified

  • Issue1363Test, Issue1357Test, Issue1350Test and Issue1362Test (53 tests) pass on JDK 8.
  • The five test classes named in the CONTRIBUTING.md upgrade command all exist on both branches, and the JDK matrix it describes matches each branch's ci.yml.
  • Mutation check on SelectiveTreeDeserializer (run on the master build, Issue1363Test, 22 cases; the 2.x class has the same structure but I did not rerun the mutations there):
    • precision parser dropped on plain reads: 6 failures;
    • newDelegatingInstance returns this (contextualization lost): 2 failures;
    • precision parser dropped on the update overload: 4 failures;
    • ArrayNode not registered: 8 failures;
    • precision parser dropped in deserializeWithType: 0 failures (see finding 1).

Findings (all low severity)

  1. deserializeWithType is not pinned. The mutation above passes all 22 cases. The polymorphic test passes because Jackson's type deserializer resolves the concrete node deserializer, which wraps the parser itself. Either add a case that reaches deserializeWithType with a lossy decimal, or drop the override if it is dead.
  2. sameFailure compares only the exception class. A Jackson change that alters the message, location or cause of the root-type, empty-input, duplicate-key, trailing-token or unknown-type-id errors would still pass. Comparing getOriginalMessage() would pin the error shape the PR says it protects.
  3. Test class names in CONTRIBUTING.md will rot. The command lists Issue1363Test,Issue1357Test,Issue1350Test,Issue1350ReviewTest,Issue1362Test. If one is renamed or removed, mvn -Dtest=... runs fewer tests (or fails) and an upgrade could be qualified without the deserializer checks. A JUnit @Tag with -Dgroups=... would keep the instruction stable.
  4. Root CONTRIBUTING.md. A root file is surfaced by GitHub as the project's contributing guide, but this one covers only the Jackson upgrade checks. Placing it under doc/ (the README link can point there) or adding the general workflow would avoid sending contributors to a maintenance page.

🤖 Generated with Claude Code

@stevehu
stevehu merged commit 9696c27 into 2.x Oct 24, 2026
5 checks passed
@stevehu
stevehu deleted the fix/1363-tree-deserializer-contract-2.x branch October 24, 2026 00:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant