Program: 118101
Project: 118101
Buggy source:
@Override public void widgetSelected(SelectionEvent e){
  final IProxyRepositoryFactory proxyRepositoryFactory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
  Property property=repositoryObject.getProperty();
  if (nameText == null || nameText.isDisposed() || versionText == null || versionText.isDisposed() || purposeText == null || purposeText.isDisposed() || jobTypeCCombo == null || jobTypeCCombo.isDisposed() || jobFrameworkCCombo == null || jobFrameworkCCombo.isDisposed() || statusText == null || statusText.isDisposed() || descriptionText == null || descriptionText.isDisposed() || btnConfirm == null || btnConfirm.isDisposed() || property == null) {
    return;
  }
  String originalName=nameText.getText();
  String originalJobType=jobTypeCCombo.getText();
  String originalFramework=jobFrameworkCCombo.getText();
  String originalversion=versionText.getText();
  String originalPurpose=purposeText.getText();
  String originalStatus=statusText.getText();
  String originalDescription=descriptionText.getText();
  saveJobEditor(repositoryObject);
  if (repositoryObject instanceof IProcess2) {
    IWorkspaceRunnable runnable=new IWorkspaceRunnable(){
      @Override public void run(      final IProgressMonitor monitor) throws CoreException {
        DeleteActionCache.getInstance().closeOpenedEditor(repositoryObject);
      }
    }
;
    IWorkspace workspace=ResourcesPlugin.getWorkspace();
    try {
      ISchedulingRule schedulingRule=workspace.getRoot();
      workspace.run(runnable,schedulingRule,IWorkspace.AVOID_UPDATE,null);
    }
 catch (    CoreException e1) {
      MessageBoxExceptionHandler.process(e1.getCause());
    }
  }
  String newJobName=null;
  if (!originalName.equals(StringUtils.trimToEmpty(repositoryObject.getLabel()))) {
    newJobName=originalName;
  }
  if (!originalversion.equals(StringUtils.trimToEmpty(repositoryObject.getVersion()))) {
    property.setVersion(originalversion);
  }
  if (!originalPurpose.equals(StringUtils.trimToEmpty(repositoryObject.getPurpose()))) {
    property.setPurpose(originalPurpose);
  }
  if (!originalStatus.equals(StringUtils.trimToEmpty(repositoryObject.getStatusCode()))) {
    property.setStatusCode(getStatusCode(statusMap,originalStatus));
  }
  if (!originalDescription.equals(StringUtils.trimToEmpty(repositoryObject.getDescription()))) {
    property.setDescription(originalDescription);
  }
  Item originalItem=repositoryObject.getProperty().getItem();
  if (ConvertJobsUtil.isNeedConvert(originalItem,originalJobType,originalFramework,true)) {
    boolean hasTestCase=ConvertJobsUtil.hasTestCase(repositoryObject.getProperty());
    if (hasTestCase && !MessageDialogWithToggle.openConfirm(null,"String_Node_Str","String_Node_Str")) {
      return;
    }
    final List<ItemReferenceBean> unDeleteItems=RepositoryNodeDeleteManager.getInstance().getUnDeleteItems(repositoryObject,null,true);
    if (!unDeleteItems.isEmpty()) {
      ItemReferenceDialog dialog=new ItemReferenceDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),unDeleteItems);
      dialog.open();
      return;
    }
    final Item newItem=ConvertJobsUtil.createOperation(originalName,originalJobType,originalFramework,repositoryObject);
    RepositoryWorkUnit repositoryWorkUnit=new RepositoryWorkUnit("String_Node_Str"){
      @Override public void run() throws PersistenceException {
        IWorkspaceRunnable runnable=new IWorkspaceRunnable(){
          @Override public void run(          final IProgressMonitor monitor) throws CoreException {
            try {
              boolean isOpened=false;
              if (repositoryObject instanceof IProcess2) {
                isOpened=true;
                boolean locked=proxyRepositoryFactory.getStatus(repositoryObject) == ERepositoryStatus.LOCK_BY_USER;
                if (locked) {
                  proxyRepositoryFactory.unlock(repositoryObject);
                }
              }
              boolean isNewItemCreated=true;
              Property repositoryProperty=repositoryObject.getProperty();
              if (repositoryProperty != null) {
                isNewItemCreated=(repositoryProperty.getItem() != newItem);
              }
              if (isNewItemCreated) {
                proxyRepositoryFactory.deleteObjectPhysical(repositoryObject);
                proxyRepositoryFactory.saveProject(ProjectManager.getInstance().getCurrentProject());
              }
 else               if (repositoryObject.getProperty() != null) {
                proxyRepositoryFactory.save(ProjectManager.getInstance().getCurrentProject(),repositoryObject.getProperty().getItem(),false);
              }
              if (newItem != null && newItem.getProperty() != null) {
                String newId=newItem.getProperty().getId();
                if (isNewItemCreated) {
                  newRepositoryObject=proxyRepositoryFactory.getLastVersion(ProjectManager.getInstance().getCurrentProject(),newId);
                }
 else {
                  newRepositoryObject=repositoryObject;
                }
                if (!isOpened) {
                  repositoryObject=newRepositoryObject;
                  if (!jobTypeCCombo.isDisposed() && !jobFrameworkCCombo.isDisposed()) {
                    jobTypeValue=jobTypeCCombo.getText();
                    frameworkValue=jobFrameworkCCombo.getText();
                  }
                }
              }
            }
 catch (            PersistenceException e1) {
              e1.printStackTrace();
            }
catch (            LoginException e) {
              e.printStackTrace();
            }
          }
        }
;
        IWorkspace workspace=ResourcesPlugin.getWorkspace();
        try {
          ISchedulingRule schedulingRule=workspace.getRoot();
          workspace.run(runnable,schedulingRule,IWorkspace.AVOID_UPDATE,null);
        }
 catch (        CoreException e1) {
          MessageBoxExceptionHandler.process(e1.getCause());
        }
      }
    }
