public void finishUpdate() {
      inUpdate = false;
      if (updates.isEmpty()) {
        updates = null;
        return;
      }
      sortUpdates();
      mergeUpdates();
      Document document = updates.get(0).document;
      int documentSize = document.getTextLength();
      int processedOffset = -1;
      for (DocumentUpdate event : updates) {
        if (event.offset + event.newLength < processedOffset) {
          continue;
        }
        processedOffset = super.incrementalUpdate(event.offset, event.oldLength, event.newLength, document);
        if (processedOffset >= documentSize) {
          break;
        }
      }
      updates = null;
    }
public void finishUpdate()