void (@NotNull Document doc) { Document document = getTopLevelDocument(doc); if (isEventSystemEnabled(document)) { ((TransactionGuardImpl)TransactionGuard.getInstance()).assertWriteActionAllowed(); } if (!isCommitted(document)) { doCommit(document); } }