-
Notifications
You must be signed in to change notification settings - Fork 76
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
UseNewRequestMatchers should also replace with 5.7 on classpath #398
UseNewRequestMatchers should also replace with 5.7 on classpath #398
Conversation
Verified locally with |
...tWithSpringSecurity_5_8/java/org/openrewrite/spring/security5/UseNewRequestMatchersTest.java
Outdated
Show resolved
Hide resolved
return methods.stream() | ||
.filter(m -> m.getName().equals("requestMatchers")) | ||
.filter(m -> m.getParameterTypes().equals(parameterTypes)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lookup failed, as at recipe runtime only the 5.7 class is available, meaning no replacement method was found. The recipes tests hid that fact, by using classpathResources of 5.8+.
src/main/java/org/openrewrite/java/spring/security5/UseNewRequestMatchers.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/spring/security5/UseNewRequestMatchers.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking a look at this
What's changed?
Adopt JavaTemplate to replace methods.
What's your motivation?
Replacements failed as we looked for a replacement method in the target type, but only 5.7 classes were available, leading to a mismatch and thus no replacement. Fixes #350
Anything in particular you'd like reviewers to focus on?
Called out below.