}  if (mNotify && pms.created != null) for (Iterator it = pms.created.values().iterator(); it.hasNext(); ) mChanges.recordCreated((MailItem) it.next());  if (mNotify && pms.modified != null) for (Iterator it = pms.modified.values().iterator(); it.hasNext(); ) { Change chg = (Change) it.next();
}  if (mNotify && pms.created != null) { for (MailItem item : pms.created.values()) mChanges.recordCreated(item); }  if (mNotify && pms.modified != null) { for (Change chg : pms.modified.values())
    public void notifyPendingChanges(PendingModifications pms) {        if (!pms.hasNotifications() || !mNotify)            return;                try {            Mailbox mbox = Mailbox.getMailboxByAccountId(mAccountId);                    // must lock the Mailbox before locking the Session to avoid deadlock            //   because ToXML functions can now call back into the Mailbox            synchronized(mbox) {                synchronized(this) {                    // XXX: should constrain to folders, tags, and stuff relevant to the current query?                    if (mNotify && pms.deleted != null)                        for (Iterator it = pms.deleted.values().iterator(); it.hasNext(); ) {                            Object obj = it.next();                            if (obj instanceof MailItem)                                mChanges.recordDeleted((MailItem) obj);                            else if (obj instanceof Integer)                                mChanges.recordDeleted(((Integer) obj).intValue());                        }                                        if (mNotify && pms.created != null)                        for (Iterator it = pms.created.values().iterator(); it.hasNext(); )                            mChanges.recordCreated((MailItem) it.next());                                        if (mNotify && pms.modified != null)                        for (Iterator it = pms.modified.values().iterator(); it.hasNext(); ) {                            Change chg = (Change) it.next();                            if (chg.what instanceof MailItem)                                mChanges.recordModified((MailItem) chg.what, chg.why);                            else if (chg.what instanceof Mailbox)                                mChanges.recordModified((Mailbox) chg.what, chg.why);                        }                                        if (mNotify && pms.imNotifications != null) {                        for (IMNotification not : pms.imNotifications)                             mChanges.addIMNotification(not);                    }                                        if (mPushChannel != null) {                        Element e = new Element.XMLElement("notify");                        putNotifications(mPushChannel.getZimbraContext(),e, mPushChannel.getLastKnownSeqNo());                        try {                            mPushChannel.writeHttpResponse(200, "OK", "text/xml", e.toUTF8());                        } catch (IOException ex) {                            throw ServiceException.FAILURE("IOException writing HTTP response to stream "+ex, ex);                        }                        mPushChannel.close();                        mPushChannel = null;                    }                }            }                    	clearCachedQueryResults();        } catch (ServiceException e) {            ZimbraLog.session.warn("ServiceException in notifyPendingChanges ", e);        }    }