;
    repositoryWorkUnit.setAvoidSvnUpdate(true);
    repositoryWorkUnit.setAvoidUnloadResources(true);
    ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(repositoryWorkUnit);
    if (newItem != null && repositoryObject instanceof IProcess2) {
      if (newRepositoryObject != null && newRepositoryObject.getProperty() != null) {
        openEditorOperation(newRepositoryObject.getProperty().getItem());
      }
    }
  }
 else {
    if (newJobName != null) {
      property.setLabel(newJobName);
      property.setDisplayName(newJobName);
    }
    if (originalFramework != null) {
      if (property.getAdditionalProperties().containsKey(ConvertJobsUtil.FRAMEWORK)) {
        property.getAdditionalProperties().removeKey(ConvertJobsUtil.FRAMEWORK);
      }
      property.getAdditionalProperties().put(ConvertJobsUtil.FRAMEWORK,originalFramework);
    }
    RepositoryWorkUnit repositoryWorkUnit=new RepositoryWorkUnit("String_Node_Str"){
      @Override public void run() throws PersistenceException {
        IWorkspaceRunnable runnable=new IWorkspaceRunnable(){
          @Override public void run(          final IProgressMonitor monitor) throws CoreException {
            try {
              if (repositoryObject.getProperty() != null) {
                proxyRepositoryFactory.save(ProjectManager.getInstance().getCurrentProject(),repositoryObject.getProperty().getItem(),false);
              }
            }
 catch (            PersistenceException e1) {
              ExceptionHandler.process(e1);
            }
          }
        }
;
        IWorkspace workspace=ResourcesPlugin.getWorkspace();
        try {
          ISchedulingRule schedulingRule=workspace.getRoot();
          workspace.run(runnable,schedulingRule,IWorkspace.AVOID_UPDATE,null);
        }
 catch (        CoreException e1) {
          MessageBoxExceptionHandler.process(e1.getCause());
        }
      }
    }
;
    repositoryWorkUnit.setAvoidSvnUpdate(true);
    repositoryWorkUnit.setAvoidUnloadResources(true);
    ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(repositoryWorkUnit);
    if (repositoryObject instanceof IProcess2) {
      openEditorOperation(property.getItem());
    }
  }
  IViewPart jobSettingView=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(IJobSettingsView.ID);
  if (jobSettingView != null && jobSettingView instanceof IJobSettingsView && !(repositoryObject instanceof IProcess2)) {
    Map<String,Object> propertiesMap=new HashMap<String,Object>();
    propertiesMap.put(IJobSettingsView.JOBTYPE_CHANGED,repositoryObject);
    ((IJobSettingsView)jobSettingView).onPropertiesChanged(propertiesMap);
  }
  if (!btnConfirm.isDisposed()) {
    btnConfirm.setEnabled(false);
  }
}

