mLog.warn("error encoding item " + mi.getId(), e);
ZimbraLog.session.warn("error encoding item " + mi.getId(), e);
    private static void putPendingModifications(ZimbraSoapContext zc, PendingModifications pm, Element parent, Mailbox mbox, String explicitAcct)    {        assert(pm.getSeqNo() > 0);                // <notify [acct="4f778920-1a84-11da-b804-6b188d2a20c4"]/>        Element eNotify = parent.addElement(ZimbraNamespace.E_NOTIFY)                              .addAttribute(ZimbraSoapContext.A_ACCOUNT_ID, explicitAcct)                              .addAttribute(ZimbraSoapContext.A_SEQNO, pm.getSeqNo());                                      if (pm.deleted != null && pm.deleted.size() > 0) {            StringBuilder ids = new StringBuilder ();            for (Iterator it = pm.deleted.values().iterator(); it.hasNext(); ) {                if (ids.length() != 0)                    ids.append(',');                Object obj = it.next();                if (obj instanceof MailItem)                    ids.append(((MailItem) obj).getId());                else if (obj instanceof Integer)                    ids.append(obj);            }            Element eDeleted = eNotify.addUniqueElement(ZimbraNamespace.E_DELETED);            eDeleted.addAttribute(A_ID, ids.toString());        }        if (pm.created != null && pm.created.size() > 0) {            Element eCreated = eNotify.addUniqueElement(ZimbraNamespace.E_CREATED);            for (Iterator it = pm.created.values().iterator(); it.hasNext(); ) {                MailItem mi = (MailItem) it.next();                try {                    ToXML.encodeItem(eCreated, zc, mi, ToXML.NOTIFY_FIELDS);                } catch (ServiceException e) {                    mLog.warn("error encoding item " + mi.getId(), e);                    return;                }            }        }        if (pm.modified != null && pm.modified.size() > 0) {            Element eModified = eNotify.addUniqueElement(ZimbraNamespace.E_MODIFIED);            for (Iterator it = pm.modified.values().iterator(); it.hasNext(); ) {                Change chg = (Change) it.next();                if (chg.why != 0 && chg.what instanceof MailItem) {                    MailItem mi = (MailItem) chg.what;                    try {                        ToXML.encodeItem(eModified, zc, mi, chg.why);                    } catch (ServiceException e) {                        mLog.warn("error encoding item " + mi.getId(), e);                        return;                    }                } else if (chg.why != 0 && chg.what instanceof Mailbox)                    ToXML.encodeMailbox(eModified, (Mailbox) chg.what, chg.why);            }        }                if (pm.imNotifications != null && pm.imNotifications.size() > 0) {            Element eIM = eNotify.addUniqueElement("im");            for (IMNotification imn : pm.imNotifications) {                try {                    imn.toXml(eIM);                } catch (ServiceException e) {                    e.printStackTrace();                }            }        }    }