Program: 137830
Project: 137830
Buggy source:
public ReturnCode execute(TdReport report) throws AnalysisExecutionException {
  atLeastOneFailure=false;
  long startTime=System.currentTimeMillis();
  EList<AnalysisMap> analysisMaps=report.getAnalysisMap();
  StringBuilder strBuilder=new StringBuilder();
  for (  AnalysisMap analysisMap : analysisMaps) {
    Analysis analysis=analysisMap.getAnalysis();
    if (analysisMap.isMustRefresh()) {
      if (analysis == null) {
        return new ReturnCode(Messages.getString("String_Node_Str",report.getName()),false);
      }
      ReturnCode executeRc=AnalysisExecutorSelector.executeAnalysis(analysis);
      if (executeRc.getMessage() != null) {
        throw new AnalysisExecutionException(Messages.getString("String_Node_Str",analysis.getName(),executeRc.getMessage()));
      }
      TdqAnalysisConnectionPool connectionPool=TdqAnalysisConnectionPool.getConnectionPool(analysis);
      if (connectionPool != null) {
        connectionPool.closeConnectionPool();
      }
      if (!executeRc.isOk()) {
        log.error("String_Node_Str" + analysis.getName() + "String_Node_Str"+ executeRc.getMessage());
        atLeastOneFailure=true;
      }
      if (log.isInfoEnabled()) {
        strBuilder.append("String_Node_Str" + report.getName() + "String_Node_Str"+ analysis.getName()+ "String_Node_Str"+ executeRc.isOk()+ "String_Node_Str");
      }
    }
 else {
      if (log.isInfoEnabled()) {
        strBuilder.append("String_Node_Str" + report.getName() + "String_Node_Str"+ analysis.getName()+ "String_Node_Str");
      }
    }
  }
  if (log.isInfoEnabled()) {
    if (strBuilder.length() == 0) {
      log.info("String_Node_Str" + report.getName() + "String_Node_Str");
    }
 else {
      log.info(strBuilder.toString());
    }
  }
  long endTime=System.currentTimeMillis();
  ExecutionInformations execInformations=ReportHelper.getExecutionInformations(report);
  execInformations.setExecutionDate(new Date(startTime));
  int duration=(int)(endTime - startTime);
  execInformations.setExecutionDuration(duration);
  execInformations.setExecutionNumber(execInformations.getExecutionNumber() + 1);
  if (atLeastOneFailure) {
    execInformations.setLastRunOk(false);
    String err=Messages.getString("String_Node_Str",report.getName());
    execInformations.setMessage(err);
    return new ReturnCode(err,false);
  }
  execInformations.setLastRunOk(true);
  execInformations.setLastExecutionNumberOk(execInformations.getExecutionNumber());
  execInformations.setMessage(null);
  return new ReturnCode();
}

Fixed version (ground truth):
public ReturnCode execute(TdReport report) throws AnalysisExecutionException {
  atLeastOneFailure=false;
  long startTime=System.currentTimeMillis();
  if (report.eIsProxy()) {
    report=(TdReport)EObjectHelper.resolveObject(report);
  }
  EList<AnalysisMap> analysisMaps=report.getAnalysisMap();
  StringBuilder strBuilder=new StringBuilder();
  for (  AnalysisMap analysisMap : analysisMaps) {
    Analysis analysis=analysisMap.getAnalysis();
    if (analysisMap.isMustRefresh()) {
      if (analysis == null) {
        return new ReturnCode(Messages.getString("String_Node_Str",report.getName()),false);
      }
      ReturnCode executeRc=AnalysisExecutorSelector.executeAnalysis(analysis);
      if (executeRc.getMessage() != null) {
        throw new AnalysisExecutionException(Messages.getString("String_Node_Str",analysis.getName(),executeRc.getMessage()));
      }
      TdqAnalysisConnectionPool connectionPool=TdqAnalysisConnectionPool.getConnectionPool(analysis);
      if (connectionPool != null) {
        connectionPool.closeConnectionPool();
      }
      if (!executeRc.isOk()) {
        log.error("String_Node_Str" + analysis.getName() + "String_Node_Str"+ executeRc.getMessage());
        atLeastOneFailure=true;
      }
      if (log.isInfoEnabled()) {
        strBuilder.append("String_Node_Str" + report.getName() + "String_Node_Str"+ analysis.getName()+ "String_Node_Str"+ executeRc.isOk()+ "String_Node_Str");
      }
    }
 else {
      if (log.isInfoEnabled()) {
        strBuilder.append("String_Node_Str" + report.getName() + "String_Node_Str"+ analysis.getName()+ "String_Node_Str");
      }
    }
  }
  if (log.isInfoEnabled()) {
    if (strBuilder.length() == 0) {
      log.info("String_Node_Str" + report.getName() + "String_Node_Str");
    }
 else {
      log.info(strBuilder.toString());
    }
  }
  long endTime=System.currentTimeMillis();
  ExecutionInformations execInformations=ReportHelper.getExecutionInformations(report);
  execInformations.setExecutionDate(new Date(startTime));
  int duration=(int)(endTime - startTime);
  execInformations.setExecutionDuration(duration);
  execInformations.setExecutionNumber(execInformations.getExecutionNumber() + 1);
  if (atLeastOneFailure) {
    execInformations.setLastRunOk(false);
    String err=Messages.getString("String_Node_Str",report.getName());
    execInformations.setMessage(err);
    return new ReturnCode(err,false);
  }
  execInformations.setLastRunOk(true);
  execInformations.setLastExecutionNumberOk(execInformations.getExecutionNumber());
  execInformations.setMessage(null);
  return new ReturnCode();
}