private static MigrationMap readMap(File file) throws JDOMException, InvalidDataException, IOException {
    if (!file.exists()) {
      return null;
    }

    Element root = JDOMUtil.load(file);
    if (!MIGRATION_MAP.equals(root.getName())){
      throw new InvalidDataException();
    }
    String fileName = file.getName();

    MigrationMap map = new MigrationMap();

    for (Element node : root.getChildren()) {
      if (NAME.equals(node.getName())) {
        @NlsSafe String name = node.getAttributeValue(VALUE);
        map.setName(name);
        for (PredefinedMigrationProvider provider : PredefinedMigrationProvider.EP_NAME.getExtensionList()) {
          if (new File(provider.getMigrationMap().getFile()).getName().equals(fileName)) {
            map.setDescription(provider.getDescription());
            break;
          }
        }
      }

      if (map.getDescription() == null && DESCRIPTION.equals(node.getName())) {
        @NlsSafe String description = node.getAttributeValue(VALUE);
        map.setDescription(description);
      }

      if (ORDER.equals(node.getName())) {
        String orderValue = node.getAttributeValue(VALUE);
        if (orderValue != null && !orderValue.isBlank()) {
          map.setOrder(Integer.parseInt(orderValue));
        }
      }

      if (ENTRY.equals(node.getName())) {
        MigrationMapEntry entry = new MigrationMapEntry();
        String oldName = node.getAttributeValue(OLD_NAME);
        if (oldName == null) {
          throw new InvalidDataException();
        }
        entry.setOldName(oldName);
        String newName = node.getAttributeValue(NEW_NAME);
        if (newName == null) {
          throw new InvalidDataException();
        }
        entry.setNewName(newName);
        String typeStr = node.getAttributeValue(TYPE);
        if (typeStr == null) {
          throw new InvalidDataException();
        }
        entry.setType(MigrationMapEntry.CLASS);
        if (typeStr.equals(PACKAGE_TYPE)) {
          entry.setType(MigrationMapEntry.PACKAGE);
          @NonNls String isRecursiveStr = node.getAttributeValue(RECURSIVE);
          if (isRecursiveStr != null && isRecursiveStr.equals("true")) {
            entry.setRecursive(true);
          }
          else {
            entry.setRecursive(false);
          }
        }
        map.addEntry(entry);
      }
    }

    return map;
  }
private static MigrationMap readMap(File file)