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

Fabio Pistolesi
02.09.2015 24d7644bb126bc3d798b49208d74a22e86d13f49
opendj-server-legacy/src/main/java/org/opends/server/replication/server/changelog/file/LogFile.java
@@ -80,6 +80,8 @@
  /** Indicates if log is enabled for write. */
  private final boolean isWriteEnabled;
  private Record<K, V> newestRecord;
  /**
   * Creates a new log file.
   *
@@ -243,6 +245,7 @@
  {
    checkLogIsEnabledForWrite();
    writer.write(record);
    newestRecord = record;
  }
  /**
@@ -366,22 +369,11 @@
   */
  Record<K, V> getNewestRecord() throws ChangelogException
  {
    // TODO : need a more efficient way to retrieve it
    DBCursor<Record<K, V>> cursor = null;
    try
    if (newestRecord == null)
    {
      cursor = getCursor();
      Record<K, V> record = null;
      while (cursor.next())
      {
        record = cursor.getRecord();
      }
      return record;
      newestRecord = getReader().getNewestRecord();
    }
    finally
    {
      StaticUtils.close(cursor);
    }
    return newestRecord;
  }
  /**