void (final Map<String, Set<String>> keyToDifferentValues, final Map<String, Set<PsiFile>> keyToFiles, final List<? super ProblemDescriptor> problemDescriptors, final InspectionManager manager, final PsiFile psiFile, final ProgressIndicator progress) { for (String key : keyToDifferentValues.keySet()) { if (progress != null) { progress.setText2(PropertiesBundle.message("duplicate.property.diff.key.progress.indicator.text", key)); ProgressIndicatorUtils.checkCancelledEvenWithPCEDisabled(progress); } final Set<String> values = keyToDifferentValues.get(key); if (values == null || values.size() < 2){ keyToFiles.remove(key); } else { @Nls StringBuilder message = new StringBuilder(); final Set<PsiFile> psiFiles = keyToFiles.get(key); boolean firstUsage = true; for (PsiFile file : psiFiles) { if (!(file instanceof PropertiesFile propertiesFile)) continue; final List<IProperty> propertiesByKey = propertiesFile.findPropertiesByKey(key); for (IProperty property : propertiesByKey) { if (firstUsage){ message.append(PropertiesBundle.message("duplicate.property.diff.key.problem.descriptor", key)); firstUsage = false; } surroundWithHref(message, property.getPsiElement().getFirstChild(), false); } } problemDescriptors.add(manager.createProblemDescriptor(psiFile, message.toString(), false, null, ProblemHighlightType.GENERIC_ERROR_OR_WARNING)); } } }