-
Notifications
You must be signed in to change notification settings - Fork 109
Add recipe to migrate System.out.print/println to IO.print/println
#848
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
Conversation
…o IO.print/println
|
While preparing the PR, I realized we might also want to handle I can look into it and we could add it in a follow-up PR |
|
Great to see thanks! I think we can support that without extra effort if we switch to using MethodMatcher :) |
src/main/java/org/openrewrite/java/migrate/io/ReplaceSystemOutWithIOPrint.java
Outdated
Show resolved
Hide resolved
src/main/java/org/openrewrite/java/migrate/io/ReplaceSystemOutWithIOPrint.java
Outdated
Show resolved
Hide resolved
src/test/java/org/openrewrite/java/migrate/io/ReplaceSystemOutWithIOPrintTest.java
Show resolved
Hide resolved
src/test/java/org/openrewrite/java/migrate/io/ReplaceSystemOutWithIOPrintTest.java
Show resolved
Hide resolved
|
Good point, thanks @timtebeek , I'll update the code. |
|
@timtebeek - I just realized though, that Did I miss anything, or do you see a cleaner way to restrict it just to |
System.out.print/println to IO.print/println
timtebeek
left a comment
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 a lot for the help here @e5LA ! I've added a few small changes, mostly to reduce duplication, support edge cases, improve performance and remove unused imports past migration. It's also now included in the Java 25 migration going forward. 🎉
|
Thanks for the improvements @timtebeek ! Always great to see yours solutions. |
What's changed?
Added recipe to migrate
System.out.print()andSystem.out.println()toIO.print()andIO.println()What's your motivation?
Closes #846.
Checklist