BS-9317: Avoid stack in log when refactoring Document and let the
selection on edited document