1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-26 08:12:05 +01:00

Put the AccountManager in getInstance() in the map

thereby following the code guidelines.
This commit is contained in:
Florian Schmaus 2014-08-11 21:08:02 +02:00
parent 0c0737942c
commit 7caf413637

View file

@ -46,8 +46,10 @@ public class AccountManager extends Manager {
*/ */
public static synchronized AccountManager getInstance(XMPPConnection connection) { public static synchronized AccountManager getInstance(XMPPConnection connection) {
AccountManager accountManager = INSTANCES.get(connection); AccountManager accountManager = INSTANCES.get(connection);
if (accountManager == null) if (accountManager == null) {
accountManager = new AccountManager(connection); accountManager = new AccountManager(connection);
INSTANCES.put(connection, accountManager);
}
return accountManager; return accountManager;
} }
@ -68,7 +70,6 @@ public class AccountManager extends Manager {
*/ */
private AccountManager(XMPPConnection connection) { private AccountManager(XMPPConnection connection) {
super(connection); super(connection);
INSTANCES.put(connection, this);
} }
/** /**