void (Object sessionId, CompilerMessage message) { if (ApplicationManager.getApplication().isDispatchThread()) { openMessageView(sessionId); doAddMessage(message); } else { ApplicationManager.getApplication().invokeLater(() -> { if (!myProject.isDisposed()) { openMessageView(sessionId); doAddMessage(message); } }, ModalityState.nonModal()); } }