Program: 139489
Project: 139489
Buggy source:
public void hookContextMenu(){
  MenuManager menuMgr=new MenuManager("String_Node_Str","String_Node_Str");
  menuMgr.setRemoveAllWhenShown(true);
  menuMgr.addMenuListener(new IMenuListener(){
    public void menuAboutToShow(    IMenuManager manager){
      manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
      IStructuredSelection selection=(IStructuredSelection)diffTabLeft.getSelection();
      EObject selectedElement=null;
      if (selection.toList().size() == 1) {
        selectedElement=(EObject)selection.getFirstElement();
        if (selectedElement instanceof Package) {
          SubelementCompareAction subEleCompTableAction=new SubelementCompareAction(Messages.getString("String_Node_Str"),diffTabLeft,selectedOjbect,SubelementCompareAction.TABLE_COMPARE);
          SubelementCompareAction subEleCompViewAction=new SubelementCompareAction(Messages.getString("String_Node_Str"),diffTabLeft,selectedOjbect,SubelementCompareAction.VIEW_COMPARE);
          manager.add(subEleCompTableAction);
          manager.add(subEleCompViewAction);
        }
 else         if (selectedElement instanceof ColumnSet) {
          addRenameMenuAction(manager,selectedElement);
          SubelementCompareAction subEleCompColumnAction=new SubelementCompareAction(Messages.getString("String_Node_Str"),diffTabLeft,selectedOjbect,SubelementCompareAction.COLUMN_COMPARE);
          manager.add(subEleCompColumnAction);
        }
 else         if (selectedElement instanceof Column) {
          addRenameMenuAction(manager,selectedElement);
        }
      }
    }
  }
);
  Menu menu=menuMgr.createContextMenu(diffTabLeft.getControl());
  diffTabLeft.getControl().setMenu(menu);
  CompareUIPlugin.getActiveWorkbenchWindow().getActivePage().getActiveEditor().getSite().registerContextMenu(menuMgr,diffTabLeft);
  diffTabLeft.getTree().addKeyListener(new CompareKeyListener());
  diffTabLeft.getTree().addMouseListener(new CompareMouseListener());
}

Fixed version (ground truth):
public void hookContextMenu(boolean compareEachOther){
  if (!compareEachOther) {
    MenuManager menuMgr=new MenuManager("String_Node_Str","String_Node_Str");
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener(){
      public void menuAboutToShow(      IMenuManager manager){
        manager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
        IStructuredSelection selection=(IStructuredSelection)diffTabLeft.getSelection();
        EObject selectedElement=null;
        if (selection.toList().size() == 1) {
          selectedElement=(EObject)selection.getFirstElement();
          if (selectedElement instanceof Package) {
            SubelementCompareAction subEleCompTableAction=new SubelementCompareAction(Messages.getString("String_Node_Str"),diffTabLeft,selectedOjbect,SubelementCompareAction.TABLE_COMPARE);
            SubelementCompareAction subEleCompViewAction=new SubelementCompareAction(Messages.getString("String_Node_Str"),diffTabLeft,selectedOjbect,SubelementCompareAction.VIEW_COMPARE);
            manager.add(subEleCompTableAction);
            manager.add(subEleCompViewAction);
          }
 else           if (selectedElement instanceof ColumnSet) {
            addRenameMenuAction(manager,selectedElement);
            SubelementCompareAction subEleCompColumnAction=new SubelementCompareAction(Messages.getString("String_Node_Str"),diffTabLeft,selectedOjbect,SubelementCompareAction.COLUMN_COMPARE);
            manager.add(subEleCompColumnAction);
          }
 else           if (selectedElement instanceof Column) {
            addRenameMenuAction(manager,selectedElement);
          }
        }
      }
    }
);
    Menu menu=menuMgr.createContextMenu(diffTabLeft.getControl());
    diffTabLeft.getControl().setMenu(menu);
    CompareUIPlugin.getActiveWorkbenchWindow().getActivePage().getActiveEditor().getSite().registerContextMenu(menuMgr,diffTabLeft);
    diffTabLeft.getTree().addKeyListener(new CompareKeyListener());
    diffTabLeft.getTree().addMouseListener(new CompareMouseListener());
  }
}