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

davidely
20.49.2007 d222583a4c71585b8c207e0f59441400c6ef37b4
opends/tests/unit-tests-testng/src/server/org/opends/server/TestAccessLogger.java
@@ -31,6 +31,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Iterator;
import java.util.ArrayList;
import org.opends.server.api.AccessLogger;
import org.opends.server.api.ClientConnection;
@@ -110,16 +111,18 @@
  /**
   * Retrieves the set of messages logged to this access logger since the last
   * time it was cleared.  The caller must not attempt to alter the list in any
   * way.
   * Retrieves a copy of the set of messages logged to this error logger since
   * the last time it was cleared.  A copy of the list is returned to avoid
   * a ConcurrentModificationException.
   *
   * @return  The set of messages logged to this access logger since the last
   * @return  The set of messages logged to this error logger since the last
   *          time it was cleared.
   */
  public static List<String> getMessages()
  {
    return SINGLETON.messageList;
    synchronized (SINGLETON) {
      return new ArrayList<String>(SINGLETON.messageList);
    }
  }
@@ -129,7 +132,9 @@
   */
  public static void clear()
  {
    SINGLETON.messageList.clear();
    synchronized (SINGLETON) {
      SINGLETON.messageList.clear();
    }
  }