Skip to content

Commit

Permalink
Fixing recursion in AssociationFromLinkExpressionEvaluator
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Mar 23, 2016
1 parent 3c65fda commit 80bf5c5
Showing 1 changed file with 6 additions and 5 deletions.
Expand Up @@ -113,7 +113,7 @@ public PrismValueDeltaSetTriple<PrismContainerValue<ShadowAssociationType>> eval
// Always process the first role (myself) regardless of recursion setting
gatherAssociationsFromAbstractRole(thisRole, output, resourceOid, kind, intent, assocName, options, desc, params);

if (thisRole instanceof OrgType) {
if (thisRole instanceof OrgType && matchesForRecursion((OrgType)thisRole)) {
gatherAssociationsFromAbstractRoleRecurse((OrgType)thisRole, output, resourceOid, kind, intent, assocName, options, desc, params);
}

Expand Down Expand Up @@ -150,12 +150,13 @@ private void gatherAssociationsFromAbstractRoleRecurse(OrgType thisOrg,
String intent, QName assocName, Collection<SelectorOptions<GetOperationOptions>> options,
String desc, ExpressionEvaluationContext params) throws SchemaException, ObjectNotFoundException {

if (!matchesForRecursion(thisOrg)) {
return;
}
gatherAssociationsFromAbstractRole(thisOrg, output, resourceOid, kind, intent, assocName, options, desc, params);

for (ObjectReferenceType parentOrgRef: thisOrg.getParentOrgRef()) {
OrgType parent = objectResolver.resolve(parentOrgRef, OrgType.class, options, desc, params.getTask(), params.getResult());
gatherAssociationsFromAbstractRole(parent, output, resourceOid, kind, intent, assocName, options, desc, params);
if (matchesForRecursion(parent)) {
gatherAssociationsFromAbstractRoleRecurse(parent, output, resourceOid, kind, intent, assocName, options, desc, params);
}
}
}

Expand Down

0 comments on commit 80bf5c5

Please sign in to comment.