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
1 changed files with 3 additions and 2 deletions

View File

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