From 9f3e7037211c0f9828cade20b7ebcd0f9ad7b677 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 13 Aug 2013 12:59:45 +0000
Subject: [PATCH] ReplicationIterator.java: In next(), removed useless local variable. Renamed instance field from dbh to dbHandler.

---
 opends/src/server/org/opends/server/replication/server/ReplicationIterator.java |   21 ++++++---------------
 1 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/opends/src/server/org/opends/server/replication/server/ReplicationIterator.java b/opends/src/server/org/opends/server/replication/server/ReplicationIterator.java
index cac8bfb..82b201f 100644
--- a/opends/src/server/org/opends/server/replication/server/ReplicationIterator.java
+++ b/opends/src/server/org/opends/server/replication/server/ReplicationIterator.java
@@ -41,7 +41,7 @@
 {
   private UpdateMsg currentChange = null;
   private ReplServerDBCursor cursor = null;
-  private DbHandler dbh;
+  private DbHandler dbHandler;
   private ReplicationDB db;
   private ChangeNumber lastNonNullCurrentCN;
 
@@ -59,7 +59,7 @@
       DbHandler dbHandler) throws ChangelogException
   {
     this.db = db;
-    this.dbh = dbHandler;
+    this.dbHandler = dbHandler;
     this.lastNonNullCurrentCN = changeNumber;
 
     try
@@ -102,14 +102,11 @@
    */
   public boolean next()
   {
-    boolean hasNext;
-
-    currentChange = cursor.next(); // can return null
+    currentChange = cursor.next();
 
     if (currentChange != null)
     {
       lastNonNullCurrentCN = currentChange.getChangeNumber();
-      hasNext = true;
     }
     else
     {
@@ -120,7 +117,7 @@
           cursor.close();
           cursor = null;
         }
-        dbh.flush();
+        dbHandler.flush();
         try
         {
           cursor = db.openReadCursor(lastNonNullCurrentCN);
@@ -128,21 +125,15 @@
           if (currentChange != null)
           {
             lastNonNullCurrentCN = currentChange.getChangeNumber();
-            hasNext = true;
-          }
-          else
-          {
-            hasNext = false;
           }
         }
         catch(Exception e)
         {
           currentChange = null;
-          hasNext = false;
         }
       }
     }
-    return hasNext;
+    return currentChange != null;
   }
 
   /**
@@ -159,7 +150,7 @@
         cursor.close();
         cursor = null;
       }
-      this.dbh = null;
+      this.dbHandler = null;
       this.db = null;
     }
   }

--
Gitblit v1.10.0