Program: 141819
Project: 141819
Buggy source:
@Override public boolean performFinish(){
  if (mainPage.isCreateNewVersionJob()) {
    if (!alreadyEditedByUser) {
      refreshNewJob();
      try {
        ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
      }
 catch (      Exception e) {
        ExceptionHandler.process(e);
      }
    }
    try {
      ProxyRepositoryFactory.getInstance().lock(processObject);
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
catch (    LoginException e) {
      ExceptionHandler.process(e);
    }
    boolean locked=processObject.getRepositoryStatus().equals(ERepositoryStatus.LOCK_BY_USER);
    openAnotherVersion((RepositoryNode)processObject.getRepositoryNode(),!locked);
    try {
      ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
    }
 catch (    Exception e) {
      ExceptionHandler.process(e);
    }
  }
 else {
    StructuredSelection selection=(StructuredSelection)mainPage.getSelection();
    RepositoryNode node=(RepositoryNode)selection.getFirstElement();
    boolean lastVersion=node.getObject().getVersion().equals(processObject.getVersion());
    processObject.getProperty().setVersion(originalVersion);
    if (lastVersion) {
      lockObject(processObject);
    }
    ERepositoryStatus status=node.getObject().getRepositoryStatus();
    boolean isLocked=false;
    if (status == ERepositoryStatus.LOCK_BY_USER) {
      isLocked=true;
    }
    openAnotherVersion(node,!lastVersion || !isLocked);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  if (mainPage.isCreateNewVersionJob()) {
    IWorkspaceRunnable runnable=new IWorkspaceRunnable(){
      public void run(      final IProgressMonitor monitor) throws CoreException {
        if (!alreadyEditedByUser) {
          refreshNewJob();
          try {
            ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
          }
 catch (          Exception e) {
            ExceptionHandler.process(e);
          }
        }
        try {
          ProxyRepositoryFactory.getInstance().lock(processObject);
        }
 catch (        PersistenceException e) {
          ExceptionHandler.process(e);
        }
catch (        LoginException e) {
          ExceptionHandler.process(e);
        }
        boolean locked=processObject.getRepositoryStatus().equals(ERepositoryStatus.LOCK_BY_USER);
        openAnotherVersion((RepositoryNode)processObject.getRepositoryNode(),!locked);
        try {
          ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
        }
 catch (        Exception e) {
          ExceptionHandler.process(e);
        }
      }
    }
;
    IWorkspace workspace=ResourcesPlugin.getWorkspace();
    try {
      ISchedulingRule schedulingRule=workspace.getRoot();
      workspace.run(runnable,schedulingRule,IWorkspace.AVOID_UPDATE,null);
    }
 catch (    CoreException e) {
      MessageBoxExceptionHandler.process(e);
    }
  }
 else {
    StructuredSelection selection=(StructuredSelection)mainPage.getSelection();
    RepositoryNode node=(RepositoryNode)selection.getFirstElement();
    boolean lastVersion=node.getObject().getVersion().equals(processObject.getVersion());
    processObject.getProperty().setVersion(originalVersion);
    if (lastVersion) {
      lockObject(processObject);
    }
    ERepositoryStatus status=node.getObject().getRepositoryStatus();
    boolean isLocked=false;
    if (status == ERepositoryStatus.LOCK_BY_USER) {
      isLocked=true;
    }
    openAnotherVersion(node,!lastVersion || !isLocked);
  }
  return true;
}