[MNG-6829] Replace StringUtils#isEmpty(String) & #isNotEmpty(String)#3
Merged
Conversation
Last batch of is(Not)Empty for https://issues.apache.org/jira/browse/MNG-6829 These are the smallest change sets, hence why I opened more at the same time. After this we can target the next most often used method from the StringUtils classes. Use this link to re-run the recipe: https://public.moderne.io/recipes/org.openrewrite.java.migrate.apache.commons.lang.IsNotEmptyToJdk?organizationId=QXBhY2hlIE1hdmVu Co-authored-by: Moderne <team@moderne.io>
elharo
reviewed
May 23, 2023
|
|
||
| String providerClass = request.getProviderClass(); | ||
| if ( !StringUtils.isEmpty( providerClass ) ) | ||
| if ( !(providerClass == null || providerClass.isEmpty()) ) |
There was a problem hiding this comment.
I guess the recipe doesn't pick up the ! in StringUtils.isEmpty( providerClass )? This isn't the same replacement as StringUtils.isNotEmpty.
Contributor
Author
There was a problem hiding this comment.
No it's a bit unfortunate; would have required a separate recipe (or targeted manual change) to first replace the !StringUtils.isEmpty with StringUtils.isNotEmpty. But then since we are phasing these out we decided against it on an earlier pull request.
In this specific case we can fix these manually here if you'd like, as I imagine checkstyle will have its complaints as well.
elharo
approved these changes
May 23, 2023
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.
Use this link to re-run the recipe: https://public.moderne.io/recipes/org.openrewrite.java.migrate.apache.commons.lang.IsNotEmptyToJdk?organizationId=QXBhY2hlIE1hdmVu