Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use StringBuilder.append(char) where possible #2674

Merged
merged 1 commit into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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