Program: 127281
Project: 127281
Buggy source:
@Override public void run(){
  try {
    IWorkbenchPage page=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    for (    IEditorReference editors : page.getEditorReferences()) {
      String nameInEditor=editors.getName();
      if (objToDelete.getLabel().equals(nameInEditor.substring(nameInEditor.indexOf("String_Node_Str") + 1))) {
        page.closeEditor(editors.getEditor(false),false);
      }
    }
    if (objToDelete.getRepositoryObjectType() != ERepositoryObjectType.JOB_DOC && objToDelete.getRepositoryObjectType() != ERepositoryObjectType.JOBLET_DOC) {
      if (currentNode.getType() == ENodeType.SIMPLE_FOLDER) {
        for (        IRepositoryNode curNode : currentNode.getChildren()) {
          deleteElements(factory,(RepositoryNode)curNode);
        }
        factory.deleteFolder(ProjectManager.getInstance().getCurrentProject(),currentNode.getContentType(),RepositoryNodeUtilities.getFolderPath(currentNode.getObject().getProperty().getItem()),true);
      }
 else {
        for (        IRepositoryContentHandler handler : RepositoryContentManager.getHandlers()) {
          handler.deleteNode(objToDelete);
        }
        ERepositoryObjectType nodeType=(ERepositoryObjectType)currentNode.getProperties(EProperties.CONTENT_TYPE);
        if (nodeType == ERepositoryObjectType.ROUTINES || nodeType == ERepositoryObjectType.PIG_UDF) {
          forceBuild=true;
        }
        factory.deleteObjectPhysical(ProjectManager.getInstance().getCurrentProject(),objToDelete,null,true);
      }
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    IWorkbenchPage page=PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    for (    IEditorReference editors : page.getEditorReferences()) {
      String nameInEditor=editors.getName();
      if (objToDelete.getLabel().equals(nameInEditor.substring(nameInEditor.indexOf("String_Node_Str") + 1))) {
        page.closeEditor(editors.getEditor(false),false);
      }
    }
    if (objToDelete.getRepositoryObjectType() != ERepositoryObjectType.JOB_DOC && objToDelete.getRepositoryObjectType() != ERepositoryObjectType.JOBLET_DOC) {
      if (currentNode.getType() == ENodeType.SIMPLE_FOLDER) {
        for (        IRepositoryNode curNode : currentNode.getChildren()) {
          deleteElements(factory,(RepositoryNode)curNode);
        }
        factory.deleteFolder(ProjectManager.getInstance().getCurrentProject(),currentNode.getContentType(),RepositoryNodeUtilities.getFolderPath(currentNode.getObject().getProperty().getItem()),true);
      }
 else {
        for (        IRepositoryContentHandler handler : RepositoryContentManager.getHandlers()) {
          handler.deleteNode(objToDelete);
        }
        ERepositoryObjectType nodeType=(ERepositoryObjectType)currentNode.getProperties(EProperties.CONTENT_TYPE);
        if (nodeType == ERepositoryObjectType.ROUTINES || nodeType == ERepositoryObjectType.PIG_UDF) {
          forceBuild=true;
        }
        if (!forceBuild) {
          if (GlobalServiceRegister.getDefault().isServiceRegistered(ICamelDesignerCoreService.class)) {
            ICamelDesignerCoreService camelService=(ICamelDesignerCoreService)GlobalServiceRegister.getDefault().getService(ICamelDesignerCoreService.class);
            if (nodeType == camelService.getBeansType()) {
              forceBuild=true;
            }
          }
        }
        factory.deleteObjectPhysical(ProjectManager.getInstance().getCurrentProject(),objToDelete,null,true);
      }
    }
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}