Program: 188374
Project: 188374
Buggy source:
private boolean isIndexMigrationNecessary(SolrClient solrClient,Optional<Path> tempIndexConfigsPath) throws GenericException {
  boolean migrationIsNecessary=false;
  if (tempIndexConfigsPath.isPresent()) {
    Path indexConfigsFolder=tempIndexConfigsPath.get().resolve(RodaConstants.CORE_CONFIG_FOLDER).resolve(RodaConstants.CORE_INDEX_FOLDER);
    List<String> solrCollections=getSolrCollections(indexConfigsFolder);
    Map<String,Integer> indexVersionsFromCode=getIndexVersionsFromCode(indexConfigsFolder,solrCollections);
    Map<String,Integer> indexVersionsInstalled=getIndexVersionsFromSolr(solrClient,solrCollections);
    if (indexVersionsFromCode.isEmpty() || indexVersionsInstalled.isEmpty()) {
      LOGGER.error("String_Node_Str");
      throw new GenericException("String_Node_Str");
    }
 else {
      for (      Entry<String,Integer> indexFromCode : indexVersionsFromCode.entrySet()) {
        String collection=indexFromCode.getKey();
        Integer collectionVersionFromCode=indexFromCode.getValue();
        if (indexVersionsInstalled.containsKey(collection)) {
          Integer collectionVersionInstalled=indexVersionsInstalled.get(collection);
          if (collectionVersionFromCode != collectionVersionInstalled) {
            LOGGER.warn("String_Node_Str",collection,collectionVersionFromCode,collectionVersionInstalled);
            migrationIsNecessary=true;
          }
        }
 else {
          LOGGER.warn("String_Node_Str",collection);
          migrationIsNecessary=true;
        }
      }
    }
  }
 else {
    LOGGER.error("String_Node_Str");
    throw new GenericException("String_Node_Str");
  }
  return migrationIsNecessary;
}

Fixed version (ground truth):
private boolean isIndexMigrationNecessary(SolrClient solrClient,Optional<Path> tempIndexConfigsPath) throws GenericException {
  boolean migrationIsNecessary=false;
  if (tempIndexConfigsPath.isPresent()) {
    Path indexConfigsFolder=tempIndexConfigsPath.get().resolve(RodaConstants.CORE_CONFIG_FOLDER).resolve(RodaConstants.CORE_INDEX_FOLDER);
    List<String> solrCollections=getSolrCollections(indexConfigsFolder);
    Map<String,Integer> indexVersionsFromCode=getIndexVersionsFromCode(indexConfigsFolder,solrCollections);
    Map<String,Integer> indexVersionsInstalled=getIndexVersionsFromSolr(solrClient,solrCollections);
    if (indexVersionsFromCode.isEmpty() || indexVersionsInstalled.isEmpty()) {
      LOGGER.error("String_Node_Str");
      throw new GenericException("String_Node_Str");
    }
 else {
      for (      Entry<String,Integer> indexFromCode : indexVersionsFromCode.entrySet()) {
        String collection=indexFromCode.getKey();
        Integer collectionVersionFromCode=indexFromCode.getValue();
        if (indexVersionsInstalled.containsKey(collection)) {
          Integer collectionVersionInstalled=indexVersionsInstalled.get(collection);
          if (!collectionVersionFromCode.equals(collectionVersionInstalled)) {
            LOGGER.warn("String_Node_Str",collection,collectionVersionFromCode,collectionVersionInstalled);
            migrationIsNecessary=true;
          }
        }
 else {
          LOGGER.warn("String_Node_Str",collection);
          migrationIsNecessary=true;
        }
      }
    }
  }
 else {
    LOGGER.error("String_Node_Str");
    throw new GenericException("String_Node_Str");
  }
  return migrationIsNecessary;
}