deletes.addAll(this._membershipsToDelete(g, this.toSubject(), f));
Set   temp0 = this._membershipsToDelete(g, this.toSubject(), f); deletes.addAll(temp0); GrouperLog.debug( LOG, this.s, tmpMsg + ": " + temp0.size() + " mships from group membership " + " in group '" + g.getName() + "'" );
  public void delete()     throws  GroupDeleteException,            InsufficientPrivilegeException  {    // TODO Refactor into smaller components    try {      PrivilegeResolver.getInstance().canADMIN(this.s, this, this.s.getSubject());    }    catch (InsufficientPrivilegeException eIP) {      GrouperLog.debug(LOG, this.s, ERR_DG + eIP.getMessage());      throw new InsufficientPrivilegeException(ERR_DG + eIP.getMessage());    }     try {      Set     deletes = new LinkedHashSet();      deletes.add(this);      String  name    = "'" + this.getName() + "'";      // Find all fields of type list      Iterator iter = FieldFinder.findAllByType(FieldType.LIST).iterator();      while (iter.hasNext()) {        Field f = (Field) iter.next();        // ... and then remove where this group is an immediate member        Iterator  iterIs  = this.toMember().getImmediateGroups().iterator();        while (iterIs.hasNext()) {          Group g = (Group) iterIs.next();          deletes.addAll(this._membershipsToDelete(g, this.toSubject(), f));        }        // ... and then deal with this group's immediate members        Iterator  iterHas = this.getImmediateMembers().iterator();        while (iterHas.hasNext()) { Member m = (Member) iterHas.next();          deletes.addAll(this._membershipsToDelete(this, m.getSubject(), f));        }      }      // And revoke all access privileges      this.revokePriv(AccessPrivilege.OPTIN);      this.revokePriv(AccessPrivilege.OPTOUT);      this.revokePriv(AccessPrivilege.READ);      this.revokePriv(AccessPrivilege.UPDATE);      this.revokePriv(AccessPrivilege.VIEW);      // TODO I think ordering may be important here, especially since      //      I don't have privilege caching in place yet      this.revokePriv(AccessPrivilege.OPTIN);      // And then commit changes to registry      HibernateHelper.delete(deletes);      // TODO info      GrouperLog.debug(LOG, this.s, MSG_DG + name);    }    catch (HibernateException eH) {      throw new GroupDeleteException(ERR_DG + eH.getMessage());    }    catch (MemberDeleteException eMD) {      throw new GroupDeleteException(ERR_DG + eMD.getMessage());    }    catch (RevokePrivilegeException eRP) {      throw new GroupDeleteException(ERR_DG + eRP.getMessage());    }    catch (SubjectNotFoundException eSNF) {      throw new GroupDeleteException(ERR_DG + eSNF.getMessage());    }  }