void (final PsiFile file, final InspectionManager manager, GlobalInspectionContextBase context, final RefManager refManager, final ProblemDescriptionsProcessor processor) { if (!(file instanceof PropertiesFile propertiesFile)) return; if (!context.isToCheckFile(file, this) || SuppressionUtil.inspectionResultSuppressed(file, this)) return; final PsiSearchHelper searchHelper = PsiSearchHelper.getInstance(file.getProject()); final List<IProperty> properties = propertiesFile.getProperties(); Module module = ModuleUtilCore.findModuleForPsiElement(file); if (module == null) return; final GlobalSearchScope scope = GlobalSearchScope.getScopeRestrictedByFileTypes(CURRENT_FILE ? GlobalSearchScope.fileScope(file) : MODULE_WITH_DEPENDENCIES ? GlobalSearchScope.moduleWithDependenciesScope(module) : GlobalSearchScope.projectScope(file.getProject()), PropertiesFileType.INSTANCE); final Map<String, Set<PsiFile>> processedValueToFiles = Collections.synchronizedMap(new HashMap<>()); final Map<String, Set<PsiFile>> processedKeyToFiles = Collections.synchronizedMap(new HashMap<>()); final ProgressIndicator original = ProgressManager.getInstance().getProgressIndicator(); final ProgressIndicator progress = ProgressWrapper.wrap(original); ProgressManager.getInstance().runProcess(() -> { if (!JobLauncher.getInstance().invokeConcurrentlyUnderProgress(properties, progress, property -> { if (original != null) { if (original.isCanceled()) return false; original.setText2(PropertiesBundle.message("searching.for.property.key.progress.text", property.getUnescapedKey())); } processTextUsages(processedValueToFiles, property.getValue(), processedKeyToFiles, searchHelper, scope); processTextUsages(processedKeyToFiles, property.getUnescapedKey(), processedValueToFiles, searchHelper, scope); return true; })) throw new ProcessCanceledException(); List<ProblemDescriptor> problemDescriptors = new ArrayList<>(); Map<String, Set<String>> keyToDifferentValues = new HashMap<>(); if (CHECK_DUPLICATE_KEYS || CHECK_DUPLICATE_KEYS_WITH_DIFFERENT_VALUES) { prepareDuplicateKeysByFile(processedKeyToFiles, manager, keyToDifferentValues, problemDescriptors, file, original); } if (CHECK_DUPLICATE_VALUES) prepareDuplicateValuesByFile(processedValueToFiles, manager, problemDescriptors, file, original); if (CHECK_DUPLICATE_KEYS_WITH_DIFFERENT_VALUES) { processDuplicateKeysWithDifferentValues(keyToDifferentValues, processedKeyToFiles, problemDescriptors, manager, file, original); } if (!problemDescriptors.isEmpty()) { processor.addProblemElement(refManager.getReference(file), problemDescriptors.toArray(ProblemDescriptor.EMPTY_ARRAY)); } }, progress); }