Fix Jackson 2.21+ conflicting creators in AWT recipes#1007
Merged
Conversation
Remove `@AllArgsConstructor` from `ReplaceAWTGetPeerMethod` and `ReplaceComSunAWTUtilitiesMethods` and replace the no-arg `@JsonCreator` constructor with an all-args `@JsonCreator` constructor accepting `@Nullable` parameters with defaults. This eliminates the conflicting property-based creators caused by Lombok's `@ConstructorProperties` annotation on the generated all-args constructor. Closes #1003
timtebeek
added a commit
that referenced
this pull request
Mar 16, 2026
Remove @requiredargsconstructor which generates @ConstructorProperties on the all-args constructor, conflicting with the no-arg @JsonCreator. Change @JsonCreator to accept nullable parameters with defaults, matching the pattern from #1007. This resolves the InvalidDefinitionException: Conflicting property-based creators reported in issue #1003.
timtebeek
added a commit
that referenced
this pull request
Mar 16, 2026
Remove @requiredargsconstructor which generates @ConstructorProperties on the all-args constructor, conflicting with the no-arg @JsonCreator. Change @JsonCreator to accept nullable parameters with defaults, matching the pattern from #1007. This resolves the InvalidDefinitionException: Conflicting property-based creators reported in issue #1003.
mergify bot
added a commit
to robfrank/linklift
that referenced
this pull request
Mar 19, 2026
…29.0 to 3.30.1 [skip ci] Bumps [org.openrewrite.recipe:rewrite-migrate-java](https://github.com/openrewrite/rewrite-migrate-java) from 3.29.0 to 3.30.1. Release notes *Sourced from [org.openrewrite.recipe:rewrite-migrate-java's releases](https://github.com/openrewrite/rewrite-migrate-java/releases).* > v3.30.1 > ------- > > What's Changed > -------------- > > * Fix Jackson 2.21+ compatibility for JREThrowableFinalMethods by [`@timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1010](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1010) > * Fix UpgradeToJava21 recipe ordering for switch expressions by [`@timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1012](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1012) > * Fix IfElseIfConstructToSwitch null safety regression by [`@timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1014](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1014) > * Fix Jetty EE9 dependencies by [`@evie-lau`](https://github.com/evie-lau) in [openrewrite/rewrite-migrate-java#1016](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1016) > * Cleanup Jetty EE10 recipes. Reorder… by [`@evie-lau`](https://github.com/evie-lau) in [openrewrite/rewrite-migrate-java#1017](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1017) > > **Full Changelog**: <openrewrite/rewrite-migrate-java@v3.30.0...v3.30.1> > > 3.30.0 > ------ > > What's Changed > -------------- > > * DataNucleus migrations by [`@jkschneider`](https://github.com/jkschneider) in [openrewrite/rewrite-migrate-java#998](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/998) > * Enable Lombok annotation processor during Java 17 upgrades by [`@timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#999](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/999) > * Use Groovy 4 by [`@greg-at-moderne`](https://github.com/greg-at-moderne) in [openrewrite/rewrite-migrate-java#1001](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1001) > * Avoid 9.1 Gradle version, should be 9.1.0 by [`@greg-at-moderne`](https://github.com/greg-at-moderne) in [openrewrite/rewrite-migrate-java#1002](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1002) > * Also upgrade maven-surefire-report-plugin to 3.5.x by [`@timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1006](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1006) > * Fix `IfElseIfConstructToSwitch` dropping pattern variables for unresolvable types by [`@timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1005](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1005) > * Fix Jackson 2.21+ conflicting creators in AWT recipes by [`@timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1007](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1007) > > **Full Changelog**: <openrewrite/rewrite-migrate-java@v3.29.0...v3.30.0> Commits * [`b9375e4`](openrewrite/rewrite-migrate-java@b9375e4) Fix Jetty EE10 duplicate oldArtifactId on ChangeDependencies. Reorder and bri... * [`fd968d3`](openrewrite/rewrite-migrate-java@fd968d3) Fix Jetty EE9 dependencies ([#1016](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/1016)) * [`062873e`](openrewrite/rewrite-migrate-java@062873e) Fix IfElseIfConstructToSwitch null safety regression ([#1014](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/1014)) * [`7948b9a`](openrewrite/rewrite-migrate-java@7948b9a) Fix UpgradeToJava21 recipe ordering for switch expressions ([#1012](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/1012)) * [`c421ab1`](openrewrite/rewrite-migrate-java@c421ab1) Fix Jackson 2.21+ compatibility for JREThrowableFinalMethods ([#1010](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/1010)) * [`9826a90`](openrewrite/rewrite-migrate-java@9826a90) [Auto] SDKMAN! Java candidates as of 2026-03-16T1049 * [`5ff7443`](openrewrite/rewrite-migrate-java@5ff7443) Lombok Best Practices * [`6044cbb`](openrewrite/rewrite-migrate-java@6044cbb) OpenRewrite recipe best practices * [`114a5a2`](openrewrite/rewrite-migrate-java@114a5a2) Fix Jackson 2.21+ compatibility for AWT migration recipes ([#1007](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/1007)) * [`7661bb1`](openrewrite/rewrite-migrate-java@7661bb1) Fix `IfElseIfConstructToSwitch` dropping pattern variables for unresolvable t... * Additional commits viewable in [compare view](openrewrite/rewrite-migrate-java@v3.29.0...v3.30.1) [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Remove
@AllArgsConstructorfromReplaceAWTGetPeerMethodandReplaceComSunAWTUtilitiesMethodsReplace the no-arg
@JsonCreatorconstructor with an all-args@JsonCreatorconstructor accepting@Nullableparameters with defaultsThis eliminates the
InvalidDefinitionExceptioncaused by Lombok's@ConstructorPropertieson the generated all-args constructor conflicting with the explicit@JsonCreatorno-arg constructor (exposed by jackson-databind#5045 in Jackson 2.21+)Follows the same pattern already used by
ReplaceLocalizedStreamMethodsCloses Jackson 2.21+ compatibility: InvalidDefinitionException due to conflicting creators in ReplaceAWTGetPeerMethod and ReplaceComSunAWTUtilitiesMethods #1003
Test plan
ReplaceAWTGetPeerMethodTestpassReplaceComSunAWTUtilitiesMethodsTestpass