1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-30 02:02:06 +01:00

Make getServiceNames() return List

instead of Collection. Return types should always be as specific as
possible. Because e.g. Collection does not allow 'get(0)', but List
does.
This commit is contained in:
Florian Schmaus 2014-10-12 16:52:49 +02:00
parent fe74fc23dc
commit 38582eed84
2 changed files with 3 additions and 3 deletions

View file

@ -261,7 +261,7 @@ public class MultiUserChat {
* @throws NoResponseException * @throws NoResponseException
* @throws NotConnectedException * @throws NotConnectedException
*/ */
public static Collection<String> getServiceNames(XMPPConnection connection) throws NoResponseException, XMPPErrorException, NotConnectedException { public static List<String> getServiceNames(XMPPConnection connection) throws NoResponseException, XMPPErrorException, NotConnectedException {
ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(connection); ServiceDiscoveryManager sdm = ServiceDiscoveryManager.getInstanceFor(connection);
return sdm.findServices(MUCInitialPresence.NAMESPACE, false, false); return sdm.findServices(MUCInitialPresence.NAMESPACE, false, false);
} }

View file

@ -23,7 +23,7 @@ import org.jivesoftware.smack.XMPPException.XMPPErrorException;
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager; import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
import org.jivesoftware.smackx.xdata.Form; import org.jivesoftware.smackx.xdata.Form;
import java.util.Collection; import java.util.List;
/** /**
* The UserSearchManager is a facade built upon Jabber Search Services (XEP-055) to allow for searching * The UserSearchManager is a facade built upon Jabber Search Services (XEP-055) to allow for searching
@ -95,7 +95,7 @@ public class UserSearchManager {
* @throws NoResponseException * @throws NoResponseException
* @throws NotConnectedException * @throws NotConnectedException
*/ */
public Collection<String> getSearchServices() throws NoResponseException, XMPPErrorException, NotConnectedException { public List<String> getSearchServices() throws NoResponseException, XMPPErrorException, NotConnectedException {
ServiceDiscoveryManager discoManager = ServiceDiscoveryManager.getInstanceFor(con); ServiceDiscoveryManager discoManager = ServiceDiscoveryManager.getInstanceFor(con);
return discoManager.findServices(UserSearch.NAMESPACE, false, false); return discoManager.findServices(UserSearch.NAMESPACE, false, false);
} }