GrouperLog.debug(LOG, s, MSG_FMSHIPSM_PRO + " unfiltered: " + l.size());
  protected static Set findMemberships(    GrouperSession s, Member m, Field f  )  {    /*     * @caller    public GrouperAccessAdapter.getGroupsWhereSubjectHasPriv(s, subj, priv)     * @caller    public GrouperNamingAdapter.getStemsWhereSubjectHasPriv(s, subj, priv)     * @caller    public Member.getMemberships(f)     * @filtered  true     * @session   true     */    GrouperSession.validate(s);    GrouperLog.debug(LOG, s, MSG_FMSHIPSM_PRO);    Set mships  = new LinkedHashSet();    try {      Session hs  = HibernateHelper.getSession();      Query   qry = hs.createQuery(        "from Membership as ms where    "        + "     ms.member_id  = :mid    "        + "and  ms.field.name = :fname  "        + "and  ms.field.type = :ftype"      );      qry.setCacheable(GrouperConfig.QRY_MSF_FM);      qry.setCacheRegion(GrouperConfig.QCR_MSF_FM);      qry.setString("mid"   , m.getId()             );      qry.setString("fname" , f.getName()           );      qry.setString("ftype" , f.getType().toString());      List    l   = qry.list();      Member all = MemberFinder.findAllMember();      qry.setString("mid", all.getId());      l.addAll(qry.list());      hs.close();      GrouperLog.debug(LOG, s, MSG_FMSHIPSM_PRO + " unfiltered: " + l.size());      // If the session's member is equivalent to the member that we      // are searching for, don't filter the results - but still attach      // session, otherwise a member that has OPTIN, OPTOUT, etc      // will have those results filtered out.      if (s.getMember().equals(m)) {        Iterator iter = l.iterator();        while (iter.hasNext()) {          Membership ms = (Membership) iter.next();          ms.setSession(s);          mships.add(ms);        }      }      else {        mships.addAll( _filterMemberships(s, f, l) );      }    }    catch (HibernateException eH) {      GrouperLog.error(LOG, s, MSG_FMSHIPSM_PRO + ": " + eH.getMessage());    }    GrouperLog.debug(LOG, s, MSG_FMSHIPSM_PRO + " filtered: " + mships.size());    return mships;  } // protected static Set findMemberships(s, m, f)