Program: 141763
Project: 141763
Buggy source:
@Override protected void addMavenBuildScripts(List<URL> scriptsUrls,Map<String,String> mavenPropertiesMap){
  IExportRouteResourcesService resourcesService=null;
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IExportRouteResourcesService.class)) {
    resourcesService=(IExportRouteResourcesService)GlobalServiceRegister.getDefault().getService(IExportRouteResourcesService.class);
  }
  if (resourcesService == null) {
    return;
  }
  File mavenBuildFile=new File(getTmpFolder() + PATH_SEPARATOR + IExportJobConstants.MAVEN_BUILD_FILE_NAME);
  File mavenBuildBundleFile=new File(getTmpFolder() + PATH_SEPARATOR + IExportJobConstants.MAVEN_KARAF_BUILD_BUNDLE_FILE_NAME);
  File mavenBuildFeatureFile=new File(getTmpFolder() + PATH_SEPARATOR + IExportJobConstants.MAVEN_KARAF_BUILD_FEATURE_FILE_NAME);
  File mavenBuildParentFile=new File(getTmpFolder() + PATH_SEPARATOR + IExportJobConstants.MAVEN_KARAF_BUILD_PARENT_FILE_NAME);
  try {
    String mavenScript=resourcesService.getScriptFromPreferenceStore(IExportRoutePrefConstants.MAVEN_KARAF_SCRIPT_TEMPLATE);
    if (mavenScript != null) {
      createMavenBuildFileFromTemplate(mavenBuildFile,mavenScript);
      updateMavenBuildFileContent(mavenBuildFile,mavenPropertiesMap,false);
      scriptsUrls.add(mavenBuildFile.toURL());
    }
    mavenScript=resourcesService.getScriptFromPreferenceStore(IExportRoutePrefConstants.MAVEN_KARAF_SCRIPT_TEMPLATE_BUNDLE);
    if (mavenScript != null) {
      createMavenBuildFileFromTemplate(mavenBuildBundleFile,mavenScript);
      updateMavenBuildFileContent(mavenBuildBundleFile,mavenPropertiesMap,true);
      scriptsUrls.add(mavenBuildBundleFile.toURL());
    }
    mavenScript=resourcesService.getScriptFromPreferenceStore(IExportRoutePrefConstants.MAVEN_KARAF_SCRIPT_TEMPLATE_FEATURE);
    if (mavenScript != null) {
      createMavenBuildFileFromTemplate(mavenBuildFeatureFile,mavenScript);
      updateMavenBuildFileContent(mavenBuildFeatureFile,mavenPropertiesMap,false);
      scriptsUrls.add(mavenBuildFeatureFile.toURL());
    }
    mavenScript=resourcesService.getScriptFromPreferenceStore(IExportRoutePrefConstants.MAVEN_KARAF_SCRIPT_TEMPLATE_PARENT);
    if (mavenScript != null) {
      createMavenBuildFileFromTemplate(mavenBuildParentFile,mavenScript);
      updateMavenBuildFileContent(mavenBuildParentFile,mavenPropertiesMap,false);
      scriptsUrls.add(mavenBuildParentFile.toURL());
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
@Override protected void addMavenBuildScripts(List<URL> scriptsUrls,Map<String,String> mavenPropertiesMap){
  IExportRouteResourcesService resourcesService=null;
  if (GlobalServiceRegister.getDefault().isServiceRegistered(IExportRouteResourcesService.class)) {
    resourcesService=(IExportRouteResourcesService)GlobalServiceRegister.getDefault().getService(IExportRouteResourcesService.class);
  }
  if (resourcesService == null) {
    return;
  }
  File mavenBuildFile=new File(getTmpFolder() + PATH_SEPARATOR + IExportJobConstants.MAVEN_BUILD_FILE_NAME);
  File mavenBuildBundleFile=new File(getTmpFolder() + PATH_SEPARATOR + IExportJobConstants.MAVEN_KARAF_BUILD_BUNDLE_FILE_NAME);
  File mavenBuildFeatureFile=new File(getTmpFolder() + PATH_SEPARATOR + IExportJobConstants.MAVEN_KARAF_BUILD_FEATURE_FILE_NAME);
  File mavenBuildParentFile=new File(getTmpFolder() + PATH_SEPARATOR + IExportJobConstants.MAVEN_KARAF_BUILD_PARENT_FILE_NAME);
  try {
    String mavenScript=resourcesService.getScriptFromPreferenceStore(IExportRoutePrefConstants.MAVEN_KARAF_SCRIPT_TEMPLATE);
    if (mavenScript != null) {
      createMavenBuildFileFromTemplate(mavenBuildFile,mavenScript);
      updateMavenBuildFileContent(mavenBuildFile,mavenPropertiesMap,false,true);
      scriptsUrls.add(mavenBuildFile.toURL());
    }
    mavenScript=resourcesService.getScriptFromPreferenceStore(IExportRoutePrefConstants.MAVEN_KARAF_SCRIPT_TEMPLATE_BUNDLE);
    if (mavenScript != null) {
      createMavenBuildFileFromTemplate(mavenBuildBundleFile,mavenScript);
      updateMavenBuildFileContent(mavenBuildBundleFile,mavenPropertiesMap,true,false);
      scriptsUrls.add(mavenBuildBundleFile.toURL());
    }
    mavenScript=resourcesService.getScriptFromPreferenceStore(IExportRoutePrefConstants.MAVEN_KARAF_SCRIPT_TEMPLATE_FEATURE);
    if (mavenScript != null) {
      createMavenBuildFileFromTemplate(mavenBuildFeatureFile,mavenScript);
      updateMavenBuildFileContent(mavenBuildFeatureFile,mavenPropertiesMap);
      scriptsUrls.add(mavenBuildFeatureFile.toURL());
    }
    mavenScript=resourcesService.getScriptFromPreferenceStore(IExportRoutePrefConstants.MAVEN_KARAF_SCRIPT_TEMPLATE_PARENT);
    if (mavenScript != null) {
      createMavenBuildFileFromTemplate(mavenBuildParentFile,mavenScript);
      updateMavenBuildFileContent(mavenBuildParentFile,mavenPropertiesMap);
      scriptsUrls.add(mavenBuildParentFile.toURL());
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}