modifyAttrs(identity, identityAttrs, true); if (newName) renameIdentity(ldapAccount, identity, name);
String name = (String) identityAttrs.get(A_zimbraPrefIdentityName); boolean newName = (name != null && !name.equals(identityName)); if (newName) identityAttrs.remove(A_zimbraPrefIdentityName);  modifyAttrs(identity, identityAttrs, true); if (newName) renameIdentity(ldapAccount, identity, name);  }
    public void modifyIdentity(Account account, String identityName, Map<String, Object> identityAttrs) throws ServiceException {        LdapAccount ldapAccount = (LdapAccount) (account instanceof LdapAccount ? account : getAccountById(account.getId()));        if (ldapAccount == null)             throw AccountServiceException.NO_SUCH_ACCOUNT(account.getName());        LdapIdentity identity = (LdapIdentity) getIdentityByName(ldapAccount, identityName, null);        if (identity == null)                throw AccountServiceException.NO_SUCH_IDENTITY(identityName);                   String name = (String) identityAttrs.get(A_zimbraPrefIdentityName);        boolean newName = (name != null && !name.equals(identityName));        if (newName) identityAttrs.remove(A_zimbraPrefIdentityName);                modifyAttrs(identity, identityAttrs, true);        if (newName) renameIdentity(ldapAccount, identity, name);    }