From 1d608ebdb1f4efd4c3f1aa0ac03c5b044efbf129 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Mon, 02 Sep 2013 12:27:44 +0000
Subject: [PATCH] Added spaces between error messages and stack traces.

---
 opendj-sdk/opends/src/server/org/opends/server/replication/server/changelog/je/ReplicationDB.java |   37 ++++++++++++++++++-------------------
 1 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/replication/server/changelog/je/ReplicationDB.java b/opendj-sdk/opends/src/server/org/opends/server/replication/server/changelog/je/ReplicationDB.java
index 338a468..fad6571 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/replication/server/changelog/je/ReplicationDB.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/replication/server/changelog/je/ReplicationDB.java
@@ -270,7 +270,8 @@
     catch (DatabaseException e)
     {
       MessageBuilder mb = new MessageBuilder();
-      mb.append(NOTE_EXCEPTION_CLOSING_DATABASE.get(this.toString()));
+      mb.append(NOTE_EXCEPTION_CLOSING_DATABASE.get(toString()));
+      mb.append(" ");
       mb.append(stackTraceToSingleLineString(e));
       logError(mb.toMessage());
     }
@@ -589,26 +590,24 @@
         }
 
         localCursor = db.openCursor(txn, null);
-        if (startCSN != null)
+        if (startCSN != null
+            && localCursor.getSearchKey(key, data, LockMode.DEFAULT) != SUCCESS)
         {
-          if (localCursor.getSearchKey(key, data, LockMode.DEFAULT) != SUCCESS)
+          // We could not move the cursor to the expected startCSN
+          if (localCursor.getSearchKeyRange(key, data, DEFAULT) != SUCCESS)
           {
-            // We could not move the cursor to the expected startCSN
-            if (localCursor.getSearchKeyRange(key, data, DEFAULT) != SUCCESS)
-            {
-              // We could not even move the cursor close to it => failure
-              throw new ChangelogException(Message.raw("CSN not available"));
-            }
+            // We could not even move the cursor close to it => failure
+            throw new ChangelogException(Message.raw("CSN not available"));
+          }
 
-            // We can move close to the startCSN.
-            // Let's create a cursor from that point.
-            DatabaseEntry aKey = new DatabaseEntry();
-            DatabaseEntry aData = new DatabaseEntry();
-            if (localCursor.getPrev(aKey, aData, LockMode.DEFAULT) != SUCCESS)
-            {
-              localCursor.close();
-              localCursor = db.openCursor(txn, null);
-            }
+          // We can move close to the startCSN.
+          // Let's create a cursor from that point.
+          DatabaseEntry aKey = new DatabaseEntry();
+          DatabaseEntry aData = new DatabaseEntry();
+          if (localCursor.getPrev(aKey, aData, LockMode.DEFAULT) != SUCCESS)
+          {
+            localCursor.close();
+            localCursor = db.openCursor(txn, null);
           }
         }
         cursor = localCursor;
@@ -892,7 +891,7 @@
     catch(Exception e)
     {
       MessageBuilder mb = new MessageBuilder();
-      mb.append(ERR_ERROR_CLEARING_DB.get(this.toString(),
+      mb.append(ERR_ERROR_CLEARING_DB.get(toString(),
           e.getMessage() + " " +
           stackTraceToSingleLineString(e)));
       logError(mb.toMessage());

--
Gitblit v1.10.0