Browse Source

Make event handling in ClassPathFileSystemWatcherTests thread-safe

See gh-30844
pull/30878/head
dugenkui03 4 years ago committed by Andy Wilkinson
parent
commit
aeaad006cd
  1. 3
      spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathFileSystemWatcherTests.java

3
spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/classpath/ClassPathFileSystemWatcherTests.java

@ -23,6 +23,7 @@ import java.util.ArrayList; @@ -23,6 +23,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CopyOnWriteArrayList;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
@ -116,7 +117,7 @@ class ClassPathFileSystemWatcherTests { @@ -116,7 +117,7 @@ class ClassPathFileSystemWatcherTests {
static class Listener implements ApplicationListener<ClassPathChangedEvent> {
private List<ClassPathChangedEvent> events = new ArrayList<>();
private List<ClassPathChangedEvent> events = new CopyOnWriteArrayList<>();
@Override
public void onApplicationEvent(ClassPathChangedEvent event) {

Loading…
Cancel
Save