Program: 126206
Project: 126206
Buggy source:
/** 
 * Set definition for this action and text so that it will be used for File -&gt; Open Workspace in the argument window.
 * @param window the window in which this action should appear
 */
public OpenWorkspaceAction(IWorkbenchWindow window){
  super(Messages.getString("String_Node_Str"),IAction.AS_DROP_DOWN_MENU);
  if (window == null) {
    throw new IllegalArgumentException();
  }
  this.window=window;
  setToolTipText(Messages.getString("String_Node_Str"));
  setActionDefinitionId("String_Node_Str");
  setMenuCreator(new IMenuCreator(){
    private MenuManager dropDownMenuMgr;
    /** 
 * Creates the menu manager for the drop-down.
 */
    private void createDropDownMenuMgr(){
      if (dropDownMenuMgr == null) {
        dropDownMenuMgr=new MenuManager();
        final ChooseWorkspaceData data=new ChooseWorkspaceData(Platform.getInstanceLocation().getURL());
        data.readPersistedData();
        String current=data.getInitialDefault();
        String[] workspaces=data.getRecentWorkspaces();
        for (int i=0; i < workspaces.length; i++) {
          if (workspaces[i] != null && !workspaces[i].equals(current)) {
            dropDownMenuMgr.add(new WorkspaceMRUAction(workspaces[i],data));
          }
        }
        if (!dropDownMenuMgr.isEmpty()) {
          dropDownMenuMgr.add(new Separator());
        }
        dropDownMenuMgr.add(new OpenDialogAction());
      }
    }
    @Override public Menu getMenu(    Control parent){
      createDropDownMenuMgr();
      return dropDownMenuMgr.createContextMenu(parent);
    }
    @Override public Menu getMenu(    Menu parent){
      createDropDownMenuMgr();
      Menu menu=new Menu(parent);
      IContributionItem[] items=dropDownMenuMgr.getItems();
      for (      IContributionItem item : items) {
        IContributionItem newItem=item;
        if (item instanceof ActionContributionItem) {
          newItem=new ActionContributionItem(((ActionContributionItem)item).getAction());
        }
        newItem.fill(menu,-1);
      }
      return menu;
    }
    @Override public void dispose(){
      if (dropDownMenuMgr != null) {
        dropDownMenuMgr.dispose();
        dropDownMenuMgr=null;
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Set definition for this action and text so that it will be used for File -&gt; Open Workspace in the argument window.
 * @param window the window in which this action should appear
 */
public OpenWorkspaceAction(IWorkbenchWindow window){
  super(Messages.getString("String_Node_Str"),IAction.AS_DROP_DOWN_MENU);
  if (window == null) {
    throw new IllegalArgumentException();
  }
  this.window=window;
  setToolTipText(Messages.getString("String_Node_Str"));
  setActionDefinitionId("String_Node_Str");
  setMenuCreator(new IMenuCreator(){
    private MenuManager dropDownMenuMgr;
    /** 
 * Creates the menu manager for the drop-down.
 */
    private void createDropDownMenuMgr(){
      if (dropDownMenuMgr == null) {
        dropDownMenuMgr=new MenuManager();
        final ChooseWorkspaceData data=new ChooseWorkspaceData(Platform.getInstanceLocation().getURL());
        data.readPersistedData();
        filterUsefulWorkspaces(data);
        String current=data.getInitialDefault();
        String[] workspaces=data.getRecentWorkspaces();
        for (int i=0; i < workspaces.length; i++) {
          if (workspaces[i] != null && !workspaces[i].equals(current)) {
            dropDownMenuMgr.add(new WorkspaceMRUAction(workspaces[i],data));
          }
        }
        if (!dropDownMenuMgr.isEmpty()) {
          dropDownMenuMgr.add(new Separator());
        }
        dropDownMenuMgr.add(new OpenDialogAction());
      }
    }
    @Override public Menu getMenu(    Control parent){
      createDropDownMenuMgr();
      return dropDownMenuMgr.createContextMenu(parent);
    }
    @Override public Menu getMenu(    Menu parent){
      createDropDownMenuMgr();
      Menu menu=new Menu(parent);
      IContributionItem[] items=dropDownMenuMgr.getItems();
      for (      IContributionItem item : items) {
        IContributionItem newItem=item;
        if (item instanceof ActionContributionItem) {
          newItem=new ActionContributionItem(((ActionContributionItem)item).getAction());
        }
        newItem.fill(menu,-1);
      }
      return menu;
    }
    @Override public void dispose(){
      if (dropDownMenuMgr != null) {
        dropDownMenuMgr.dispose();
        dropDownMenuMgr=null;
      }
    }
  }
);
}