You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2020/01/17 15:16:29 UTC

[GitHub] [skywalking] kezhenxu94 commented on a change in pull request #4264: Refactor SnifferConfigInitializer and related componets with new features in JDK8+

kezhenxu94 commented on a change in pull request #4264: Refactor SnifferConfigInitializer and related componets with new features in JDK8+
URL: https://github.com/apache/skywalking/pull/4264#discussion_r367982469
 
 

 ##########
 File path: apm-commons/apm-util/src/main/java/org/apache/skywalking/apm/util/StringUtil.java
 ##########
 @@ -27,6 +27,24 @@ public static boolean isNotEmpty(String str) {
         return !isEmpty(str);
     }
 
+    public static boolean isBlank(CharSequence str) {
+        if (str == null) {
+            return true;
+        }
+
+        for (int i = 0; i < str.length(); i++) {
+            if (!Character.isWhitespace(str.charAt(i))) {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    public static boolean isNotBlank(CharSequence str) {
+        return !isBlank(str);
+    }
+
 
 Review comment:
   If we don't have to manipulate `CharSequence`, just reuse `org.apache.skywalking.apm.util.StringUtil#isNotEmpty`, only add codes when you really need it

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services