File tree 1 file changed +4
-2
lines changed
spring-jms/src/main/java/org/springframework/jms/connection 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2014 the original author or authors.
2
+ * Copyright 2002-2015 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.
@@ -667,7 +667,9 @@ private class AggregatedExceptionListener implements ExceptionListener {
667
667
@ Override
668
668
public void onException (JMSException ex ) {
669
669
synchronized (connectionMonitor ) {
670
- for (ExceptionListener listener : this .delegates ) {
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 )) {
671
673
listener .onException (ex );
672
674
}
673
675
}
You can’t perform that action at this time.
0 commit comments