subjects          = _getImmediateElements(privileges, "subject");
subjects          = this._getImmediateElements(privileges, "subject");
  private void _processAccessPrivLists()     throws  GrantPrivilegeException,            GroupNotFoundException,            InsufficientPrivilegeException,            RevokePrivilegeException,            SchemaException,            SubjectNotFoundException  {    if (accessPrivLists == null || accessPrivLists.size() == 0) {      return;    }    Collection  subjects;    Iterator    subjectsIterator;    Element     subjectE;    Element     privileges;    Map         map;    String      group;    Subject     subject           = null;    String      subjectType;    boolean     isImmediate       = false;    Group       privGroup;    Group       focusGroup        = null;    String      subjectId;    String      subjectIdentifier;    String      privilege;    Privilege   grouperPrivilege;    String      importOption;    String      lastGroup         = "";    for (int i = 0; i < accessPrivLists.size(); i++) {      map   = (Map) accessPrivLists.get(i);      group = (String) map.get("group");      //Save a call if we are dealing with same group      if (!group.equals(lastGroup)) {        if (XmlUtils.isEmpty(lastGroup)) {          if (LOG.isInfoEnabled())            LOG.debug("Finished loading Access privs for " + lastGroup);        }        focusGroup = GroupFinder.findByName(s, group);        if (LOG.isInfoEnabled()) {          LOG.debug("Loading Access privs for " + group);        }      }      lastGroup     = group;      privileges    = (Element) map.get("privileges");      privilege     = privileges.getAttribute("type");      importOption  = privileges.getAttribute("importOption");      if (XmlUtils.isEmpty(importOption))        importOption = options.getProperty("import.data.privileges");      if (XmlUtils.isEmpty(importOption) || "ignore".equals(importOption)) {        if (LOG.isInfoEnabled()) {          LOG.debug("Ignoring any '" + privilege + "' privileges");        }        continue; //No instruction so ignore      }      grouperPrivilege = Privilege.getInstance(privilege);      if ("replace".equals(importOption)) {        if (LOG.isInfoEnabled()) {          LOG.debug("Revoking current '" + privilege + "' privileges");        }        focusGroup.revokePriv(grouperPrivilege);      }      subjects          = _getImmediateElements(privileges, "subject");      subjectsIterator  = subjects.iterator();      while (subjectsIterator.hasNext()) {        subjectE    = (Element) subjectsIterator.next();        isImmediate = "true".equals(subjectE.getAttribute("immediate"));        if (XmlUtils.isEmpty(subjectE.getAttribute("immediate"))) {          isImmediate = true; //default is to assign        }        if (!isImmediate) {          continue;        }        subjectId         = subjectE.getAttribute("id");        subjectIdentifier = subjectE.getAttribute("identifier");        subjectType       = subjectE.getAttribute("type");        if ("group".equals(subjectType)) {          if (            subjectIdentifier.startsWith("*")            && !subjectIdentifier.endsWith("*")          )           {            //relative import            if (XmlUtils.isEmpty(importRoot)) {              subjectIdentifier = importRoot + Stem.ROOT_INT + subjectIdentifier.substring(1);            }            else {              subjectIdentifier = subjectIdentifier.substring(1);            }          }           else {            if ("*SELF*".equals(subjectIdentifier)) {              subjectIdentifier = group;            }            else {              subjectIdentifier = _getAbsoluteName(                  subjectIdentifier, focusGroup.getParentStem().getName()              );            }          }          try {            privGroup = GroupFinder.findByName(s, subjectIdentifier);          }           catch (Exception e) {            LOG.warn("Could not find Group identified by " + subjectIdentifier);            continue;          }          subject = privGroup.toMember().getSubject();        }         else {          try {            if (XmlUtils.isEmpty(subjectId)) {              subject = _getSubjectByIdentifier(subjectIdentifier, subjectType);            }             else {              subject = _getSubjectById(subjectId, subjectType);            }          }           catch (Exception e) {            String msg = "Could not find subject with ";            if (XmlUtils.isEmpty(subjectId)) {              msg = msg + "identifier=" + subjectIdentifier;            }            else {              msg = msg + "id=" + subjectId;            }            LOG.error(msg);            continue;          }        }        if (          !XmlExporter.hasImmediatePrivilege( subject, focusGroup, privilege)        )         {          if (LOG.isDebugEnabled()) {            LOG.debug("Assigning " + privilege + " to " + subject.getName() + " for " + group);          }          focusGroup.grantPriv(subject, Privilege.getInstance(privilege));          if (LOG.isDebugEnabled()) {            LOG.debug("... finished assignment");          }        }         else {          if (LOG.isDebugEnabled()) {            LOG.debug(privilege + " already assigned to " + subject.getName() + " so skipping");          }        }      }    }    if (LOG.isInfoEnabled()) {      LOG.debug("Finished assigning Access privs");    }    accessPrivLists = null;  } // private void _processAccessPrivLists()