File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
driver-core/src/main/com/mongodb/connection Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 2222import com .mongodb .selector .ServerSelector ;
2323
2424import java .util .ArrayList ;
25- import java .util .Arrays ;
2625import java .util .Collections ;
2726import java .util .LinkedHashSet ;
2827import java .util .List ;
2928import java .util .concurrent .TimeUnit ;
3029
3130import static com .mongodb .assertions .Assertions .isTrueArgument ;
3231import static com .mongodb .assertions .Assertions .notNull ;
32+ import static java .util .Collections .singletonList ;
3333
3434/**
3535 * Settings for the cluster.
@@ -84,7 +84,7 @@ public Builder description(final String description) {
8484 }
8585
8686 /**
87- * Sets the hosts for the cluster. And duplicate server addresses are removed from the list.
87+ * Sets the hosts for the cluster. Any duplicate server addresses are removed from the list.
8888 *
8989 * @param hosts the seed list of hosts
9090 * @return this
@@ -181,7 +181,7 @@ public Builder maxWaitQueueSize(final int maxWaitQueueSize) {
181181 public Builder applyConnectionString (final ConnectionString connectionString ) {
182182 if (connectionString .getHosts ().size () == 1 && connectionString .getRequiredReplicaSetName () == null ) {
183183 mode (ClusterConnectionMode .SINGLE )
184- .hosts (Arrays . asList (new ServerAddress (connectionString .getHosts ().get (0 ))));
184+ .hosts (singletonList (new ServerAddress (connectionString .getHosts ().get (0 ))));
185185 } else {
186186 List <ServerAddress > seedList = new ArrayList <ServerAddress >();
187187 for (final String cur : connectionString .getHosts ()) {
You can’t perform that action at this time.
0 commit comments