From a8f5d8345278d27ddf5325d3977e460b86b6275f Mon Sep 17 00:00:00 2001
From: ludovicp <ludovicp@localhost>
Date: Tue, 27 Apr 2010 20:56:50 +0000
Subject: [PATCH] Fixing several issues with the Control Panel, the QuickSetup, Core server and Replication. Also improves unit, functional tests. More specifically this commit resolves the following open issues: 4385 - NPE when using ExtensibleMatch filter without a matching rule 4521 - dynamic lookup in attribut selection when selecting the sort order attribut while defining VLV index 4531 - Control Panel creates virtual static groups using groupOfURLs as objectclass 4533 - NullPointerException when configuring replication between 2 OpenDS 4539 - DSML Gateway - jaxb.properties Exception

---
 opends/src/server/org/opends/server/replication/service/ReplicationBroker.java |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/service/ReplicationBroker.java b/opends/src/server/org/opends/server/replication/service/ReplicationBroker.java
index cb84ba5..1b1f955 100644
--- a/opends/src/server/org/opends/server/replication/service/ReplicationBroker.java
+++ b/opends/src/server/org/opends/server/replication/service/ReplicationBroker.java
@@ -862,13 +862,14 @@
             "phase 2 : will perform PhaseOneH with the preferred RS.");
         replicationServerInfo = performPhaseOneHandshake(
           replicationServerInfo.getServerURL(), true);
-        // Update replication server info with potentially more up to date data
-        // (server state for instance may have changed)
-        replicationServerInfos.put(replicationServerInfo.getServerId(),
-          replicationServerInfo);
 
         if (replicationServerInfo != null)
         {
+          // Update replication server info with potentially more up to date
+          // data (server state for instance may have changed)
+          replicationServerInfos.put(replicationServerInfo.getServerId(),
+              replicationServerInfo);
+
           // Handshake phase 1 exchange went well
 
           // Compute in which status we are starting the session to tell the RS
@@ -2383,10 +2384,14 @@
         {
           synchronized (connectPhaseLock)
           {
+            // session may have been set to null in the connection phase
+            // when restarting the broker for example.
+
             // check the session. If it has changed, some
             // deconnection/reconnection happened and we need to restart from
             // scratch.
-            if (session == current_session)
+            if ((session != null) &&
+                (session == current_session))
             {
               session.publish(msg);
               done = true;

--
Gitblit v1.10.0