mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-22 12:02:14 +00:00
DelegatingApplicationListener uses CopyOnWriteArrayList
Fixes: gh-4979
This commit is contained in:
parent
a898415c65
commit
976ce05373
@ -20,8 +20,8 @@ import org.springframework.context.ApplicationListener;
|
|||||||
import org.springframework.context.event.SmartApplicationListener;
|
import org.springframework.context.event.SmartApplicationListener;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used for delegating to a number of SmartApplicationListener instances. This is useful
|
* 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
|
public final class DelegatingApplicationListener implements
|
||||||
ApplicationListener<ApplicationEvent> {
|
ApplicationListener<ApplicationEvent> {
|
||||||
private List<SmartApplicationListener> listeners = new ArrayList<SmartApplicationListener>();
|
private List<SmartApplicationListener> listeners = new CopyOnWriteArrayList<SmartApplicationListener>();
|
||||||
|
|
||||||
public void onApplicationEvent(ApplicationEvent event) {
|
public void onApplicationEvent(ApplicationEvent event) {
|
||||||
if (event == null) {
|
if (event == null) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user