diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/NetView.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/NetView.java index a9c68529e0cf..8f7e752816f1 100644 --- a/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/NetView.java +++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/membership/NetView.java @@ -512,23 +512,35 @@ public String toString() { InternalDistributedMember lead = getLeadMember(); StringBuilder sb = new StringBuilder(200); - sb.append("View[").append(creator).append('|').append(viewId).append("]\nmembers: ["); + sb.append("View[").append(creator).append('|').append(viewId).append("] members: ["); + boolean first = true; for (InternalDistributedMember mbr : this.members) { - sb.append("\n").append(mbr); + if (!first) + sb.append(", "); + sb.append(mbr); if (mbr == lead) { sb.append("{lead}"); } + first = false; } if (!this.shutdownMembers.isEmpty()) { - sb.append("]\nshutdown: ["); + sb.append("] shutdown: ["); + first = true; for (InternalDistributedMember mbr : this.shutdownMembers) { - sb.append("\n").append(mbr); + if (!first) + sb.append(", "); + sb.append(mbr); + first = false; } } if (!this.crashedMembers.isEmpty()) { - sb.append("]\ncrashed: ["); + sb.append("] crashed: ["); + first = true; for (InternalDistributedMember mbr : this.crashedMembers) { - sb.append("\n").append(mbr); + if (!first) + sb.append(", "); + sb.append(mbr); + first = false; } } // sb.append("] fd ports: ["); @@ -543,7 +555,6 @@ public String toString() { sb.append("]"); return sb.toString(); } - /** * Returns the ID from this view that is equal to the argument. If no such ID exists the argument * is returned.