List<Pair<String, RefactoringElementListener>> listenersForPackages = new ArrayList<Pair<String,RefactoringElementListener>>();
final Set entries = myAllRenames.entrySet();
for (Iterator iterator = entries.iterator(); iterator.hasNext();) {
Map.Entry<PsiElement, String> entry = (Map.Entry<PsiElement, String>)iterator.next();
PsiElement element = entry.getKey();
<BUG>String newName = entry.getValue();
final RefactoringElementListener elementListener = getTransaction().getElementListener(element);</BUG>
RenameUtil.doRename(element, newName, extractUsagesForElement(element, usages), myProject, elementListener);
if (element instanceof PsiPackage) {
final PsiPackage psiPackage = (PsiPackage) element;

List<Pair<String, RefactoringElementListener>> listenersForPackages = new ArrayList<Pair<String,RefactoringElementListener>>();
final Set entries = myAllRenames.entrySet();
for (Iterator iterator = entries.iterator(); iterator.hasNext();) {
Map.Entry<PsiElement, String> entry = (Map.Entry<PsiElement, String>)iterator.next();
PsiElement element = entry.getKey();
String newName = entry.getValue();
if (newName != null) {
final RefactoringElementListener elementListener = getTransaction().getElementListener(element);
RenameUtil.doRename(element, newName, extractUsagesForElement(element, usages), myProject, elementListener);
if (element instanceof PsiPackage) {
final PsiPackage psiPackage = (PsiPackage) element;
