Program: 133553
Project: 133553
Buggy source:
/** 
 * Creates a context   {@code Menu} for the drawn plot's main{@code Composite}. It includes the following controls by default: <ol> <li>Remove Plot</li> <li>Separator</li> <li>Set Plot Type</li> <li>Separator</li> <li>Any implementation-specific plot actions...</li> </ol> It is up to the related   {@code IPlot} implementation to take thecreated  {@code Menu} and add it to child {@code Composite}s or update it.
 * @return The JFace {@code MenuManager} for the context {@code Menu}.
 */
private MenuManager createContextMenu(){
  MenuManager contextMenuManager=new MenuManager();
  final Action removeAction=new Action("String_Node_Str"){
    @Override public void run(){
      dispose();
    }
  }
;
  final ActionTree plotTypeTree=new ActionTree("String_Node_Str");
  try {
    Map<String,String[]> plotTypes=plot.getPlotTypes();
    for (    Entry<String,String[]> entry : plotTypes.entrySet()) {
      String category=entry.getKey();
      String[] types=entry.getValue();
      if (category != null && types != null && types.length > 0) {
        ActionTree categoryTree=new ActionTree(category);
        plotTypeTree.add(categoryTree);
        final String categoryRef=category;
        for (        String type : types) {
          final String typeRef=type;
          categoryTree.add(new ActionTree(new Action(type){
            @Override public void run(){
              try {
                draw(categoryRef,typeRef);
              }
 catch (              Exception e) {
                logger.error(getClass().getName() + "String_Node_Str",e);
              }
            }
          }
));
        }
      }
    }
  }
 catch (  Exception e) {
    logger.error(getClass().getName() + "String_Node_Str",e);
  }
  contextMenuManager.add(removeAction);
  contextMenuManager.add(new Separator());
  contextMenuManager.add(plotTypeTree.getContributionItem());
  setMenu(contextMenuManager.createContextMenu(this));
  return contextMenuManager;
}

Fixed version (ground truth):
/** 
 * Creates a context   {@code Menu} for the drawn plot's main{@code Composite}. It includes the following controls by default: <ol> <li>Remove Plot</li> <li>Separator</li> <li>Set Plot Type</li> <li>Separator</li> <li>Any implementation-specific plot actions...</li> </ol> It is up to the related   {@code IPlot} implementation to take thecreated  {@code Menu} and add it to child {@code Composite}s or update it.
 * @return The JFace {@code MenuManager} for the context {@code Menu}.
 */
private MenuManager createContextMenu(){
  final Action removeAction=new Action("String_Node_Str"){
    @Override public void run(){
      dispose();
    }
  }
;
  final List<IContributionItem> actions=new ArrayList<IContributionItem>();
  actions.add(new ActionContributionItem(removeAction));
  final MenuManager menuManager=new MenuManager();
  Menu contextMenu=menuManager.createContextMenu(this);
  menuManager.setRemoveAllWhenShown(true);
  contextMenu.addMenuListener(new MenuListener(){
    @Override public void menuHidden(    MenuEvent e){
    }
    @Override public void menuShown(    MenuEvent e){
      Menu menu=(Menu)e.widget;
      for (      IContributionItem item : actions) {
        item.fill(menu,-1);
      }
    }
  }
);
  setMenu(contextMenu);
  return menuManager;
}