Program: 139910
Project: 139910
Buggy source:
@Override protected boolean runAnalysis(Analysis analysis,String sqlStatement){
  boolean ok=true;
  TypedReturnCode<Connection> trc=this.getConnection(analysis);
  if (!trc.isOk()) {
    return traceError("String_Node_Str" + analysis.getName() + "String_Node_Str"+ trc.getMessage());
  }
  Connection connection=trc.getObject();
  try {
    Map<ModelElement,List<Indicator>> elementToIndicator=new HashMap<ModelElement,List<Indicator>>();
    Collection<Indicator> indicators=IndicatorHelper.getIndicatorLeaves(analysis.getResults());
    for (    Indicator indicator : indicators) {
      if (indicator instanceof CompositeIndicator) {
        continue;
      }
      String catalogName=getCatalogOrSchemaName(indicator.getAnalyzedElement());
      if (catalogName != null) {
        changeCatalog(catalogName,connection);
      }
      Expression query=dbms().getInstantiatedExpression(indicator);
      if (query == null || !executeQuery(indicator,connection,query.getBody())) {
        ok=traceError("String_Node_Str" + indicator.getName() + "String_Node_Str"+ ((query == null) ? "String_Node_Str" : "String_Node_Str" + query.getBody()));
      }
 else {
        indicator.setComputed(true);
      }
      MultiMapHelper.addUniqueObjectToListMap(indicator.getAnalyzedElement(),indicator,elementToIndicator);
    }
    connection.close();
  }
 catch (  SQLException e) {
    log.error(e,e);
    this.errorMessage=e.getMessage();
    ok=false;
  }
 finally {
    ConnectionUtils.closeConnection(connection);
  }
  return ok;
}

Fixed version (ground truth):
@Override protected boolean runAnalysis(Analysis analysis,String sqlStatement){
  boolean ok=true;
  TypedReturnCode<Connection> trc=this.getConnection(analysis);
  if (!trc.isOk()) {
    return traceError("String_Node_Str" + analysis.getName() + "String_Node_Str"+ trc.getMessage());
  }
  Connection connection=trc.getObject();
  try {
    Map<ModelElement,List<Indicator>> elementToIndicator=new HashMap<ModelElement,List<Indicator>>();
    Collection<Indicator> indicators=IndicatorHelper.getIndicatorLeaves(analysis.getResults());
    for (    Indicator indicator : indicators) {
      if (indicator instanceof CompositeIndicator) {
        continue;
      }
      String catalogName=getCatalogOrSchemaName(indicator.getAnalyzedElement());
      if (catalogName != null) {
        changeCatalog(catalogName,connection);
      }
      Expression query=dbms().getInstantiatedExpression(indicator);
      if (query == null || !executeQuery(indicator,connection,query.getBody())) {
        ok=traceError("String_Node_Str" + indicator.getName() + "String_Node_Str"+ ((query == null) ? "String_Node_Str" : "String_Node_Str" + query.getBody()));
      }
 else {
        indicator.setComputed(true);
      }
      MultiMapHelper.addUniqueObjectToListMap(indicator.getAnalyzedElement(),indicator,elementToIndicator);
    }
    connection.close();
    ColumnAnalysisSqlExecutor finalization=new ColumnAnalysisSqlExecutor();
    finalization.setRowCountAndNullCount(elementToIndicator);
  }
 catch (  SQLException e) {
    log.error(e,e);
    this.errorMessage=e.getMessage();
    ok=false;
  }
 finally {
    ConnectionUtils.closeConnection(connection);
  }
  return ok;
}