Commit 5c6537c2 authored by Andy Wilkinson's avatar Andy Wilkinson

Consistently synchronize on this.monitor in InMemoryAuditEventRepository

See gh-6261
parent 00a56cdf
...@@ -82,7 +82,7 @@ public class InMemoryAuditEventRepository implements AuditEventRepository { ...@@ -82,7 +82,7 @@ public class InMemoryAuditEventRepository implements AuditEventRepository {
@Override @Override
public List<AuditEvent> find(String principal, Date after, String type) { public List<AuditEvent> find(String principal, Date after, String type) {
LinkedList<AuditEvent> events = new LinkedList<AuditEvent>(); LinkedList<AuditEvent> events = new LinkedList<AuditEvent>();
synchronized (this.events) { synchronized (this.monitor) {
for (int i = 0; i < this.events.length; i++) { for (int i = 0; i < this.events.length; i++) {
AuditEvent event = resolveTailEvent(i); AuditEvent event = resolveTailEvent(i);
if (event != null && isMatch(principal, after, type, event)) { if (event != null && isMatch(principal, after, type, event)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment