Skip to content

Consolidate null-provider bookkeeping and drop redundant deserialize() overrides in SettableAnyProperty - #2

Draft
java-dependency-upgrade-fixer[bot] wants to merge 1 commit into
mirror/upstream-pr-6171from
jaipilot/pr-1-X9eQTgVJwyL7
Draft

java-dependency-upgrade-fixer[bot] wants to merge 1 commit into
mirror/upstream-pr-6171from
jaipilot/pr-1-X9eQTgVJwyL7

Conversation

@java-dependency-upgrade-fixer

Copy link
Copy Markdown

Summary

Bounded cleanup pass over the single production file already changed by the mirrored PR (Apply default null handling to @JsonAnySetter), scoped strictly inside SettableAnyProperty.java.

Changes

  1. Consolidate: The ternary (_valueDeserializer == _nullProvider) ? deser : _nullProvider (deciding whether to keep tracking the value deserializer as the null provider, or preserve an explicitly-configured null provider) was duplicated identically across MethodAnyProperty, MapFieldAnyProperty, JsonNodeFieldAnyProperty, and MapParameterAnyProperty's withValueDeserializer() overrides. Extracted into one protected helper _nullProviderFor(ValueDeserializer<Object>) on the base class.
  2. Delete redundant overrides: JsonNodeFieldAnyProperty.deserialize() and JsonNodeParameterAnyProperty.deserialize() duplicated the base class's deserialize() logic. Both subclasses always construct with a null TypeDeserializer, so once the PR added the null-provider check to the base method, the base method's behavior for these subclasses is provably identical to the override body (confirmed via bytecode inspection that JsonParser.hasToken(t) is exactly currentToken() == t). Removed the now-dead-weight overrides.

Behavior preservation

  • Net change is -15 lines in one file; no API, null-handling, ordering, or error-message change.
  • Same focused behavior command (72 tests spanning the PR's own new tests plus pre-existing any-setter/buffer/object-id tests that exercise SettableAnyProperty/PropertyValueBuffer) passes identically before and after.
  • Full ./mvnw clean verify passes: 6188 tests, 0 failures, 0 errors, 1 pre-existing unrelated skip.

Limitations

  • No performance claim is made; this is a structural/duplication cleanup, not a measured optimization.
  • No build/dependency/JDK modernization was in scope since the original PR touched no build or version files.
  • This mirror does not merge; per the mirror's own description, any validated companion improvement would be offered to the original contributor branch first.

Generated by JAIPilot Cloud for #1 from Anthropic session sesn_01TQjNkpqQAVX9eQTgVJwyL7.

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.

0 participants