Program: 119762
Project: 119762
Buggy source:
/** 
 * DOC qwei Comment method "addDepencies".
 */
protected void addDependencies(ExportFileResource[] allResources,ProcessItem processItem,Boolean needDependencies,ExportFileResource resource){
  if (!needDependencies) {
    return;
  }
  if (!exportCaculatedItems.contains(processItem)) {
    BuildExportManager.getInstance().exportDependencies(resource,processItem);
    exportCaculatedItems.add(processItem);
  }
  Collection<IRepositoryViewObject> allDependencies=ProcessUtils.getAllProcessDependencies(Arrays.asList(new Item[]{processItem}),false);
  ITransformService tdmService=null;
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ITransformService.class)) {
    tdmService=(ITransformService)GlobalServiceRegister.getDefault().getService(ITransformService.class);
  }
  try {
    for (    IRepositoryViewObject object : allDependencies) {
      Item item=object.getProperty().getItem();
      ERepositoryObjectType itemType=ERepositoryObjectType.getItemType(item);
      IPath typeFolderPath=new Path(ERepositoryObjectType.getFolderName(itemType));
      String itemName=item.getProperty().getLabel();
      String itemVersion=item.getProperty().getVersion();
      String itemPath=item.getState().getPath();
      itemPath=(itemPath == null || itemPath.equals("String_Node_Str")) ? "String_Node_Str" : itemPath;
      IPath projectRootPath=getCorrespondingProjectRootPath(item);
      String projectName=getCorrespondingProjectName(item);
      String relativePath=JOB_ITEMS_FOLDER_NAME + PATH_SEPARATOR + projectName;
      if (tdmService != null && !exportCaculatedProject.contains(projectName) && tdmService.isTransformItem(item)) {
        IPath propsPath=getCorrespondingProjectRootPath(item).append(FileConstants.TDM_PROPS_PATH);
        String propsRelativePath=relativePath;
        propsRelativePath=propsRelativePath + PATH_SEPARATOR + FileConstants.TDM_PROPS_FOLDER;
        resource.addResource(propsRelativePath,propsPath.toFile().toURL());
      }
      IPath projectFilePath=getCorrespondingProjectRootPath(item).append(FileConstants.LOCAL_PROJECT_FILENAME);
      checkAndAddProjectResource(allResources,resource,relativePath,FileLocator.toFileURL(projectFilePath.toFile().toURL()));
      IPath itemFilePath;
      String itemVersionString=(itemVersion == null) ? "String_Node_Str" : "String_Node_Str" + itemVersion;
      if (itemPath.startsWith(typeFolderPath.toString())) {
        itemPath=itemPath.substring(typeFolderPath.toString().length());
      }
      if (item.getFileExtension() == null || "String_Node_Str".equals(item.getFileExtension())) {
        itemFilePath=projectRootPath.append(typeFolderPath).append(itemPath).append(itemName + (item.isNeedVersion() ? itemVersionString : "String_Node_Str") + "String_Node_Str"+ FileConstants.ITEM_EXTENSION);
      }
 else {
        itemFilePath=projectRootPath.append(typeFolderPath).append(itemPath).append(itemName + (item.isNeedVersion() ? itemVersionString : "String_Node_Str") + "String_Node_Str"+ item.getFileExtension());
      }
      IPath propertiesFilePath=projectRootPath.append(typeFolderPath).append(itemPath).append(itemName + itemVersionString + "String_Node_Str"+ FileConstants.PROPERTIES_EXTENSION);
      List<URL> metadataNameFileUrls=new ArrayList<URL>();
      File itemFile=itemFilePath.toFile();
      if (itemFile.exists()) {
        metadataNameFileUrls.add(FileLocator.toFileURL(itemFile.toURI().toURL()));
      }
 else {
        ExceptionHandler.log(Messages.getString("String_Node_Str",itemFilePath));
      }
      File propertiesFile=propertiesFilePath.toFile();
      if (propertiesFile.exists()) {
        metadataNameFileUrls.add(FileLocator.toFileURL(propertiesFile.toURI().toURL()));
      }
 else {
        ExceptionHandler.log(Messages.getString("String_Node_Str",propertiesFilePath));
      }
      String basePath=relativePath + PATH_SEPARATOR + typeFolderPath.toString();
      if (itemPath != null && !"String_Node_Str".equals(itemPath)) {
        basePath=basePath + PATH_SEPARATOR + itemPath;
      }
      resource.addResources(basePath,metadataNameFileUrls);
      if (!exportCaculatedItems.contains(item)) {
        BuildExportManager.getInstance().exportDependencies(resource,item);
        exportCaculatedItems.add(item);
      }
    }
    if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQItemService.class)) {
      ITDQItemService tdqItemService=(ITDQItemService)GlobalServiceRegister.getDefault().getService(ITDQItemService.class);
      if (tdqItemService != null && tdqItemService.hasProcessItemDependencies(Arrays.asList(new Item[]{processItem}))) {
        String defIdxFolderName="String_Node_Str";
        String defIdxFileName="String_Node_Str";
        IProject project=ReponsitoryContextBridge.getRootProject();
        IFile defIdxFile=project.getFile(defIdxFolderName + PATH_SEPARATOR + defIdxFileName);
        if (defIdxFile.exists()) {
          String defIdxBasePath=JOB_ITEMS_FOLDER_NAME + PATH_SEPARATOR + project.getName().toLowerCase()+ PATH_SEPARATOR+ defIdxFolderName;
          List<URL> defIdxUrls=new ArrayList<URL>();
          defIdxUrls.add(project.getLocation().makeAbsolute().append(defIdxFolderName).append(defIdxFileName).toFile().toURI().toURL());
          resource.addResources(defIdxBasePath,defIdxUrls);
        }
        String reportingBundlePath=PluginChecker.getBundlePath("String_Node_Str");
        List<URL> reportResourceUrls=new ArrayList<URL>();
        File imageFolder=new File(reportingBundlePath + PATH_SEPARATOR + "String_Node_Str");
        if (imageFolder.exists()) {
          reportResourceUrls.add(imageFolder.toURI().toURL());
        }
        File templateFolder=new File(reportingBundlePath + PATH_SEPARATOR + "String_Node_Str");
        if (templateFolder.exists() && templateFolder.isDirectory()) {
          reportResourceUrls.add(templateFolder.toURI().toURL());
        }
        resource.addResources(JOB_ITEMS_FOLDER_NAME + PATH_SEPARATOR,reportResourceUrls);
      }
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
/** 
 * DOC qwei Comment method "addDepencies".
 */
protected void addDependencies(ExportFileResource[] allResources,ProcessItem processItem,Boolean needDependencies,ExportFileResource resource){
  if (!needDependencies) {
    return;
  }
  if (!exportCaculatedItems.contains(processItem)) {
    BuildExportManager.getInstance().exportDependencies(resource,processItem);
    exportCaculatedItems.add(processItem);
  }
  Collection<IRepositoryViewObject> allDependencies=ProcessUtils.getAllProcessDependencies(Arrays.asList(new Item[]{processItem}),false);
  ITransformService tdmService=null;
  if (GlobalServiceRegister.getDefault().isServiceRegistered(ITransformService.class)) {
    tdmService=(ITransformService)GlobalServiceRegister.getDefault().getService(ITransformService.class);
  }
  try {
    for (    IRepositoryViewObject object : allDependencies) {
      Item item=object.getProperty().getItem();
      ERepositoryObjectType itemType=ERepositoryObjectType.getItemType(item);
      IPath typeFolderPath=new Path(ERepositoryObjectType.getFolderName(itemType));
      String itemName=item.getProperty().getLabel();
      String itemVersion=item.getProperty().getVersion();
      String itemPath=item.getState().getPath();
      itemPath=(itemPath == null || itemPath.equals("String_Node_Str")) ? "String_Node_Str" : itemPath;
      IPath projectRootPath=getCorrespondingProjectRootPath(item);
      String projectName=getCorrespondingProjectName(item);
      String relativePath=JOB_ITEMS_FOLDER_NAME + PATH_SEPARATOR + projectName;
      if (tdmService != null && !exportCaculatedProject.contains(projectName) && tdmService.isTransformItem(item)) {
        IPath propsPath=getCorrespondingProjectRootPath(item).append(FileConstants.TDM_PROPS_PATH);
        String propsRelativePath=relativePath;
        propsRelativePath=propsRelativePath + PATH_SEPARATOR + FileConstants.TDM_PROPS_FOLDER;
        resource.addResource(propsRelativePath,propsPath.toFile().toURL());
      }
      IPath projectFilePath=getCorrespondingProjectRootPath(item).append(FileConstants.LOCAL_PROJECT_FILENAME);
      checkAndAddProjectResource(allResources,resource,relativePath,FileLocator.toFileURL(projectFilePath.toFile().toURL()));
      if (item.getProperty() instanceof FakePropertyImpl) {
        String basePath=relativePath + PATH_SEPARATOR + typeFolderPath.toString();
        FakePropertyImpl fakeProperty=(FakePropertyImpl)item.getProperty();
        IPath relativeItemPath=fakeProperty.getItemPath();
        IPath absItemPath=projectRootPath.removeLastSegments(1).append(relativeItemPath.makeRelative());
        resource.addResource(basePath,absItemPath.toFile().toURL());
        continue;
      }
      IPath itemFilePath;
      String itemVersionString=(itemVersion == null) ? "String_Node_Str" : "String_Node_Str" + itemVersion;
      if (itemPath.startsWith(typeFolderPath.toString())) {
        itemPath=itemPath.substring(typeFolderPath.toString().length());
      }
      if (item.getFileExtension() == null || "String_Node_Str".equals(item.getFileExtension())) {
        itemFilePath=projectRootPath.append(typeFolderPath).append(itemPath).append(itemName + (item.isNeedVersion() ? itemVersionString : "String_Node_Str") + "String_Node_Str"+ FileConstants.ITEM_EXTENSION);
      }
 else {
        itemFilePath=projectRootPath.append(typeFolderPath).append(itemPath).append(itemName + (item.isNeedVersion() ? itemVersionString : "String_Node_Str") + "String_Node_Str"+ item.getFileExtension());
      }
      IPath propertiesFilePath=projectRootPath.append(typeFolderPath).append(itemPath).append(itemName + itemVersionString + "String_Node_Str"+ FileConstants.PROPERTIES_EXTENSION);
      List<URL> metadataNameFileUrls=new ArrayList<URL>();
      File itemFile=itemFilePath.toFile();
      if (itemFile.exists()) {
        metadataNameFileUrls.add(FileLocator.toFileURL(itemFile.toURI().toURL()));
      }
 else {
        ExceptionHandler.log(Messages.getString("String_Node_Str",itemFilePath));
      }
      File propertiesFile=propertiesFilePath.toFile();
      if (propertiesFile.exists()) {
        metadataNameFileUrls.add(FileLocator.toFileURL(propertiesFile.toURI().toURL()));
      }
 else {
        ExceptionHandler.log(Messages.getString("String_Node_Str",propertiesFilePath));
      }
      String basePath=relativePath + PATH_SEPARATOR + typeFolderPath.toString();
      if (itemPath != null && !"String_Node_Str".equals(itemPath)) {
        basePath=basePath + PATH_SEPARATOR + itemPath;
      }
      resource.addResources(basePath,metadataNameFileUrls);
      if (!exportCaculatedItems.contains(item)) {
        BuildExportManager.getInstance().exportDependencies(resource,item);
        exportCaculatedItems.add(item);
      }
    }
    if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQItemService.class)) {
      ITDQItemService tdqItemService=(ITDQItemService)GlobalServiceRegister.getDefault().getService(ITDQItemService.class);
      if (tdqItemService != null && tdqItemService.hasProcessItemDependencies(Arrays.asList(new Item[]{processItem}))) {
        String defIdxFolderName="String_Node_Str";
        String defIdxFileName="String_Node_Str";
        IProject project=ReponsitoryContextBridge.getRootProject();
        IFile defIdxFile=project.getFile(defIdxFolderName + PATH_SEPARATOR + defIdxFileName);
        if (defIdxFile.exists()) {
          String defIdxBasePath=JOB_ITEMS_FOLDER_NAME + PATH_SEPARATOR + project.getName().toLowerCase()+ PATH_SEPARATOR+ defIdxFolderName;
          List<URL> defIdxUrls=new ArrayList<URL>();
          defIdxUrls.add(project.getLocation().makeAbsolute().append(defIdxFolderName).append(defIdxFileName).toFile().toURI().toURL());
          resource.addResources(defIdxBasePath,defIdxUrls);
        }
        String reportingBundlePath=PluginChecker.getBundlePath("String_Node_Str");
        List<URL> reportResourceUrls=new ArrayList<URL>();
        File imageFolder=new File(reportingBundlePath + PATH_SEPARATOR + "String_Node_Str");
        if (imageFolder.exists()) {
          reportResourceUrls.add(imageFolder.toURI().toURL());
        }
        File templateFolder=new File(reportingBundlePath + PATH_SEPARATOR + "String_Node_Str");
        if (templateFolder.exists() && templateFolder.isDirectory()) {
          reportResourceUrls.add(templateFolder.toURI().toURL());
        }
        resource.addResources(JOB_ITEMS_FOLDER_NAME + PATH_SEPARATOR,reportResourceUrls);
      }
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}