Unable to compile on JDK 7
This commit is contained in:
parent
f92fe6bea9
commit
c2c2b835b2
1 changed files with 9 additions and 1 deletions
|
@ -158,7 +158,15 @@ public class DefaultMongoConnectionFactoryProvider implements MongoConnectionPro
|
|||
MongoClientURI uri = new MongoClientURI(uriString);
|
||||
MongoClient client = new MongoClient(uri);
|
||||
|
||||
String hosts = String.join(", ", uri.getHosts());
|
||||
StringBuilder hostsBuilder = new StringBuilder();
|
||||
for (int i=0 ; i<uri.getHosts().size() ; i++) {
|
||||
if (i!=0) {
|
||||
hostsBuilder.append(", ");
|
||||
}
|
||||
hostsBuilder.append(uri.getHosts().get(i));
|
||||
}
|
||||
String hosts = hostsBuilder.toString();
|
||||
|
||||
operationalInfo.put("mongoHosts", hosts);
|
||||
operationalInfo.put("mongoDatabaseName", dbName);
|
||||
operationalInfo.put("mongoUser", uri.getUsername());
|
||||
|
|
Loading…
Reference in a new issue