Commit 388898d3 authored by Guillaume Surrel's avatar Guillaume Surrel
Browse files

Replace ClientMessages Vector and Enumeration with collection framework List and Iterator.

parent 9934b4f8
......@@ -749,11 +749,11 @@ public final class AdminTopicImpl extends TopicImpl implements AdminTopicImplMBe
if (not == null) return;
Enumeration messages = not.getMessages().elements();
Iterator messages = not.getMessages().iterator();
while (messages.hasMoreElements()) {
while (messages.hasNext()) {
nbMsgsReceiveSinceCreation = nbMsgsReceiveSinceCreation + 1;
msg = (Message) messages.nextElement();
msg = (Message) messages.next();
msgId = msg.id;
replyTo = AgentId.fromString(msg.replyToId);
request = null;
......
/*
* JORAM: Java(TM) Open Reliable Asynchronous Messaging
* Copyright (C) 2004 - 2009 ScalAgent Distributed Technologies
* Copyright (C) 2004 - 2010 ScalAgent Distributed Technologies
* Copyright (C) 2004 France Telecom R&D
*
* This library is free software; you can redistribute it and/or
......@@ -293,9 +293,8 @@ public class ClusterQueueImpl extends QueueImpl {
Message msg;
// Storing each received message:
for (Enumeration msgs = not.getMessages().elements();
msgs.hasMoreElements();) {
msg = new Message((org.objectweb.joram.shared.messages.Message) msgs.nextElement());
for (Iterator msgs = not.getMessages().iterator(); msgs.hasNext();) {
msg = new Message((org.objectweb.joram.shared.messages.Message) msgs.next());
msg.order = arrivalsCounter++;
storeMsgIdInTimeTable(msg.getIdentifier(),
new Long(date));
......@@ -604,10 +603,9 @@ public class ClusterQueueImpl extends QueueImpl {
ClientMessages cm = super.getClientMessages(nb, selector, remove);
if (cm != null) {
// set information in cluster
for (Enumeration e = cm.getMessages().elements();
e.hasMoreElements(); ) {
for (Iterator e = cm.getMessages().iterator(); e.hasNext();) {
org.objectweb.joram.shared.messages.Message message =
(org.objectweb.joram.shared.messages.Message) e.nextElement();
(org.objectweb.joram.shared.messages.Message) e.next();
monitoringMsgSendToCluster(message.id);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment