Loop over new list to avoid ConcurrentModificationException in case a new hook is added while looping (#3233)
Co-authored-by: juan.marchionatto <juan.marchionatto@smilecdr.com>
This commit is contained in:
parent
4075c003f7
commit
d6e543a478
|
@ -291,7 +291,8 @@ public abstract class BaseInterceptorService<POINTCUT extends IPointcut> impleme
|
||||||
}
|
}
|
||||||
|
|
||||||
private Object doCallHooks(POINTCUT thePointcut, HookParams theParams, Object theRetVal) {
|
private Object doCallHooks(POINTCUT thePointcut, HookParams theParams, Object theRetVal) {
|
||||||
List<BaseInvoker> invokers = getInvokersForPointcut(thePointcut);
|
// use new list for loop to avoid ConcurrentModificationException in case invoker gets added while looping
|
||||||
|
List<BaseInvoker> invokers = new ArrayList<>(getInvokersForPointcut(thePointcut));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Call each hook in order
|
* Call each hook in order
|
||||||
|
|
Loading…
Reference in New Issue