void (@NotNull DocumentEvent e) { List<T> toInvalidate = Collections.emptyList(); l.writeLock().lock(); try { if (size() != 0) { toInvalidate = updateMarkersOnChange(e); if (DocumentEventUtil.isMoveInsertion(e)) { toInvalidate = ContainerUtil.concat(toInvalidate, reTargetMarkersOnChange(e)); } IntervalNode<T> root = getRoot(); assert root == null || root.maxEnd + root.delta <= e.getDocument().getTextLength() : "Root: "+root+"; root.maxEnd="+root.maxEnd+"; root.delta="+root.delta+"; e.getDocument().getTextLength()="+e.getDocument().getTextLength()+"; event: "+e; } } finally { l.writeLock().unlock(); fireAfterRemoved(toInvalidate); } }