From e60baaef11af6bcd6e7aee73b9e304732bf9a16e Mon Sep 17 00:00:00 2001
From: Chris Ridd <chris.ridd@forgerock.com>
Date: Fri, 23 May 2014 15:13:23 +0000
Subject: [PATCH] Backport fix for OPENDJ-1466: Improve initialization of InetSocketAddress in SDK to prevent cached DNS data.

---
 opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/LDAPConnectionFactory.java |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/LDAPConnectionFactory.java b/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/LDAPConnectionFactory.java
index 08eb75e..cbd9eb9 100644
--- a/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/LDAPConnectionFactory.java
+++ b/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/LDAPConnectionFactory.java
@@ -86,7 +86,9 @@
      *            The address of the Directory Server.
      * @throws NullPointerException
      *             If {@code address} was {@code null}.
+     * @deprecated use {@link #LDAPConnectionFactory(String, int)} instead.
      */
+    @Deprecated
     public LDAPConnectionFactory(final InetSocketAddress address) {
         this(address, new LDAPOptions());
     }
@@ -101,7 +103,10 @@
      *            The LDAP options to use when creating connections.
      * @throws NullPointerException
      *             If {@code address} or {@code options} was {@code null}.
+     * @deprecated use {@link #LDAPConnectionFactory(String, int,
+     * org.forgerock.opendj.ldap.LDAPOptions)} instead.
      */
+    @Deprecated
     public LDAPConnectionFactory(final InetSocketAddress address, final LDAPOptions options) {
         Validator.ensureNotNull(address, options);
         this.impl = new LDAPConnectionFactoryImpl(address, options);
@@ -139,8 +144,7 @@
      */
     public LDAPConnectionFactory(final String host, final int port, final LDAPOptions options) {
         Validator.ensureNotNull(host, options);
-        final InetSocketAddress address = new InetSocketAddress(host, port);
-        this.impl = new LDAPConnectionFactoryImpl(address, options);
+        this.impl = new LDAPConnectionFactoryImpl(host, port, options);
     }
 
     /**

--
Gitblit v1.10.0