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

@@ -108,7 +108,7 @@ public final class Metadata {
private String createDescription() {
StringBuilder description = new StringBuilder();
description.append("an item named '" + this.name + "'");
description.append("an item named '").append(this.name).append("'");
if (this.type != null) {
description.append(" with dataType:").append(this.type);
}
@@ -258,7 +258,7 @@ public final class Metadata {
private String createDescription() {
StringBuilder description = new StringBuilder();
description.append("a hints name '" + this.name + "'");
description.append("a hints name '").append(this.name).append("'");
if (!this.valueConditions.isEmpty()) {
description.append(" with values:").append(this.valueConditions);
}
@@ -348,7 +348,7 @@ public final class Metadata {
private String createDescription() {
StringBuilder description = new StringBuilder();
description.append("value hint at index '" + this.index + "'");
description.append("value hint at index '").append(this.index).append("'");
if (this.value != null) {
description.append(" with value:").append(this.value);
}