Commit 09765ef2 authored by Karsten Loesing's avatar Karsten Loesing
Browse files

Avoid unnecessary conversions to String.

parent 4521ad33
......@@ -173,12 +173,12 @@ public class BandwidthStatus extends Document {
for (long[] v : writeHistory.values()) {
sb.append("w ").append(DateTimeHelper.format(v[0])).append(" ")
.append(DateTimeHelper.format(v[1])).append(" ")
.append(String.valueOf(v[2])).append("\n");
.append(v[2]).append("\n");
}
for (long[] v : readHistory.values()) {
sb.append("r ").append(DateTimeHelper.format(v[0])).append(" ")
.append(DateTimeHelper.format(v[1])).append(" ")
.append(String.valueOf(v[2])).append("\n");
.append(v[2]).append("\n");
}
return sb.toString();
}
......
......@@ -724,11 +724,11 @@ public class NodeStatus extends Document {
sb.append("\t").append(this.dirPort).append("\t");
sb.append(StringUtils.join(this.getRelayFlags(), ","));
if (this.isRelay) {
sb.append("\t").append(String.valueOf(this.consensusWeight));
sb.append("\t").append(this.consensusWeight);
sb.append("\t")
.append((this.countryCode != null ? this.countryCode : "??"));
sb.append("\t"); /* formerly used for storing host names */
sb.append("\t").append(String.valueOf(this.lastRdnsLookup));
sb.append("\t").append(this.lastRdnsLookup);
sb.append("\t").append((this.defaultPolicy != null
? this.defaultPolicy : "null"));
sb.append("\t").append((this.portList != null ? this.portList : "null"));
......
......@@ -124,8 +124,7 @@ class DescriptorQueue {
for (Map.Entry<String, Long> e : excludedAndParsedFiles.entrySet()) {
String absolutePath = e.getKey();
long lastModifiedMillis = e.getValue();
bw.write(String.valueOf(lastModifiedMillis) + " " + absolutePath
+ "\n");
bw.write(lastModifiedMillis + " " + absolutePath + "\n");
}
} catch (IOException e) {
log.error("Could not write history file '{}'. Not excluding descriptors "
......
......@@ -248,7 +248,7 @@ public class LookupService {
this.geoLite2AsnBlocksIpv4CsvFile.getAbsolutePath());
return lookupResults;
}
String asNumber = "AS" + String.valueOf(Integer.parseInt(parts[1]));
String asNumber = "AS" + Integer.parseInt(parts[1]);
String asName = parts[2];
while (firstAddressNumber < startIpNum
&& firstAddressNumber != -1L) {
......
......@@ -1358,7 +1358,7 @@ public class ResourceServletTest {
@Test(timeout = 100)
public void testFirstSeenDaysMaxInt() {
this.assertSummaryDocument(
"/summary?last_seen_days=" + String.valueOf(Integer.MAX_VALUE), 0,
"/summary?last_seen_days=" + Integer.MAX_VALUE, 0,
null, 0, null);
}
......@@ -1366,7 +1366,7 @@ public class ResourceServletTest {
public void testFirstSeenDaysMaxIntPlusOne() {
this.assertErrorStatusCode(
"/summary?first_seen_days="
+ String.valueOf(((long) Integer.MAX_VALUE) + 1L), 400);
+ (((long) Integer.MAX_VALUE) + 1L), 400);
}
@Test(timeout = 100)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment