Program: 96360
Project: 96360
Buggy source:
/** 
 * Adds name information to the given widget, if necessary.
 * @param widget The widget to name.
 */
private void addNameData(Widget widget){
  if (widget != null && !widget.isDisposed()) {
    if (widget.getData(Startup.GD_RCP_DATA_KEY) != null) {
      return;
    }
    Object data=getWidgetData(widget);
    if (data instanceof IContributionItem) {
      String actionId=((IContributionItem)data).getId();
      if (actionId != null && actionId.trim().length() > 0) {
        widget.setData(Startup.GD_RCP_DATA_KEY,actionId);
        Control parent=null;
        try {
          if (widget instanceof ToolItem) {
            parent=((ToolItem)widget).getParent();
          }
 else           if (widget instanceof CoolItem) {
            parent=((CoolItem)widget).getParent();
          }
 else           if (widget instanceof Control) {
            parent=((Control)widget).getParent();
          }
        }
 catch (        NoClassDefFoundError e) {
        }
        if (parent != null && !parent.isDisposed()) {
          parent.update();
          parent.redraw();
          parent.update();
        }
      }
    }
 else     if (data instanceof PreferenceDialog) {
      PreferenceDialog prefDialog=(PreferenceDialog)data;
      prefDialog.addPageChangedListener(new IPageChangedListener(){
        public void pageChanged(        PageChangedEvent event){
          addNameDataToPrefPage(event.getSelectedPage());
        }
      }
);
      addNameDataToPrefPage(prefDialog.getSelectedPage());
    }
    if (generateNames && data instanceof Dialog) {
      Dialog dialog=(Dialog)data;
      setNameForDialogButtonBarButtons(dialog);
    }
  }
}

Fixed version (ground truth):
/** 
 * Adds name information to the given widget, if necessary.
 * @param widget The widget to name.
 */
private void addNameData(Widget widget){
  if (widget != null && !widget.isDisposed()) {
    if (widget.getData(Startup.TEST_RCP_DATA_KEY) != null) {
      return;
    }
    Object data=getWidgetData(widget);
    if (data instanceof IContributionItem) {
      String actionId=((IContributionItem)data).getId();
      if (actionId != null && actionId.trim().length() > 0) {
        widget.setData(Startup.TEST_RCP_DATA_KEY,actionId);
        Control parent=null;
        try {
          if (widget instanceof ToolItem) {
            parent=((ToolItem)widget).getParent();
          }
 else           if (widget instanceof CoolItem) {
            parent=((CoolItem)widget).getParent();
          }
 else           if (widget instanceof Control) {
            parent=((Control)widget).getParent();
          }
        }
 catch (        NoClassDefFoundError e) {
        }
        if (parent != null && !parent.isDisposed()) {
          parent.update();
          parent.redraw();
          parent.update();
        }
      }
    }
 else     if (data instanceof PreferenceDialog) {
      PreferenceDialog prefDialog=(PreferenceDialog)data;
      prefDialog.addPageChangedListener(new IPageChangedListener(){
        public void pageChanged(        PageChangedEvent event){
          addNameDataToPrefPage(event.getSelectedPage());
        }
      }
);
      addNameDataToPrefPage(prefDialog.getSelectedPage());
    }
    if (generateNames && data instanceof Dialog) {
      Dialog dialog=(Dialog)data;
      setNameForDialogButtonBarButtons(dialog);
    }
  }
}