Unable to compile on JDK 7

This commit is contained in:
mposolda 2015-10-14 11:23:10 +02:00
parent f92fe6bea9
commit c2c2b835b2

View file

@ -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());