Skip to content

Commit a0fd551

Browse files
authored
Use synchronized lists in MockReporter (#1179)
attempt to fix #1178
1 parent 14267e9 commit a0fd551

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

apm-agent-core/src/test/java/co/elastic/apm/agent/MockReporter.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ public class MockReporter implements Reporter {
7878
// And for any case the disablement of the check cannot rely on subtype (eg Redis, where Jedis supports and Lettuce does not)
7979
private boolean disableDestinationAddressCheck;
8080

81-
private final List<Transaction> transactions = new ArrayList<>();
82-
private final List<Span> spans = new ArrayList<>();
83-
private final List<ErrorCapture> errors = new ArrayList<>();
81+
private final List<Transaction> transactions = Collections.synchronizedList(new ArrayList<>());
82+
private final List<Span> spans = Collections.synchronizedList(new ArrayList<>());
83+
private final List<ErrorCapture> errors = Collections.synchronizedList(new ArrayList<>());
8484
private final ObjectMapper objectMapper;
8585
private final boolean verifyJsonSchema;
8686
private boolean closed;

0 commit comments

Comments
 (0)