Program: 120008
Project: 120008
Buggy source:
public IStatus doRun(){
  try {
    TimeMeasure.display=CommonsPlugin.isDebugMode();
    TimeMeasure.displaySteps=CommonsPlugin.isDebugMode();
    TimeMeasure.measureActive=CommonsPlugin.isDebugMode();
    TimeMeasure.begin("String_Node_Str");
    jetFilesCompileFail.clear();
    IProgressMonitor monitorWrap=null;
    monitorWrap=new NullProgressMonitor();
    ECodeLanguage codeLanguage=LanguageManager.getCurrentLanguage();
    initializeJetEmittersProject(monitorWrap);
    TimeMeasure.step("String_Node_Str","String_Node_Str");
    CodeGeneratorInternalTemplatesFactory templatesFactory=CodeGeneratorInternalTemplatesFactoryProvider.getInstance();
    templatesFactory.setCurrentLanguage(codeLanguage);
    templatesFactory.init();
    IComponentsFactory componentsFactory=ComponentsFactoryProvider.getInstance();
    long startTime=System.currentTimeMillis();
    defaultTemplate=TemplateUtil.RESOURCES_DIRECTORY + TemplateUtil.DIR_SEP + EInternalTemplate.DEFAULT_TEMPLATE+ TemplateUtil.EXT_SEP+ codeLanguage.getExtension()+ TemplateUtil.TEMPLATE_EXT;
    List<JetBean> jetBeans=new ArrayList<JetBean>();
    List<TemplateUtil> templates=templatesFactory.getTemplates();
    Set<IComponent> components=componentsFactory.getComponents();
    TimeMeasure.step("String_Node_Str","String_Node_Str");
    monitorWrap.beginTask(Messages.getString("String_Node_Str"),(2 * templates.size() + 5 * components.size()));
    int monitorBuffer=0;
    for (    TemplateUtil template : templates) {
      JetBean jetBean=initializeUtilTemplate(template,codeLanguage);
      jetBeans.add(jetBean);
      monitorBuffer++;
      if (monitorBuffer % 100 == 0) {
        monitorWrap.worked(100);
        monitorBuffer=0;
      }
    }
    TimeMeasure.step("String_Node_Str","String_Node_Str");
    if (components != null) {
      ECodePart codePart=ECodePart.MAIN;
      for (      IComponent component : new ArrayList<IComponent>(components)) {
        if (component.getAvailableCodeParts().size() > 0) {
          initComponent(codeLanguage,jetBeans,codePart,component);
        }
        monitorBuffer++;
        if (monitorBuffer % 100 == 0) {
          monitorWrap.worked(100);
          monitorBuffer=0;
        }
      }
    }
    TimeMeasure.step("String_Node_Str","String_Node_Str");
    monitorWrap.worked(monitorBuffer);
    initializeEmittersPool(jetBeans,codeLanguage,monitorWrap);
    monitorWrap.done();
    TimeMeasure.step("String_Node_Str","String_Node_Str");
    if (!CommonUIPlugin.isFullyHeadless()) {
      Job job=new Job(Messages.getString("String_Node_Str")){
        @Override protected IStatus run(        IProgressMonitor monitor){
          CorePlugin.getDefault().getDesignerCoreService().synchronizeDesignerUI(new PropertyChangeEvent(this,IComponentConstants.NORMAL,null,null));
          return Status.OK_STATUS;
        }
      }
;
      job.setUser(true);
      job.setPriority(Job.INTERACTIVE);
      job.schedule();
      job.wakeUp();
    }
    log.debug(Messages.getString("String_Node_Str",(System.currentTimeMillis() - startTime)));
    initialized=true;
    ComponentCompilations.addMarkers();
    initializeStart=false;
  }
 catch (  Exception e) {
    log.error(Messages.getString("String_Node_Str"),e);
    TimeMeasure.end("String_Node_Str");
    TimeMeasure.display=false;
    TimeMeasure.displaySteps=false;
    TimeMeasure.measureActive=false;
    return new Status(IStatus.ERROR,CodeGeneratorActivator.PLUGIN_ID,Messages.getString("String_Node_Str"),e);
  }
  TimeMeasure.end("String_Node_Str");
  TimeMeasure.display=false;
  TimeMeasure.displaySteps=false;
  TimeMeasure.measureActive=false;
  if (jetFilesCompileFail.size() > 0) {
    StringBuilder message=new StringBuilder();
    for (    JetBean tmpJetBean : jetFilesCompileFail) {
      if (message.length() > 0) {
        message.append("String_Node_Str").append(tmpJetBean.getTemplateRelativeUri());
      }
 else {
        message.append(tmpJetBean.getTemplateRelativeUri());
      }
    }
    return new Status(IStatus.ERROR,CodeGeneratorActivator.PLUGIN_ID,Messages.getString("String_Node_Str") + message.toString());
  }
  CorePlugin.getDefault().getRcpService().activeSwitchProjectAction();
  return Status.OK_STATUS;
}

