Program: 118285
Project: 118285
Buggy source:
protected void addXmlMapping(ExportFileResource resource,boolean needSource){
  try {
    boolean hasDynamicMetadata=false;
    if (resource.getItem() instanceof ProcessItem) {
      List<JobInfo> list=new ArrayList<JobInfo>();
      hasDynamicMetadata=LastGenerationInfo.getInstance().isUseDynamic(resource.getItem().getProperty().getId(),resource.getItem().getProperty().getVersion());
    }
    if (hasDynamicMetadata) {
      needMappingInSystemRoutine=true;
      if (needSource) {
        IRunProcessService service=CorePlugin.getDefault().getRunProcessService();
        ITalendProcessJavaProject talendProcessJavaProject=service.getTalendProcessJavaProject();
        if (talendProcessJavaProject == null) {
          return;
        }
        IFolder xmlMappingFolder=talendProcessJavaProject.getResourcesFolder().getFolder(JavaUtils.JAVA_XML_MAPPING);
        if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreService.class)) {
          ICoreService coreService=(ICoreService)GlobalServiceRegister.getDefault().getService(ICoreService.class);
          coreService.synchronizeMapptingXML();
        }
        List<URL> xmlMappingFileUrls=new ArrayList<URL>();
        if (xmlMappingFolder.exists()) {
          for (          IResource fileResource : xmlMappingFolder.members()) {
            if (XmlUtil.isXMLFile(fileResource.getName())) {
              xmlMappingFileUrls.add(fileResource.getLocationURI().toURL());
            }
          }
          resource.addResources(JOB_SOURCE_FOLDER_NAME + PATH_SEPARATOR + JavaUtils.JAVA_XML_MAPPING,xmlMappingFileUrls);
        }
      }
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
protected void addXmlMapping(ExportFileResource resource,boolean needSource){
  try {
    boolean hasDynamicMetadata=false;
    if (resource.getItem() instanceof ProcessItem) {
      List<JobInfo> list=new ArrayList<JobInfo>();
      hasDynamicMetadata=LastGenerationInfo.getInstance().isUseDynamic(resource.getItem().getProperty().getId(),resource.getItem().getProperty().getVersion());
    }
    if (hasDynamicMetadata) {
      needMappingInSystemRoutine=true;
      if (needSource) {
        IRunProcessService service=CorePlugin.getDefault().getRunProcessService();
        ITalendProcessJavaProject talendProcessJavaProject=service.getTalendProcessJavaProject();
        if (talendProcessJavaProject == null) {
          return;
        }
        IFolder xmlMappingFolder=talendProcessJavaProject.getResourcesFolder().getFolder(JavaUtils.JAVA_XML_MAPPING);
        if (GlobalServiceRegister.getDefault().isServiceRegistered(ICoreService.class)) {
          ICoreService coreService=(ICoreService)GlobalServiceRegister.getDefault().getService(ICoreService.class);
          coreService.synchronizeMapptingXML();
          coreService.syncLog4jSettings();
        }
        List<URL> xmlMappingFileUrls=new ArrayList<URL>();
        if (xmlMappingFolder.exists()) {
          for (          IResource fileResource : xmlMappingFolder.members()) {
            if (XmlUtil.isXMLFile(fileResource.getName())) {
              xmlMappingFileUrls.add(fileResource.getLocationURI().toURL());
            }
          }
          resource.addResources(JOB_SOURCE_FOLDER_NAME + PATH_SEPARATOR + JavaUtils.JAVA_XML_MAPPING,xmlMappingFileUrls);
        }
      }
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}