Program: 147987
Project: 147987
Buggy source:
@Override public void run(){
  PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().saveAllEditors(true);
  Set<IRepositoryViewObject> allChangedObjects=findAllChangedObjects();
  String name=getSameServerName();
  allChangedObjects.addAll(RemoveFromRepositoryAction.getViewObjectsRemovedList());
  DeployAllDialog dialog=new DeployAllDialog(getShell(),commonViewer.getInput(),allChangedObjects,name);
  List<IRepositoryViewObject> selectededViewObjs=new ArrayList<IRepositoryViewObject>();
  int retCode=dialog.open();
  IS_DEPLOYALL_FLAG=false;
  IRepositoryViewObject[] theInput=(IRepositoryViewObject[])commonViewer.getInput();
  backDeleteObjectsTreeView(theInput);
  if (retCode == IDialogConstants.OK_ID) {
    selectededViewObjs=dialog.getSelectededViewObjs();
    for (    IRepositoryViewObject viewObj : selectededViewObjs) {
      Item item=viewObj.getProperty().getItem();
      MDMServerObject serverObj=((MDMServerObjectItem)item).getMDMServerObject();
      serverObj.getLastServerDef();
    }
    MDMServerDef def=dialog.getTheServerDef();
    List<IRepositoryViewObject> viewObjectsRemoved=new ArrayList<IRepositoryViewObject>();
    for (    IRepositoryViewObject viewObj : selectededViewObjs) {
      if (RemoveFromRepositoryAction.getViewObjectsRemovedList().contains(viewObj)) {
        viewObjectsRemoved.add(viewObj);
      }
    }
    for (    IRepositoryViewObject viewObj : viewObjectsRemoved) {
      selectededViewObjs.remove(viewObj);
    }
    if (selectededViewObjs.size() >= 0) {
      IStatus status=updateServer(def,selectededViewObjs,viewObjectsRemoved);
      updateChangedStatus(status);
      if (status.isMultiStatus()) {
        showDeployStatus(status);
      }
      if (status.isMultiStatus()) {
        for (        IStatus childStatus : status.getChildren()) {
          DeployService.DeployStatus deployStatus=(DeployStatus)childStatus;
          if (deployStatus.isOK()) {
            if (deployStatus.getItem() instanceof MDMServerObjectItem)             saveLastServer((MDMServerObjectItem)deployStatus.getItem(),def,selectededViewObjs);
          }
        }
      }
    }
  }
  defNames.clear();
  Object input=commonViewer.getInput();
  for (  IRepositoryViewObject viewObj : (IRepositoryViewObject[])input) {
    commonViewer.refresh(viewObj);
  }
}

Fixed version (ground truth):
@Override public void run(){
  PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().saveAllEditors(true);
  Set<IRepositoryViewObject> allChangedObjects=findAllChangedObjects();
  String name=getSameServerName();
  allChangedObjects.addAll(RemoveFromRepositoryAction.getViewObjectsRemovedList());
  IRepositoryViewObject[] categoryViewObjects=RepositoryResourceUtil.getCategoryViewObjects();
  DeployAllDialog dialog=new DeployAllDialog(getShell(),categoryViewObjects,allChangedObjects,name);
  List<IRepositoryViewObject> selectededViewObjs=new ArrayList<IRepositoryViewObject>();
  int retCode=dialog.open();
  IS_DEPLOYALL_FLAG=false;
  IRepositoryViewObject[] theInput=(IRepositoryViewObject[])commonViewer.getInput();
  backDeleteObjectsTreeView(theInput);
  if (retCode == IDialogConstants.OK_ID) {
    selectededViewObjs=dialog.getSelectededViewObjs();
    for (    IRepositoryViewObject viewObj : selectededViewObjs) {
      Item item=viewObj.getProperty().getItem();
      MDMServerObject serverObj=((MDMServerObjectItem)item).getMDMServerObject();
      serverObj.getLastServerDef();
    }
    MDMServerDef def=dialog.getTheServerDef();
    List<IRepositoryViewObject> viewObjectsRemoved=new ArrayList<IRepositoryViewObject>();
    for (    IRepositoryViewObject viewObj : selectededViewObjs) {
      if (RemoveFromRepositoryAction.getViewObjectsRemovedList().contains(viewObj)) {
        viewObjectsRemoved.add(viewObj);
      }
    }
    for (    IRepositoryViewObject viewObj : viewObjectsRemoved) {
      selectededViewObjs.remove(viewObj);
    }
    if (selectededViewObjs.size() >= 0) {
      IStatus status=updateServer(def,selectededViewObjs,viewObjectsRemoved);
      updateChangedStatus(status);
      if (status.isMultiStatus()) {
        showDeployStatus(status);
      }
      if (status.isMultiStatus()) {
        for (        IStatus childStatus : status.getChildren()) {
          DeployService.DeployStatus deployStatus=(DeployStatus)childStatus;
          if (deployStatus.isOK()) {
            if (deployStatus.getItem() instanceof MDMServerObjectItem)             saveLastServer((MDMServerObjectItem)deployStatus.getItem(),def,selectededViewObjs);
          }
        }
      }
    }
  }
  defNames.clear();
  Object input=commonViewer.getInput();
  for (  IRepositoryViewObject viewObj : (IRepositoryViewObject[])input) {
    commonViewer.refresh(viewObj);
  }
}