commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r345907 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java
Date Mon, 21 Nov 2005 14:10:11 GMT
Author: bayard
Date: Mon Nov 21 06:10:08 2005
New Revision: 345907

URL: http://svn.apache.org/viewcvs?rev=345907&view=rev
Log:
implemented isNotXxx methods as !isXxx calls to simplify and ensure symmetry

Modified:
    jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java

Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java?rev=345907&r1=345906&r2=345907&view=diff
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java (original)
+++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringUtils.java Mon
Nov 21 06:10:08 2005
@@ -212,7 +212,7 @@
      * @return <code>true</code> if the String is not empty and not null
      */
     public static boolean isNotEmpty(String str) {
-        return str != null && str.length() > 0;
+        return !StringUtils.isEmpty(str);
     }
 
     /**
@@ -260,16 +260,7 @@
      * @since 2.0
      */
     public static boolean isNotBlank(String str) {
-        int strLen;
-        if (str == null || (strLen = str.length()) == 0) {
-            return false;
-        }
-        for (int i = 0; i < strLen; i++) {
-            if ((Character.isWhitespace(str.charAt(i)) == false)) {
-                return true;
-            }
-        }
-        return false;
+        return !StringUtils.isBlank(str);
     }
 
     // Trim



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message