Revert "Exploit DiscoveryNode immutability..."
This reverts commit e76038e076
.
This commit is contained in:
parent
29278f8482
commit
4ff8f5c16c
|
@ -312,30 +312,25 @@ public class DiscoveryNode implements Writeable<DiscoveryNode>, ToXContent {
|
|||
return nodeId.hashCode();
|
||||
}
|
||||
|
||||
private String toString;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
if (toString == null) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (nodeName.length() > 0) {
|
||||
sb.append('{').append(nodeName).append('}');
|
||||
}
|
||||
if (nodeId != null) {
|
||||
sb.append('{').append(nodeId).append('}');
|
||||
}
|
||||
if (Strings.hasLength(hostName)) {
|
||||
sb.append('{').append(hostName).append('}');
|
||||
}
|
||||
if (address != null) {
|
||||
sb.append('{').append(address).append('}');
|
||||
}
|
||||
if (!attributes.isEmpty()) {
|
||||
sb.append(attributes);
|
||||
}
|
||||
toString = sb.toString();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (nodeName.length() > 0) {
|
||||
sb.append('{').append(nodeName).append('}');
|
||||
}
|
||||
return toString;
|
||||
if (nodeId != null) {
|
||||
sb.append('{').append(nodeId).append('}');
|
||||
}
|
||||
if (Strings.hasLength(hostName)) {
|
||||
sb.append('{').append(hostName).append('}');
|
||||
}
|
||||
if (address != null) {
|
||||
sb.append('{').append(address).append('}');
|
||||
}
|
||||
if (!attributes.isEmpty()) {
|
||||
sb.append(attributes);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue