[ISSUE #4040] Unnecessary toString methods deleted (#4041)

This commit is contained in:
hjl11
2022-03-28 10:15:43 +08:00
committed by GitHub
parent 02228d870c
commit c121565c3e
7 changed files with 9 additions and 9 deletions
@@ -221,7 +221,7 @@ public abstract class AbstractSendMessageProcessor extends AsyncNettyRequestProc
if (queueIdInt >= idValid) {
String errorInfo = String.format("request queueId[%d] is illegal, %s Producer: %s",
queueIdInt,
topicConfig.toString(),
topicConfig,
RemotingHelper.parseChannelRemoteAddr(ctx.channel()));
log.warn(errorInfo);
@@ -314,7 +314,7 @@ public class ConsumeMessageConcurrentlyService implements ConsumeMessageService
this.defaultMQPushConsumerImpl.sendMessageBack(msg, delayLevel, context.getMessageQueue().getBrokerName());
return true;
} catch (Exception e) {
log.error("sendMessageBack exception, group: " + this.consumerGroup + " msg: " + msg.toString(), e);
log.error("sendMessageBack exception, group: " + this.consumerGroup + " msg: " + msg, e);
}
return false;
@@ -399,7 +399,7 @@ public class DefaultMQProducerImpl implements MQProducerInner {
if (info != null && topic != null) {
TopicPublishInfo prev = this.topicPublishInfoTable.put(topic, info);
if (prev != null) {
log.info("updateTopicPublishInfo prev is not null, " + prev.toString());
log.info("updateTopicPublishInfo prev is not null, " + prev);
}
}
}
@@ -145,7 +145,7 @@ public class BloomFilter {
if (!isValid(filterData)) {
throw new IllegalArgumentException(
String.format("Bloom filter data may not belong to this filter! %s, %s",
filterData, this.toString())
filterData, this)
);
}
hashTo(filterData.getBitPos(), bits);
@@ -183,7 +183,7 @@ public class BloomFilter {
if (!isValid(filterData)) {
throw new IllegalArgumentException(
String.format("Bloom filter data may not belong to this filter! %s, %s",
filterData, this.toString())
filterData, this)
);
}
return isHit(filterData.getBitPos(), bits);
@@ -513,7 +513,7 @@ public class NettyRemotingClient extends NettyRemotingAbstract implements Remoti
log.info("createChannel: connect remote host[{}] success, {}", addr, channelFuture.toString());
return cw.getChannel();
} else {
log.warn("createChannel: connect remote host[" + addr + "] failed, " + channelFuture.toString(), channelFuture.cause());
log.warn("createChannel: connect remote host[" + addr + "] failed, " + channelFuture, channelFuture.cause());
}
} else {
log.warn("createChannel: connect remote host[{}] timeout {}ms, {}", addr, this.nettyClientConfig.getConnectTimeoutMillis(),
@@ -90,7 +90,7 @@ public class DuplicateMessageInfo<T> {
getFloatNumString(msgQueueInnerDupRate) + "%\r\n");
}
System.out.print(strBuilder.toString());
System.out.print(strBuilder);
String titleString = "queue\tdupQueue\tdupMsg\r\n";
System.out.print(titleString);
@@ -104,7 +104,7 @@ public class DuplicateMessageInfo<T> {
String strToWrite;
byte[] byteToWrite;
strToWrite = strBuilder.toString() + titleString;
strToWrite = strBuilder + titleString;
for (int i = 0; i < msgListSize; i++)
strToWrite += strBQueue.get(i).toString() + "\r\n";
@@ -93,7 +93,7 @@ public class PrintMessageByQueueCommand implements SubCommand {
for (MessageExt msg : msgs) {
try {
System.out.printf("MSGID: %s %s BODY: %s%n", msg.getMsgId(), msg.toString(),
System.out.printf("MSGID: %s %s BODY: %s%n", msg.getMsgId(), msg,
printBody ? new String(msg.getBody(), charsetName) : "NOT PRINT BODY");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();