File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/trace Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1616
1717package org .springframework .boot .actuate .trace ;
1818
19+ import java .util .ArrayList ;
1920import java .util .Collections ;
2021import java .util .Date ;
2122import java .util .LinkedList ;
2627 * In-memory implementation of {@link TraceRepository}.
2728 *
2829 * @author Dave Syer
30+ * @author Olivier Bourgain
2931 */
3032public class InMemoryTraceRepository implements TraceRepository {
3133
@@ -40,20 +42,24 @@ public class InMemoryTraceRepository implements TraceRepository {
4042 * @param reverse flag value (default true)
4143 */
4244 public void setReverse (boolean reverse ) {
43- this .reverse = reverse ;
45+ synchronized (this .traces ) {
46+ this .reverse = reverse ;
47+ }
4448 }
4549
4650 /**
4751 * @param capacity the capacity to set
4852 */
4953 public void setCapacity (int capacity ) {
50- this .capacity = capacity ;
54+ synchronized (this .traces ) {
55+ this .capacity = capacity ;
56+ }
5157 }
5258
5359 @ Override
5460 public List <Trace > findAll () {
5561 synchronized (this .traces ) {
56- return Collections .unmodifiableList (this .traces );
62+ return Collections .unmodifiableList (new ArrayList < Trace >( this .traces ) );
5763 }
5864 }
5965
You can’t perform that action at this time.
0 commit comments