Skip to content
Snippets Groups Projects
Commit a4c0ab63 authored by Michael Hamann's avatar Michael Hamann
Browse files

XWIKI-21119: ConcurrentModificationException in Right

* Use CopyOnWriteArrayList for VALUES (writes to this list are rare).
parent a7730dc3
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.EqualsBuilder;
import org.xwiki.model.EntityType; import org.xwiki.model.EntityType;
...@@ -101,7 +102,7 @@ public class Right implements RightDescription, Serializable, Comparable<Right> ...@@ -101,7 +102,7 @@ public class Right implements RightDescription, Serializable, Comparable<Right>
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** Internal list of existing instances. */ /** Internal list of existing instances. */
private static final List<Right> VALUES = new ArrayList<Right>(); private static final List<Right> VALUES = new CopyOnWriteArrayList<>();
/** Unmodifiable list of existing instance for public dissemination. */ /** Unmodifiable list of existing instance for public dissemination. */
private static final List<Right> UNMODIFIABLE_VALUES = Collections.unmodifiableList(VALUES); private static final List<Right> UNMODIFIABLE_VALUES = Collections.unmodifiableList(VALUES);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment