if (!ns.getModifyTime().equals(new Date())) { ns.setModified(); }
ns.setModified();
  public void grantPriv(    GrouperSession s, Stem ns, Subject subj, Privilege priv  )    throws  GrantPrivilegeException,             InsufficientPrivilegeException,            SchemaException  {    String msg = MSG_GP + "'" + priv.toString().toUpperCase() + "' "       + SubjectHelper.getPretty(subj);    GrouperLog.debug(LOG, s, msg);    this._canWriteList(s, ns, priv, msg);    try {      // The objects that will need saving      Set     objects = new LinkedHashSet();      // Who we're adding      Member  m       = PrivilegeResolver.getInstance().canViewSubject(        s, subj, msg      );      // Conditionally update stem modify time.  Because the granting      // of STEM to the creator takes place *after* the group has been      // created, the modify* attributes would be set.  However, we      // don't want to consider that a modification.  As such, if      // the modify time is equal to the start of the epoch, don't      // set the group's modify* attrs.      // TODO Shouldn't this be negated?      if (!ns.getModifyTime().equals(new Date())) {        ns.setModified();      }      objects.add(ns);      Field f = this._getField(priv);      // Create the immediate membership      objects.add(Membership.addMembership(s, ns, m, f));      // Find effective memberships      Set effs = MemberOf.doMemberOf(s, ns, m, f);      objects.addAll(effs);      // And then save stem and memberships      HibernateHelper.save(objects);      // TODO make INFO + (conditionally?) log each privilege granted      GrouperLog.debug(        LOG, s,         msg + "added members: " + SubjectHelper.getPretty(subj)         + " and " + effs.size() + " effs"      );    }    catch (HibernateException eH) {      GrouperLog.debug(LOG, s, ERR_GP + eH.getMessage());      throw new GrantPrivilegeException(ERR_GP + eH.getMessage());    }    catch (MemberAddException eMAF) {      GrouperLog.debug(LOG, s, ERR_GP + eMAF.getMessage());      throw new GrantPrivilegeException(ERR_GP + eMAF.getMessage());    }    catch (MemberNotFoundException eMNF) {      GrouperLog.debug(LOG, s, ERR_GP + eMNF.getMessage());      throw new GrantPrivilegeException(ERR_GP + eMNF.getMessage());    }    catch (StemNotFoundException eSNF) {      GrouperLog.debug(LOG, s, ERR_GP + eSNF.getMessage());      throw new GrantPrivilegeException(ERR_GP + eSNF.getMessage());    }  } // public void grantPriv(s, ns, subj, priv)