private void updateModuleNames(Map<String, String> moduleNameMap) {
    JpsJavaCompilerOptions settings = getJavaCompilerSettings();
    boolean updated = false;
    for (Map.Entry<String, String> entry : moduleNameMap.entrySet()) {
      String targetLevel = myModuleBytecodeTarget.remove(entry.getKey());
      if (targetLevel != null) {
        myModuleBytecodeTarget.put(entry.getValue(), targetLevel);
        updated = true;
      }
      if (settings != null) {
        String options = settings.ADDITIONAL_OPTIONS_OVERRIDE.remove(entry.getKey());
        if (options != null) {
          settings.ADDITIONAL_OPTIONS_OVERRIDE.put(entry.getValue(), options);
          updated = true;
        }
      }
    }

    for (ProcessorConfigProfile profile : myModuleProcessorProfiles) {
      Set<String> names = profile.getModuleNames();
      Collection<String> updatedNames = ContainerUtil.intersection(names, moduleNameMap.keySet());
      if (!updatedNames.isEmpty()) {
        profile.removeModuleNames(updatedNames);
        profile.addModuleNames(ContainerUtil.map(updatedNames, moduleNameMap::get));
        updated = true;
      }
    }

    if (updated) {
      clearBuildManagerState(myProject);
    }
  }
private void updateModuleNames(Map<String, String> moduleNameMap)