提交 7a359956 编写于 作者: R RosaDreaming 提交者: RongtongJin

[ISSUE #2082] Use StringBuilder instead of StringBuffer. (#2087)

* stringbuilder replace
Co-authored-by: Nqunlin.yi <qunlin.yi@beibei.com>
上级 2c49e6b1
......@@ -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();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册