Fixed version (ground truth):
@Override public void widgetSelected(SelectionEvent e){
  final IProxyRepositoryFactory proxyRepositoryFactory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
  Property property=repositoryObject.getProperty();
  if (nameText == null || nameText.isDisposed() || versionText == null || versionText.isDisposed() || purposeText == null || purposeText.isDisposed() || jobTypeCCombo == null || jobTypeCCombo.isDisposed() || jobFrameworkCCombo == null || jobFrameworkCCombo.isDisposed() || statusText == null || statusText.isDisposed() || descriptionText == null || descriptionText.isDisposed() || btnConfirm == null || btnConfirm.isDisposed() || property == null) {
    return;
  }
  String originalName=nameText.getText();
  String originalJobType=jobTypeCCombo.getText();
  String originalFramework=jobFrameworkCCombo.getText();
  String originalversion=versionText.getText();
  String originalPurpose=purposeText.getText();
  String originalStatus=statusText.getText();
  String originalDescription=descriptionText.getText();
  saveJobEditor(repositoryObject);
  if (repositoryObject instanceof IProcess2) {
    IWorkspaceRunnable runnable=new IWorkspaceRunnable(){
      @Override public void run(      final IProgressMonitor monitor) throws CoreException {
        DeleteActionCache.getInstance().closeOpenedEditor(repositoryObject);
      }
    }
;
    IWorkspace workspace=ResourcesPlugin.getWorkspace();
    try {
      ISchedulingRule schedulingRule=workspace.getRoot();
      workspace.run(runnable,schedulingRule,IWorkspace.AVOID_UPDATE,null);
    }
 catch (    CoreException e1) {
      MessageBoxExceptionHandler.process(e1.getCause());
    }
  }
  String newJobName=null;
  if (!originalName.equals(StringUtils.trimToEmpty(repositoryObject.getLabel()))) {
    newJobName=originalName;
  }
  if (!originalversion.equals(StringUtils.trimToEmpty(repositoryObject.getVersion()))) {
    property.setVersion(originalversion);
  }
  if (!originalPurpose.equals(StringUtils.trimToEmpty(repositoryObject.getPurpose()))) {
    property.setPurpose(originalPurpose);
  }
  if (!originalStatus.equals(StringUtils.trimToEmpty(repositoryObject.getStatusCode()))) {
    property.setStatusCode(getStatusCode(statusMap,originalStatus));
  }
  if (!originalDescription.equals(StringUtils.trimToEmpty(repositoryObject.getDescription()))) {
    property.setDescription(originalDescription);
  }
  Item originalItem=repositoryObject.getProperty().getItem();
  if (ConvertJobsUtil.isNeedConvert(originalItem,originalJobType,originalFramework,true)) {
    boolean hasTestCase=ConvertJobsUtil.hasTestCase(repositoryObject.getProperty());
    final List<ItemReferenceBean> unDeleteItems=RepositoryNodeDeleteManager.getInstance().getUnDeleteItems(repositoryObject,null,true);
    if (!unDeleteItems.isEmpty()) {
      ItemReferenceDialog dialog=new ItemReferenceDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),unDeleteItems);
      dialog.open();
      return;
    }
    final Item newItem=ConvertJobsUtil.createOperation(originalName,originalJobType,originalFramework,repositoryObject);
    if (newItem != null) {
      ConvertJobsUtil.convertTestcases(newItem,repositoryObject,originalJobType);
    }
    RepositoryWorkUnit repositoryWorkUnit=new RepositoryWorkUnit("String_Node_Str"){
      @Override public void run() throws PersistenceException {
        IWorkspaceRunnable runnable=new IWorkspaceRunnable(){
          @Override public void run(          final IProgressMonitor monitor) throws CoreException {
            try {
              boolean isOpened=false;
              if (repositoryObject instanceof IProcess2) {
                isOpened=true;
                boolean locked=proxyRepositoryFactory.getStatus(repositoryObject) == ERepositoryStatus.LOCK_BY_USER;
                if (locked) {
                  proxyRepositoryFactory.unlock(repositoryObject);
                }
              }
              boolean isNewItemCreated=true;
              Property repositoryProperty=repositoryObject.getProperty();
              if (repositoryProperty != null) {
                isNewItemCreated=(repositoryProperty.getItem() != newItem);
              }
              if (isNewItemCreated) {
                proxyRepositoryFactory.deleteObjectPhysical(repositoryObject);
                proxyRepositoryFactory.saveProject(ProjectManager.getInstance().getCurrentProject());
              }
 else               if (repositoryObject.getProperty() != null) {
                proxyRepositoryFactory.save(ProjectManager.getInstance().getCurrentProject(),repositoryObject.getProperty().getItem(),false);
              }
              if (newItem != null && newItem.getProperty() != null) {
                String newId=newItem.getProperty().getId();
                if (isNewItemCreated) {
                  newRepositoryObject=proxyRepositoryFactory.getLastVersion(ProjectManager.getInstance().getCurrentProject(),newId);
                }
 else {
                  newRepositoryObject=repositoryObject;
                }
                if (!isOpened) {
                  repositoryObject=newRepositoryObject;
                  if (!jobTypeCCombo.isDisposed() && !jobFrameworkCCombo.isDisposed()) {
                    jobTypeValue=jobTypeCCombo.getText();
                    frameworkValue=jobFrameworkCCombo.getText();
                  }
                }
              }
            }
 catch (            PersistenceException e1) {
              e1.printStackTrace();
            }
catch (            LoginException e) {
              e.printStackTrace();
            }
          }
        }
;
        IWorkspace workspace=ResourcesPlugin.getWorkspace();
        try {
          ISchedulingRule schedulingRule=workspace.getRoot();
          workspace.run(runnable,schedulingRule,IWorkspace.AVOID_UPDATE,null);
        }
 catch (        CoreException e1) {
          MessageBoxExceptionHandler.process(e1.getCause());
        }
      }
    }
