void () { Map<ConfigurationErrorType, Collection<ConfigurationErrorDescription>> descriptionMap; synchronized (myLock) { if (myErrors.isEmpty()) { return; } descriptionMap = myErrors.toHashMap(); myErrors.clear(); } for (Map.Entry<ConfigurationErrorType, Collection<ConfigurationErrorDescription>> entry : descriptionMap.entrySet()) { List<ConfigurationErrorDescription> descriptions = new ArrayList<>(entry.getValue()); ConfigurationErrorType type = entry.getKey(); if (descriptions.isEmpty()) { continue; } String invalidElements = type.getErrorText(descriptions.size(), descriptions.iterator().next().getElementName()); String errorText = ProjectBundle.message("error.message.configuration.cannot.load", invalidElements); NotificationGroupManager.getInstance() .getNotificationGroup("Project Loading Error") .createNotification(ProjectBundle.message("notification.title.error.loading.project"), errorText, NotificationType.ERROR) .addAction( NotificationAction.create(ProjectBundle.message("error.message.configuration.cannot.load.button"), (event, notification) -> { List<ConfigurationErrorDescription> validDescriptions = ContainerUtil.findAll(descriptions, ConfigurationErrorDescription::isValid); if (RemoveInvalidElementsDialog.showDialog(myProject, CommonBundle.getErrorTitle(), type, invalidElements, validDescriptions)) { notification.expire(); } })) .notify(myProject); } }