mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-22 14:22:05 +01:00
Put the AccountManager in getInstance() in the map
thereby following the code guidelines.
This commit is contained in:
parent
0c0737942c
commit
7caf413637
1 changed files with 3 additions and 2 deletions
|
@ -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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue