mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 22:32: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:
parent
fe74fc23dc
commit
38582eed84
2 changed files with 3 additions and 3 deletions
|
@ -261,7 +261,7 @@ public class MultiUserChat {
|
|||
* @throws NoResponseException
|
||||
* @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);
|
||||
return sdm.findServices(MUCInitialPresence.NAMESPACE, false, false);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ import org.jivesoftware.smack.XMPPException.XMPPErrorException;
|
|||
import org.jivesoftware.smackx.disco.ServiceDiscoveryManager;
|
||||
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
|
||||
|
@ -95,7 +95,7 @@ public class UserSearchManager {
|
|||
* @throws NoResponseException
|
||||
* @throws NotConnectedException
|
||||
*/
|
||||
public Collection<String> getSearchServices() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
public List<String> getSearchServices() throws NoResponseException, XMPPErrorException, NotConnectedException {
|
||||
ServiceDiscoveryManager discoManager = ServiceDiscoveryManager.getInstanceFor(con);
|
||||
return discoManager.findServices(UserSearch.NAMESPACE, false, false);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue