From 833ef2eb5fc04139d6b41b4bb96dc4db84e828d5 Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Fri, 30 Aug 2013 10:02:05 +0000
Subject: [PATCH] More code cleanup and use of interfaces in dsreplication and ADS.

---
 opends/src/ads/org/opends/admin/ads/util/PreferredConnection.java |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/opends/src/ads/org/opends/admin/ads/util/PreferredConnection.java b/opends/src/ads/org/opends/admin/ads/util/PreferredConnection.java
index f856354..5a52a97 100644
--- a/opends/src/ads/org/opends/admin/ads/util/PreferredConnection.java
+++ b/opends/src/ads/org/opends/admin/ads/util/PreferredConnection.java
@@ -23,11 +23,13 @@
  *
  *
  *      Copyright 2008-2009 Sun Microsystems, Inc.
+ *      Portions Copyright 2013 ForgeRock AS.
  */
 
 package org.opends.admin.ads.util;
 
 import java.util.LinkedHashSet;
+import java.util.Set;
 
 import javax.naming.ldap.InitialLdapContext;
 
@@ -123,7 +125,7 @@
   /**
    * Commodity method that returns a PreferredConnection object with the
    * information on a given InitialLdapContext.
-   * @param ctx the connection we retrieve the inforamtion from.
+   * @param ctx the connection we retrieve the information from.
    * @return a preferred connection object.
    */
   public static PreferredConnection getPreferredConnection(
@@ -143,8 +145,7 @@
     {
       type = PreferredConnection.Type.LDAP;
     }
-    PreferredConnection cnx = new PreferredConnection(ldapUrl, type);
-    return cnx;
+    return new PreferredConnection(ldapUrl, type);
   }
 
 
@@ -152,14 +153,14 @@
   /**
    * Commodity method that generates a list of preferred connection (of just
    * one) with the information on a given InitialLdapContext.
-   * @param ctx the connection we retrieve the inforamtion from.
+   * @param ctx the connection we retrieve the information from.
    * @return a list containing the preferred connection object.
    */
-  public static LinkedHashSet<PreferredConnection> getPreferredConnections(
+  public static Set<PreferredConnection> getPreferredConnections(
       InitialLdapContext ctx)
   {
     PreferredConnection cnx = PreferredConnection.getPreferredConnection(ctx);
-    LinkedHashSet<PreferredConnection> returnValue =
+    Set<PreferredConnection> returnValue =
       new LinkedHashSet<PreferredConnection>();
     returnValue.add(cnx);
     return returnValue;

--
Gitblit v1.10.0