File tree 1 file changed +8
-6
lines changed
spring-jms/src/main/java/org/springframework/jms/connection
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2015 the original author or authors.
2
+ * Copyright 2002-2017 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -666,12 +666,14 @@ private class AggregatedExceptionListener implements ExceptionListener {
666
666
667
667
@ Override
668
668
public void onException (JMSException ex ) {
669
+ // Iterate over temporary copy in order to avoid ConcurrentModificationException,
670
+ // since listener invocations may in turn trigger registration of listeners...
671
+ Set <ExceptionListener > copy ;
669
672
synchronized (connectionMonitor ) {
670
- // Iterate over temporary copy in order to avoid ConcurrentModificationException,
671
- // since listener invocations may in turn trigger registration of listeners...
672
- for (ExceptionListener listener : new LinkedHashSet <ExceptionListener >(this .delegates )) {
673
- listener .onException (ex );
674
- }
673
+ copy = new LinkedHashSet <ExceptionListener >(this .delegates );
674
+ }
675
+ for (ExceptionListener listener : copy ) {
676
+ listener .onException (ex );
675
677
}
676
678
}
677
679
}
You can’t perform that action at this time.
0 commit comments