Commit d3d713d0 authored by Andy Wilkinson's avatar Andy Wilkinson

Merge branch '1.2.x'

parents 24ef2e50 5ed2a963
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
package org.springframework.boot.actuate.trace; package org.springframework.boot.actuate.trace;
import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.LinkedList; import java.util.LinkedList;
...@@ -26,6 +27,7 @@ import java.util.Map; ...@@ -26,6 +27,7 @@ import java.util.Map;
* In-memory implementation of {@link TraceRepository}. * In-memory implementation of {@link TraceRepository}.
* *
* @author Dave Syer * @author Dave Syer
* @author Olivier Bourgain
*/ */
public class InMemoryTraceRepository implements TraceRepository { public class InMemoryTraceRepository implements TraceRepository {
...@@ -40,20 +42,24 @@ public class InMemoryTraceRepository implements TraceRepository { ...@@ -40,20 +42,24 @@ public class InMemoryTraceRepository implements TraceRepository {
* @param reverse flag value (default true) * @param reverse flag value (default true)
*/ */
public void setReverse(boolean reverse) { public void setReverse(boolean reverse) {
this.reverse = reverse; synchronized (this.traces) {
this.reverse = reverse;
}
} }
/** /**
* @param capacity the capacity to set * @param capacity the capacity to set
*/ */
public void setCapacity(int capacity) { public void setCapacity(int capacity) {
this.capacity = capacity; synchronized (this.traces) {
this.capacity = capacity;
}
} }
@Override @Override
public List<Trace> findAll() { public List<Trace> findAll() {
synchronized (this.traces) { synchronized (this.traces) {
return Collections.unmodifiableList(this.traces); return Collections.unmodifiableList(new ArrayList<Trace>(this.traces));
} }
} }
......
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