mirror of https://github.com/apache/activemq.git
AMQ-9550 for loop can be replaced with enhanced for connection manager adapter
This commit is contained in:
parent
e45ee4aae5
commit
f4c5b9dfb3
|
@ -17,7 +17,6 @@
|
|||
package org.apache.activemq.ra;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
|
||||
import jakarta.resource.ResourceException;
|
||||
import jakarta.resource.spi.ConnectionEvent;
|
||||
|
@ -50,8 +49,7 @@ public class ConnectionManagerAdapter implements ConnectionManager, ConnectionEv
|
|||
* @param l
|
||||
*/
|
||||
public void addConnectionEventListener(ConnectionEventListener l) {
|
||||
for (Iterator<ManagedConnection> iter = connections.iterator(); iter.hasNext();) {
|
||||
ManagedConnection c = iter.next();
|
||||
for (ManagedConnection c : connections) {
|
||||
c.addConnectionEventListener(l);
|
||||
}
|
||||
listners.add(l);
|
||||
|
@ -66,8 +64,7 @@ public class ConnectionManagerAdapter implements ConnectionManager, ConnectionEv
|
|||
Subject subject = null;
|
||||
ManagedConnection connection = connectionFactory.createManagedConnection(subject, info);
|
||||
connection.addConnectionEventListener(this);
|
||||
for (Iterator<ConnectionEventListener> iter = listners.iterator(); iter.hasNext();) {
|
||||
ConnectionEventListener l = iter.next();
|
||||
for (ConnectionEventListener l : listners) {
|
||||
connection.addConnectionEventListener(l);
|
||||
}
|
||||
connections.add(connection);
|
||||
|
|
Loading…
Reference in New Issue