From 0c68d59adee29e21e7a720751530d2903192dedc Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Sat, 27 Dec 2014 13:38:41 +0100 Subject: [PATCH] Use ConcurrentHashMap instead of synchronizedMap in ChatManager. Also use diamond operator. --- .../src/main/java/org/jivesoftware/smack/ChatManager.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/ChatManager.java b/smack-core/src/main/java/org/jivesoftware/smack/ChatManager.java index 55b7d91a4..71bb7b8ad 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/ChatManager.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/ChatManager.java @@ -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 threadChats = Collections.synchronizedMap(new HashMap()); + private Map threadChats = new ConcurrentHashMap<>(); /** * Maps jids to chats */ - private Map jidChats = Collections.synchronizedMap(new HashMap()); + private Map jidChats = new ConcurrentHashMap<>(); /** * Maps base jids to chats */ - private Map baseJidChats = Collections.synchronizedMap(new HashMap()); + private Map baseJidChats = new ConcurrentHashMap<>(); private Set chatManagerListeners = new CopyOnWriteArraySet();