GrouperGroup  mAsG        = GrouperBackend._groupLoadByID( m.subjectID() ); Iterator      iterViaMAsG = GrouperBackend._queryGrouperList( session, GrouperBackend.VAL_NOTNULL, GrouperBackend.VAL_NOTNULL, list, mAsG.key() ).iterator(); while (iterViaMAsG.hasNext()) { GrouperList   gl  = (GrouperList) iterViaMAsG.next(); GrouperGroup  grp = gl.group(); GrouperMember mem = gl.member(); if ( (grp != null) && (mem != null) ) { GrouperBackend._listDelVal(session, grp, mem, list, mAsG);
groups.add(g); GrouperGroup gm = GrouperBackend._groupLoadByID(m.subjectID()); Iterator imms = GrouperBackend.listImmVals( s, gm, list ).iterator(); while (imms.hasNext()) { GrouperList glI = (GrouperList) imms.next(); Iterator iter = groups.iterator(); while (iter.hasNext()) { GrouperGroup ggI = (GrouperGroup) iter.next(); GrouperBackend._listDelVal( session, ggI, glI.member(), list, gm ); } } Iterator effs = GrouperBackend.listEffVals( s, gm, list ).iterator(); while (effs.hasNext()) { GrouperList glE = (GrouperList) effs.next(); Iterator iter = groups.iterator(); while (iter.hasNext()) { GrouperGroup ggE = (GrouperGroup) iter.next(); GrouperBackend._listDelVal( session, ggE, glE.member(), list, glE.via() );
  protected static boolean listDelVal(GrouperSession s, GrouperGroup g, GrouperMember m, String list) {    Session session = GrouperBackend._init();    boolean rv      = false;    // FIXME Better validation efforts, please.    // TODO  Refactor to a method    if (        g.getClass().getName().equals("edu.internet2.middleware.grouper.GrouperGroup")   &&        s.getClass().getName().equals("edu.internet2.middleware.grouper.GrouperSession") &&        m.getClass().getName().equals("edu.internet2.middleware.grouper.GrouperMember")  &&        Grouper.groupField(g.type(), list)       )     {      try {        Transaction t = session.beginTransaction();        // TODO Verify that the subject has privilege to remove this list data        /*         * When deleting a list value, take the following approach:         * - Delete (`g', `m', `list', null)         * - Delete ( * , `m', `list', `g' )         * - If `m' is a group:         *   - Delete ( *, * , `list', `m' )         */        // Update immediate list data for `m'        GrouperBackend._listDelVal(session, g, m, list, null);        // Update effective list data for `m'        Iterator iterViaG = GrouperBackend._queryGrouperList(                              session, GrouperBackend.VAL_NOTNULL,                              GrouperBackend.VAL_NOTNULL, list, g.key()                            ).iterator();        while (iterViaG.hasNext()) {          GrouperList   gl  = (GrouperList) iterViaG.next();          GrouperGroup  grp = gl.group();          GrouperMember mem = gl.member();          if ( (grp != null) && (mem != null) ) {            GrouperBackend._listDelVal(session, grp, mem, list, g);          }        }        // If `m' is a group, delete effective list data via `m'        if (m.typeID().equals("group")) {          GrouperGroup  mAsG        = GrouperBackend._groupLoadByID(                                         m.subjectID()                                       );          Iterator      iterViaMAsG = GrouperBackend._queryGrouperList(                                        session,                                         GrouperBackend.VAL_NOTNULL,                                         GrouperBackend.VAL_NOTNULL,                                         list, mAsG.key()                                      ).iterator();          while (iterViaMAsG.hasNext()) {            GrouperList   gl  = (GrouperList) iterViaMAsG.next();            GrouperGroup  grp = gl.group();            GrouperMember mem = gl.member();            if ( (grp != null) && (mem != null) ) {              GrouperBackend._listDelVal(session, grp, mem, list, mAsG);            }          }        }        // Update modify information        session.update(g);        // Commit it        t.commit();        rv = true;      } catch (HibernateException e) {        System.err.println(e);        System.exit(1);      }    }     GrouperBackend._hibernateSessionClose(session);    return rv;  }