Program: 141759
Project: 141759
Buggy source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  String destinationPath=serviceManager.getDestinationPath();
  if (!destinationPath.endsWith(FileConstants.KAR_FILE_SUFFIX)) {
    destinationPath=destinationPath.replace("String_Node_Str",PATH_SEPERATOR);
    if (destinationPath.indexOf(PATH_SEPERATOR) != -1) {
      String filePath=destinationPath.substring(0,destinationPath.lastIndexOf(PATH_SEPERATOR) + 1);
      String fileName=destinationPath.substring(destinationPath.lastIndexOf(PATH_SEPERATOR) + 1);
      if (fileName.indexOf("String_Node_Str") != -1) {
        fileName=fileName.substring(0,fileName.lastIndexOf("String_Node_Str"));
      }
      destinationPath=filePath + fileName + FileConstants.KAR_FILE_SUFFIX;
    }
  }
  try {
    String directoryName=serviceManager.getRootFolderName(tempFolder);
    Map<String,String> bundles=new HashMap<String,String>();
    for (    RepositoryNode node : nodes) {
      JobScriptsManager manager=serviceManager.getJobManager(exportChoiceMap,tempFolder,node,getGroupId(),getServiceVersion());
      JobExportAction job=new JobExportAction(Collections.singletonList(node),node.getObject().getVersion(),getBundleVersion(),manager,directoryName,"String_Node_Str");
      job.run(monitor);
      bundles.put(serviceManager.getNodeLabel(node),tempFolder);
    }
    try {
      final String artefactName=getServiceName() + "String_Node_Str";
      bundles.put(artefactName,generateControlBundle(getGroupId(),artefactName));
      processFeature(generateFeature(bundles));
      processFinalResult(destinationPath);
    }
 catch (    Exception e) {
      throw new InvocationTargetException(e);
    }
  }
  finally {
    clean();
  }
}

Fixed version (ground truth):
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  String destinationPath=serviceManager.getDestinationPath();
  if (!destinationPath.endsWith(FileConstants.KAR_FILE_SUFFIX)) {
    destinationPath=destinationPath.replace("String_Node_Str",PATH_SEPERATOR);
    if (destinationPath.indexOf(PATH_SEPERATOR) != -1) {
      String filePath=destinationPath.substring(0,destinationPath.lastIndexOf(PATH_SEPERATOR) + 1);
      String fileName=destinationPath.substring(destinationPath.lastIndexOf(PATH_SEPERATOR) + 1);
      if (fileName.indexOf("String_Node_Str") != -1) {
        fileName=fileName.substring(0,fileName.lastIndexOf("String_Node_Str"));
      }
      destinationPath=filePath + fileName + FileConstants.KAR_FILE_SUFFIX;
    }
  }
  try {
    String directoryName=serviceManager.getRootFolderName(tempFolder);
    Map<String,String> bundles=new HashMap<String,String>();
    for (    RepositoryNode node : nodes) {
      JobScriptsManager manager=serviceManager.getJobManager(exportChoiceMap,tempFolder,node,getGroupId(),getServiceVersion());
      JobExportAction job=new JobExportAction(Collections.singletonList(node),node.getObject().getVersion(),getBundleVersion(),manager,directoryName,"String_Node_Str");
      job.run(monitor);
      bundles.put(serviceManager.getNodeLabel(node),manager.getDestinationPath());
    }
    try {
      final String artefactName=getServiceName() + "String_Node_Str";
      bundles.put(artefactName,generateControlBundle(getGroupId(),artefactName));
      processFeature(generateFeature(bundles));
      processFinalResult(destinationPath);
    }
 catch (    Exception e) {
      throw new InvocationTargetException(e);
    }
  }
  finally {
    clean();
  }
}