Avoid duplicate ldapGroups

Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/9722c921
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/9722c921
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/9722c921

Branch: refs/heads/master
Commit: 9722c921827d034c63ed4a4ab42adbf76a1720fd
Parents: 5af8e4a
Author: Francesco Chicchiriccò <ilgro...@apache.org>
Authored: Wed Nov 30 15:29:49 2016 +0100
Committer: Francesco Chicchiriccò <ilgro...@apache.org>
Committed: Thu Dec 1 09:29:10 2016 +0100

----------------------------------------------------------------------
 .../java/propagation/LDAPMembershipPropagationActions.java       | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/syncope/blob/9722c921/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/LDAPMembershipPropagationActions.java
----------------------------------------------------------------------
diff --git 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/LDAPMembershipPropagationActions.java
 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/LDAPMembershipPropagationActions.java
index 54be326..29390be 100644
--- 
a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/LDAPMembershipPropagationActions.java
+++ 
b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/propagation/LDAPMembershipPropagationActions.java
@@ -102,14 +102,14 @@ public class LDAPMembershipPropagationActions extends 
DefaultPropagationActions
 
                 Set<String> groups = new HashSet<>(groupConnObjectLinks);
                 Attribute ldapGroups = 
AttributeUtil.find(getGroupMembershipAttrName(), attributes);
-
                 if (ldapGroups != null) {
                     for (Object obj : ldapGroups.getValue()) {
                         groups.add(obj.toString());
                     }
+                    attributes.remove(ldapGroups);
                 }
-
                 
attributes.add(AttributeBuilder.build(getGroupMembershipAttrName(), groups));
+
                 task.setAttributes(attributes);
             }
         } else {

Reply via email to