void (@NotNull final PsiElement element, @NotNull final String newName, @NotNull final Map<? extends PsiElement, String> allRenames, @NotNull final List<UsageInfo> result) { final PsiClass aClass = (PsiClass)element; final ClassCollisionsDetector classCollisionsDetector = new ClassCollisionsDetector(aClass); Collection<UsageInfo> initialResults = new ArrayList<>(result); for(UsageInfo usageInfo: initialResults) { if (usageInfo instanceof MoveRenameUsageInfo) { classCollisionsDetector.addClassCollisions(usageInfo.getElement(), newName, result); } } findSubmemberHidesMemberCollisions(aClass, newName, result); if (aClass instanceof PsiTypeParameter) { final PsiTypeParameterListOwner owner = ((PsiTypeParameter)aClass).getOwner(); if (owner != null) { for (PsiTypeParameter typeParameter : owner.getTypeParameters()) { if (Objects.equals(newName, typeParameter.getName())) { result.add(new UnresolvableCollisionUsageInfo(aClass, typeParameter) { @Override public String getDescription() { return JavaRefactoringBundle .message("there.is.already.type.parameter.in.0.with.name.1", RefactoringUIUtil.getDescription(aClass, false), newName); } }); } } } } }