You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by el...@apache.org on 2023/01/01 20:03:27 UTC

[maven-shared-utils] branch master updated: [MSHARED-1172] Deprecate redundant isEmptyString method (#123)

This is an automated email from the ASF dual-hosted git repository.

elharo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-shared-utils.git


The following commit(s) were added to refs/heads/master by this push:
     new c002482  [MSHARED-1172] Deprecate redundant isEmptyString method (#123)
c002482 is described below

commit c0024829b40f20d758c28192f07b9c3fd04223ba
Author: Elliotte Rusty Harold <el...@users.noreply.github.com>
AuthorDate: Sun Jan 1 20:03:22 2023 +0000

    [MSHARED-1172] Deprecate redundant isEmptyString method (#123)
    
    deprecate a string utility method that doesn't belong in this package and is duplicated in 72 other places
---
 .../java/org/apache/maven/shared/utils/xml/Xpp3DomUtils.java   | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/apache/maven/shared/utils/xml/Xpp3DomUtils.java b/src/main/java/org/apache/maven/shared/utils/xml/Xpp3DomUtils.java
index 1b10dc8..985c559 100644
--- a/src/main/java/org/apache/maven/shared/utils/xml/Xpp3DomUtils.java
+++ b/src/main/java/org/apache/maven/shared/utils/xml/Xpp3DomUtils.java
@@ -148,15 +148,15 @@ public class Xpp3DomUtils
     }
 
     /**
-     * @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+) 
+     *             or <code>org.apache.commons.lang3.StringUtils.isBlank(str)</code>
+     * @param str the string to be checked
+     * @return <code>true</code> if the string is null, empty, or whitespace only; <code>false</code> otherwise
      */
+    @Deprecated
     public static boolean isEmpty( String str )
     {
         return str == null || str.trim().length() == 0;
     }
 
-
-
-
 }