V3 modify revert

This commit is contained in:
lytscu 2017-11-16 10:48:03 +08:00
parent ab36a1bb83
commit b7790c5a87
1 changed files with 1 additions and 9 deletions

View File

@ -200,15 +200,7 @@ public class MongoDBMethodInterceptor implements InstanceMethodsAroundIntercepto
public void onConstruct(EnhancedInstance objInst, Object[] allArguments) {
Cluster cluster = (Cluster)allArguments[0];
StringBuilder peers = new StringBuilder();
List<ServerDescription> servers;
try {
cluster.getDescription().getClass().getMethod("getServerDescriptions", null);
servers = cluster.getDescription().getServerDescriptions();
} catch (NoSuchMethodException e) {
servers = cluster.getDescription().getAny();
}
for (ServerDescription description : servers) {
for (ServerDescription description : cluster.getDescription().getServerDescriptions()) {
ServerAddress address = description.getAddress();
peers.append(address.getHost() + ":" + address.getPort() + ";");
}