Program: 137266
Project: 137266
Buggy source:
/** 
 * orgnize EList 'objectLs' for DelimitedFile connection.
 * @param sqlStatement
 * @param returnCode
 * @return
 */
private ReturnCode evaluateByDelimitedFile(String sqlStatement,ReturnCode returnCode){
  DelimitedFileConnection fileConnection=(DelimitedFileConnection)analysis.getContext().getConnection();
  String path=AnalysisExecutorHelper.getFilePath(fileConnection);
  String rowSeparator=fileConnection.getRowSeparatorValue();
  if (fileConnection.isContextMode()) {
    rowSeparator=ConnectionUtils.getOriginalConntextValue(fileConnection,rowSeparator);
  }
  IPath iPath=new Path(path);
  File file=iPath.toFile();
  if (!file.exists()) {
    returnCode.setReturnCode(Messages.getString("String_Node_Str",file.getName()),false);
    return returnCode;
  }
  CsvReader csvReader=null;
  try {
    List<ModelElement> analysisElementList=this.analysis.getContext().getAnalysedElements();
    EMap<Indicator,AnalyzedDataSet> indicToRowMap=analysis.getResults().getIndicToRowMap();
    indicToRowMap.clear();
    if (Escape.CSV.equals(fileConnection.getEscapeType())) {
      csvReader=AnalysisExecutorHelper.createCsvReader(file,fileConnection);
      this.useCsvReader(csvReader,file,fileConnection,analysisElementList);
    }
 else {
      FileInputDelimited fileInputDelimited=AnalysisExecutorHelper.createFileInputDelimited(fileConnection);
      long currentRow=AnalysisExecutorHelper.getHeadValue(fileConnection);
      int columsCount=0;
      while (fileInputDelimited.nextRecord()) {
        if (!continueRun()) {
          break;
        }
        currentRow++;
        if (columsCount == 0) {
          columsCount=fileInputDelimited.getColumnsCountOfCurrentRow();
        }
        String[] rowValues=new String[columsCount];
        for (int i=0; i < columsCount; i++) {
          rowValues[i]=fileInputDelimited.get(i);
        }
        orgnizeObjectsToHandel(path,rowValues,currentRow,analysisElementList,rowSeparator);
      }
      fileInputDelimited.close();
    }
  }
 catch (  Exception e) {
    log.error(e,e);
    returnCode.setReturnCode(e.getMessage(),false);
  }
 finally {
    if (csvReader != null) {
      csvReader.close();
    }
  }
  return returnCode;
}

Fixed version (ground truth):
/** 
 * orgnize EList 'objectLs' for DelimitedFile connection.
 * @param sqlStatement
 * @param returnCode
 * @return
 */
private ReturnCode evaluateByDelimitedFile(String sqlStatement,ReturnCode returnCode){
  DelimitedFileConnection fileConnection=(DelimitedFileConnection)analysis.getContext().getConnection();
  String path=JavaSqlFactory.getURL(fileConnection);
  String rowSeparator=JavaSqlFactory.getRowSeparatorValue(fileConnection);
  IPath iPath=new Path(path);
  File file=iPath.toFile();
  if (!file.exists()) {
    returnCode.setReturnCode(Messages.getString("String_Node_Str",file.getName()),false);
    return returnCode;
  }
  CsvReader csvReader=null;
  try {
    List<ModelElement> analysisElementList=this.analysis.getContext().getAnalysedElements();
    EMap<Indicator,AnalyzedDataSet> indicToRowMap=analysis.getResults().getIndicToRowMap();
    indicToRowMap.clear();
    if (Escape.CSV.equals(fileConnection.getEscapeType())) {
      csvReader=AnalysisExecutorHelper.createCsvReader(file,fileConnection);
      this.useCsvReader(csvReader,file,fileConnection,analysisElementList);
    }
 else {
      FileInputDelimited fileInputDelimited=AnalysisExecutorHelper.createFileInputDelimited(fileConnection);
      long currentRow=JavaSqlFactory.getHeadValue(fileConnection);
      int columsCount=0;
      while (fileInputDelimited.nextRecord()) {
        if (!continueRun()) {
          break;
        }
        currentRow++;
        if (columsCount == 0) {
          columsCount=fileInputDelimited.getColumnsCountOfCurrentRow();
        }
        String[] rowValues=new String[columsCount];
        for (int i=0; i < columsCount; i++) {
          rowValues[i]=fileInputDelimited.get(i);
        }
        orgnizeObjectsToHandel(path,rowValues,currentRow,analysisElementList,rowSeparator);
      }
      fileInputDelimited.close();
    }
  }
 catch (  Exception e) {
    log.error(e,e);
    returnCode.setReturnCode(e.getMessage(),false);
  }
 finally {
    if (csvReader != null) {
      csvReader.close();
    }
  }
  return returnCode;
}