DelegatingApplicationListener uses CopyOnWriteArrayList
Fixes gh-4416
This commit is contained in:
parent
8fd0ba3bc4
commit
38a8189a62
|
@ -20,8 +20,8 @@ import org.springframework.context.ApplicationListener;
|
|||
import org.springframework.context.event.SmartApplicationListener;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
/**
|
||||
* Used for delegating to a number of SmartApplicationListener instances. This is useful
|
||||
|
@ -32,7 +32,7 @@ import java.util.List;
|
|||
*/
|
||||
public final class DelegatingApplicationListener implements
|
||||
ApplicationListener<ApplicationEvent> {
|
||||
private List<SmartApplicationListener> listeners = new ArrayList<SmartApplicationListener>();
|
||||
private List<SmartApplicationListener> listeners = new CopyOnWriteArrayList<>();
|
||||
|
||||
public void onApplicationEvent(ApplicationEvent event) {
|
||||
if (event == null) {
|
||||
|
|
Loading…
Reference in New Issue