1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-26 14:02:06 +01:00

SDM: Follow guidelines, perform put() where get() is performed

This commit is contained in:
Florian Schmaus 2014-08-26 13:34:42 +02:00
parent 5d159c4be2
commit 6af5d5e462

View file

@ -117,8 +117,6 @@ public class ServiceDiscoveryManager extends Manager {
*/
private ServiceDiscoveryManager(XMPPConnection connection) {
super(connection);
// Register the new instance and associate it with the connection
instances.put(connection, this);
addFeature(DiscoverInfo.NAMESPACE);
addFeature(DiscoverItems.NAMESPACE);
@ -293,6 +291,8 @@ public class ServiceDiscoveryManager extends Manager {
ServiceDiscoveryManager sdm = instances.get(connection);
if (sdm == null) {
sdm = new ServiceDiscoveryManager(connection);
// Register the new instance and associate it with the connection
instances.put(connection, sdm);
}
return sdm;
}