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

Jean-Noel Rouvignac
14.03.2013 431ed6f0fce445f7375af1d154461674627deedf
opends/src/server/org/opends/server/replication/server/changelog/je/CompositeDBCursor.java
@@ -79,15 +79,18 @@
  @Override
  public boolean next() throws ChangelogException
  {
    // try to recycle empty cursors in case the underlying ReplicaDBs received
    // new changes. Copy the List to avoid ConcurrentModificationExceptions.
    DBCursor<UpdateMsg>[] copy =
        exhaustedCursors.toArray(new DBCursor[exhaustedCursors.size()]);
    exhaustedCursors.clear();
    for (DBCursor<UpdateMsg> cursor : copy)
    if (!exhaustedCursors.isEmpty())
    {
      cursor.next();
      add(cursor);
      // try to recycle empty cursors in case the underlying ReplicaDBs received
      // new changes. Copy the List to avoid ConcurrentModificationExceptions.
      final DBCursor<UpdateMsg>[] copy =
          exhaustedCursors.toArray(new DBCursor[exhaustedCursors.size()]);
      exhaustedCursors.clear();
      for (DBCursor<UpdateMsg> cursor : copy)
      {
        cursor.next();
        add(cursor);
      }
    }
    if (cursors.isEmpty())