Program: 140031
Project: 140031
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();
      try {
        connection.setCatalog(catName);
      }
 catch (      Exception e) {
        log.warn("String_Node_Str" + sqlStatement,e);
      }
      CatalogIndicator catalogIndic=SchemaFactory.eINSTANCE.createCatalogIndicator();
      DefinitionHandler.getInstance().setDefaultIndicatorDefinition(catalogIndic);
      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();
          DefinitionHandler.getInstance().setDefaultIndicatorDefinition(schemaIndic);
          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();
      DefinitionHandler.getInstance().setDefaultIndicatorDefinition(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();
          DefinitionHandler.getInstance().setDefaultIndicatorDefinition(schemaIndic);
          evalSchemaIndicLow(catalogIndic,schemaIndic,tdCatalog,tdSchema,ok);
        }
        catalogIndic.setSchemaCount(schemas.size());
      }
    }
  }
  if (log.isDebugEnabled()) {
    printCounts(connectionIndicator);
  }
  return ok;
}