String aliasesString = (String) iter.next(); isAliasInUse = doesAliasesStringContainAlias(aliasesString, alias); if (isAliasInUse) { break;
String[] aliases = AttendantRule.getAttendantAliasesAsArray((String) iter.next()); if (ArrayUtils.contains(aliases, alias)) { return true;
    private boolean isAutoAttendantAliasInUse(String alias) {        // Because auto attendant aliases are stored together in a comma-delimited string,        // we can't query the DB for individual aliases. However, there will be so few        // of these aliases (one string per internal dialing rule) that we can simply load        // all such alias strings and check them in Java.        boolean isAliasInUse = false;        List aliasStrings = getHibernateTemplate().findByNamedQuery(QUERY_AUTO_ATTENDANT_ALIASES);        for (Iterator iter = SipxCollectionUtils.safeIterator(aliasStrings); iter.hasNext();) {            String aliasesString = (String) iter.next();            isAliasInUse = doesAliasesStringContainAlias(aliasesString, alias);            if (isAliasInUse) {                break;            }        }        return isAliasInUse;    }