private void editMap(MigrationMap map) {
    if (map == null) {
      return;
    }

    final boolean predefined = MigrationMapSet.isPredefined(map.getFileName());

    MigrationMap mapToEdit = map;
    String editedMapName = "";
    if (predefined) {
      mapToEdit = map.cloneMap();
      mapToEdit.setName(JavaRefactoringBundle.message("migration.edit.duplicated.migration.name", mapToEdit.getName()));
    } else {
      editedMapName = mapToEdit.getName();
    }

    EditMigrationDialog dialog = new EditMigrationDialog(myProject, mapToEdit, myMigrationMapSet, editedMapName);
    if (!dialog.showAndGet()) {
      return;
    }

    MigrationManager.updateMapFromDialog(mapToEdit, dialog);

    if (predefined) {
      // Save new map and close the dialog
      try {
        myMigrationMapSet.addMap(mapToEdit);
        myMigrationMapSet.saveMaps();
        doCancelAction();
      }
      catch (IOException e) {
        LOG.error("Couldn't save migration maps.", e);
      }
    } else {
      // Update the dialog with edited map
      myMigrationMap = mapToEdit;
      myUi.update(myMigrationMap);
    }
  }
private void editMap(MigrationMap map)