void (UsageInfo[] usage, MultiMap<PsiElement, String> conflicts) { HashMap<PsiElement,HashSet<PsiElement>> reportedNonDelegatedUsages = new HashMap<>(); HashMap<PsiClass,HashSet<PsiElement>> reportedUpcasts = new HashMap<>(); final String classDescription = RefactoringUIUtil.getDescription(myClass, false); for (UsageInfo aUsage : usage) { final PsiElement element = aUsage.getElement(); if (aUsage instanceof InheritanceToDelegationUsageInfo usageInfo) { /*if (usageInfo instanceof ObjectUpcastedUsageInfo) { PsiElement container = ConflictsUtil.getContainer(usageInfo.element); if (!reportedObjectUpcasts.contains(container)) { String message = "An instance of " + classDescription + " is upcasted to " + nameJavaLangObject + " in " + ConflictsUtil.getDescription(container, true) + "."; conflicts.add(message); reportedObjectUpcasts.add(container); } } else*/ if (!myIsDelegateOtherMembers && !usageInfo.getDelegateFieldAccessible().isAccessible()) { if (usageInfo instanceof NonDelegatedMemberUsageInfo) { final PsiElement nonDelegatedMember = ((NonDelegatedMemberUsageInfo)usageInfo).nonDelegatedMember; HashSet<PsiElement> reportedContainers = reportedNonDelegatedUsages.get(nonDelegatedMember); if (reportedContainers == null) { reportedContainers = new HashSet<>(); reportedNonDelegatedUsages.put(nonDelegatedMember, reportedContainers); } final PsiElement container = ConflictsUtil.getContainer(element); if (!reportedContainers.contains(container)) { String message = JavaRefactoringBundle.message("0.uses.1.of.an.instance.of.a.2", RefactoringUIUtil.getDescription(container, true), RefactoringUIUtil.getDescription(nonDelegatedMember, true), classDescription); conflicts.putValue(container, StringUtil.capitalize(message)); reportedContainers.add(container); } } else if (usageInfo instanceof UpcastedUsageInfo) { final PsiClass upcastedTo = ((UpcastedUsageInfo)usageInfo).upcastedTo; HashSet<PsiElement> reportedContainers = reportedUpcasts.get(upcastedTo); if (reportedContainers == null) { reportedContainers = new HashSet<>(); reportedUpcasts.put(upcastedTo, reportedContainers); } final PsiElement container = ConflictsUtil.getContainer(element); if (!reportedContainers.contains(container)) { String message = JavaRefactoringBundle.message("0.upcasts.an.instance.of.1.to.2", RefactoringUIUtil.getDescription(container, true), classDescription, RefactoringUIUtil.getDescription(upcastedTo, false)); conflicts.putValue(container, StringUtil.capitalize(message)); reportedContainers.add(container); } } } } else if (aUsage instanceof NoLongerOverridingSubClassMethodUsageInfo info) { String message = JavaRefactoringBundle.message("0.will.no.longer.override.1", RefactoringUIUtil.getDescription(info.getSubClassMethod(), true), RefactoringUIUtil.getDescription(info.getOverridenMethod(), true)); conflicts.putValue(info.getSubClassMethod(), message); } } }