String msg = "addImmediateMembership '" + f + "'"; GrouperLog.debug(LOG, s, msg); try {  Set     objects = new LinkedHashSet();  Member  m       = PrivilegeResolver.getInstance().canViewSubject( s, subj, msg ); objects.add(m);  String oid = new String(); if (o.getClass().equals(Group.class)) { ( (Group) o).setModified(); oid = ( (Group) o).getUuid(); } else { ( (Stem) o).setModified(); oid = ( (Stem) o).getUuid(); }   Membership  imm = _addMembership(s, o, m, f); TxQueue     tx  = new TxMemberAdd(s, oid, m, f);   Set effs = _findEffectiveMemberships(s, imm); objects.addAll(effs);    objects.add(imm); objects.add(o); objects.add(tx); HibernateHelper.save(objects);  EL.addEffMembers(s, o, subj, f, effs);  } catch (MemberAddException eMA) { throw eMA; } catch (Exception e) { throw new MemberAddException(e.getMessage()); }
g.setModified(); _addImmediateMembership(s, g, g.getUuid(), subj, f);
  protected static void addImmediateMembership(    GrouperSession s, Object o, Subject subj, Field f  )    throws  InsufficientPrivilegeException,            MemberAddException,            SchemaException  {    GrouperSession.validate(s);    String msg = "addImmediateMembership '" + f + "'";    GrouperLog.debug(LOG, s, msg);    try {      // The objects that will need saving      Set     objects = new LinkedHashSet();      // Who we're adding      Member  m       = PrivilegeResolver.getInstance().canViewSubject(        s, subj, msg      );      objects.add(m);      String oid = new String();      if (o.getClass().equals(Group.class)) {        ( (Group) o).setModified();        oid = ( (Group) o).getUuid();      }      else {        ( (Stem) o).setModified();        oid = ( (Stem) o).getUuid();      }      // Create the immediate membership      Membership  imm = _addMembership(s, o, m, f);      TxQueue     tx  = new TxMemberAdd(s, oid, m, f);      // Find effective memberships      Set effs = _findEffectiveMemberships(s, imm);      objects.addAll(effs);      // And then save owner and memberships      objects.add(imm);      objects.add(o);      objects.add(tx);      HibernateHelper.save(objects);      EL.addEffMembers(s, o, subj, f, effs);    }    catch (MemberAddException eMA) {      throw eMA;    }    catch (Exception e) {      throw new MemberAddException(e.getMessage());    }  } // protected static void addImmediateMembership(s, g, subj, f)