@@ -0,0 +1,2179 @@
+/*%0A * Copyright 2000-2012 JetBrains s.r.o.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.intellij.openapi.project;%0A%0Aimport com.intellij.openapi.Disposable;%0Aimport com.intellij.openapi.module.Module;%0Aimport com.intellij.openapi.util.Disposer;%0A%0Aimport java.util.HashMap;%0Aimport java.util.List;%0Aimport java.util.Map;%0A%0A/**%0A * User: ksafonov%0A */%0Apublic abstract class ModuleNameTracker extends ModuleAdapter %7B%0A  private Map%3CModule, String%3E myModulesNames = new HashMap%3CModule, String%3E();%0A  private final Project myProject;%0A%0A  public ModuleNameTracker(Project project) %7B%0A    myProject = project;%0A    Disposer.register(project, new Disposable() %7B%0A      @Override%0A      public void dispose() %7B%0A        myModulesNames.clear();%0A      %7D%0A    %7D);%0A  %7D%0A%0A  @Override%0A  public void moduleAdded(final Project project, final Module module) %7B%0A    if (myProject == project) %7B%0A      myModulesNames.put(module, module.getName());%0A    %7D%0A  %7D%0A%0A  @Override%0A  public void moduleRemoved(final Project project, final Module module) %7B%0A    if (myProject == project) %7B%0A      myModulesNames.remove(module);%0A    %7D%0A  %7D%0A%0A  @Override%0A  public void modulesRenamed(final Project project, final List%3CModule%3E modules) %7B%0A    if (myProject != project) %7B%0A      return;%0A    %7D%0A%0A    Map%3CString, String%3E old2newNames = new HashMap%3CString, String%3E(modules.size());%0A    for (Module module : modules) %7B%0A      String newName = module.getName();%0A      String oldName = myModulesNames.put(module, newName);%0A      old2newNames.put(oldName, newName);%0A    %7D%0A    modulesRenamed(project, old2newNames);%0A  %7D%0A%0A  protected abstract void modulesRenamed(final Project project, final Map%3CString, String%3E old2newNames);%0A%7D%0A

Update run configuration reference on module and build configuration rename (IDEA-74823)