Avoid string concatenation inside StringBuilder append()

See gh-15589
This commit is contained in:
igor-suhorukov
2018-12-30 22:34:02 +03:00
committed by Stephane Nicoll
parent 1b970b0ece
commit 59ac85d371
12 changed files with 45 additions and 42 deletions

View File

@@ -180,9 +180,9 @@ class DiscoveredJmxOperation extends AbstractDiscoveredOperation implements JmxO
public String toString() {
StringBuilder result = new StringBuilder(this.name);
if (this.description != null) {
result.append(" (" + this.description + ")");
result.append(" (").append(this.description).append(")");
}
result.append(":" + this.type);
result.append(":").append(this.type);
return result.toString();
}

View File

@@ -124,12 +124,12 @@ public final class WebOperationRequestPredicate {
StringBuilder result = new StringBuilder(
this.httpMethod + " to path '" + this.path + "'");
if (!CollectionUtils.isEmpty(this.consumes)) {
result.append(" consumes: "
+ StringUtils.collectionToCommaDelimitedString(this.consumes));
result.append(" consumes: ")
.append(StringUtils.collectionToCommaDelimitedString(this.consumes));
}
if (!CollectionUtils.isEmpty(this.produces)) {
result.append(" produces: "
+ StringUtils.collectionToCommaDelimitedString(this.produces));
result.append(" produces: ")
.append(StringUtils.collectionToCommaDelimitedString(this.produces));
}
return result.toString();
}