Program: 127288
Project: 127288
Buggy source:
@Override protected void doRun(){
  ISelection selection=getSelection();
  Object obj=((IStructuredSelection)selection).getFirstElement();
  final RepositoryNode node=(RepositoryNode)obj;
  final String title=Messages.getString("String_Node_Str");
  String message=null;
  List<IRepositoryNode> originalChildren=node.getChildren();
  final List<IRepositoryNode> children=new ArrayList<IRepositoryNode>(originalChildren);
  if (children.size() == 0) {
    return;
  }
  AbstractResourceChangesService resChangeService=TDQServiceRegister.getInstance().getResourceChangeService(AbstractResourceChangesService.class);
  if (resChangeService != null) {
    List<IRepositoryNode> dependentNodes=resChangeService.getDependentConnNodesInRecycleBin(children);
    if (dependentNodes != null && !dependentNodes.isEmpty()) {
      resChangeService.openDependcesDialog(dependentNodes);
      return;
    }
  }
  if (children.size() > 1) {
    message=Messages.getString("String_Node_Str") + "String_Node_Str" + Messages.getString("String_Node_Str");
  }
 else {
    message=Messages.getString("String_Node_Str") + "String_Node_Str" + Messages.getString("String_Node_Str");
  }
  final List<ItemReferenceBean> unDeleteItems=RepositoryNodeDeleteManager.getInstance().getUnDeleteItems(children,null);
  final Shell shell=getShell();
  if (!(MessageDialog.openQuestion(shell,title,message))) {
    return;
  }
  for (  IRepositoryNode child : children) {
    if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQRepositoryService.class)) {
      ITDQRepositoryService tdqRepService=(ITDQRepositoryService)GlobalServiceRegister.getDefault().getService(ITDQRepositoryService.class);
      if (!tdqRepService.removeAliasInSQLExplorer(child)) {
        MessageDialog.openWarning(shell,title,Messages.getString("String_Node_Str"));
        try {
          IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
          factory.saveProject(ProjectManager.getInstance().getCurrentProject());
        }
 catch (        PersistenceException e) {
          ExceptionHandler.process(e);
        }
        return;
      }
    }
  }
  final IWorkspaceRunnable op=new IWorkspaceRunnable(){
    @Override public void run(    IProgressMonitor monitor){
      IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
      for (      IRepositoryNode child : children) {
        try {
          deleteElements(factory,(RepositoryNode)child);
        }
 catch (        Exception e) {
          MessageBoxExceptionHandler.process(e);
        }
      }
      try {
        factory.saveProject(ProjectManager.getInstance().getCurrentProject());
      }
 catch (      PersistenceException e) {
        ExceptionHandler.process(e);
      }
    }
  }
;
  IRunnableWithProgress iRunnableWithProgress=new IRunnableWithProgress(){
    @Override public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      IWorkspace workspace=ResourcesPlugin.getWorkspace();
      try {
        ISchedulingRule schedulingRule=workspace.getRoot();
        workspace.run(op,schedulingRule,IWorkspace.AVOID_UPDATE,monitor);
      }
 catch (      CoreException e) {
        throw new InvocationTargetException(e);
      }
    }
  }
;
  try {
    PlatformUI.getWorkbench().getProgressService().run(true,true,iRunnableWithProgress);
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
  if (unDeleteItems.size() > 0) {
    Display.getDefault().syncExec(new Runnable(){
      @Override public void run(){
        ItemReferenceDialog dialog=new ItemReferenceDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),unDeleteItems);
        dialog.open();
      }
    }
);
  }
}

Fixed version (ground truth):
@Override protected void doRun(){
  ISelection selection=getSelection();
  Object obj=((IStructuredSelection)selection).getFirstElement();
  final RepositoryNode node=(RepositoryNode)obj;
  final String title=Messages.getString("String_Node_Str");
  String message=null;
  List<IRepositoryNode> originalChildren=node.getChildren();
  final List<IRepositoryNode> children=new ArrayList<IRepositoryNode>(originalChildren);
  if (children.size() == 0) {
    return;
  }
  AbstractResourceChangesService resChangeService=TDQServiceRegister.getInstance().getResourceChangeService(AbstractResourceChangesService.class);
  if (resChangeService != null) {
    List<IRepositoryNode> dependentNodes=resChangeService.getDependentConnNodesInRecycleBin(children);
    if (dependentNodes != null && !dependentNodes.isEmpty()) {
      resChangeService.openDependcesDialog(dependentNodes);
      return;
    }
  }
  if (children.size() > 1) {
    message=Messages.getString("String_Node_Str") + "String_Node_Str" + Messages.getString("String_Node_Str");
  }
 else {
    message=Messages.getString("String_Node_Str") + "String_Node_Str" + Messages.getString("String_Node_Str");
  }
  final List<ItemReferenceBean> unDeleteItems=RepositoryNodeDeleteManager.getInstance().getUnDeleteItems(children,null);
  final Shell shell=getShell();
  if (!(MessageDialog.openQuestion(shell,title,message))) {
    return;
  }
  for (  IRepositoryNode child : children) {
    if (GlobalServiceRegister.getDefault().isServiceRegistered(ITDQRepositoryService.class)) {
      ITDQRepositoryService tdqRepService=(ITDQRepositoryService)GlobalServiceRegister.getDefault().getService(ITDQRepositoryService.class);
      if (!tdqRepService.removeAliasInSQLExplorer(child)) {
        MessageDialog.openWarning(shell,title,Messages.getString("String_Node_Str"));
        try {
          IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
          factory.saveProject(ProjectManager.getInstance().getCurrentProject());
        }
 catch (        PersistenceException e) {
          ExceptionHandler.process(e);
        }
        return;
      }
    }
  }
  final IWorkspaceRunnable op=new IWorkspaceRunnable(){
    @Override public void run(    IProgressMonitor monitor){
      IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
      for (      IRepositoryNode child : children) {
        try {
          deleteElements(factory,(RepositoryNode)child);
        }
 catch (        Exception e) {
          MessageBoxExceptionHandler.process(e);
        }
      }
      try {
        factory.saveProject(ProjectManager.getInstance().getCurrentProject());
      }
 catch (      PersistenceException e) {
        ExceptionHandler.process(e);
      }
    }
  }
;
  IRunnableWithProgress iRunnableWithProgress=new IRunnableWithProgress(){
    @Override public void run(    IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
      IWorkspace workspace=ResourcesPlugin.getWorkspace();
      try {
        ISchedulingRule schedulingRule=workspace.getRoot();
        workspace.run(op,schedulingRule,IWorkspace.AVOID_UPDATE,monitor);
      }
 catch (      CoreException e) {
        throw new InvocationTargetException(e);
      }
    }
  }
;
  try {
    PlatformUI.getWorkbench().getProgressService().run(true,true,iRunnableWithProgress);
    if (forceBuild) {
      IRunProcessService service=(IRunProcessService)GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
      service.buildJavaProject();
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
  if (unDeleteItems.size() > 0) {
    Display.getDefault().syncExec(new Runnable(){
      @Override public void run(){
        ItemReferenceDialog dialog=new ItemReferenceDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),unDeleteItems);
        dialog.open();
      }
    }
);
  }
}