From 498f0ddf14eab8b8e85f8d231dd897257ddbd63a Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Mon, 12 Mar 2012 14:49:35 +0000
Subject: [PATCH] Fix OPENDJ-447: OpenDJ Quicksetup: Problems when hostname cannot be resolved

---
 opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/ServerController.java |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/ServerController.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/ServerController.java
index 9c81c8b..9a39f28 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/ServerController.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/ServerController.java
@@ -23,7 +23,7 @@
  *
  *
  *      Copyright 2008-2010 Sun Microsystems, Inc.
- *      Portions Copyright 2011 ForgeRock AS
+ *      Portions Copyright 2011-2012 ForgeRock AS
  */
 
 package org.opends.quicksetup.util;
@@ -485,19 +485,20 @@
 
             int dig = i % 10;
 
-            if (((dig >= 3) || (dig <= 4)) &&
-            !"localhost".equals(hostName))
+            if (((dig == 3) || (dig == 4)) && !"localhost".equals(hostName))
             {
-              // Try with local host.  This might be necessary in certain
+              // Try with local host. This might be necessary in certain
               // network configurations.
               hostName = "localhost";
             }
-            if (((dig >= 5) || (dig <= 6)))
+
+            if (((dig == 5) || (dig == 6)))
             {
-              // Try with 0.0.0.0.  This might be necessary in certain
+              // Try with 0.0.0.0. This might be necessary in certain
               // network configurations.
               hostName = "0.0.0.0";
             }
+
             hostName = ConnectionUtils.getHostNameForLdapUrl(hostName);
             String ldapUrl = "ldaps://"+hostName+":" + port;
             try

--
Gitblit v1.10.0