Program: 122445
Project: 122445
Buggy source:
@Override public void performRequest(Request req){
  Node node=(Node)getModel();
  IExternalData oldExternalData=node.getExternalData();
  if (req.getType().equals("String_Node_Str")) {
    IExternalNode externalNode=null;
    if (node.isExternalNode()) {
      if (node.getElementParameterFromField(EParameterFieldType.EXTERNAL) != null) {
        externalNode=ExternalUtilities.getExternalNodeReadyToOpen(node);
      }
    }
    IWorkbenchPart part=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    if (externalNode != null && (part instanceof AbstractMultiPageTalendEditor)) {
      int returnValue=externalNode.open(getViewer().getControl().getShell());
      if (!node.isReadOnly()) {
        if (returnValue == SWT.OK) {
          Command cmd=new ExternalNodeChangeCommand(node,externalNode,oldExternalData);
          CommandStack cmdStack=(CommandStack)part.getAdapter(CommandStack.class);
          cmdStack.execute(cmd);
        }
 else {
          externalNode.setExternalData(oldExternalData);
        }
      }
    }
 else {
      boolean isJoblet=false;
      if (PluginChecker.isJobLetPluginLoaded()) {
        AbstractProcessProvider jobletProcessProvider=AbstractProcessProvider.findProcessProviderFromPID(IComponent.JOBLET_PID);
        IJobletProviderService service=(IJobletProviderService)GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
        boolean isAvoidShowJobletAfterDoubleClick=CorePlugin.getDefault().getComponentsLocalProviderService().isAvoidToShowJobletAfterDoubleClick();
        if (service != null && service.isJobletComponent(node) && !isAvoidShowJobletAfterDoubleClick) {
          isJoblet=true;
          String version=(String)node.getPropertyValue(EParameterName.PROCESS_TYPE_VERSION.getName());
          Item jobletItem=jobletProcessProvider.getJobletItem(node,version);
          if (jobletItem != null) {
            service.openJobletItem((JobletProcessItem)jobletItem);
          }
        }
      }
      if (!isJoblet) {
        IWorkbenchPage page=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        String processName=(String)node.getPropertyValue(EParameterName.PROCESS_TYPE_PROCESS.getName());
        String version=(String)node.getPropertyValue(EParameterName.PROCESS_TYPE_VERSION.getName());
        boolean isAvoidShowJobAfterDoubleClick=CorePlugin.getDefault().getComponentsLocalProviderService().isAvoidToShowJobAfterDoubleClick();
        boolean isSelectUseDynamic=false;
        Object useDynamicJobValue=(Object)node.getPropertyValue(EParameterName.USE_DYNAMIC_JOB.getName());
        if (useDynamicJobValue != null && useDynamicJobValue instanceof Boolean) {
          isSelectUseDynamic=(Boolean)useDynamicJobValue;
        }
        if (processName != null && !"String_Node_Str".equals(processName) && !isAvoidShowJobAfterDoubleClick && !isSelectUseDynamic) {
          try {
            ItemCacheManager.clearCache();
            ProcessItem processItem=ItemCacheManager.getProcessItem(processName,version);
            Property updatedProperty=null;
            try {
              updatedProperty=ProxyRepositoryFactory.getInstance().getLastVersion(new Project(ProjectManager.getInstance().getProject(processItem)),processName).getProperty();
            }
 catch (            PersistenceException e) {
              ExceptionHandler.process(e);
            }
            processItem=(ProcessItem)updatedProperty.getItem();
            if (processItem != null) {
              ProcessEditorInput fileEditorInput=new ProcessEditorInput(processItem,true);
              IEditorPart editorPart=page.findEditor(fileEditorInput);
              if (editorPart == null) {
                page.openEditor(fileEditorInput,MultiPageTalendEditor.ID,true);
              }
 else {
                page.activate(editorPart);
              }
            }
          }
 catch (          PartInitException e) {
            MessageBoxExceptionHandler.process(e);
          }
catch (          PersistenceException e) {
            MessageBoxExceptionHandler.process(e);
          }
        }
 else {
          try {
            page.showView(ComponentSettingsView.ID);
          }
 catch (          PartInitException e) {
            ExceptionHandler.process(e);
          }
        }
      }
    }
  }
  super.performRequest(req);
}

