You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by ji...@apache.org on 2020/06/15 04:35:34 UTC

[rocketmq] branch develop updated: [ISSUE #2082] Use StringBuilder instead of StringBuffer. (#2087)

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

jinrongtong pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git


The following commit(s) were added to refs/heads/develop by this push:
     new 2fa51fc  [ISSUE #2082] Use StringBuilder instead of StringBuffer. (#2087)
2fa51fc is described below

commit 2fa51fc1bd3be4d31156f40854eaddcf2b790a6f
Author: RosaDreaming <94...@qq.com>
AuthorDate: Mon Jun 15 12:35:21 2020 +0800

    [ISSUE #2082] Use StringBuilder instead of StringBuffer. (#2087)
    
    * stringbuilder replace
    
    Co-authored-by: qunlin.yi <qu...@beibei.com>
---
 .../apache/rocketmq/common/protocol/NamespaceUtil.java   | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/common/src/main/java/org/apache/rocketmq/common/protocol/NamespaceUtil.java b/common/src/main/java/org/apache/rocketmq/common/protocol/NamespaceUtil.java
index 4827844..704eb90 100644
--- a/common/src/main/java/org/apache/rocketmq/common/protocol/NamespaceUtil.java
+++ b/common/src/main/java/org/apache/rocketmq/common/protocol/NamespaceUtil.java
@@ -39,19 +39,19 @@ public class NamespaceUtil {
             return resourceWithNamespace;
         }
 
-        StringBuffer strBuffer = new StringBuffer();
+        StringBuilder stringBuilder = new StringBuilder();
         if (isRetryTopic(resourceWithNamespace)) {
-            strBuffer.append(MixAll.RETRY_GROUP_TOPIC_PREFIX);
+            stringBuilder.append(MixAll.RETRY_GROUP_TOPIC_PREFIX);
         }
         if (isDLQTopic(resourceWithNamespace)) {
-            strBuffer.append(MixAll.DLQ_GROUP_TOPIC_PREFIX);
+            stringBuilder.append(MixAll.DLQ_GROUP_TOPIC_PREFIX);
         }
 
         String resourceWithoutRetryAndDLQ = withOutRetryAndDLQ(resourceWithNamespace);
         int index = resourceWithoutRetryAndDLQ.indexOf(NAMESPACE_SEPARATOR);
         if (index > 0) {
             String resourceWithoutNamespace = resourceWithoutRetryAndDLQ.substring(index + 1);
-            return strBuffer.append(resourceWithoutNamespace).toString();
+            return stringBuilder.append(resourceWithoutNamespace).toString();
         }
 
         return resourceWithNamespace;
@@ -91,17 +91,17 @@ public class NamespaceUtil {
         }
 
         String resourceWithoutRetryAndDLQ = withOutRetryAndDLQ(resourceWithOutNamespace);
-        StringBuffer strBuffer = new StringBuffer();
+        StringBuilder stringBuilder = new StringBuilder();
 
         if (isRetryTopic(resourceWithOutNamespace)) {
-            strBuffer.append(MixAll.RETRY_GROUP_TOPIC_PREFIX);
+            stringBuilder.append(MixAll.RETRY_GROUP_TOPIC_PREFIX);
         }
 
         if (isDLQTopic(resourceWithOutNamespace)) {
-            strBuffer.append(MixAll.DLQ_GROUP_TOPIC_PREFIX);
+            stringBuilder.append(MixAll.DLQ_GROUP_TOPIC_PREFIX);
         }
 
-        return strBuffer.append(namespace).append(NAMESPACE_SEPARATOR).append(resourceWithoutRetryAndDLQ).toString();
+        return stringBuilder.append(namespace).append(NAMESPACE_SEPARATOR).append(resourceWithoutRetryAndDLQ).toString();
 
     }