Fix java.util.ConcurrentModificationException on User creation.

main
Paulo Gustavo Veiga 2022-10-03 18:18:30 -07:00
parent 2146e2e457
commit 103534475d
1 changed files with 2 additions and 1 deletions

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);
}