mirror of https://github.com/apache/activemq.git
Merge pull request #1260 from levrun/enhanced_for_loop_transport_connection
for loop can be replaced with enhanced for
This commit is contained in:
commit
95af27c512
|
@ -1214,8 +1214,7 @@ public class TransportConnection implements Connection, Task, CommandVisitor {
|
|||
// Run the MessageDispatch callbacks so that message references get
|
||||
// cleaned up.
|
||||
synchronized (dispatchQueue) {
|
||||
for (Iterator<Command> iter = dispatchQueue.iterator(); iter.hasNext(); ) {
|
||||
Command command = iter.next();
|
||||
for (Command command : dispatchQueue) {
|
||||
if (command.isMessageDispatch()) {
|
||||
MessageDispatch md = (MessageDispatch) command;
|
||||
TransmitCallback sub = md.getTransmitCallback();
|
||||
|
@ -1421,8 +1420,7 @@ public class TransportConnection implements Connection, Task, CommandVisitor {
|
|||
String duplexNetworkConnectorId = config.getName() + "@" + info.getBrokerId();
|
||||
CopyOnWriteArrayList<TransportConnection> connections = this.connector.getConnections();
|
||||
synchronized (connections) {
|
||||
for (Iterator<TransportConnection> iter = connections.iterator(); iter.hasNext(); ) {
|
||||
TransportConnection c = iter.next();
|
||||
for (TransportConnection c : connections) {
|
||||
if ((c != this) && (duplexNetworkConnectorId.equals(c.getDuplexNetworkConnectorId()))) {
|
||||
LOG.warn("Stopping an existing active duplex connection [{}] for network connector ({}).", c, duplexNetworkConnectorId);
|
||||
c.stopAsync();
|
||||
|
|
Loading…
Reference in New Issue