Recipe ReplaceLocalizedStreamMethods#532
Merged
cjobinabo merged 11 commits intoopenrewrite:mainfrom Aug 20, 2024
Merged
Conversation
timtebeek
reviewed
Aug 14, 2024
timtebeek
reviewed
Aug 14, 2024
timtebeek
reviewed
Aug 14, 2024
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
timtebeek
approved these changes
Aug 14, 2024
Member
timtebeek
left a comment
There was a problem hiding this comment.
Thanks @BhavanaPidapa ! I've done a few quick polish commits but with that we're good from my side. @cjobinabo can do the final review & merge.
timtebeek
reviewed
Aug 15, 2024
timtebeek
reviewed
Aug 15, 2024
cjobinabo
reviewed
Aug 15, 2024
|
|
||
| @Override | ||
| public String getDescription() { | ||
| return "Replace `Runtime.getLocalizedInputStream(InputStream)` and `Runtime.getLocalizedOutputStream(with the argument)` with their direct arguments."; |
Contributor
There was a problem hiding this comment.
In the description, I think it would be helpful to add some info about why this change is made. That the earlier implementation of these methods simply returned the input parameter.
Contributor
Author
There was a problem hiding this comment.
Updated the description as mentioned.
cjobinabo
approved these changes
Aug 20, 2024
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.
What's changed?
This PR contains recipe - org.openrewrite.java.migrate.ReplaceLocalizedStreamMethods

Rule:
What's your motivation?
This custom recipe replaces the occurrences of Runtime.getLocalizedInputStream and Runtime.getLocalizedOutputStream methods. The occurrence of getLocalizedInputStream(in) is replaced with in parameter and getLocalizedOutputStream(out) is replaced with out parameter.
Anyone you would like to review specifically?
@timtebeek @cjobinabo
Have you considered any alternatives or workarounds?
I created sample files, created a local plugin using
./gradlew publishToMavenLocal then ran it in the Java8 Sample App using mvn rewrite:dryRun
Attaching the rewrite.patch file
rewrite.patch
Checklist