Details
-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
1.4.0
-
None
Description
There are currently a few different GrouperUtil methods for joining to return a delimited string. All work with either an iterator or an array. The iterator version can be used for Set objects, but the caller needs to check for a null Set before getting its iterator. If there were a version taking in a Collection object instead of an iterator, it could do the null check in the method (returning null?) so the caller doesn't need to do it. This would be particularly useful in jexl calls where results can't be saved to temporary variables, so lookups need to be done twice.
E.g.,
Now (subject.getAttributeValues called twice)
${subject.getAttributeValues("eduPersonAffiliation") == null ? null : edu.internet2.middleware.grouper.util.GrouperUtil.join(subject.getAttributeValues("eduPersonAffiliation").iterator(), "|")}
|
Proposed:
${edu.internet2.middleware.grouper.util.GrouperUtil.join(subject.getAttributeValues("eduPersonAffiliation"), "|")}
|