void (Notification notification, @Nullable Project project) { if (project != null && !project.isDisposed() && !project.isDefault()) { project.getMessageBus().syncPublisher(TOPIC).notify(notification); Disposable notificationDisposable = () -> notification.expire(); Disposer.register(project, notificationDisposable); notification.whenExpired(() -> Disposer.dispose(notificationDisposable)); } else { Application app = ApplicationManager.getApplication(); if (!app.isDisposed()) { app.getMessageBus().syncPublisher(TOPIC).notify(notification); } } }