Program: 120044
Project: 120044
Buggy source:
private void generateJavaFile(){
  final IWorkspaceRunnable op=new IWorkspaceRunnable(){
    @Override public void run(    IProgressMonitor monitor) throws CoreException {
      Node node=(Node)elem;
      IProcess process=node.getProcess();
      String jobName=process.getName();
      String nodeName=node.getUniqueName();
      String wsdlfile=(String)node.getPropertyValue("String_Node_Str");
      wsdlfile=wsdlfile.substring(1,wsdlfile.length() - 1);
      if (wsdlfile.equals("String_Node_Str")) {
        Display.getDefault().syncExec(new Runnable(){
          @Override public void run(){
            MessageDialog.openError(Display.getDefault().getActiveShell(),org.talend.designer.core.i18n.Messages.getString("String_Node_Str"),org.talend.designer.core.i18n.Messages.getString("String_Node_Str"));
          }
        }
);
        return;
      }
      File dir=new File(getTmpFolder());
      final TalendWSDL2Java java2WSDL=new TalendWSDL2Java();
      boolean hasError=java2WSDL.generateWSDL(new String[]{"String_Node_Str" + dir,"String_Node_Str" + PACK,wsdlfile});
      final String tempWsdlfile=wsdlfile;
      if (hasError) {
        Display.getDefault().syncExec(new Runnable(){
          @Override public void run(){
            MessageDialog.openError(Display.getDefault().getActiveShell(),org.talend.designer.core.i18n.Messages.getString("String_Node_Str"),org.talend.designer.core.i18n.Messages.getString("String_Node_Str",java2WSDL.getException().getClass().getCanonicalName(),java2WSDL.getException().getMessage()));
          }
        }
);
      }
 else {
        Display.getDefault().syncExec(new Runnable(){
          @Override public void run(){
            MessageDialog.openInformation(Display.getDefault().getActiveShell(),org.talend.designer.core.i18n.Messages.getString("String_Node_Str"),org.talend.designer.core.i18n.Messages.getString("String_Node_Str",tempWsdlfile));
          }
        }
);
      }
      IPath path=new Path(jobName + "String_Node_Str" + nodeName);
      String[] filter=new String[]{"String_Node_Str"};
      Collection listFiles=FileUtils.listFiles(dir,filter,true);
      Iterator iterator=listFiles.iterator();
      String name="String_Node_Str";
      for (int i=0; i < listFiles.size(); i++) {
        File javaFile=(File)listFiles.toArray()[i];
        String parentFileName=javaFile.getParentFile().getName();
        if (!parentFileName.equals("String_Node_Str")) {
          name=parentFileName;
        }
      }
      List<RoutineItem> returnItemList=new ArrayList<RoutineItem>();
      while (iterator.hasNext()) {
        File javaFile=(File)iterator.next();
        String fileName=javaFile.getName();
        String label=fileName.substring(0,fileName.indexOf('.'));
        try {
          RoutineItem returnItem=createRoutine(path,label,javaFile,name);
          returnItemList.add(returnItem);
          syncRoutine(returnItem,true,name);
          refreshProject();
        }
 catch (        IllegalArgumentException e) {
        }
catch (        Exception e) {
          ExceptionHandler.process(e);
        }
      }
      Project currentProject=ProjectManager.getInstance().getCurrentProject();
      IRepositoryService service=(IRepositoryService)GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
      IProxyRepositoryFactory factory=service.getProxyRepositoryFactory();
      List<IRepositoryViewObject> all;
      Item item=null;
      try {
        all=factory.getAll(currentProject,ERepositoryObjectType.PROCESS,true,true);
        for (        IRepositoryViewObject repositoryViewObject : all) {
          if (repositoryViewObject.getLabel().equals(jobName)) {
            item=repositoryViewObject.getProperty().getItem();
          }
        }
      }
 catch (      PersistenceException ex) {
        ExceptionHandler.process(ex);
      }
      try {
        List<RoutinesParameterType> needList=new ArrayList<RoutinesParameterType>();
        List<RoutinesParameterType> createJobRoutineDependencies=RoutinesUtil.createJobRoutineDependencies(false);
        for (        RoutineItem returnItem : returnItemList) {
          for (          RoutinesParameterType routinesParameterType : createJobRoutineDependencies) {
            if (routinesParameterType.getId().equals(returnItem.getProperty().getId())) {
              needList.add(routinesParameterType);
            }
          }
        }
        if (process instanceof org.talend.designer.core.ui.editor.process.Process) {
          ((org.talend.designer.core.ui.editor.process.Process)process).addGeneratingRoutines(needList);
        }
      }
 catch (      PersistenceException e) {
        ExceptionHandler.process(e);
      }
      FilesUtils.removeFolder(dir,true);
    }
  }
;
  IRunnableWithProgress iRunnableWithProgress=new IRunnableWithProgress(){
    @Override public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      IWorkspace workspace=ResourcesPlugin.getWorkspace();
      try {
        ISchedulingRule schedulingRule=workspace.getRoot();
        workspace.run(op,schedulingRule,IWorkspace.AVOID_UPDATE,monitor);
      }
 catch (      CoreException e) {
      }
    }
  }
