diff --git a/perun-ldapc/src/main/java/cz/metacentrum/perun/ldapc/beans/UserSynchronizer.java b/perun-ldapc/src/main/java/cz/metacentrum/perun/ldapc/beans/UserSynchronizer.java index 7abb4e888f..c606954103 100644 --- a/perun-ldapc/src/main/java/cz/metacentrum/perun/ldapc/beans/UserSynchronizer.java +++ b/perun-ldapc/src/main/java/cz/metacentrum/perun/ldapc/beans/UserSynchronizer.java @@ -14,7 +14,6 @@ import cz.metacentrum.perun.ldapc.model.PerunUser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.beans.BeansException; import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; @@ -22,6 +21,7 @@ import javax.naming.Name; import java.util.ArrayList; +import java.util.Comparator; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -115,6 +115,7 @@ public void synchronizeUsers() { log.debug("Getting list of users"); List users = perun.getUsersManagerBl().getUsers(ldapcManager.getPerunSession()); + users.sort(Comparator.comparingInt(User::getId)); Set presentUsers = new HashSet(users.size()); syncExecutor.setCorePoolSize(5);