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 16
16
17
17
package org .springframework .boot .actuate .trace ;
18
18
19
+ import java .util .ArrayList ;
19
20
import java .util .Collections ;
20
21
import java .util .Date ;
21
22
import java .util .LinkedList ;
26
27
* In-memory implementation of {@link TraceRepository}.
27
28
*
28
29
* @author Dave Syer
30
+ * @author Olivier Bourgain
29
31
*/
30
32
public class InMemoryTraceRepository implements TraceRepository {
31
33
@@ -40,20 +42,24 @@ public class InMemoryTraceRepository implements TraceRepository {
40
42
* @param reverse flag value (default true)
41
43
*/
42
44
public void setReverse (boolean reverse ) {
43
- this .reverse = reverse ;
45
+ synchronized (this .traces ) {
46
+ this .reverse = reverse ;
47
+ }
44
48
}
45
49
46
50
/**
47
51
* @param capacity the capacity to set
48
52
*/
49
53
public void setCapacity (int capacity ) {
50
- this .capacity = capacity ;
54
+ synchronized (this .traces ) {
55
+ this .capacity = capacity ;
56
+ }
51
57
}
52
58
53
59
@ Override
54
60
public List <Trace > findAll () {
55
61
synchronized (this .traces ) {
56
- return Collections .unmodifiableList (this .traces );
62
+ return Collections .unmodifiableList (new ArrayList < Trace >( this .traces ) );
57
63
}
58
64
}
59
65
You can’t perform that action at this time.
0 commit comments