From b77eae607a22dd4ef8b7984681befdd401d8379c Mon Sep 17 00:00:00 2001 From: Artem Vysochyn Date: Tue, 9 Jun 2020 12:44:02 +0300 Subject: [PATCH] Fixed Member.toString --- cluster-api/src/main/java/io/scalecube/cluster/Member.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cluster-api/src/main/java/io/scalecube/cluster/Member.java b/cluster-api/src/main/java/io/scalecube/cluster/Member.java index dfb05b88..df1d82db 100644 --- a/cluster-api/src/main/java/io/scalecube/cluster/Member.java +++ b/cluster-api/src/main/java/io/scalecube/cluster/Member.java @@ -6,8 +6,8 @@ import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; -import java.nio.file.Paths; import java.util.Objects; +import java.util.StringJoiner; /** * Cluster member which represents node in the cluster and contains its id and address. This class @@ -134,10 +134,11 @@ public void readExternal(ObjectInput in) throws IOException { @Override public String toString() { + StringJoiner stringJoiner = new StringJoiner("/", "", ""); if (alias == null) { - return Paths.get(namespace, id + "@" + address).toString(); + return stringJoiner.add(namespace).add(id + "@" + address).toString(); } else { - return Paths.get(namespace, alias, id + "@" + address).toString(); + return stringJoiner.add(namespace).add(alias).add(id + "@" + address).toString(); } } }