Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Also change Guava Predicate method name #473

Merged
merged 2 commits into from
May 6, 2024

Conversation

timtebeek
Copy link
Contributor

What's changed?

Added an additional ChangeMethodName and unit test to PreferJavaUtilPredicate.

What's your motivation?

Fixes #435

Anything in particular you'd like reviewers to focus on?

ChangeMethodName for now ignores the NewClass, instead looking for ClassDeclaration when trying to match the method pattern supplied, which therefor mismatches and fails to do the required replacement. This should probably be fixed upstream in rewrite-java.

Have you considered any alternatives or workarounds?

We could add a dedicated recipe here for that replacement, but then any similar such change would need the same. It'd be easier if ChangeMethodName supported this out of the box, especially when using matchOverrides.

Any additional context

@timtebeek timtebeek self-assigned this May 6, 2024
@timtebeek timtebeek added the bug Something isn't working label May 6, 2024
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@timtebeek
Copy link
Contributor Author

@timtebeek timtebeek marked this pull request as ready for review May 6, 2024 16:34
@timtebeek timtebeek merged commit 3897b37 into main May 6, 2024
2 checks passed
@timtebeek timtebeek deleted the change-guava-predicate-method-name branch May 6, 2024 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

PreferJavaUtilPredicate does not change functional method {apply -> test}
1 participant