Fix java.util.ConcurrentModificationException on User creation.

This commit is contained in:
Paulo Gustavo Veiga 2022-10-03 18:18:30 -07:00
parent 2146e2e457
commit 103534475d

View File

@ -34,6 +34,7 @@ import org.springframework.security.crypto.password.PasswordEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
public class UserManagerImpl
extends HibernateDaoSupport
@ -118,7 +119,7 @@ public class UserManagerImpl
this.createUser(user);
// Update mindmap ...
final Set<Collaboration> collaborations = collaborator.getCollaborations();
final Set<Collaboration> collaborations = new CopyOnWriteArraySet<>(collaborator.getCollaborations());
for (Collaboration collabs : collaborations) {
collabs.setCollaborator(user);
}