if ("imm".equals(membershipListScope)&& "members".equals(membershipField)) { if(group.hasComposite()) {
if ("imm".equals(membershipListScope)) { if(group.hasComposite()&& "members".equals(membershipField)) {
	public ActionForward grouperExecute(ActionMapping mapping, ActionForm form,			HttpServletRequest request, HttpServletResponse response,			HttpSession session, GrouperSession grouperSession)			throws Exception {				if(!isEmpty(request.getParameter("submit.addMembers"))) return mapping.findForward(FORWARD_AddGroupMembers);		session.setAttribute("subtitle","groups.action.show-members");				DynaActionForm groupForm = (DynaActionForm) form;		saveAsCallerPage(request,groupForm,"findForNode membershipListScope");		request.setAttribute("contextSubject",groupForm.get("contextSubject"));		//Identify the group whose membership we are showing		String groupId = (String)groupForm.get("groupId");		//TODO: check following - shouldn't I always pass parameter		if (groupId == null || groupId.length() == 0)			groupId = (String) session.getAttribute("findForNode");		if (groupId == null)			groupId = request.getParameter("asMemberOf");		Group group = null;		String listField = request.getParameter("listField");		String membershipField = "members";				if(!isEmpty(listField)) membershipField=listField;		Field mField = FieldFinder.find(membershipField);		//Determine whether to show immediate, effective only, or all memberships		String membershipListScope = (String) groupForm				.get("membershipListScope");		if (":all:imm:eff:".indexOf(":" + membershipListScope + ":") == -1) {			membershipListScope = (String) session					.getAttribute("membershipListScope");		}		if (membershipListScope == null)			membershipListScope = "imm";		session.setAttribute("membershipListScope", membershipListScope);		groupForm.set("membershipListScope", membershipListScope);			//Retrieve the membership according to scope selected by user		group = GroupFinder.findByUuid(grouperSession, groupId);				List listFields = GrouperHelper.getListFieldsForGroup(grouperSession,group);		request.setAttribute("listFields",listFields);		request.setAttribute("listFieldsSize",new Integer(listFields.size()));				Set members = null;		if ("imm".equals(membershipListScope)&& "members".equals(membershipField)) {			if(group.hasComposite()) {				members=new HashSet();			}else{				members = group.getImmediateMemberships(mField);			}		} else if ("eff".equals(membershipListScope)) {			if(group.hasComposite()&& membershipField.equals("members")) {				members = group.getCompositeMemberships();			}else{				members = group.getEffectiveMemberships(mField);			}		} else {			members = group.getMemberships(mField);		}		Map compMap = null;		if(membershipField.equals("members")) {						if(group.hasComposite()) {				if(!"eff".equals(membershipListScope)) {					Composite comp = CompositeFinder.findAsOwner(group);					compMap = GrouperHelper.getCompositeMap(grouperSession,comp);				}				request.setAttribute("isCompositeGroup",Boolean.TRUE);			}					}		Map countMap = new HashMap();		List uniqueMemberships = GrouperHelper.getOneMembershipPerSubjectOrGroup(members,"group",countMap);		//Set up CollectionPager for view		String startStr = request.getParameter("start");		if (startStr == null || "".equals(startStr))			startStr = "0";		int start = Integer.parseInt(startStr);		int pageSize = getPageSize(session);		int end = start + pageSize;		if (end > uniqueMemberships.size())			end = uniqueMemberships.size();				List membershipMaps = GrouperHelper.memberships2Maps(				grouperSession, uniqueMemberships.subList(start, end));		int uniqueMembershipCount = uniqueMemberships.size();		GrouperHelper.setMembershipCountPerSubjectOrGroup(membershipMaps,"group",countMap);		if(compMap!=null) {			membershipMaps.add(0,compMap);			uniqueMembershipCount++;		}		CollectionPager pager = new CollectionPager(membershipMaps,uniqueMembershipCount,				null, start, null, pageSize);		pager.setParam("groupId", groupId);		pager.setTarget(mapping.getPath());		if(!isEmpty(listField))pager.setParam("listField", listField);		request.setAttribute("pager", pager);		request.setAttribute("listField",listField);		request.setAttribute("linkParams", pager.getParams().clone());		Map membership = new HashMap();				membership.put("groupId", groupId);		membership.put("callerPageId",request.getAttribute("thisPageId"));		if(!isEmpty(listField)) membership.put("listField",listField);		//TODO: some of this looks familar  - look at refactoring		Map privs = GrouperHelper.hasAsMap(grouperSession, GroupOrStem.findByGroup(grouperSession, group));		request.setAttribute("groupPrivs", privs);		request.setAttribute("browseParent", GrouperHelper.group2Map(				grouperSession, group));		request.setAttribute("groupMembership", membership);				return mapping.findForward(FORWARD_GroupMembers);	}