From 46fd9423ab622d7f9531aa1564846ec52fe09534 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.

---
 opends/src/server/org/opends/server/replication/protocol/AckMsg.java |   31 ++++++-------------------------
 1 files changed, 6 insertions(+), 25 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/protocol/AckMsg.java b/opends/src/server/org/opends/server/replication/protocol/AckMsg.java
index b461272..544e680 100644
--- a/opends/src/server/org/opends/server/replication/protocol/AckMsg.java
+++ b/opends/src/server/org/opends/server/replication/protocol/AckMsg.java
@@ -23,6 +23,7 @@
  *
  *
  *      Copyright 2006-2009 Sun Microsystems, Inc.
+ *      Portions Copyright 2013 ForgeRock AS.
  */
 package org.opends.server.replication.protocol;
 
@@ -176,31 +177,13 @@
       pos += length + 1;
 
       /* Read the hasTimeout flag */
-      if (in[pos++] == 1)
-      {
-        hasTimeout = true;
-      } else
-      {
-        hasTimeout = false;
-      }
+      hasTimeout = in[pos++] == 1;
 
       /* Read the hasWrongStatus flag */
-      if (in[pos++] == 1)
-      {
-        hasWrongStatus = true;
-      } else
-      {
-        hasWrongStatus = false;
-      }
+      hasWrongStatus = in[pos++] == 1;
 
       /* Read the hasReplayError flag */
-      if (in[pos++] == 1)
-      {
-        hasReplayError = true;
-      } else
-      {
-        hasReplayError = false;
-      }
+      hasReplayError = in[pos++] == 1;
 
       /* Read the list of failed server ids */
       while (pos < in.length)
@@ -318,7 +301,7 @@
    */
   public String errorsToString()
   {
-    String idList = null;
+    String idList;
     if (failedServers.size() > 0)
     {
       idList = "[";
@@ -334,12 +317,10 @@
       idList="none";
     }
 
-    String ackErrorStr = "hasTimeout: " + (hasTimeout ? "yes" : "no")  + ", " +
+    return "hasTimeout: " + (hasTimeout ? "yes" : "no")  + ", " +
       "hasWrongStatus: " + (hasWrongStatus ? "yes" : "no")  + ", " +
       "hasReplayError: " + (hasReplayError ? "yes" : "no")  + ", " +
       "concerned server ids: " + idList;
-
-    return ackErrorStr;
   }
 
 }

--
Gitblit v1.10.0