Commit a9fca53c authored by Guus der Kinderen's avatar Guus der Kinderen

OF-1424: Use weakly consistent impl to prevent CME.

parent daf92ff2
...@@ -28,6 +28,7 @@ import java.util.HashSet; ...@@ -28,6 +28,7 @@ import java.util.HashSet;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ConcurrentSkipListSet;
import org.jivesoftware.openfire.XMPPServer; import org.jivesoftware.openfire.XMPPServer;
import org.jivesoftware.openfire.event.GroupEventDispatcher; import org.jivesoftware.openfire.event.GroupEventDispatcher;
...@@ -62,8 +63,8 @@ public class Group implements Cacheable, Externalizable { ...@@ -62,8 +63,8 @@ public class Group implements Cacheable, Externalizable {
private String name; private String name;
private String description; private String description;
private Set<JID> members; private ConcurrentSkipListSet<JID> members;
private Set<JID> administrators; private ConcurrentSkipListSet<JID> administrators;
/** /**
* Constructor added for Externalizable. Do not use this constructor. * Constructor added for Externalizable. Do not use this constructor.
...@@ -88,8 +89,8 @@ public class Group implements Cacheable, Externalizable { ...@@ -88,8 +89,8 @@ public class Group implements Cacheable, Externalizable {
this.provider = groupManager.getProvider(); this.provider = groupManager.getProvider();
this.name = name; this.name = name;
this.description = description; this.description = description;
this.members = new HashSet<>(members); this.members = new ConcurrentSkipListSet<>(members);
this.administrators = new HashSet<>(administrators); this.administrators = new ConcurrentSkipListSet<>(administrators);
} }
/** /**
...@@ -110,8 +111,8 @@ public class Group implements Cacheable, Externalizable { ...@@ -110,8 +111,8 @@ public class Group implements Cacheable, Externalizable {
this.provider = groupManager.getProvider(); this.provider = groupManager.getProvider();
this.name = name; this.name = name;
this.description = description; this.description = description;
this.members = new HashSet<>(members); this.members = new ConcurrentSkipListSet<>(members);
this.administrators = new HashSet<>(administrators); this.administrators = new ConcurrentSkipListSet<>(administrators);
this.properties = provider.loadProperties(this); this.properties = provider.loadProperties(this);
...@@ -502,8 +503,8 @@ public class Group implements Cacheable, Externalizable { ...@@ -502,8 +503,8 @@ public class Group implements Cacheable, Externalizable {
if (ExternalizableUtil.getInstance().readBoolean(in)) { if (ExternalizableUtil.getInstance().readBoolean(in)) {
description = ExternalizableUtil.getInstance().readSafeUTF(in); description = ExternalizableUtil.getInstance().readSafeUTF(in);
} }
members= new HashSet<>(); members= new ConcurrentSkipListSet<>();
administrators = new HashSet<>(); administrators = new ConcurrentSkipListSet<>();
ExternalizableUtil.getInstance().readSerializableCollection(in, members, getClass().getClassLoader()); ExternalizableUtil.getInstance().readSerializableCollection(in, members, getClass().getClassLoader());
ExternalizableUtil.getInstance().readSerializableCollection(in, administrators, getClass().getClassLoader()); ExternalizableUtil.getInstance().readSerializableCollection(in, administrators, getClass().getClassLoader());
} }
......
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