-
Notifications
You must be signed in to change notification settings - Fork 22
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
[MSHARED-1172] Deprecate redundant isEmptyString method #123
Conversation
deprecate a string utility method that doesn't belong in this package and is duplicated in 72 other places @slawekjaranowski
src/main/java/org/apache/maven/shared/utils/xml/Xpp3DomUtils.java
Outdated
Show resolved
Hide resolved
PTAl @michael-o |
@@ -148,15 +148,15 @@ private static boolean isMergeChildren( Xpp3Dom dominant ) | |||
} | |||
|
|||
/** | |||
* @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+) |
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.
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?
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.
This is fine as well
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.
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.
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