[MSHARED-1172] Deprecate redundant isEmptyString method#123
Merged
Conversation
deprecate a string utility method that doesn't belong in this package and is duplicated in 72 other places @slawekjaranowski
michael-o
requested changes
Dec 3, 2022
src/main/java/org/apache/maven/shared/utils/xml/Xpp3DomUtils.java
Outdated
Show resolved
Hide resolved
Contributor
Author
|
PTAl @michael-o |
kwin
reviewed
Jan 1, 2023
| /** | ||
| * @param str The string to be checked. | ||
| * @return <code>true</code> in case string is empty <code>false</code> otherwise. | ||
| * @deprecated use <code>str == null || String.isBlank(str)</code> (Java 11+) |
Member
There was a problem hiding this comment.
Why not recommending https://github.com/apache/maven-shared-utils/blob/f4383c55f77ad4480f146481bf3192bc52c3af30/src/main/java/org/apache/maven/shared/utils/StringUtils.java#L145 as replacement? Or should we rather deprecate that method as well?
Contributor
Author
There was a problem hiding this comment.
IMHO
JDK > org,apache.commons > Guava > maven-shared-utils > plexus-utils > random classes where it doesn't belong
Realistically, this method is reinvented so often and so frequently, we'll never get down to a single version. However this case is particularly egregious.
michael-o
approved these changes
Jan 1, 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.
deprecate a string utility method that doesn't belong in this package, wasn't correctly documented, isn't tested, and is duplicated in 72 other places
@slawekjaranowski