Remove ServiceDiscoveryManager.getFeaturesList()

The method was redundant, getFeatures() did already return a copy of the
features. There is also no need to make it an unmodifiable List.
This commit is contained in:
Florian Schmaus 2014-11-01 13:16:22 +01:00
parent ed313c9629
commit fadef7d1bf
2 changed files with 5 additions and 13 deletions

View File

@ -478,7 +478,7 @@ public class EntityCapsManager extends Manager {
final List<Identity> identities = new LinkedList<Identity>(ServiceDiscoveryManager.getInstanceFor(connection).getIdentities());
sdm.setNodeInformationProvider(entityNode + '#' + currentCapsVersion, new AbstractNodeInformationProvider() {
List<String> features = sdm.getFeaturesList();
List<String> features = sdm.getFeatures();
List<PacketExtension> packetExtensions = sdm.getExtendedInfoAsList();
@Override
public List<String> getNodeFeatures() {

View File

@ -357,23 +357,15 @@ public class ServiceDiscoveryManager extends Manager {
/**
* Returns the supported features by this XMPP entity.
* <p>
* The result is a copied modifiable list of the original features.
* </p>
*
* @return a List of the supported features by this XMPP entity.
*/
public List<String> getFeatures() {
synchronized (features) {
return Collections.unmodifiableList(new ArrayList<String>(features));
}
}
/**
* Returns the supported features by this XMPP entity.
*
* @return a copy of the List on the supported features by this XMPP entity.
*/
public List<String> getFeaturesList() {
synchronized (features) {
return new LinkedList<String>(features);
return new ArrayList<String>(features);
}
}