void () { final String message = panel.getCommitMessage(); final Project project = panel.getProject(); final TaskManagerImpl manager = (TaskManagerImpl)TaskManager.getManager(project); if (manager.getState().saveContextOnCommit) { Task task = findTaskInRepositories(message, manager); if (task == null) { task = manager.createLocalTask(message); ((LocalTaskImpl)task).setClosed(true); } LocalTask localTask = manager.addTask(task); localTask.setUpdated(new Date()); ApplicationManager.getApplication().invokeLater(() -> WorkingContextManager.getInstance(project).saveContext(localTask), project.getDisposed()); } }