From 17e7241d4617adeae286b0954197cb88acf8798b Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Thu, 20 Jan 2011 18:12:32 +0000
Subject: [PATCH] Code cleanup removing potential issues detected by FindBugs

---
 opends/src/server/org/opends/server/replication/service/ReplicationBroker.java |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 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 9f4a21e..d8798bf 100644
--- a/opends/src/server/org/opends/server/replication/service/ReplicationBroker.java
+++ b/opends/src/server/org/opends/server/replication/service/ReplicationBroker.java
@@ -23,6 +23,7 @@
  *
  *
  *      Copyright 2006-2010 Sun Microsystems, Inc.
+ *      Portions Copyright 2011 ForgeRock AS
  */
 package org.opends.server.replication.service;
 
@@ -234,7 +235,7 @@
     this.groupId = groupId;
     this.generationID = generationId;
     this.heartbeatInterval = heartbeatInterval;
-    this.maxRcvWindow = window;
+    this.rcvWindow = window;
     this.maxRcvWindow = window;
     this.halfRcvWindow = window / 2;
     this.changeTimeHeartbeatSendInterval = changeTimeHeartbeatInterval;
@@ -2655,12 +2656,17 @@
               {
                 // The best replication server is no more the one we are
                 // currently using. Disconnect properly then reconnect.
+                int bestServerId = -1;
+                if (bestServerInfo != null)
+                {
+                  bestServerId = bestServerInfo.getServerId();
+                }
                 Message message =
                   NOTE_NEW_BEST_REPLICATION_SERVER.get(baseDn.toString(),
                   Integer.toString(serverId),
                   Integer.toString(rsServerId),
                   rsServerUrl,
-                  Integer.toString(bestServerInfo.getServerId()));
+                  Integer.toString(bestServerId));
                 logError(message);
                 reStart(true);
               }

--
Gitblit v1.10.0