Author: ilgrosso Date: Tue Dec 11 13:41:10 2012 New Revision: 1420152 URL: http://svn.apache.org/viewvc?rev=1420152&view=rev Log: Small refinements
Modified: syncope/branches/DEV_ROLE_PROVISIONING/core/src/main/java/org/apache/syncope/core/propagation/PropagationManager.java syncope/branches/DEV_ROLE_PROVISIONING/core/src/main/java/org/apache/syncope/core/util/MappingUtil.java Modified: syncope/branches/DEV_ROLE_PROVISIONING/core/src/main/java/org/apache/syncope/core/propagation/PropagationManager.java URL: http://svn.apache.org/viewvc/syncope/branches/DEV_ROLE_PROVISIONING/core/src/main/java/org/apache/syncope/core/propagation/PropagationManager.java?rev=1420152&r1=1420151&r2=1420152&view=diff ============================================================================== --- syncope/branches/DEV_ROLE_PROVISIONING/core/src/main/java/org/apache/syncope/core/propagation/PropagationManager.java (original) +++ syncope/branches/DEV_ROLE_PROVISIONING/core/src/main/java/org/apache/syncope/core/propagation/PropagationManager.java Tue Dec 11 13:41:10 2012 @@ -450,7 +450,7 @@ public class PropagationManager { switch (mapItem.getIntMappingType().getAttributableType()) { case USER: if (subject instanceof SyncopeUser) { - attributables.addAll(Collections.singleton(subject)); + attributables.add(subject); } break; @@ -459,7 +459,7 @@ public class PropagationManager { attributables.addAll(((SyncopeUser) subject).getRoles()); } if (subject instanceof SyncopeRole) { - attributables.addAll(Collections.singleton(subject)); + attributables.add(subject); } break; Modified: syncope/branches/DEV_ROLE_PROVISIONING/core/src/main/java/org/apache/syncope/core/util/MappingUtil.java URL: http://svn.apache.org/viewvc/syncope/branches/DEV_ROLE_PROVISIONING/core/src/main/java/org/apache/syncope/core/util/MappingUtil.java?rev=1420152&r1=1420151&r2=1420152&view=diff ============================================================================== --- syncope/branches/DEV_ROLE_PROVISIONING/core/src/main/java/org/apache/syncope/core/util/MappingUtil.java (original) +++ syncope/branches/DEV_ROLE_PROVISIONING/core/src/main/java/org/apache/syncope/core/util/MappingUtil.java Tue Dec 11 13:41:10 2012 @@ -185,9 +185,11 @@ public final class MappingUtil { case Username: for (AbstractAttributable attributable : attributables) { - AbstractAttrValue attrValue = new UAttrValue(); - attrValue.setStringValue(((SyncopeUser) attributable).getUsername()); - values.add(attrValue); + if (attributable instanceof SyncopeUser) { + AbstractAttrValue attrValue = new UAttrValue(); + attrValue.setStringValue(((SyncopeUser) attributable).getUsername()); + values.add(attrValue); + } } break; @@ -201,16 +203,18 @@ public final class MappingUtil { case RoleName: for (AbstractAttributable attributable : attributables) { - attrValue = new UAttrValue(); - attrValue.setStringValue(((SyncopeRole) attributable).getName()); - values.add(attrValue); + if (attributable instanceof SyncopeRole) { + attrValue = new RAttrValue(); + attrValue.setStringValue(((SyncopeRole) attributable).getName()); + values.add(attrValue); + } } break; default: } - LOG.debug("Retrived values '{}'", values); + LOG.debug("Retrieved values '{}'", values); return new DefaultMapEntry(schema, values); }