mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-12-22 20:47:57 +01:00
Use ConcurrentHashMap instead of synchronizedMap
in ChatManager. Also use diamond operator.
This commit is contained in:
parent
56bf54eab5
commit
0c68d59ade
1 changed files with 4 additions and 4 deletions
|
@ -18,11 +18,11 @@
|
|||
package org.jivesoftware.smack;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.WeakHashMap;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.CopyOnWriteArraySet;
|
||||
|
||||
import org.jivesoftware.smack.SmackException.NotConnectedException;
|
||||
|
@ -114,17 +114,17 @@ public class ChatManager extends Manager{
|
|||
/**
|
||||
* Maps thread ID to chat.
|
||||
*/
|
||||
private Map<String, Chat> threadChats = Collections.synchronizedMap(new HashMap<String, Chat>());
|
||||
private Map<String, Chat> threadChats = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* Maps jids to chats
|
||||
*/
|
||||
private Map<String, Chat> jidChats = Collections.synchronizedMap(new HashMap<String, Chat>());
|
||||
private Map<String, Chat> jidChats = new ConcurrentHashMap<>();
|
||||
|
||||
/**
|
||||
* Maps base jids to chats
|
||||
*/
|
||||
private Map<String, Chat> baseJidChats = Collections.synchronizedMap(new HashMap<String, Chat>());
|
||||
private Map<String, Chat> baseJidChats = new ConcurrentHashMap<>();
|
||||
|
||||
private Set<ChatManagerListener> chatManagerListeners
|
||||
= new CopyOnWriteArraySet<ChatManagerListener>();
|
||||
|
|
Loading…
Reference in a new issue