From 791840ef10ecb9f25b4c3b97eacbf848bf75a261 Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Wed, 24 Apr 2013 12:44:51 +0000
Subject: [PATCH] Replication Cleanup.

---
 opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationServer.java |   25 ++++++++-----------------
 1 files changed, 8 insertions(+), 17 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationServer.java b/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationServer.java
index 614efdd..0e75c5e 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationServer.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/server/ReplicationServer.java
@@ -23,7 +23,7 @@
  *
  *
  *      Copyright 2006-2010 Sun Microsystems, Inc.
- *      Portions Copyright 2011-2012 ForgeRock AS
+ *      Portions Copyright 2011-2013 ForgeRock AS
  */
 package org.opends.server.replication.server;
 
@@ -75,7 +75,7 @@
 
 /**
  * ReplicationServer Listener. This singleton is the main object of the
- * replication server It waits for the incoming connections and create listener
+ * replication server. It waits for the incoming connections and create listener
  * and publisher objects for connection with LDAP servers and with replication
  * servers It is responsible for creating the replication server
  * replicationServerDomain and managing it
@@ -251,7 +251,7 @@
     {
       backendConfigEntryDN = DN.decode(
       "ds-cfg-backend-id=" + backendId + ",cn=Backends,cn=config");
-    } catch (Exception e) {}
+    } catch (Exception e) { /* do nothing */ }
 
     // Creates the backend associated to this ReplicationServer
     // if it does not exist.
@@ -293,7 +293,7 @@
         listenSocket.getLocalPort());
     logError(listenMsg);
 
-    while ((shutdown == false) && (stopListen  == false))
+    while (!shutdown && !stopListen)
     {
       // Wait on the replicationServer port.
       // Read incoming messages and create LDAP or ReplicationServer listener
@@ -365,7 +365,7 @@
         {
           TRACER.debugCaught(DebugLogLevel.ERROR, e);
         }
-        if (shutdown == false) {
+        if (!shutdown) {
           Message message =
             ERR_EXCEPTION_LISTENING.get(e.getLocalizedMessage());
           logError(message);
@@ -1561,9 +1561,7 @@
   public ExternalChangeLogSession createECLSession(StartECLSessionMsg msg)
   throws DirectoryException
   {
-    ExternalChangeLogSessionImpl session =
-      new ExternalChangeLogSessionImpl(this, msg);
-    return session;
+    return new ExternalChangeLogSessionImpl(this, msg);
   }
 
   /**
@@ -1623,16 +1621,9 @@
     {
       InetAddress localAddr = InetAddress.getLocalHost();
 
-      if (localPorts.contains(port)
+      return localPorts.contains(port)
           && (InetAddress.getByName(hostname).isLoopbackAddress() ||
-              InetAddress.getByName(hostname).equals(localAddr)))
-      {
-        return true;
-      }
-      else
-      {
-        return false;
-      }
+          InetAddress.getByName(hostname).equals(localAddr));
 
     } catch (UnknownHostException e)
     {

--
Gitblit v1.10.0