You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/12/15 08:16:53 UTC

[GitHub] [rocketmq] xiaoyifang commented on a diff in pull request #5700: [ISSUE #5699] remove duplicate code definition of UtilAll.isBlank

xiaoyifang commented on code in PR #5700:
URL: https://github.com/apache/rocketmq/pull/5700#discussion_r1049332071


##########
remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RocketMQSerializable.java:
##########
@@ -243,15 +245,6 @@ public static HashMap<String, String> mapDeserialize(ByteBuf byteBuffer, int len
     }
 
     public static boolean isBlank(String str) {
-        int strLen;
-        if (str == null || (strLen = str.length()) == 0) {
-            return true;
-        }
-        for (int i = 0; i < strLen; i++) {
-            if (!Character.isWhitespace(str.charAt(i))) {
-                return false;
-            }
-        }
-        return true;
+        return StringUtils.isBlank(str);

Review Comment:
   ![image](https://user-images.githubusercontent.com/105986/207807717-e1ced284-fbf5-48cb-b0a3-a26b7025c62e.png)
   
   I think this can be done ,this very method is only used in test



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org