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 22
22
import com .mongodb .selector .ServerSelector ;
23
23
24
24
import java .util .ArrayList ;
25
- import java .util .Arrays ;
26
25
import java .util .Collections ;
27
26
import java .util .LinkedHashSet ;
28
27
import java .util .List ;
29
28
import java .util .concurrent .TimeUnit ;
30
29
31
30
import static com .mongodb .assertions .Assertions .isTrueArgument ;
32
31
import static com .mongodb .assertions .Assertions .notNull ;
32
+ import static java .util .Collections .singletonList ;
33
33
34
34
/**
35
35
* Settings for the cluster.
@@ -84,7 +84,7 @@ public Builder description(final String description) {
84
84
}
85
85
86
86
/**
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.
88
88
*
89
89
* @param hosts the seed list of hosts
90
90
* @return this
@@ -181,7 +181,7 @@ public Builder maxWaitQueueSize(final int maxWaitQueueSize) {
181
181
public Builder applyConnectionString (final ConnectionString connectionString ) {
182
182
if (connectionString .getHosts ().size () == 1 && connectionString .getRequiredReplicaSetName () == null ) {
183
183
mode (ClusterConnectionMode .SINGLE )
184
- .hosts (Arrays . asList (new ServerAddress (connectionString .getHosts ().get (0 ))));
184
+ .hosts (singletonList (new ServerAddress (connectionString .getHosts ().get (0 ))));
185
185
} else {
186
186
List <ServerAddress > seedList = new ArrayList <ServerAddress >();
187
187
for (final String cur : connectionString .getHosts ()) {
You can’t perform that action at this time.
0 commit comments