Skip to content

Allow AddMethodParameter to match overridden methods - #6294

Merged
timtebeek merged 5 commits into
openrewrite:mainfrom
Anmol202005:addParam
Dec 24, 2025
Merged

Allow AddMethodParameter to match overridden methods#6294
timtebeek merged 5 commits into
openrewrite:mainfrom
Anmol202005:addParam

Conversation

@Anmol202005

@Anmol202005 Anmol202005 commented Nov 14, 2025

Copy link
Copy Markdown
Contributor

Improves AddMethodParameter so that methodPattern resolution includes overridden methods from interfaces and superclasses.

Checklist

  • I've added unit tests to cover both positive and negative cases
  • I've read and applied the recipe conventions and best practices
  • I've used the IntelliJ IDEA auto-formatter on affected files

@Anmol202005

Copy link
Copy Markdown
Contributor Author

@timtebeek kindly review :)

@timtebeek
timtebeek self-requested a review November 14, 2025 18:50
@timtebeek timtebeek added the enhancement New feature or request label Nov 14, 2025
@timtebeek

Copy link
Copy Markdown
Member

Thanks for the runnable example! I'm off here today, but will try to circle back next week.

I had thought we could clear this up with just changing the expected method pattern instead.

@Anmol202005

Copy link
Copy Markdown
Contributor Author

ping @timtebeek

@timtebeek

Copy link
Copy Markdown
Member

Will likely move into next week before I can get to this; I've got some online trainings to give and a weekend ahead first. 🙏🏻

@timtebeek timtebeek moved this from In Progress to Ready to Review in OpenRewrite Nov 19, 2025

@timtebeek timtebeek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the help here @Anmol202005 ! Found a way to achieve the same without changes to MethodMatcher, to minimize added API surface and potential impact. With that I think we're ok to merge this change.

Appreciate your patience as well; it's not been easy to get to everything, but hope you enjoy some end of year time off there!

@timtebeek timtebeek changed the title Issue #6287: enable AddMethodParameter to match overridden methods Allow AddMethodParameter to match overridden methods Dec 24, 2025
@timtebeek
timtebeek merged commit e4b72b6 into openrewrite:main Dec 24, 2025
2 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to Review to Done in OpenRewrite Dec 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Allow AddMethodParameter to operate on overridden methods

2 participants