This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch 2_1_X
in repository https://gitbox.apache.org/repos/asf/syncope.git


The following commit(s) were added to refs/heads/2_1_X by this push:
     new 20641f5  [SYNCOPE-1454] Ensuring no duplicated tasks
20641f5 is described below

commit 20641f5e36182ff504ba1364881108dcc828a3dc
Author: Francesco Chicchiriccò <[email protected]>
AuthorDate: Tue Apr 2 12:17:58 2019 +0200

    [SYNCOPE-1454] Ensuring no duplicated tasks
---
 .../core/provisioning/java/propagation/PropagationManagerImpl.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PropagationManagerImpl.java
 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PropagationManagerImpl.java
index c82b60f..46fc368 100644
--- 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PropagationManagerImpl.java
+++ 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/PropagationManagerImpl.java
@@ -211,11 +211,13 @@ public class PropagationManagerImpl implements 
PropagationManager {
         UserPatch userPatch = wfResult.getResult().getKey();
 
         // Propagate password update only to requested resources
-        List<PropagationTaskInfo> tasks = new ArrayList<>();
+        List<PropagationTaskInfo> tasks;
         if (userPatch.getPassword() == null) {
             // a. no specific password propagation request: generate 
propagation tasks for any resource associated
             tasks = getUserUpdateTasks(wfResult, false, null);
         } else {
+            tasks = new ArrayList<>();
+
             // b. generate the propagation task list in two phases: first the 
ones containing password,
             // the the rest (with no password)
             WorkflowResult<Pair<UserPatch, Boolean>> pwdWFResult = new 
WorkflowResult<>(
@@ -244,6 +246,8 @@ public class PropagationManagerImpl implements 
PropagationManager {
             if (!noPwdWFResult.getPropByRes().isEmpty()) {
                 tasks.addAll(getUserUpdateTasks(noPwdWFResult, false, 
pwdResourceNames));
             }
+
+            tasks = tasks.stream().distinct().collect(Collectors.toList());
         }
 
         return tasks;

Reply via email to