;
  try {
    PlatformUI.getWorkbench().getProgressService().run(true,true,iRunnableWithProgress);
  }
 catch (  InvocationTargetException e) {
    ExceptionHandler.process(e);
  }
catch (  InterruptedException e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
private void generateJavaFile(){
  final IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
  RepositoryWorkUnit<Object> workUnit=new RepositoryWorkUnit<Object>("String_Node_Str",this){
    @Override protected void run() throws PersistenceException {
      Node node=(Node)elem;
      IProcess process=node.getProcess();
      String jobName=process.getName();
      String nodeName=node.getUniqueName();
      String wsdlfile=(String)node.getPropertyValue("String_Node_Str");
      wsdlfile=wsdlfile.substring(1,wsdlfile.length() - 1);
      if (wsdlfile.equals("String_Node_Str")) {
        Display.getDefault().syncExec(new Runnable(){
          @Override public void run(){
            MessageDialog.openError(Display.getDefault().getActiveShell(),org.talend.designer.core.i18n.Messages.getString("String_Node_Str"),org.talend.designer.core.i18n.Messages.getString("String_Node_Str"));
          }
        }
);
        return;
      }
      File dir=new File(getTmpFolder());
      final TalendWSDL2Java java2WSDL=new TalendWSDL2Java();
      boolean hasError=java2WSDL.generateWSDL(new String[]{"String_Node_Str" + dir,"String_Node_Str" + PACK,wsdlfile});
      final String tempWsdlfile=wsdlfile;
      if (hasError) {
        Display.getDefault().syncExec(new Runnable(){
          @Override public void run(){
            MessageDialog.openError(Display.getDefault().getActiveShell(),org.talend.designer.core.i18n.Messages.getString("String_Node_Str"),org.talend.designer.core.i18n.Messages.getString("String_Node_Str",java2WSDL.getException().getClass().getCanonicalName(),java2WSDL.getException().getMessage()));
          }
        }
);
      }
 else {
        Display.getDefault().syncExec(new Runnable(){
          @Override public void run(){
            MessageDialog.openInformation(Display.getDefault().getActiveShell(),org.talend.designer.core.i18n.Messages.getString("String_Node_Str"),org.talend.designer.core.i18n.Messages.getString("String_Node_Str",tempWsdlfile));
          }
        }
);
      }
      IPath path=new Path(jobName + "String_Node_Str" + nodeName);
      String[] filter=new String[]{"String_Node_Str"};
      Collection listFiles=FileUtils.listFiles(dir,filter,true);
      Iterator iterator=listFiles.iterator();
      String name="String_Node_Str";
      for (int i=0; i < listFiles.size(); i++) {
        File javaFile=(File)listFiles.toArray()[i];
        String parentFileName=javaFile.getParentFile().getName();
        if (!parentFileName.equals("String_Node_Str")) {
          name=parentFileName;
        }
      }
      List<RoutineItem> returnItemList=new ArrayList<RoutineItem>();
      while (iterator.hasNext()) {
        File javaFile=(File)iterator.next();
        String fileName=javaFile.getName();
        String label=fileName.substring(0,fileName.indexOf('.'));
        try {
          RoutineItem returnItem=createRoutine(path,label,javaFile,name);
          returnItemList.add(returnItem);
          syncRoutine(returnItem,true,name);
          refreshProject();
        }
 catch (        IllegalArgumentException e) {
        }
catch (        Exception e) {
          ExceptionHandler.process(e);
        }
      }
      Project currentProject=ProjectManager.getInstance().getCurrentProject();
      IRepositoryService service=(IRepositoryService)GlobalServiceRegister.getDefault().getService(IRepositoryService.class);
      IProxyRepositoryFactory factory=service.getProxyRepositoryFactory();
      List<IRepositoryViewObject> all;
      Item item=null;
      try {
        all=factory.getAll(currentProject,ERepositoryObjectType.PROCESS,true,true);
        for (        IRepositoryViewObject repositoryViewObject : all) {
          if (repositoryViewObject.getLabel().equals(jobName)) {
            item=repositoryViewObject.getProperty().getItem();
          }
        }
      }
 catch (      PersistenceException ex) {
        ExceptionHandler.process(ex);
      }
      try {
        List<RoutinesParameterType> needList=new ArrayList<RoutinesParameterType>();
        List<RoutinesParameterType> createJobRoutineDependencies=RoutinesUtil.createJobRoutineDependencies(false);
        for (        RoutineItem returnItem : returnItemList) {
          for (          RoutinesParameterType routinesParameterType : createJobRoutineDependencies) {
            if (routinesParameterType.getId().equals(returnItem.getProperty().getId())) {
              needList.add(routinesParameterType);
            }
          }
        }
        if (process instanceof org.talend.designer.core.ui.editor.process.Process) {
          ((org.talend.designer.core.ui.editor.process.Process)process).addGeneratingRoutines(needList);
        }
      }
 catch (      PersistenceException e) {
        ExceptionHandler.process(e);
      }
      FilesUtils.removeFolder(dir,true);
    }
  }
;
  workUnit.setAvoidUnloadResources(true);
  factory.executeRepositoryWorkUnit(workUnit);
}