mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
13.59.2013 9f3e7037211c0f9828cade20b7ebcd0f9ad7b677
ReplicationIterator.java:
In next(), removed useless local variable.
Renamed instance field from dbh to dbHandler.
1 files modified
21 ■■■■ changed files
opends/src/server/org/opends/server/replication/server/ReplicationIterator.java 21 ●●●● patch | view | raw | blame | history
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;
    }
  }