Skip to content

Commit 83cda0b

Browse files
committed
JAVA-458: Fixed regression in ReplicaSetStatus.toString()
1 parent acc552a commit 83cda0b

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/main/com/mongodb/ReplicaSetStatus.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public String toString() {
6262
StringBuilder sb = new StringBuilder();
6363
sb.append("{replSetName: ").append(_setName.get());
6464
sb.append(", nextResolveTime: ").append(new Date(_updater.getNextResolveTime()).toString());
65-
sb.append(", all : ").append(_replicaSetHolder);
65+
sb.append(", members: ").append(_replicaSetHolder);
6666

6767
return sb.toString();
6868
}
@@ -178,6 +178,14 @@ public synchronized void close() {
178178
this.members = null;
179179
notifyAll();
180180
}
181+
182+
public String toString() {
183+
ReplicaSet cur = this.members;
184+
if (cur != null) {
185+
return cur.toString();
186+
}
187+
return "none";
188+
}
181189
}
182190

183191
// Immutable snapshot state of a replica set. Since the nodes don't change state, this class pre-computes the list

0 commit comments

Comments
 (0)