void (@NotNull AnActionEvent e, @NotNull Notification notification) { WriteCommandAction.writeCommandAction(project) .withName(JavaRefactoringBundle.message("move.classes.or.packages.unused.exports.command.name")) .withUndoConfirmationPolicy(UndoConfirmationPolicy.REQUEST_CONFIRMATION) .withGlobalUndo() .run(() -> { for (var entry : packageStatementsByModulePath.entrySet()) { PsiJavaModule moduleDescriptor = findModuleByPath(project, entry.getKey()); if (moduleDescriptor != null) { deleteModuleStatements(moduleDescriptor, (Set<String>)entry.getValue()); } } }); notification.expire(); }