Fixed version (ground truth):
public IStatus doRun(){
  try {
    TimeMeasure.display=CommonsPlugin.isDebugMode();
    TimeMeasure.displaySteps=CommonsPlugin.isDebugMode();
    TimeMeasure.measureActive=CommonsPlugin.isDebugMode();
    TimeMeasure.begin("String_Node_Str");
    jetFilesCompileFail.clear();
    IProgressMonitor monitorWrap=null;
    monitorWrap=new NullProgressMonitor();
    ECodeLanguage codeLanguage=LanguageManager.getCurrentLanguage();
    initializeJetEmittersProject(monitorWrap);
    TimeMeasure.step("String_Node_Str","String_Node_Str");
    CodeGeneratorInternalTemplatesFactory templatesFactory=CodeGeneratorInternalTemplatesFactoryProvider.getInstance();
    templatesFactory.setCurrentLanguage(codeLanguage);
    templatesFactory.init();
    IComponentsFactory componentsFactory=ComponentsFactoryProvider.getInstance();
    long startTime=System.currentTimeMillis();
    defaultTemplate=TemplateUtil.RESOURCES_DIRECTORY + TemplateUtil.DIR_SEP + EInternalTemplate.DEFAULT_TEMPLATE+ TemplateUtil.EXT_SEP+ codeLanguage.getExtension()+ TemplateUtil.TEMPLATE_EXT;
    List<JetBean> jetBeans=new ArrayList<JetBean>();
    List<TemplateUtil> templates=templatesFactory.getTemplates();
    Set<IComponent> components=componentsFactory.getComponents();
    TimeMeasure.step("String_Node_Str","String_Node_Str");
    monitorWrap.beginTask(Messages.getString("String_Node_Str"),(2 * templates.size() + 5 * components.size()));
    int monitorBuffer=0;
    for (    TemplateUtil template : templates) {
      JetBean jetBean=initializeUtilTemplate(template,codeLanguage);
      jetBeans.add(jetBean);
      monitorBuffer++;
      if (monitorBuffer % 100 == 0) {
        monitorWrap.worked(100);
        monitorBuffer=0;
      }
    }
    TimeMeasure.step("String_Node_Str","String_Node_Str");
    if (components != null) {
      ECodePart codePart=ECodePart.MAIN;
      for (      IComponent component : new ArrayList<IComponent>(components)) {
        if (component.getAvailableCodeParts().size() > 0) {
          initComponent(codeLanguage,jetBeans,codePart,component);
        }
        monitorBuffer++;
        if (monitorBuffer % 100 == 0) {
          monitorWrap.worked(100);
          monitorBuffer=0;
        }
      }
    }
    TimeMeasure.step("String_Node_Str","String_Node_Str");
    monitorWrap.worked(monitorBuffer);
    initializeEmittersPool(jetBeans,codeLanguage,monitorWrap);
    monitorWrap.done();
    TimeMeasure.step("String_Node_Str","String_Node_Str");
    if (!CommonUIPlugin.isFullyHeadless()) {
      if (firstTime) {
        Job job=new Job(Messages.getString("String_Node_Str")){
          @Override protected IStatus run(          IProgressMonitor monitor){
            CorePlugin.getDefault().getDesignerCoreService().synchronizeDesignerUI(new PropertyChangeEvent(this,IComponentConstants.NORMAL,null,null));
            return Status.OK_STATUS;
          }
        }
;
        job.setUser(true);
        job.setPriority(Job.INTERACTIVE);
        job.schedule();
        job.wakeUp();
        firstTime=false;
      }
    }
    log.debug(Messages.getString("String_Node_Str",(System.currentTimeMillis() - startTime)));
    initialized=true;
    ComponentCompilations.addMarkers();
    initializeStart=false;
  }
 catch (  Exception e) {
    log.error(Messages.getString("String_Node_Str"),e);
    TimeMeasure.end("String_Node_Str");
    TimeMeasure.display=false;
    TimeMeasure.displaySteps=false;
    TimeMeasure.measureActive=false;
    return new Status(IStatus.ERROR,CodeGeneratorActivator.PLUGIN_ID,Messages.getString("String_Node_Str"),e);
  }
  TimeMeasure.end("String_Node_Str");
  TimeMeasure.display=false;
  TimeMeasure.displaySteps=false;
  TimeMeasure.measureActive=false;
  if (jetFilesCompileFail.size() > 0) {
    StringBuilder message=new StringBuilder();
    for (    JetBean tmpJetBean : jetFilesCompileFail) {
      if (message.length() > 0) {
        message.append("String_Node_Str").append(tmpJetBean.getTemplateRelativeUri());
      }
 else {
        message.append(tmpJetBean.getTemplateRelativeUri());
      }
    }
    return new Status(IStatus.ERROR,CodeGeneratorActivator.PLUGIN_ID,Messages.getString("String_Node_Str") + message.toString());
  }
  CorePlugin.getDefault().getRcpService().activeSwitchProjectAction();
  return Status.OK_STATUS;
}