void (@NotNull DocumentEvent event, long newModificationStamp, @NotNull CharSequence prevText, DelayedExceptions exceptions) { try { if (LOG.isTraceEnabled()) LOG.trace(new Throwable(event.toString())); else if (LOG.isDebugEnabled()) LOG.debug(event.toString()); assert event.getOldFragment().length() == event.getOldLength() : "event.getOldFragment().length() = " + event.getOldFragment().length()+"; event.getOldLength() = " + event.getOldLength(); assert event.getNewFragment().length() == event.getNewLength() : "event.getNewFragment().length() = " + event.getNewFragment().length()+"; event.getNewLength() = " + event.getNewLength(); assert prevText.length() + event.getNewLength() - event.getOldLength() == getTextLength() : "prevText.length() = " + prevText.length()+ "; event.getNewLength() = " + event.getNewLength()+ "; event.getOldLength() = " + event.getOldLength()+ "; getTextLength() = " + getTextLength(); myLineSet = getLineSet().update(prevText, event.getOffset(), event.getOffset() + event.getOldLength(), event.getNewFragment(), event.isWholeTextReplaced()); assert getTextLength() == myLineSet.getLength() : "getTextLength() = " + getTextLength()+ "; myLineSet.getLength() = " + myLineSet.getLength(); myFrozen = null; setModificationStamp(newModificationStamp); if (!ShutDownTracker.isShutdownHookRunning()) { DocumentListener[] listeners = getListeners(); ProgressManager.getInstance().executeNonCancelableSection(() -> { for (DocumentListener listener : listeners) { try { listener.documentChanged(event); } catch (Throwable e) { exceptions.register(e); } } }); } } finally { myEventsHandling = false; } }