-
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
Use StringBuilder#isEmpty() instead of comparing size() #336
Comments
Hello @koppor, can I pick this up? And if the answer is yes, can you add a bit more description regarding this? |
Hi @jeexan2 ! Sure; if you open up a draft pull request containing just the tests of what you want to cover, I'll then assign the issue to you. You can start with a test class similar to the one we have already for collections, but then adapted to fit StringBuilder. |
Implementation-wise the |
Actually; come to think of it we already have such recipes in https://github.com/openrewrite/rewrite-migrate-java/blob/v2.1.1/src/main/java/org/openrewrite/java/migrate/lang/UseStringIsEmpty.java , but we need to broaden their matchers to use |
The work still to do for this recipe then becomes:
Thanks a lot for the suggestion & offer to help! |
@jeexan2 (or anyone else looking to pick this up) I've added some clickable links to the above comment; hope that helps! |
@timtebeek I am a new contributer. Shall I pick this ? |
That would be appreciated, yes please! Feel free to start with a draft pull request containing just a test, and then I'll assign the issue to you. |
@timtebeek sure. |
If I understand the test correctly, it assures that nothing happens if My request was a) for |
Our friends over at Picnic & ErrorProne Support already have a separate artifact to compile Java 17 templates to Java 8 runtime; they also have a matching recipe that with some changes there could solve this issue, once we pull it in through rewrite-third-party. |
Similar to https://docs.openrewrite.org/recipes/staticanalysis/isemptycalloncollections:
Example: https://github.com/JabRef/jabref/pull/10489/files#diff-7a00bcdda16c9953e17ec2db403404b78ad1a750671c76bd7ec885fdf8ffa776
The text was updated successfully, but these errors were encountered: