private void updateIconAndNotify() {
    MessagePool.State state = messagePool.getState();
    updateIcon(state);

    if (state == MessagePool.State.NoErrors) {
      if (balloon != null) {
        Disposer.dispose(balloon);
      }
    }
    else if (state == MessagePool.State.UnreadErrors && balloon == null && isActive(frame)) {
      Project project = frame.getProject();
      if (project != null) {
        ApplicationManager.getApplication().invokeLater(() -> showErrorNotification(project), project.getDisposed());
      }
    }
  }
private void updateIconAndNotify()