Program: 141728
Project: 141728
Buggy source:
@Override public boolean performFinish(){
  if (mainPage.isCreateNewVersionJob()) {
    try {
      ProxyRepositoryFactory.getInstance().updateLockStatus();
    }
 catch (    PersistenceException e1) {
      ExceptionHandler.process(e1);
    }
    ERepositoryStatus repositoryStatus=ProxyRepositoryFactory.getInstance().getStatus(processObject);
    if ((repositoryStatus.equals(ERepositoryStatus.READ_ONLY)) || repositoryStatus == ERepositoryStatus.LOCK_BY_OTHER || repositoryStatus.equals(ERepositoryStatus.LOCK_BY_USER)) {
      Display.getDefault().syncExec(new Runnable(){
        public void run(){
          MessageDialog.openWarning(getShell(),"String_Node_Str",Messages.getString("String_Node_Str"));
        }
      }
);
      return false;
    }
 else {
      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());
    if (lastVersion) {
      lockObject(processObject);
    }
    ERepositoryStatus status=node.getObject().getRepositoryStatus();
    boolean isLocked=false;
    if (status == ERepositoryStatus.LOCK_BY_USER) {
      isLocked=true;
    }
    restoreVersion();
    openAnotherVersion(node,!lastVersion || !isLocked);
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  if (mainPage.isCreateNewVersionJob()) {
    try {
      ProxyRepositoryFactory.getInstance().updateLockStatus();
    }
 catch (    PersistenceException e1) {
      ExceptionHandler.process(e1);
    }
    ERepositoryStatus repositoryStatus=ProxyRepositoryFactory.getInstance().getStatus(processObject);
    if ((repositoryStatus.equals(ERepositoryStatus.READ_ONLY)) || repositoryStatus == ERepositoryStatus.LOCK_BY_OTHER || repositoryStatus.equals(ERepositoryStatus.LOCK_BY_USER)) {
      Display.getDefault().syncExec(new Runnable(){
        public void run(){
          MessageDialog.openWarning(getShell(),"String_Node_Str",Messages.getString("String_Node_Str"));
        }
      }
);
      return false;
    }
 else {
      IWorkspaceRunnable runnable=new IWorkspaceRunnable(){
        public void run(        final IProgressMonitor monitor) throws CoreException {
          if (!alreadyEditedByUser) {
            getProperty().setVersion(mainPage.getNewVersion());
            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());
    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;
}