File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
spring-jms/src/main/java/org/springframework/jms/connection Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2015 the original author or authors.
2+ * Copyright 2002-2017 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -666,12 +666,14 @@ private class AggregatedExceptionListener implements ExceptionListener {
666666
667667 @ Override
668668 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 ;
669672 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 );
675677 }
676678 }
677679 }
You can’t perform that action at this time.
0 commit comments