Program: 167424
Project: 167424
Buggy source:
protected void pollForFiles(String path,Message inputMessage,ISendMessageCallback callback,boolean unitOfWorkLastMessage){
  File pathDir=getNewFile(path);
  ArrayList<File> fileReferences=new ArrayList<File>();
  String[] includes=StringUtils.isNotBlank(filePattern) ? filePattern.split("String_Node_Str") : new String[]{"String_Node_Str"};
  DirectoryScanner scanner=getDirectoryScanner();
  scanner.setIncludes(includes);
  scanner.setBasedir(pathDir);
  scanner.setCaseSensitive(false);
  scanner.scan();
  String[] files=scanner.getIncludedFiles();
  if (files.length > 0) {
    for (int i=0; i < files.length && i < maxFilesToPoll; i++) {
      File file=getNewFile(path,files[i]);
      filesSent.add(file);
      fileReferences.add(file);
    }
    Collections.sort(fileReferences,new Comparator<File>(){
      @Override public int compare(      File o1,      File o2){
        int cmpr=0;
        if (SORT_NAME.equals(fileSortOption)) {
          cmpr=new String(o1.getName()).compareTo(new String(o2.getName()));
        }
 else         if (SORT_MODIFIED.equals(fileSortOption)) {
          cmpr=new Long(o1.lastModified()).compareTo(new Long(o2.lastModified()));
        }
        return cmpr;
      }
    }
);
    ArrayList<String> filePaths=new ArrayList<>();
    for (    File file : fileReferences) {
      log(LogLevel.INFO,"String_Node_Str" + file.getAbsolutePath());
      getComponentStatistics().incrementNumberEntitiesProcessed(threadNumber);
      filePaths.add(file.getAbsolutePath());
      if (filePaths.size() <= filesPerMessage) {
        callback.sendMessage(null,filePaths,unitOfWorkLastMessage);
        filePaths=new ArrayList<>();
      }
    }
    if (filePaths.size() > 0) {
      callback.sendMessage(null,filePaths,unitOfWorkLastMessage);
    }
  }
 else   if (cancelOnNoFiles) {
    callback.sendShutdownMessage(true);
  }
}

Fixed version (ground truth):
protected void pollForFiles(String path,Message inputMessage,ISendMessageCallback callback,boolean unitOfWorkLastMessage){
  File pathDir=getNewFile(path);
  ArrayList<File> fileReferences=new ArrayList<File>();
  String[] includes=StringUtils.isNotBlank(filePattern) ? filePattern.split("String_Node_Str") : new String[]{"String_Node_Str"};
  DirectoryScanner scanner=getDirectoryScanner();
  scanner.setIncludes(includes);
  scanner.setBasedir(pathDir);
  scanner.setCaseSensitive(false);
  scanner.scan();
  String[] files=scanner.getIncludedFiles();
  if (files.length > 0) {
    for (int i=0; i < files.length && i < maxFilesToPoll; i++) {
      File file=getNewFile(path,files[i]);
      filesSent.add(file);
      fileReferences.add(file);
    }
    Collections.sort(fileReferences,new Comparator<File>(){
      @Override public int compare(      File o1,      File o2){
        int cmpr=0;
        if (SORT_NAME.equals(fileSortOption)) {
          cmpr=new String(o1.getName()).compareTo(new String(o2.getName()));
        }
 else         if (SORT_MODIFIED.equals(fileSortOption)) {
          cmpr=new Long(o1.lastModified()).compareTo(new Long(o2.lastModified()));
        }
        return cmpr;
      }
    }
);
    ArrayList<String> filePaths=new ArrayList<>();
    for (    File file : fileReferences) {
      log(LogLevel.INFO,"String_Node_Str" + file.getAbsolutePath());
      getComponentStatistics().incrementNumberEntitiesProcessed(threadNumber);
      filePaths.add(file.getAbsolutePath());
      if (filePaths.size() <= filesPerMessage) {
        callback.sendMessage(null,filePaths,false);
        filePaths=new ArrayList<>();
      }
    }
    if (filePaths.size() > 0) {
      callback.sendMessage(null,filePaths,unitOfWorkLastMessage);
    }
  }
 else   if (cancelOnNoFiles) {
    callback.sendShutdownMessage(true);
  }
}