Skip to content

Commit

Permalink
JAMES-2695 EventCollector has to be thread-safe
Browse files Browse the repository at this point in the history
  • Loading branch information
mbaechler committed Mar 20, 2019
1 parent f51503b commit 284e833
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -19,8 +19,8 @@

package org.apache.james.mailbox.util;

import java.util.ArrayList;
import java.util.List;
import java.util.Collection;
import java.util.concurrent.ConcurrentLinkedDeque;

import org.apache.james.mailbox.events.Event;
import org.apache.james.mailbox.events.Group;
Expand All @@ -31,14 +31,14 @@ public static class EventCollectorGroup extends Group {}

private static final Group GROUP = new EventCollectorGroup();

private final List<Event> events = new ArrayList<>();
private final ConcurrentLinkedDeque<Event> events = new ConcurrentLinkedDeque<>();

@Override
public Group getDefaultGroup() {
return GROUP;
}

public List<Event> getEvents() {
public Collection<Event> getEvents() {
return events;
}

Expand Down

0 comments on commit 284e833

Please sign in to comment.