Program: 123407
Project: 123407
Buggy source:
/** 
 * Saves the multi-page editor's document.
 */
@Override public void doSave(final IProgressMonitor monitor){
  Item curItem=getProcess().getProperty().getItem();
  IRepositoryService service=CorePlugin.getDefault().getRepositoryService();
  IProxyRepositoryFactory repFactory=service.getProxyRepositoryFactory();
  try {
    repFactory.updateLockStatus();
  }
 catch (  PersistenceException e1) {
    ExceptionHandler.process(e1);
  }
  ERepositoryStatus status=repFactory.getStatus(curItem);
  if (!status.equals(ERepositoryStatus.LOCK_BY_USER)) {
    MessageDialog.openWarning(getEditor(0).getEditorSite().getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    return;
  }
  if (!isDirty()) {
    return;
  }
  updateRunJobContext();
  designerEditor.getProcess().getProperty().eAdapters().remove(dirtyListener);
  display=getSite().getShell().getDisplay();
  repFactory.addRepositoryWorkUnitListener(repositoryWorkListener);
  if (getActivePage() == 0 || getActivePage() == 1) {
    getEditor(0).doSave(monitor);
  }
 else   if (getActivePage() == 2) {
    getEditor(2).doSave(monitor);
    try {
      IProcess2 oldProcess=getProcess();
      ICreateXtextProcessService n=CorePlugin.getDefault().getCreateXtextProcessService();
      ProcessType processType=n.convertDesignerEditorInput(((IFile)getEditor(2).getEditorInput().getAdapter(IResource.class)).getLocation().toOSString(),oldProcess.getProperty());
      IProcess2 newProcess=null;
      Item item=getProcess().getProperty().getItem();
      if (item instanceof ProcessItem) {
        ((Process)designerEditor.getProcess()).updateProcess(processType);
      }
 else       if (item instanceof JobletProcessItem) {
        AbstractProcessProvider processProvider=AbstractProcessProvider.findProcessProviderFromPID(IComponent.JOBLET_PID);
        if (processProvider != null) {
          newProcess=processProvider.buildNewGraphicProcess(item);
        }
        designerEditor.setProcess(newProcess);
        Boolean lastVersion=null;
        if (oldProcess instanceof ILastVersionChecker) {
          lastVersion=((ILastVersionChecker)oldProcess).isLastVersion(item);
        }
        if (designerEditor.getEditorInput() instanceof JobEditorInput) {
          ((JobEditorInput)designerEditor.getEditorInput()).checkInit(lastVersion,null,true);
        }
      }
      getEditor(0).doSave(monitor);
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
  }
  if (processEditorInput != null) {
    propertyInformation=new ArrayList(processEditorInput.getItem().getProperty().getInformations());
    propertyIsDirty=false;
    firePropertyChange(IEditorPart.PROP_DIRTY);
    if (processEditorInput.getItem() instanceof ProcessItem) {
      RepositoryManager.refresh(ERepositoryObjectType.PROCESS);
    }
 else {
      RepositoryManager.refresh(ERepositoryObjectType.JOBLET);
    }
  }
  if (designerEditor != null && dirtyListener != null) {
    designerEditor.getProcess().getProperty().eAdapters().add(dirtyListener);
  }
}

Fixed version (ground truth):
/** 
 * Saves the multi-page editor's document.
 */
@Override public void doSave(final IProgressMonitor monitor){
  Item curItem=getProcess().getProperty().getItem();
  IRepositoryService service=CorePlugin.getDefault().getRepositoryService();
  IProxyRepositoryFactory repFactory=service.getProxyRepositoryFactory();
  try {
    repFactory.updateLockStatus();
  }
 catch (  PersistenceException e1) {
    ExceptionHandler.process(e1);
  }
  ERepositoryStatus status=repFactory.getStatus(curItem);
  if (!status.equals(ERepositoryStatus.LOCK_BY_USER)) {
    MessageDialog.openWarning(getEditor(0).getEditorSite().getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"));
    return;
  }
  if (!isDirty()) {
    return;
  }
  updateRunJobContext();
  designerEditor.getProcess().getProperty().eAdapters().remove(dirtyListener);
  display=getSite().getShell().getDisplay();
  repFactory.addRepositoryWorkUnitListener(repositoryWorkListener);
  if (getActivePage() == 0 || getActivePage() == 1) {
    getEditor(0).doSave(monitor);
  }
 else   if (getActivePage() == 2) {
    boolean isDirty=getEditor(2).isDirty();
    getEditor(2).doSave(monitor);
    try {
      IProcess2 oldProcess=getProcess();
      ICreateXtextProcessService n=CorePlugin.getDefault().getCreateXtextProcessService();
      ProcessType processType=n.convertDesignerEditorInput(((IFile)getEditor(2).getEditorInput().getAdapter(IResource.class)).getLocation().toOSString(),oldProcess.getProperty());
      IProcess2 newProcess=null;
      Item item=getProcess().getProperty().getItem();
      if (item instanceof ProcessItem) {
        ((Process)designerEditor.getProcess()).updateProcess(processType);
        if (isDirty) {
          getProcess().setProcessModified(true);
          getProcess().setNeedRegenerateCode(true);
        }
      }
 else       if (item instanceof JobletProcessItem) {
        AbstractProcessProvider processProvider=AbstractProcessProvider.findProcessProviderFromPID(IComponent.JOBLET_PID);
        if (processProvider != null) {
          newProcess=processProvider.buildNewGraphicProcess(item);
        }
        designerEditor.setProcess(newProcess);
        Boolean lastVersion=null;
        if (oldProcess instanceof ILastVersionChecker) {
          lastVersion=((ILastVersionChecker)oldProcess).isLastVersion(item);
        }
        if (designerEditor.getEditorInput() instanceof JobEditorInput) {
          ((JobEditorInput)designerEditor.getEditorInput()).checkInit(lastVersion,null,true);
        }
      }
      getEditor(0).doSave(monitor);
    }
 catch (    PersistenceException e) {
      ExceptionHandler.process(e);
    }
  }
  if (processEditorInput != null) {
    propertyInformation=new ArrayList(processEditorInput.getItem().getProperty().getInformations());
    propertyIsDirty=false;
    firePropertyChange(IEditorPart.PROP_DIRTY);
    if (processEditorInput.getItem() instanceof ProcessItem) {
      RepositoryManager.refresh(ERepositoryObjectType.PROCESS);
    }
 else {
      RepositoryManager.refresh(ERepositoryObjectType.JOBLET);
    }
  }
  if (designerEditor != null && dirtyListener != null) {
    designerEditor.getProcess().getProperty().eAdapters().add(dirtyListener);
  }
}