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

iluo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git


The following commit(s) were added to refs/heads/master by this push:
     new a8785e9  fix StringUtils#isBlank (#4725)
a8785e9 is described below

commit a8785e95a04776755fbb0744a8f822fda42cbafd
Author: hengyunabc <hengyun...@gmail.com>
AuthorDate: Sat Aug 3 14:00:49 2019 +0800

    fix StringUtils#isBlank (#4725)
---
 .../java/org/apache/dubbo/common/utils/StringUtils.java     | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git 
a/dubbo-common/src/main/java/org/apache/dubbo/common/utils/StringUtils.java 
b/dubbo-common/src/main/java/org/apache/dubbo/common/utils/StringUtils.java
index b51c1bc..a8d22ad 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/utils/StringUtils.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/utils/StringUtils.java
@@ -347,8 +347,17 @@ public final class StringUtils {
         return buf.toString();
     }
 
-    public static boolean isBlank(String str) {
-        return isEmpty(str);
+    public static boolean isBlank(CharSequence cs) {
+        int strLen;
+        if (cs == null || (strLen = cs.length()) == 0) {
+            return true;
+        }
+        for (int i = 0; i < strLen; i++) {
+            if (!Character.isWhitespace(cs.charAt(i))) {
+                return false;
+            }
+        }
+        return true;
     }
 
     /**

Reply via email to