void (@NotNull RefClass aClass) { if (aClass.isAnonymous() || aClass.isLocalClass()) return; RefModule toModule = aClass.getModule(); if (toModule == null) return; String toModuleName = toModule.getName(); if (!to2FromCandidatePairsToRemove.containsKey(toModuleName)) return; if (PsiModifier.PRIVATE.equals(aClass.getAccessModifier())) return; javaInspectionContext.enqueueClassUsagesProcessor(aClass, reference -> { PsiFile containingFile = reference.getElement().getContainingFile(); if (!(containingFile instanceof PsiClassOwner)) { RefElement refFrom = refManager.getReference(containingFile); if (refFrom != null) { RefModule fromModule = refFrom.getModule(); if (fromModule != null) { CommonProblemDescriptor[] descriptions = problemDescriptionsProcessor.getDescriptions(fromModule); if (descriptions != null) { LinkedHashSet<CommonProblemDescriptor> problemDescriptors = new LinkedHashSet<>(Arrays.asList(descriptions)); boolean removed = problemDescriptors.removeIf(descriptor -> { QuickFix<?>[] fixes = descriptor.getFixes(); return fixes != null && ContainerUtil.exists(fixes, fix -> fix instanceof RemoveModuleDependencyFix && toModuleName.equals(((RemoveModuleDependencyFix)fix).myDependency)); }); if (removed) { problemDescriptionsProcessor.ignoreElement(fromModule); if (!problemDescriptors.isEmpty()) { problemDescriptionsProcessor.addProblemElement(fromModule, problemDescriptors.toArray(CommonProblemDescriptor[]::new)); } } } } } } return true; }); }