Skip to content

Commit

Permalink
string concat in StringBuilder append chain (alibaba#1984)
Browse files Browse the repository at this point in the history
  • Loading branch information
XenoAmess authored Oct 18, 2021
1 parent 09765b0 commit c73c3d1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions boot/src/main/java/com/taobao/arthas/boot/Bootstrap.java
Original file line number Diff line number Diff line change
Expand Up @@ -694,14 +694,14 @@ private static String listVersions() {

result.append("Local versions:\n");
for (String version : versionList) {
result.append(" " + version).append('\n');
result.append(" ").append(version).append('\n');
}
result.append("Remote versions:\n");

List<String> remoteVersions = DownloadUtils.readRemoteVersions();
Collections.reverse(remoteVersions);
for (String version : remoteVersions) {
result.append(" " + version).append('\n');
result.append(" ").append(version).append('\n');
}
return result.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ private void renderNode(StringBuilder sb, TraceNode node, Ansi highlighted) {

//trace_id
if (threadNode.getTraceId() != null) {
sb.append(";trace_id="+threadNode.getTraceId());
sb.append(";trace_id=").append(threadNode.getTraceId());
}
if (threadNode.getRpcId() != null) {
sb.append(";rpc_id="+threadNode.getRpcId());
sb.append(";rpc_id=").append(threadNode.getRpcId());
}
} else if (node instanceof ThrowNode) {
ThrowNode throwNode = (ThrowNode) node;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static String renderEnhancerAffect(EnhancerAffectVO affectVO) {
affectVO.getListenerId()));

if (affectVO.getThrowable() != null) {
infoSB.append("\nEnhance error! exception: " + affectVO.getThrowable());
infoSB.append("\nEnhance error! exception: ").append(affectVO.getThrowable());
}
infoSB.append("\n");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ static class RemoteJob implements Runnable {
public void appendQueryData(String key, String value) {
if (key != null && value != null) {
if (queryData.length() == 0) {
queryData.append(key + "=" + value);
queryData.append(key).append("=").append(value);
} else {
queryData.append("&" + key + "=" + value);
queryData.append("&").append(key).append("=").append(value);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public String toString() {
cost(),
listenerId));
if (this.throwable != null) {
infoSB.append("\nEnhance error! exception: " + this.throwable);
infoSB.append("\nEnhance error! exception: ").append(this.throwable);
}
return infoSB.toString();
}
Expand Down

0 comments on commit c73c3d1

Please sign in to comment.