NonCodeUsageInfo[] (UsageInfo[] usages, Map<PsiElement, PsiElement> oldToNewElementsMapping) { Arrays.sort(usages, USAGE_INFO_COMPARATOR); List<NonCodeUsageInfo> nonCodeUsages = new ArrayList<>(); for (UsageInfo usage : usages) { if (usage instanceof NonCodeUsageInfo) { nonCodeUsages.add((NonCodeUsageInfo)usage); } else if (usage instanceof MoveRenameUsageInfo moveRenameUsage) { final PsiElement oldElement = moveRenameUsage.getReferencedElement(); final PsiElement newElement = oldToNewElementsMapping.get(oldElement); LOG.assertTrue(newElement != null, oldElement); final PsiReference reference = moveRenameUsage.getReference(); if (reference != null) { try { reference.bindToElement(newElement); } catch (IncorrectOperationException e) {// } } } } return nonCodeUsages.toArray(new NonCodeUsageInfo[0]); }