Program: 167443
Project: 167443
Buggy source:
private void processFiles(List<String> files,IMessageTarget messageTarget,boolean unitOfWorkLastMessage){
  int numberMessages=0;
  int linesInMessage=0;
  ArrayList<String> payload=new ArrayList<String>();
  filesRead.addAll(files);
  for (  String file : files) {
    InputStream inStream=null;
    BufferedReader reader=null;
    int currentFileLinesRead=0;
    String currentLine;
    try {
      info("String_Node_Str",file);
      IStreamable resource=(IStreamable)getResourceReference();
      String filePath=FormatUtils.replaceTokens(file,context.getFlowParametersAsString(),true);
      inStream=resource.getInputStream(filePath,mustExist);
      reader=new BufferedReader(new InputStreamReader(inStream,encoding));
      while ((currentLine=reader.readLine()) != null) {
        currentFileLinesRead++;
        if (linesInMessage == textRowsPerMessage) {
          initAndSendMessage(payload,messageTarget,++numberMessages,false);
          linesInMessage=0;
          payload=new ArrayList<String>();
        }
        if (currentFileLinesRead > textHeaderLinesToSkip) {
          getComponentStatistics().incrementNumberEntitiesProcessed();
          payload.add(currentLine);
          linesInMessage++;
        }
      }
      if (unitOfWork.equalsIgnoreCase(UNIT_OF_WORK_FILE)) {
        initAndSendMessage(payload,messageTarget,++numberMessages,true);
        numberMessages=0;
        linesInMessage=0;
      }
    }
 catch (    IOException e) {
      throw new IoException("String_Node_Str" + e.getMessage());
    }
 finally {
      IOUtils.closeQuietly(reader);
      IOUtils.closeQuietly(inStream);
    }
  }
  if (unitOfWork.equalsIgnoreCase(UNIT_OF_WORK_INPUT_MESSAGE) || (unitOfWork.equalsIgnoreCase(UNIT_OF_WORK_FLOW) && unitOfWorkLastMessage)) {
    initAndSendMessage(payload,messageTarget,++numberMessages,true);
  }
}

Fixed version (ground truth):
private void processFiles(List<String> files,IMessageTarget messageTarget,boolean unitOfWorkLastMessage){
  int numberMessages=0;
  int linesInMessage=0;
  ArrayList<String> payload=new ArrayList<String>();
  filesRead.addAll(files);
  for (  String file : files) {
    InputStream inStream=null;
    BufferedReader reader=null;
    int currentFileLinesRead=0;
    String currentLine;
    try {
      info("String_Node_Str",file);
      IStreamable resource=(IStreamable)getResourceReference();
      String filePath=FormatUtils.replaceTokens(file,context.getFlowParametersAsString(),true);
      inStream=resource.getInputStream(filePath,mustExist);
      reader=new BufferedReader(new InputStreamReader(inStream,encoding));
      while ((currentLine=reader.readLine()) != null) {
        currentFileLinesRead++;
        if (linesInMessage == textRowsPerMessage) {
          initAndSendMessage(payload,messageTarget,++numberMessages,false);
          linesInMessage=0;
          payload=new ArrayList<String>();
        }
        if (currentFileLinesRead > textHeaderLinesToSkip) {
          getComponentStatistics().incrementNumberEntitiesProcessed();
          payload.add(currentLine);
          linesInMessage++;
        }
      }
      if (unitOfWork.equalsIgnoreCase(UNIT_OF_WORK_FILE)) {
        initAndSendMessage(payload,messageTarget,++numberMessages,true);
        numberMessages=0;
        linesInMessage=0;
      }
    }
 catch (    IOException e) {
      throw new IoException("String_Node_Str" + e.getMessage());
    }
 finally {
      IOUtils.closeQuietly(reader);
      IOUtils.closeQuietly(inStream);
    }
  }
  if (unitOfWork.equalsIgnoreCase(UNIT_OF_WORK_INPUT_MESSAGE) || (unitOfWork.equalsIgnoreCase(UNIT_OF_WORK_FLOW) && unitOfWorkLastMessage)) {
    initAndSendMessage(payload,messageTarget,++numberMessages,true);
  }
 else {
    initAndSendMessage(payload,messageTarget,++numberMessages,false);
  }
}