Commit b4f5b173 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gaston

Fixed concurrency problem. JM-284


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1320 b35dd754-fafc-0310-a699-88a17e54d16e
parent 03e5d07a
......@@ -18,6 +18,7 @@ import org.jivesoftware.messenger.roster.Roster;
import org.jivesoftware.messenger.roster.RosterItem;
import org.jivesoftware.messenger.roster.RosterManager;
import org.jivesoftware.messenger.user.UserNotFoundException;
import org.jivesoftware.util.ConcurrentHashSet;
import org.jivesoftware.util.LocaleUtils;
import org.jivesoftware.util.Log;
import org.xmpp.packet.*;
......@@ -339,7 +340,7 @@ public class PresenceUpdateHandler extends BasicModule implements ChannelHandler
// ensures that if the user sends several presences to the same handler
// we will have only one entry in the Map
map = new WeakHashMap<ChannelHandler, Set<String>>();
map.put(handler, new HashSet<String>());
map.put(handler, new ConcurrentHashSet<String>());
directedPresences.put(update.getFrom().toString(), map);
}
if (Presence.Type.unavailable.equals(update.getType())) {
......@@ -366,7 +367,7 @@ public class PresenceUpdateHandler extends BasicModule implements ChannelHandler
// presence sent by the user. This handler will be used to send
// the unavailable presence when the user goes offline
if (map.get(handler) == null) {
map.put(handler, new HashSet<String>());
map.put(handler, new ConcurrentHashSet<String>());
}
map.get(handler).add(jid);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment