-
Notifications
You must be signed in to change notification settings - Fork 77
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
AddTimeUnitArgument recipe #403
Conversation
src/main/java/org/openrewrite/java/apache/httpclient5/AddTimeUnitArgument.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/apache/httpclient5/AddTimeUnitArgument.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/apache/httpclient5/AddTimeUnitArgument.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/apache/httpclient5/AddTimeUnitArgument.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/apache/httpclient5/AddTimeUnitArgument.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/apache/httpclient5/AddTimeUnitArgument.java
Outdated
Show resolved
Hide resolved
src/test/java/org/openrewrite/java/apache/httpclient5/AddTimeUnitArgumentTest.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/apache/httpclient5/AddTimeUnitArgument.java
Show resolved
Hide resolved
Co-authored-by: Raquel Pau <1483433+rpau@users.noreply.github.com>
Co-authored-by: Raquel Pau <1483433+rpau@users.noreply.github.com>
…nitArgument.java Co-authored-by: Raquel Pau <1483433+rpau@users.noreply.github.com>
…nitArgument.java Co-authored-by: Raquel Pau <1483433+rpau@users.noreply.github.com>
…nitArgument.java Co-authored-by: Raquel Pau <1483433+rpau@users.noreply.github.com>
…nitArgument.java Co-authored-by: Raquel Pau <1483433+rpau@users.noreply.github.com>
…nitArgument.java Co-authored-by: Raquel Pau <1483433+rpau@users.noreply.github.com>
updateCursor(m), | ||
m.getCoordinates().replaceArguments(), |
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.
I'm wondering what happens to the method type when we don't replace the method, but only add an argument; wouldn't the method type post-recipe still refer to the original (usually single argument) method instead of the new multiple argument method? I'd always thought that replaceArguments
was only when you replace with the same number and type or arguments; not when you switch to a different method.
If the method type is updated correctly there's no need for a change, otherwise it might be best to replace the whole method rather than just the arguments.
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.
yes, the method type is updated correctly
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.
Already approved, but do look at my last question regarding replace arguments versus replace method and the resulting method type.
What's changed?
Added a new recipe AddTimeUnitArgument to solve the timeout and timevalue migrations. This way is more maintainable since it only requires changes in the declarative yml recipe instead of changing the recipe themselves.
Checklist
./gradlew licenseFormat