code: void endCompoundEdit()
    {
        if(!compoundMode) {
          throw new RuntimeException("not in compound mode");
        }      
        ce.end();
        undoManager.addEdit(ce);
        ce = null;
        compoundMode = false;
    }
docs: Notify manager to stop merging undoable edits.
  
  Calling endCompoundEdit when not in compound mode is an error
  and will throw a RuntimeException.
  
  @since 2.7