if ((null != userAttributeRefs) && (userAttributeRefs.size() > 0))
{
Iterator attrIter = userAttributes.iterator();
while (attrIter.hasNext())
{
UserAttribute currentAttribute = (UserAttribute) attrIter.next();
boolean linkedAttribute = false;
if (null != currentAttribute)
{
Iterator attrRefsIter = userAttributeRefs.iterator();
while (attrRefsIter.hasNext())
{
UserAttributeRef currentAttributeRef = (UserAttributeRef) attrRefsIter.next();
if (null != currentAttributeRef)
{
if ((currentAttribute.getName()).equals(currentAttributeRef.getNameLink()))
{
if (log.isDebugEnabled())
log.debug("Linking user attribute ref: [[name, " + currentAttribute.getName()
+ "], [linked name, " + currentAttributeRef.getName() + "]]");
linkedUserAttributes.add(currentAttributeRef);
linkedAttribute = true;
}
}
}
}
if (!linkedAttribute)
{
linkedUserAttributes.add(new UserAttributeRefImpl(currentAttribute));
}
}
}
else
{
Iterator attrIter = userAttributes.iterator();
while (attrIter.hasNext())
{
UserAttribute currentAttribute = (UserAttribute) attrIter.next();
linkedUserAttributes.add(new UserAttributeRefImpl(currentAttribute));
}
}
return linkedUserAttributes;
}