Usage of Collections.unmodifiableCollection is unsafe
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / DataTreeChangeListenerSupport.java
index 5b8e5f8..9a44b47 100644 (file)
@@ -11,8 +11,8 @@ import akka.actor.ActorRef;
 import akka.actor.ActorSelection;
 import com.google.common.base.Optional;
 import com.google.common.collect.Sets;
+import java.util.ArrayList;
 import java.util.Collection;
-import java.util.Collections;
 import java.util.Map.Entry;
 import java.util.Set;
 import org.opendaylight.controller.cluster.datastore.messages.EnableNotification;
@@ -33,7 +33,7 @@ final class DataTreeChangeListenerSupport extends AbstractDataListenerSupport<DO
     }
 
     Collection<ActorSelection> getListenerActors() {
-        return Collections.unmodifiableCollection(listenerActors);
+        return new ArrayList<>(listenerActors);
     }
 
     @Override