File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
spring-jms/src/main/java/org/springframework/jms/connection Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -706,12 +706,14 @@ private class AggregatedExceptionListener implements ExceptionListener {
706
706
707
707
@ Override
708
708
public void onException (JMSException ex ) {
709
+ // Iterate over temporary copy in order to avoid ConcurrentModificationException,
710
+ // since listener invocations may in turn trigger registration of listeners...
711
+ Set <ExceptionListener > copy ;
709
712
synchronized (connectionMonitor ) {
710
- // Iterate over temporary copy in order to avoid ConcurrentModificationException,
711
- // since listener invocations may in turn trigger registration of listeners...
712
- for (ExceptionListener listener : new LinkedHashSet <>(this .delegates )) {
713
- listener .onException (ex );
714
- }
713
+ copy = new LinkedHashSet <>(this .delegates );
714
+ }
715
+ for (ExceptionListener listener : copy ) {
716
+ listener .onException (ex );
715
717
}
716
718
}
717
719
}
You can’t perform that action at this time.
0 commit comments