Program: 125248
Project: 125248
Buggy source:
/** 
 * copy the current item's drools file from 'workspace/metadata/survivorship' to '.Java/src/resources'
 * @param processItem
 */
private static void copyDQDroolsToSrc(ProcessItem processItem){
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQItemService.class)) {
    ITDQItemService tdqItemService=(ITDQItemService)GlobalServiceRegister.getDefault().getService(ITDQItemService.class);
    if (tdqItemService == null) {
      return;
    }
    try {
      ExportFileResource resouece=new ExportFileResource();
      BuildExportManager.getInstance().exportDependencies(resouece,processItem);
      if (resouece.getAllResources().isEmpty()) {
        return;
      }
      final Iterator<String> relativepath=resouece.getRelativePathList().iterator();
      String pathStr="String_Node_Str";
      IRunProcessService runProcessService=CorePlugin.getDefault().getRunProcessService();
      ITalendProcessJavaProject talendProcessJavaProject=runProcessService.getTalendJobJavaProject(processItem.getProperty());
      IFolder targetFolder=talendProcessJavaProject.getExternalResourcesFolder();
      if (targetFolder.exists()) {
        IFolder survFolder=targetFolder.getFolder(new Path(pathStr));
        if (survFolder.exists()) {
          survFolder.delete(true,null);
        }
        while (relativepath.hasNext()) {
          String relativePath=relativepath.next();
          Set<URL> sources=resouece.getResourcesByRelativePath(relativePath);
          for (          URL sourceUrl : sources) {
            File currentResource=new File(org.talend.commons.utils.io.FilesUtils.getFileRealPath(sourceUrl.getPath()));
            if (currentResource.exists()) {
              FilesUtils.copyDirectory(currentResource,new File(targetFolder.getLocation().toPortableString() + File.separator + pathStr));
            }
          }
        }
      }
    }
 catch (    Exception exc) {
      log.error(exc);
    }
  }
}

Fixed version (ground truth):
/** 
 * copy the current item's drools file from 'workspace/metadata/survivorship' to '.Java/src/resources'
 * @param processItem
 */
private static void copyDQDroolsToSrc(ProcessItem processItem){
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQItemService.class)) {
    ITDQItemService tdqItemService=(ITDQItemService)GlobalServiceRegister.getDefault().getService(ITDQItemService.class);
    if (tdqItemService == null) {
      return;
    }
    try {
      ExportFileResource resouece=new ExportFileResource();
      BuildExportManager.getInstance().exportDependencies(resouece,processItem);
      if (resouece.getAllResources().isEmpty()) {
        return;
      }
      final Iterator<String> relativepath=resouece.getRelativePathList().iterator();
      String pathStr="String_Node_Str";
      IRunProcessService runProcessService=CorePlugin.getDefault().getRunProcessService();
      ITalendProcessJavaProject talendProcessJavaProject=runProcessService.getTalendJobJavaProject(processItem.getProperty());
      IFolder targetFolder=talendProcessJavaProject.getResourcesFolder();
      if (targetFolder.exists()) {
        IFolder survFolder=targetFolder.getFolder(new Path(pathStr));
        if (survFolder.exists()) {
          survFolder.delete(true,null);
        }
        while (relativepath.hasNext()) {
          String relativePath=relativepath.next();
          Set<URL> sources=resouece.getResourcesByRelativePath(relativePath);
          for (          URL sourceUrl : sources) {
            File currentResource=new File(org.talend.commons.utils.io.FilesUtils.getFileRealPath(sourceUrl.getPath()));
            if (currentResource.exists()) {
              FilesUtils.copyDirectory(currentResource,new File(targetFolder.getLocation().toPortableString() + File.separator + pathStr));
            }
          }
        }
      }
    }
 catch (    Exception exc) {
      log.error(exc);
    }
  }
}