void (final String oldClassName, String newClassName) { final NameSuggester suggester = new NameSuggester(oldClassName, newClassName); for (int varIndex = myElements.size() - 1; varIndex >= 0; varIndex--) { final PsiNamedElement element = myElements.get(varIndex); final String name = element.getName(); if (!myRenames.containsKey(element) && name != null) { String newName = suggestNameForElement(element, suggester, newClassName, oldClassName); if (!newName.equals(name)) { myRenames.put(element, newName); } else { myRenames.put(element, null); } } if (myRenames.get(element) == null) { myElements.remove(varIndex); } } }