Program: 92752
Project: 92752
Buggy source:
public IValgrindToolView createDynamicContent(String description,String toolID) throws CoreException {
  setContentDescription(description);
  IToolBarManager toolbar=getViewSite().getActionBars().getToolBarManager();
  if (dynamicActions != null) {
    for (    ActionContributionItem item : dynamicActions) {
      toolbar.remove(item);
    }
  }
  if (dynamicView != null) {
    dynamicView.dispose();
  }
  if (messages != null) {
    messagesViewer.getTreeViewer().setInput(null);
    messages=null;
  }
  for (  Control child : dynamicViewHolder.getChildren()) {
    if (!child.isDisposed()) {
      child.dispose();
    }
  }
  if (toolID != null) {
    dynamicView=ValgrindUIPlugin.getDefault().getToolView(toolID);
    dynamicView.createPartControl(dynamicViewHolder);
    IAction[] actions=dynamicView.getToolbarActions();
    if (actions != null) {
      dynamicActions=new ActionContributionItem[actions.length];
      for (int i=0; i < actions.length; i++) {
        dynamicActions[i]=new ActionContributionItem(actions[i]);
        toolbar.appendToGroup(ValgrindUIPlugin.TOOLBAR_LOC_GROUP_ID,dynamicActions[i]);
      }
    }
  }
 else {
    dynamicView=null;
  }
  IMenuManager menu=getViewSite().getActionBars().getMenuManager();
  menu.removeAll();
  hasDynamicContent=dynamicViewHolder.getChildren().length > 0;
  if (hasDynamicContent) {
    menu.add(showCoreAction);
    menu.add(showToolAction);
  }
  menu.update(true);
  toolbar.update(true);
  dynamicViewHolder.layout(true);
  return dynamicView;
}

Fixed version (ground truth):
public IValgrindToolView createDynamicContent(String description,String toolID) throws CoreException {
  setContentDescription(description);
  IToolBarManager toolbar=getViewSite().getActionBars().getToolBarManager();
  ToolBar tb=((ToolBarManager)toolbar).getControl();
  if (tb == null || tb.isDisposed()) {
    throw new CoreException(new Status(IStatus.ERROR,ValgrindUIPlugin.PLUGIN_ID,"String_Node_Str"));
  }
  if (dynamicActions != null) {
    for (    ActionContributionItem item : dynamicActions) {
      toolbar.remove(item);
    }
  }
  if (dynamicView != null) {
    dynamicView.dispose();
  }
  if (messages != null) {
    messagesViewer.getTreeViewer().setInput(null);
    messages=null;
  }
  for (  Control child : dynamicViewHolder.getChildren()) {
    if (!child.isDisposed()) {
      child.dispose();
    }
  }
  if (toolID != null) {
    dynamicView=ValgrindUIPlugin.getDefault().getToolView(toolID);
    dynamicView.createPartControl(dynamicViewHolder);
    IAction[] actions=dynamicView.getToolbarActions();
    if (actions != null) {
      dynamicActions=new ActionContributionItem[actions.length];
      for (int i=0; i < actions.length; i++) {
        dynamicActions[i]=new ActionContributionItem(actions[i]);
        toolbar.appendToGroup(ValgrindUIPlugin.TOOLBAR_LOC_GROUP_ID,dynamicActions[i]);
      }
    }
  }
 else {
    dynamicView=null;
  }
  IMenuManager menu=getViewSite().getActionBars().getMenuManager();
  menu.removeAll();
  hasDynamicContent=dynamicViewHolder.getChildren().length > 0;
  if (hasDynamicContent) {
    menu.add(showCoreAction);
    menu.add(showToolAction);
  }
  menu.update(true);
  toolbar.update(true);
  getViewSite().getActionBars().updateActionBars();
  dynamicViewHolder.layout(true);
  return dynamicView;
}