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
|
// Run the MessageDispatch callbacks so that message references get
|
||||||
// cleaned up.
|
// cleaned up.
|
||||||
synchronized (dispatchQueue) {
|
synchronized (dispatchQueue) {
|
||||||
for (Iterator<Command> iter = dispatchQueue.iterator(); iter.hasNext(); ) {
|
for (Command command : dispatchQueue) {
|
||||||
Command command = iter.next();
|
|
||||||
if (command.isMessageDispatch()) {
|
if (command.isMessageDispatch()) {
|
||||||
MessageDispatch md = (MessageDispatch) command;
|
MessageDispatch md = (MessageDispatch) command;
|
||||||
TransmitCallback sub = md.getTransmitCallback();
|
TransmitCallback sub = md.getTransmitCallback();
|
||||||
|
@ -1421,8 +1420,7 @@ public class TransportConnection implements Connection, Task, CommandVisitor {
|
||||||
String duplexNetworkConnectorId = config.getName() + "@" + info.getBrokerId();
|
String duplexNetworkConnectorId = config.getName() + "@" + info.getBrokerId();
|
||||||
CopyOnWriteArrayList<TransportConnection> connections = this.connector.getConnections();
|
CopyOnWriteArrayList<TransportConnection> connections = this.connector.getConnections();
|
||||||
synchronized (connections) {
|
synchronized (connections) {
|
||||||
for (Iterator<TransportConnection> iter = connections.iterator(); iter.hasNext(); ) {
|
for (TransportConnection c : connections) {
|
||||||
TransportConnection c = iter.next();
|
|
||||||
if ((c != this) && (duplexNetworkConnectorId.equals(c.getDuplexNetworkConnectorId()))) {
|
if ((c != this) && (duplexNetworkConnectorId.equals(c.getDuplexNetworkConnectorId()))) {
|
||||||
LOG.warn("Stopping an existing active duplex connection [{}] for network connector ({}).", c, duplexNetworkConnectorId);
|
LOG.warn("Stopping an existing active duplex connection [{}] for network connector ({}).", c, duplexNetworkConnectorId);
|
||||||
c.stopAsync();
|
c.stopAsync();
|
||||||
|
|
Loading…
Reference in New Issue