return f;
  public void addField(      GrouperSession s, String name, FieldType type, Privilege read,       Privilege write, boolean required  )    throws  InsufficientPrivilegeException,            SchemaException  {    // TODO DRY with deleteField()    Field     f   = null;    StopWatch sw    = new StopWatch();    sw.start();    if (!PrivilegeResolver.getInstance().isRoot(s.getSubject())) {      String msg = "subject not privileged to add fields";      LOG.error(msg);      throw new InsufficientPrivilegeException(msg);    }    try {      f = FieldFinder.find(name);        // field already exists.      }    catch (SchemaException eS) {      // Ignore    }     if (f != null) {      String msg = "field already exists: " + name;      LOG.error(msg);      throw new SchemaException(msg);    }    if (GroupType.isSystemType(this)) {      String msg = "cannot add fields to system group types";      LOG.error(msg);      throw new SchemaException(msg);    }    if     (      !(        (type.toString().equals(FieldType.ATTRIBUTE.toString()) )         ||         (type.toString().equals(FieldType.LIST.toString())      )       )    )    {      String msg = "invalid field type: " + type;      LOG.error(msg);      throw new SchemaException(msg);    }    if (!Privilege.isAccess(read)) {      String msg = "read privilege not access privilege: " + read;      LOG.error(msg);      throw new SchemaException(msg);    }    if (!Privilege.isAccess(write)) {      String msg = "write privilege not access privilege: " + write;      LOG.error(msg);      throw new SchemaException(msg);    }    try {      boolean nullable = true;      if (required == true) {        nullable = false;      }      Set fields = this.getFields();      f = new Field(name, type, read, write, nullable);      fields.add(f);      this.setFields(fields);      HibernateHelper.save(this);      sw.stop();      EL.groupTypeAddField(s, this.getName(), name, sw);    }    catch (HibernateException eS) {      String msg = "unable to add field: " + name + ": " + eS.getMessage();      LOG.error(msg);      throw new SchemaException(msg);    }  } // public void addField(s, name, type, read, write, required)