diff --git a/core/src/main/java/org/jivesoftware/smack/Roster.java b/core/src/main/java/org/jivesoftware/smack/Roster.java index 03b72c992..3a189013f 100644 --- a/core/src/main/java/org/jivesoftware/smack/Roster.java +++ b/core/src/main/java/org/jivesoftware/smack/Roster.java @@ -576,18 +576,18 @@ public class Roster { } /** - * Returns an iterator (of Presence objects) for all of a user's current presences + * Returns a List of Presence objects for all of a user's current presences * or an unavailable presence if the user is unavailable (offline) or if no presence * information is available, such as when you are not subscribed to the user's presence * updates. * * @param user a XMPP ID, e.g. jdoe@example.com. - * @return an Collection (of Presence objects) for all the user's current presences, + * @return a List of Presence objects for all the user's current presences, * or an unavailable presence if the user is offline or if no presence information * is available. */ - public Collection getPresences(String user) { - Collection res; + public List getPresences(String user) { + List res; String key = getPresenceMapKey(user); Map userPresences = presenceMap.get(key); if (userPresences == null) { @@ -596,7 +596,7 @@ public class Roster { res = Arrays.asList(presence); } else { - Collection answer = new ArrayList(); + List answer = new ArrayList(); for (Presence presence : userPresences.values()) { if (presence.isAvailable()) { answer.add(presence); @@ -611,7 +611,7 @@ public class Roster { res = Arrays.asList(presence); } } - return Collections.unmodifiableCollection(res); + return Collections.unmodifiableList(res); } /** diff --git a/extensions/src/main/java/org/jivesoftware/smackx/muc/packet/MUCAdmin.java b/extensions/src/main/java/org/jivesoftware/smackx/muc/packet/MUCAdmin.java index bf6c0459a..774cebf5c 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/muc/packet/MUCAdmin.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/muc/packet/MUCAdmin.java @@ -17,7 +17,6 @@ package org.jivesoftware.smackx.muc.packet; import java.util.ArrayList; -import java.util.Collection; import java.util.Collections; import java.util.List; @@ -36,13 +35,13 @@ public class MUCAdmin extends IQ { private List items = new ArrayList(); /** - * Returns a Collection of item childs that holds information about roles, affiliation, + * Returns a List of item childs that holds information about roles, affiliation, * jids and nicks. * - * @return a Collection of item childs that holds information about roles, affiliation, + * @return a List of item childs that holds information about roles, affiliation, * jids and nicks. */ - public Collection getItems() { + public List getItems() { synchronized (items) { return Collections.unmodifiableList(new ArrayList(items)); } diff --git a/extensions/src/main/java/org/jivesoftware/smackx/muc/packet/MUCOwner.java b/extensions/src/main/java/org/jivesoftware/smackx/muc/packet/MUCOwner.java index ceb14df58..1b135021a 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/muc/packet/MUCOwner.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/muc/packet/MUCOwner.java @@ -19,7 +19,6 @@ package org.jivesoftware.smackx.muc.packet; import org.jivesoftware.smack.packet.IQ; import java.util.ArrayList; -import java.util.Collection; import java.util.Collections; import java.util.List; @@ -36,13 +35,13 @@ public class MUCOwner extends IQ { private Destroy destroy; /** - * Returns a Collection of item childs that holds information about affiliation, + * Returns a List of item childs that holds information about affiliation, * jids and nicks. * - * @return a Collection of item childs that holds information about affiliation, + * @return a List of item childs that holds information about affiliation, * jids and nicks. */ - public Collection getItems() { + public List getItems() { synchronized (items) { return Collections.unmodifiableList(new ArrayList(items)); } diff --git a/extensions/src/main/java/org/jivesoftware/smackx/offline/packet/OfflineMessageRequest.java b/extensions/src/main/java/org/jivesoftware/smackx/offline/packet/OfflineMessageRequest.java index 3cf1fca67..75a15230d 100644 --- a/extensions/src/main/java/org/jivesoftware/smackx/offline/packet/OfflineMessageRequest.java +++ b/extensions/src/main/java/org/jivesoftware/smackx/offline/packet/OfflineMessageRequest.java @@ -22,7 +22,6 @@ import org.jivesoftware.smack.provider.IQProvider; import org.xmlpull.v1.XmlPullParser; import java.util.ArrayList; -import java.util.Collection; import java.util.Collections; import java.util.List; @@ -39,13 +38,13 @@ public class OfflineMessageRequest extends IQ { private boolean fetch = false; /** - * Returns a Collection of item childs that holds information about offline messages to + * Returns a List of item childs that holds information about offline messages to * view or delete. * - * @return a Collection of item childs that holds information about offline messages to + * @return a List of item childs that holds information about offline messages to * view or delete. */ - public Collection getItems() { + public List getItems() { synchronized (items) { return Collections.unmodifiableList(new ArrayList(items)); }