Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMQ-9550 for loop can be replaced with enhanced for connection manager adapter #1282

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -66,8 +64,7 @@ public Object allocateConnection(ManagedConnectionFactory connectionFactory, Con
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);
Expand Down