;
    repositoryWorkUnit.setAvoidSvnUpdate(true);
    repositoryWorkUnit.setAvoidUnloadResources(true);
    ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(repositoryWorkUnit);
    if (newItem != null && repositoryObject instanceof IProcess2) {
      if (newRepositoryObject != null && newRepositoryObject.getProperty() != null) {
        openEditorOperation(newRepositoryObject.getProperty().getItem());
      }
    }
  }
 else {
    if (newJobName != null) {
      property.setLabel(newJobName);
      property.setDisplayName(newJobName);
    }
    if (originalFramework != null) {
      if (property.getAdditionalProperties().containsKey(ConvertJobsUtil.FRAMEWORK)) {
        property.getAdditionalProperties().removeKey(ConvertJobsUtil.FRAMEWORK);
      }
      property.getAdditionalProperties().put(ConvertJobsUtil.FRAMEWORK,originalFramework);
    }
    RepositoryWorkUnit repositoryWorkUnit=new RepositoryWorkUnit("String_Node_Str"){
      @Override public void run() throws PersistenceException {
        IWorkspaceRunnable runnable=new IWorkspaceRunnable(){
          @Override public void run(          final IProgressMonitor monitor) throws CoreException {
            try {
              if (repositoryObject.getProperty() != null) {
                proxyRepositoryFactory.save(ProjectManager.getInstance().getCurrentProject(),repositoryObject.getProperty().getItem(),false);
              }
            }
 catch (            PersistenceException e1) {
              ExceptionHandler.process(e1);
            }
          }
        }
;
        IWorkspace workspace=ResourcesPlugin.getWorkspace();
        try {
          ISchedulingRule schedulingRule=workspace.getRoot();
          workspace.run(runnable,schedulingRule,IWorkspace.AVOID_UPDATE,null);
        }
 catch (        CoreException e1) {
          MessageBoxExceptionHandler.process(e1.getCause());
        }
      }
    }
;
    repositoryWorkUnit.setAvoidSvnUpdate(true);
    repositoryWorkUnit.setAvoidUnloadResources(true);
    ProxyRepositoryFactory.getInstance().executeRepositoryWorkUnit(repositoryWorkUnit);
    if (repositoryObject instanceof IProcess2) {
      openEditorOperation(property.getItem());
    }
  }
  IViewPart jobSettingView=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(IJobSettingsView.ID);
  if (jobSettingView != null && jobSettingView instanceof IJobSettingsView && !(repositoryObject instanceof IProcess2)) {
    Map<String,Object> propertiesMap=new HashMap<String,Object>();
    propertiesMap.put(IJobSettingsView.JOBTYPE_CHANGED,repositoryObject);
    ((IJobSettingsView)jobSettingView).onPropertiesChanged(propertiesMap);
  }
  if (!btnConfirm.isDisposed()) {
    btnConfirm.setEnabled(false);
  }
}