Avoid string concatenation inside StringBuilder append()
See gh-15589
This commit is contained in:
committed by
Stephane Nicoll
parent
1b970b0ece
commit
59ac85d371
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user