Skip to content

Commit

Permalink
Merge pull request #328 from scalecube/fix-member-toString
Browse files Browse the repository at this point in the history
Fixed Member.toString
  • Loading branch information
artem-v authored Jun 9, 2020
2 parents b2c8944 + b77eae6 commit a8e423d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cluster-api/src/main/java/io/scalecube/cluster/Member.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
}
}
}

0 comments on commit a8e423d

Please sign in to comment.