Fixed version (ground truth):
@Override public void performRequest(Request req){
  Node node=(Node)getModel();
  IExternalData oldExternalData=node.getExternalData();
  if (req.getType().equals("String_Node_Str")) {
    IExternalNode externalNode=null;
    if (node.isExternalNode()) {
      if (node.getElementParameterFromField(EParameterFieldType.EXTERNAL) != null) {
        externalNode=ExternalUtilities.getExternalNodeReadyToOpen(node);
      }
    }
    IWorkbenchPart part=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    if (externalNode != null && (part instanceof AbstractMultiPageTalendEditor)) {
      int returnValue=externalNode.open(getViewer().getControl().getShell());
      if (!node.isReadOnly()) {
        if (returnValue == SWT.OK) {
          Command cmd=new ExternalNodeChangeCommand(node,externalNode,oldExternalData);
          CommandStack cmdStack=(CommandStack)part.getAdapter(CommandStack.class);
          cmdStack.execute(cmd);
        }
 else {
          externalNode.setExternalData(oldExternalData);
        }
      }
    }
 else {
      boolean isJoblet=false;
      if (PluginChecker.isJobLetPluginLoaded()) {
        AbstractProcessProvider jobletProcessProvider=AbstractProcessProvider.findProcessProviderFromPID(IComponent.JOBLET_PID);
        IJobletProviderService service=(IJobletProviderService)GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
        boolean isAvoidShowJobletAfterDoubleClick=CorePlugin.getDefault().getComponentsLocalProviderService().isAvoidToShowJobletAfterDoubleClick();
        if (service != null && service.isJobletComponent(node) && !isAvoidShowJobletAfterDoubleClick) {
          isJoblet=true;
          String version=(String)node.getPropertyValue(EParameterName.PROCESS_TYPE_VERSION.getName());
          Item jobletItem=jobletProcessProvider.getJobletItem(node,version);
          if (jobletItem != null) {
            service.openJobletItem((JobletProcessItem)jobletItem);
          }
        }
      }
      if (!isJoblet) {
        IWorkbenchPage page=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
        String processName=(String)node.getPropertyValue(EParameterName.PROCESS_TYPE_PROCESS.getName());
        String version=(String)node.getPropertyValue(EParameterName.PROCESS_TYPE_VERSION.getName());
        boolean isAvoidShowJobAfterDoubleClick=CorePlugin.getDefault().getComponentsLocalProviderService().isAvoidToShowJobAfterDoubleClick();
        boolean isSelectUseDynamic=false;
        Object useDynamicJobValue=node.getPropertyValue(EParameterName.USE_DYNAMIC_JOB.getName());
        if (useDynamicJobValue != null && useDynamicJobValue instanceof Boolean) {
          isSelectUseDynamic=(Boolean)useDynamicJobValue;
        }
        if (processName != null && !"String_Node_Str".equals(processName) && !isAvoidShowJobAfterDoubleClick && !isSelectUseDynamic) {
          try {
            ItemCacheManager.clearCache();
            ProcessItem processItem=ItemCacheManager.getProcessItem(processName,version);
            Property updatedProperty=null;
            try {
              updatedProperty=ProxyRepositoryFactory.getInstance().getLastVersion(new Project(ProjectManager.getInstance().getProject(processItem)),processName).getProperty();
            }
 catch (            PersistenceException e) {
              ExceptionHandler.process(e);
            }
            processItem=(ProcessItem)updatedProperty.getItem();
            if (processItem != null) {
              ProcessEditorInput fileEditorInput=new ProcessEditorInput(processItem,true);
              IEditorPart editorPart=page.findEditor(fileEditorInput);
              if (editorPart == null) {
                page.openEditor(fileEditorInput,MultiPageTalendEditor.ID,true);
              }
 else {
                page.activate(editorPart);
              }
            }
          }
 catch (          PartInitException e) {
            MessageBoxExceptionHandler.process(e);
          }
catch (          PersistenceException e) {
            MessageBoxExceptionHandler.process(e);
          }
        }
 else {
          try {
            page.showView(ComponentSettingsView.ID);
          }
 catch (          PartInitException e) {
            ExceptionHandler.process(e);
          }
        }
      }
    }
  }
  super.performRequest(req);
}