Fix String concatenation within a StringBuilder append chain
This commit replaces String concatenation within a StringBuilder append chain by using explicit append calls.
This commit is contained in:
parent
26e2e933f5
commit
d744d77f61
|
@ -193,7 +193,7 @@ public class RoutingNode implements Iterable<ShardRouting> {
|
||||||
|
|
||||||
public String prettyPrint() {
|
public String prettyPrint() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("-----node_id[").append(nodeId).append("][" + (node == null ? "X" : "V") + "]\n");
|
sb.append("-----node_id[").append(nodeId).append("][").append(node == null ? "X" : "V").append("]\n");
|
||||||
for (ShardRouting entry : shards.values()) {
|
for (ShardRouting entry : shards.values()) {
|
||||||
sb.append("--------").append(entry.shortSummary()).append('\n');
|
sb.append("--------").append(entry.shortSummary()).append('\n');
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,7 +121,7 @@ public final class IfConfig {
|
||||||
sb.append("inet ");
|
sb.append("inet ");
|
||||||
sb.append(NetworkAddress.format(address));
|
sb.append(NetworkAddress.format(address));
|
||||||
int netmask = 0xFFFFFFFF << (32 - interfaceAddress.getNetworkPrefixLength());
|
int netmask = 0xFFFFFFFF << (32 - interfaceAddress.getNetworkPrefixLength());
|
||||||
sb.append(" netmask:" + NetworkAddress.format(InetAddress.getByAddress(new byte[] {
|
sb.append(" netmask:").append(NetworkAddress.format(InetAddress.getByAddress(new byte[]{
|
||||||
(byte) (netmask >>> 24),
|
(byte) (netmask >>> 24),
|
||||||
(byte) (netmask >>> 16 & 0xFF),
|
(byte) (netmask >>> 16 & 0xFF),
|
||||||
(byte) (netmask >>> 8 & 0xFF),
|
(byte) (netmask >>> 8 & 0xFF),
|
||||||
|
@ -129,7 +129,7 @@ public final class IfConfig {
|
||||||
})));
|
})));
|
||||||
InetAddress broadcast = interfaceAddress.getBroadcast();
|
InetAddress broadcast = interfaceAddress.getBroadcast();
|
||||||
if (broadcast != null) {
|
if (broadcast != null) {
|
||||||
sb.append(" broadcast:" + NetworkAddress.format(broadcast));
|
sb.append(" broadcast:").append(NetworkAddress.format(broadcast));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (address.isLoopbackAddress()) {
|
if (address.isLoopbackAddress()) {
|
||||||
|
@ -160,8 +160,8 @@ public final class IfConfig {
|
||||||
if (nic.isVirtual()) {
|
if (nic.isVirtual()) {
|
||||||
flags.append("VIRTUAL ");
|
flags.append("VIRTUAL ");
|
||||||
}
|
}
|
||||||
flags.append("mtu:" + nic.getMTU());
|
flags.append("mtu:").append(nic.getMTU());
|
||||||
flags.append(" index:" + nic.getIndex());
|
flags.append(" index:").append(nic.getIndex());
|
||||||
return flags.toString();
|
return flags.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ public abstract class ModuleTestCase extends ESTestCase {
|
||||||
}
|
}
|
||||||
StringBuilder s = new StringBuilder();
|
StringBuilder s = new StringBuilder();
|
||||||
for (Element element : elements) {
|
for (Element element : elements) {
|
||||||
s.append(element + "\n");
|
s.append(element).append("\n");
|
||||||
}
|
}
|
||||||
fail("Did not find any binding to " + to.getName() + ". Found these bindings:\n" + s);
|
fail("Did not find any binding to " + to.getName() + ". Found these bindings:\n" + s);
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ public abstract class ModuleTestCase extends ESTestCase {
|
||||||
List<Element> elements = Elements.getElements(module);
|
List<Element> elements = Elements.getElements(module);
|
||||||
StringBuilder s = new StringBuilder();
|
StringBuilder s = new StringBuilder();
|
||||||
for (Element element : elements) {
|
for (Element element : elements) {
|
||||||
s.append(element + "\n");
|
s.append(element).append("\n");
|
||||||
}
|
}
|
||||||
fail("Expected exception from configuring module. Found these bindings:\n" + s);
|
fail("Expected exception from configuring module. Found these bindings:\n" + s);
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
|
@ -220,7 +220,7 @@ public abstract class ModuleTestCase extends ESTestCase {
|
||||||
}
|
}
|
||||||
StringBuilder s = new StringBuilder();
|
StringBuilder s = new StringBuilder();
|
||||||
for (Element element : elements) {
|
for (Element element : elements) {
|
||||||
s.append(element + "\n");
|
s.append(element).append("\n");
|
||||||
}
|
}
|
||||||
fail("Did not find any instance binding to " + to.getName() + ". Found these bindings:\n" + s);
|
fail("Did not find any instance binding to " + to.getName() + ". Found these bindings:\n" + s);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue