Tencent / TubeMQ

TubeMQ has been donated to the Apache Software Foundation and renamed to InLong, please visit the new Apache repository: https://github.com/apache/incubator-inlong
https://inlong.apache.org/
2.02k stars 391 forks source link

Align string connection processing method #86

Closed gosonzhang closed 4 years ago

gosonzhang commented 4 years ago

Handling partially inconsistent string concatenation processing codes: Most of the string concatenation processing in TubeMQ uses the StringBuilder.append() method to concatenate strings, avoiding the use of the "+" operator, but some code uses both StringBuilder.append() Use the "+" operator,for example in BaseMessageConsumer.java :

                    if (!consumeSubInfo.isSubscribedTopicContain(partitionKeyItems[1].trim())) {
                        throw new TubeClientException(new StringBuilder(256)
                                .append("Parameter error: not included in subcribed topic list: "
                                        + "partOffsetMap's key is ")
                                .append(entry.getKey()).append(", subscribed topics are ")
                                .append(consumeSubInfo.getSubscribedTopics().toString()).toString());
                    }