Program: 140088
Project: 140088
Buggy source:
@Override protected ReturnCode executeSqlQuery(String sqlStatement) throws SQLException {
  ReturnCode ok=new ReturnCode(true);
  dataProvider=this.getDataManager();
  if (this.elementToIndicators.values().isEmpty()) {
    String msg="String_Node_Str";
    log.error(msg);
    ok.setReturnCode(msg,false);
    return ok;
  }
  elementIndics=this.elementToIndicators.values().iterator().next();
  if (elementIndics.isEmpty()) {
    String msg="String_Node_Str" + dataProvider;
    log.error(msg);
    ok.setReturnCode(msg,false);
    return ok;
  }
  ConnectionIndicator connectionIndicator=getConnectionIndicator();
  this.resetCounts(connectionIndicator);
  List<TdCatalog> catalogs=DataProviderHelper.getTdCatalogs(dataProvider);
  if (catalogs.isEmpty()) {
    List<TdSchema> schemata=DataProviderHelper.getTdSchema(dataProvider);
    for (    TdSchema tdSchema : schemata) {
      evalSchemaIndic(tdSchema,ok);
    }
  }
 else {
    for (    TdCatalog tdCatalog : catalogs) {
      String catName=tdCatalog.getName();
      connection.setCatalog(catName);
      CatalogIndicator catalogIndic=SchemaFactory.eINSTANCE.createCatalogIndicator();
      this.addToConnectionIndicator(catalogIndic);
      List<TdSchema> schemas=CatalogHelper.getSchemas(tdCatalog);
      if (schemas.isEmpty()) {
        evalCatalogIndic(catalogIndic,tdCatalog,ok);
      }
 else {
        catalogIndic.setAnalyzedElement(tdCatalog);
        for (        TdSchema tdSchema : schemas) {
          SchemaIndicator schemaIndic=SchemaFactory.eINSTANCE.createSchemaIndicator();
          evalSchemaIndicLow(catalogIndic,schemaIndic,tdCatalog,tdSchema,ok);
        }
        catalogIndic.setSchemaCount(schemas.size());
      }
    }
  }
  if (log.isDebugEnabled()) {
    printCounts(connectionIndicator);
  }
  return ok;
}

Fixed version (ground truth):
@Override protected ReturnCode executeSqlQuery(String sqlStatement) throws SQLException {
  ReturnCode ok=new ReturnCode(true);
  dataProvider=this.getDataManager();
  if (this.elementToIndicators.values().isEmpty()) {
    String msg="String_Node_Str";
    log.error(msg);
    ok.setReturnCode(msg,false);
    return ok;
  }
  elementIndics=this.elementToIndicators.values().iterator().next();
  if (elementIndics.isEmpty()) {
    String msg="String_Node_Str" + dataProvider;
    log.error(msg);
    ok.setReturnCode(msg,false);
    return ok;
  }
  ConnectionIndicator connectionIndicator=getConnectionIndicator();
  this.resetCounts(connectionIndicator);
  List<TdCatalog> catalogs=DataProviderHelper.getTdCatalogs(dataProvider);
  if (catalogs.isEmpty()) {
    List<TdSchema> schemata=DataProviderHelper.getTdSchema(dataProvider);
    for (    TdSchema tdSchema : schemata) {
      evalSchemaIndic(tdSchema,ok);
    }
  }
 else {
    for (    TdCatalog tdCatalog : catalogs) {
      String catName=tdCatalog.getName();
      try {
        connection.setCatalog(catName);
      }
 catch (      Exception e) {
        log.warn("String_Node_Str" + sqlStatement,e);
      }
      CatalogIndicator catalogIndic=SchemaFactory.eINSTANCE.createCatalogIndicator();
      this.addToConnectionIndicator(catalogIndic);
      List<TdSchema> schemas=CatalogHelper.getSchemas(tdCatalog);
      if (schemas.isEmpty()) {
        evalCatalogIndic(catalogIndic,tdCatalog,ok);
      }
 else {
        catalogIndic.setAnalyzedElement(tdCatalog);
        for (        TdSchema tdSchema : schemas) {
          SchemaIndicator schemaIndic=SchemaFactory.eINSTANCE.createSchemaIndicator();
          evalSchemaIndicLow(catalogIndic,schemaIndic,tdCatalog,tdSchema,ok);
        }
        catalogIndic.setSchemaCount(schemas.size());
      }
    }
  }
  if (log.isDebugEnabled()) {
    printCounts(connectionIndicator);
  }
  return ok;
}