Skip to content

Commit

Permalink
Use StringBuilder.append(char) where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
izeye committed Jun 30, 2021
1 parent f5defd2 commit 574e34c
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
Expand Up @@ -267,7 +267,7 @@ private String write(Meter.Id id, @Nullable String type, String... statistics) {
// appoptics requires at least one tag for every metric, so we hang something here that may be useful.
sb.append("\"_type\":\"").append(type).append('"');
if (!tags.isEmpty())
sb.append(",");
sb.append(',');
}

if (!tags.isEmpty()) {
Expand Down
Expand Up @@ -430,7 +430,7 @@ String writeDocument(Meter meter, Consumer<StringBuilder> consumer) {
}

consumer.accept(sb);
sb.append("}");
sb.append('}');

return sb.toString();
}
Expand Down
Expand Up @@ -43,7 +43,7 @@ public String toHierarchicalName(Meter.Id id, NamingConvention convention) {
for (String tagKey : tagsAsPrefix) {
String tagValue = id.getTag(tagKey);
if (tagValue != null) {
hierarchicalName.append(convention.tagValue(tagValue)).append(".");
hierarchicalName.append(convention.tagValue(tagValue)).append('.');
}
}
hierarchicalName.append(id.getConventionName(convention));
Expand Down
Expand Up @@ -414,7 +414,7 @@ private void prePopulateVerifiedDescriptors() {
private String metricType(Meter.Id id, @Nullable String statistic) {
StringBuilder metricType = new StringBuilder("custom.googleapis.com/").append(getConventionName(id));
if (statistic != null) {
metricType.append("/").append(statistic);
metricType.append('/').append(statistic);
}
return metricType.toString();
}
Expand Down
Expand Up @@ -107,7 +107,7 @@ public static Builder build(String uri, HttpSender sender) {

@Override
public String toString() {
StringBuilder printed = new StringBuilder(method.toString()).append(" ")
StringBuilder printed = new StringBuilder(method.toString()).append(' ')
.append(url.toString()).append("\n");
if (entity.length == 0) {
printed.append("<no request body>");
Expand Down

0 comments on commit 574e34c

Please sign in to comment.