Commit 00828f8b authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Modified methods that were receiveing an Iterator to receive a Collection


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@494 b35dd754-fafc-0310-a699-88a17e54d16e
parent 13a50a5d
...@@ -147,10 +147,8 @@ public class IQOwnerHandler { ...@@ -147,10 +147,8 @@ public class IQOwnerHandler {
if ("owner".equals(affiliation)) { if ("owner".equals(affiliation)) {
// The client is requesting the list of owners // The client is requesting the list of owners
MetaDataFragment ownerMetaData; MetaDataFragment ownerMetaData;
String jid;
MUCRole role; MUCRole role;
for (Iterator<String> owners = room.getOwners(); owners.hasNext();) { for (String jid : room.getOwners()) {
jid = owners.next();
ownerMetaData = ownerMetaData =
new MetaDataFragment("http://jabber.org/protocol/muc#owner", new MetaDataFragment("http://jabber.org/protocol/muc#owner",
"item"); "item");
...@@ -175,10 +173,8 @@ public class IQOwnerHandler { ...@@ -175,10 +173,8 @@ public class IQOwnerHandler {
else if ("admin".equals(affiliation)) { else if ("admin".equals(affiliation)) {
// The client is requesting the list of admins // The client is requesting the list of admins
MetaDataFragment adminMetaData; MetaDataFragment adminMetaData;
String jid;
MUCRole role; MUCRole role;
for (Iterator<String> admins = room.getAdmins(); admins.hasNext();) { for (String jid : room.getAdmins()) {
jid = admins.next();
adminMetaData = adminMetaData =
new MetaDataFragment("http://jabber.org/protocol/muc#owner", new MetaDataFragment("http://jabber.org/protocol/muc#owner",
"item"); "item");
...@@ -343,7 +339,7 @@ public class IQOwnerHandler { ...@@ -343,7 +339,7 @@ public class IQOwnerHandler {
throws ForbiddenException, ConflictException { throws ForbiddenException, ConflictException {
Iterator<String> values; Iterator<String> values;
String booleanValue; String booleanValue;
List list; List<String> list;
FormField field; FormField field;
// Get the new list of admins // Get the new list of admins
...@@ -404,7 +400,7 @@ public class IQOwnerHandler { ...@@ -404,7 +400,7 @@ public class IQOwnerHandler {
field = completedForm.getField("muc#roomconfig_presencebroadcast"); field = completedForm.getField("muc#roomconfig_presencebroadcast");
if (field != null) { if (field != null) {
values = field.getValues(); values = field.getValues();
list = new ArrayList(); list = new ArrayList<String>();
while (values.hasNext()) { while (values.hasNext()) {
list.add(values.next()); list.add(values.next());
} }
...@@ -556,8 +552,8 @@ public class IQOwnerHandler { ...@@ -556,8 +552,8 @@ public class IQOwnerHandler {
field = configurationForm.getField("muc#roomconfig_presencebroadcast"); field = configurationForm.getField("muc#roomconfig_presencebroadcast");
field.clearValues(); field.clearValues();
for (Iterator it = room.getRolesToBroadcastPresence(); it.hasNext();) { for (String roleToBroadcast : room.getRolesToBroadcastPresence()) {
field.addValue((String)it.next()); field.addValue(roleToBroadcast);
} }
field = configurationForm.getField("muc#roomconfig_publicroom"); field = configurationForm.getField("muc#roomconfig_publicroom");
...@@ -598,14 +594,14 @@ public class IQOwnerHandler { ...@@ -598,14 +594,14 @@ public class IQOwnerHandler {
field = configurationForm.getField("muc#roomconfig_roomadmins"); field = configurationForm.getField("muc#roomconfig_roomadmins");
field.clearValues(); field.clearValues();
for (Iterator<String> it = room.getAdmins(); it.hasNext();) { for (String jid : room.getAdmins()) {
field.addValue(it.next()); field.addValue(jid);
} }
field = configurationForm.getField("muc#roomconfig_roomowners"); field = configurationForm.getField("muc#roomconfig_roomowners");
field.clearValues(); field.clearValues();
for (Iterator<String> it = room.getOwners(); it.hasNext();) { for (String jid : room.getOwners()) {
field.addValue(it.next()); field.addValue(jid);
} }
} }
finally { finally {
......
Markdown is supported
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