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:13:07 UTC

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

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


##########
common/src/main/java/org/apache/rocketmq/common/UtilAll.java:
##########
@@ -462,16 +463,7 @@ public static String frontStringAtLeast(final String str, final int size) {
     }
 
     public static boolean isBlank(String str) {

Review Comment:
   How to delete this method and replace all with StringUtils.isBlank?



##########
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:
   How to delete this method and replace all with StringUtils.isBlank?



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