if (!f.getType().equals(FieldType.ATTRIBUTE)) { throw new AttributeNotFoundException("not a group attribute"); }
  public void setAttribute(String attr, String value)     throws  AttributeNotFoundException,             GroupModifyException,             InsufficientPrivilegeException  {    // TODO s,AttributeNotFoundException,SchemaException,?    //      Or both?    String msg = "setAttribute: ";    if ( (value == null) || (value.equals("")) ) {      GrouperLog.debug(LOG, this.s, msg + "no value");      throw new GroupModifyException(msg + "no value");    }    try {      Field f = FieldFinder.find(attr);      PrivilegeResolver.getInstance().canPrivDispatch(        this.s, this, this.s.getSubject(), f.getWritePriv()      );      Set       attrs = new LinkedHashSet();      boolean   found = false;      Iterator  iter  = this.getGroup_attributes().iterator();      while (iter.hasNext()) {        Attribute a = (Attribute) iter.next();        if (a.getField().equals(f)) {          // updating attribute          GrouperLog.debug(            LOG, this.s, "updating '" + a.getField().getName() + "'"          );          a.setValue(value);          }        attrs.add(a);      }      if (found == false) {        // adding new attribute        GrouperLog.debug(LOG, this.s, "adding '" + attr + "'");        attrs.add(new Attribute(this, f, value));      }      this.setGroup_attributes( this._updateSystemAttrs(f, value, attrs) );      this.setModified();      HibernateHelper.save(this);      GrouperLog.debug(LOG, this.s, "saved " + attrs.size() + " attributes");    }    catch (HibernateException eH) {      GrouperLog.debug(LOG, this.s, msg + eH.getMessage());      throw new AttributeNotFoundException(msg + eH.getMessage());    }    catch (IllegalArgumentException eIA) {      GrouperLog.debug(LOG, this.s, eIA.getMessage());      throw new GroupModifyException(eIA.getMessage());    }    catch (SchemaException eS) {      GrouperLog.debug(LOG, this.s, msg + eS.getMessage());      throw new AttributeNotFoundException(msg + eS.getMessage());    }  } // public void setAttribute(attr, value)