-
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
Including StringFormatted as part of UpgradeToJava17 seems too opinionated #616
Comments
Hi @jpraet ; I wouldn't say it's impossible; quite the opposite: we've made it easy to tailor the recipes to your needs with the builder, and then share your recipe internally using our rewrite-recipe-starter. That's a well established pattern that we think works well. I do understand that it can take some getting used to with the |
I should have said basically impossible without duplicating the recipe collection and removing the ones I don't want. An example of what throws me off in the More generally to me this feels out of scope of a general purpose "Upgrade to JDK17" recipe, as it is a stylistic change with no other driving force behind it like deprecation or a clear guideline. rewrite-migrate-java/src/main/resources/META-INF/rewrite/java-version-17.yml Lines 20 to 25 in 05b8264
Anyway, I guess it's a matter of preference. I just wanted to open this discussion. |
Thanks for that context @jpraet ; I think this PR strikes the right balance then: |
And know that you feedback is appreciated; we won't always agree on preferences, but where possible we do try to strike that right balance. We've gone through similar changes before with the introduction of text blocks, and I've copied that approach here. More generally: from time to time we get requests to minimize the changes made by recipes. Some folks would similarly only want to be runtime compatible with Java 21 for instance, and forego the SequencedCollection recipes that introduce Your case above was convincing enough to make changes; if you have any more feel free to raise those here, or in a draft unit test to explain what you're after. |
Should StringFormatted really be part of org.openrewrite.java.migrate.UpgradeToJava17?
It feels a bit too opinionated to me. String.format() isn't deprecated, and replacing it by "".formatted() doesn't always lead to more readable code.
Given that it's basically impossible to exclude a single recipe, maybe it could be removed from UpgradeToJava17?
The text was updated successfully, but these errors were encountered: