} else if (conflict.isMutable()) {
} else if (!conflict.isMutable() || (conflict_mask & Change.MODIFIED_NAME) != 0) {  name = newName; elt.addAttribute(MailService.A_NAME, name).addAttribute(InitialSync.A_RELOCATED, true); } else {
    private boolean resolveFolderConflicts(Element elt, int id, byte type, Folder local) throws ServiceException {        int change_mask = (local == null ? 0 : ombx.getChangeMask(sContext, id, type));        // if the folder was moved/renamed locally, that trumps any changes made remotely        int parentId = (id == Mailbox.ID_FOLDER_ROOT) ? id : (int) elt.getAttributeLong(MailService.A_FOLDER);        if ((change_mask & Change.MODIFIED_FOLDER) != 0) {            parentId = local.getFolderId();  elt.addAttribute(MailService.A_FOLDER, parentId);        }        String name = (id == Mailbox.ID_FOLDER_ROOT) ? "ROOT" : elt.getAttribute(MailService.A_NAME);        if ((change_mask & Change.MODIFIED_NAME) != 0 && !mSyncRenames.contains(id)) {            name = local.getName();  elt.addAttribute(MailService.A_NAME, name);        }        // if the parent folder doesn't exist or is of an incompatible type, default to using the top-level user folder as the container        Folder parent = getFolder(parentId);        if (parent == null || !parent.canContain(type)) {            parentId = Mailbox.ID_FOLDER_USER_ROOT;  parent = getFolder(parentId);            elt.addAttribute(MailService.A_FOLDER, parentId).addAttribute(InitialSync.A_RELOCATED, true);        }        // if there's a folder naming conflict within the target folder, usually push the local folder out of the way        Folder conflict = parent.findSubfolder(name);        if (conflict != null && conflict.getId() != id) {            int conflict_mask = ombx.getChangeMask(sContext, conflict.getId(), conflict.getType());            String uuid = '{' + UUID.randomUUID().toString() + '}', newName;            if (name.length() + uuid.length() > Folder.MAX_FOLDER_LENGTH)                newName = name.substring(0, Folder.MAX_FOLDER_LENGTH - uuid.length()) + uuid;            else                newName = name + uuid;            if (local == null && (conflict_mask & Change.MODIFIED_CONFLICT) != 0 && isCompatibleFolder(conflict, elt, type)) {                // if the new and existing folders are identical and being created, try to merge them                ombx.renumberItem(sContext, conflict.getId(), type, id);                ombx.setChangeMask(sContext, id, type, conflict_mask & ~Change.MODIFIED_CONFLICT);                return false;            } else if (conflict.isMutable()) {                ombx.renameFolder(null, conflict.getId(), newName);                if ((conflict_mask & Change.MODIFIED_NAME) == 0)                    mSyncRenames.add(conflict.getId());            } else {                name = newName;                elt.addAttribute(MailService.A_NAME, name).addAttribute(InitialSync.A_RELOCATED, true);            }        }        // if conflicts have forced us to deviate from the specified sync, update the local store such that these changes are pushed during the next sync        if (local != null && elt.getAttributeBool(InitialSync.A_RELOCATED, false))            ombx.renameFolder(null, id, parentId, name);        return true;    }