try {
while (!webState.getSPGroupsToResolve().isEmpty()) {
int size = webState.getSPGroupsToResolve().size();
String[] groupIds = new String[webState.getSPGroupsToResolve().size()];
webState.getSPGroupsToResolve().toArray(groupIds);
GssResolveSPGroupResult result = resolveSPGroup(groupIds);
// Null check for result. Return false if result is null.
if (result == null) {
LOGGER.warning("Group Resolution null for WebState[ "
+ webState.getWebUrl() + " ]. Returning false");
return false;
}
GssPrincipal[] groups = result.getPrinicpals();
if (groups !=null && groups.length > 0) {
Set<UserGroupMembership> memberships =
new TreeSet<UserGroupMembership>();
for (GssPrincipal group : groups) {
for (GssPrincipal member : group.getMembers()) {
memberships.add(new UserGroupMembership(member.getID(),
getPrincipalName(member), group.getID(), group.getName(),
result.getSiteCollectionUrl()));
}
webState.removeSPGroupToResolve(Integer.toString(group.getID()));
}
if (!memberships.isEmpty() &&
sharepointClientContext.getUserDataStoreDAO() != null) {