Program: 102186
Project: 102186
Buggy source:
@Override public void fillContextMenu(IMenuManager manager){
  List<Object> selectedObjs=getSelectedObjects();
  manager.removeAll();
  manager.add(new Separator());
  manager.add(newServerAction);
  manager.add(refreshAction);
  manager.add(new Separator());
  if (selectedObjs == null || selectedObjs.isEmpty()) {
    manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    return;
  }
  ITeiidServer teiidServer=null;
  if (selectedObjs.size() == 1) {
    Object selection=selectedObjs.get(0);
    teiidServer=RuntimeAssistant.adapt(selection,ITeiidServer.class);
    if (teiidServer != null) {
      boolean teiidServerConnected=teiidServer.isConnected();
      if (this.setDefaultServerAction.isEnabled()) {
        manager.add(this.setDefaultServerAction);
      }
      if (teiidServerConnected) {
        manager.add(this.disconnectAction);
      }
      if (teiidServerConnected) {
        manager.add(this.createDataSourceAction);
      }
      manager.add(new Separator());
      manager.add(this.editServerAction);
      manager.add(new Separator());
    }
    if (RuntimeAssistant.adapt(selection,ITeiidDataSource.class) != null) {
      manager.add(this.deleteDataSourceAction);
      manager.add(new Separator());
    }
    if (RuntimeAssistant.adapt(selection,ITeiidVdb.class) != null) {
      ITeiidVdb teiidVdb=RuntimeAssistant.adapt(selection,ITeiidVdb.class);
      this.executeVdbAction.setEnabled(teiidVdb.isActive());
      manager.add(this.executeVdbAction);
      manager.add(new Separator());
      manager.add(this.undeployVdbAction);
    }
    if (selection instanceof DataSourcesFolder) {
      manager.add(this.createDataSourceAction);
    }
  }
 else {
    boolean allDataSources=true;
    for (    Object obj : selectedObjs) {
      if (RuntimeAssistant.adapt(obj,ITeiidDataSource.class) == null) {
        allDataSources=false;
        break;
      }
    }
    if (allDataSources) {
      manager.add(this.deleteDataSourceAction);
    }
    boolean allVdbs=true;
    for (    Object obj : selectedObjs) {
      if (RuntimeAssistant.adapt(obj,ITeiidVdb.class) == null) {
        allVdbs=false;
        break;
      }
    }
    if (allVdbs) {
      manager.add(this.undeployVdbAction);
    }
    manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
  }
}

Fixed version (ground truth):
@Override public void fillContextMenu(IMenuManager manager){
  List<Object> selectedObjs=getSelectedObjects();
  manager.removeAll();
  manager.add(new Separator());
  manager.add(newServerAction);
  manager.add(refreshAction);
  manager.add(new Separator());
  if (selectedObjs == null || selectedObjs.isEmpty()) {
    manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
    return;
  }
  ITeiidServer teiidServer=null;
  if (selectedObjs.size() == 1) {
    Object selection=selectedObjs.get(0);
    teiidServer=RuntimeAssistant.adapt(selection,ITeiidServer.class);
    if (teiidServer != null) {
      boolean teiidServerConnected=teiidServer.isConnected();
      if (this.setDefaultServerAction.isEnabled()) {
        manager.add(this.setDefaultServerAction);
      }
      if (teiidServerConnected) {
        manager.add(this.disconnectAction);
      }
      manager.add(new Separator());
      manager.add(this.editServerAction);
      manager.add(new Separator());
      if (teiidServerConnected && selection instanceof DataSourcesFolder) {
        manager.add(this.createDataSourceAction);
      }
    }
    if (RuntimeAssistant.adapt(selection,ITeiidDataSource.class) != null) {
      manager.add(this.deleteDataSourceAction);
      manager.add(new Separator());
    }
    if (RuntimeAssistant.adapt(selection,ITeiidVdb.class) != null) {
      ITeiidVdb teiidVdb=RuntimeAssistant.adapt(selection,ITeiidVdb.class);
      this.executeVdbAction.setEnabled(teiidVdb.isActive());
      manager.add(this.executeVdbAction);
      manager.add(new Separator());
      manager.add(this.undeployVdbAction);
    }
  }
 else {
    boolean allDataSources=true;
    for (    Object obj : selectedObjs) {
      if (RuntimeAssistant.adapt(obj,ITeiidDataSource.class) == null) {
        allDataSources=false;
        break;
      }
    }
    if (allDataSources) {
      manager.add(this.deleteDataSourceAction);
    }
    boolean allVdbs=true;
    for (    Object obj : selectedObjs) {
      if (RuntimeAssistant.adapt(obj,ITeiidVdb.class) == null) {
        allVdbs=false;
        break;
      }
    }
    if (allVdbs) {
      manager.add(this.undeployVdbAction);
    }
    manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
  }
}