Program: 140431
Project: 140431
Buggy source:
/** 
 * Fill the node context menu with all the correct actions.
 * @see org.eclipse.ui.actions.ActionGroup#fillContextMenu(org.eclipse.jface.action.IMenuManager)
 */
public void fillContextMenu(IMenuManager menu){
  ConnectionsView view=SQLExplorerPlugin.getDefault().getConnectionsView();
  Object[] selection=(view == null) ? null : view.getSelected();
  if (selection == null || selection.length != 1) {
    return;
  }
  if (selection[0] instanceof Alias) {
    Alias alias=(Alias)selection[0];
    addAction(menu,new NewEditorAction());
    addAction(menu,new ConnectAliasAction());
    menu.add(new Separator());
    for (    User user : alias.getUsers())     if (!user.isAutoCommit()) {
      addAction(menu,new CommitAction());
      addAction(menu,new RollbackAction());
      menu.add(new Separator());
      break;
    }
  }
 else   if (selection[0] instanceof User) {
    User user=(User)selection[0];
    addAction(menu,new NewEditorAction());
    addAction(menu,new ConnectAliasAction());
    menu.add(new Separator());
    if (!user.isAutoCommit()) {
      addAction(menu,new CommitAction());
      addAction(menu,new RollbackAction());
      menu.add(new Separator());
    }
  }
 else   if (selection[0] instanceof SQLConnection) {
    SQLConnection connection=(SQLConnection)selection[0];
    addAction(menu,new NewEditorAction());
    menu.add(new Separator());
    if (!connection.getUser().isAutoCommit()) {
      addAction(menu,new CommitAction());
      addAction(menu,new RollbackAction());
      menu.add(new Separator());
    }
  }
}

Fixed version (ground truth):
/** 
 * Fill the node context menu with all the correct actions.
 * @see org.eclipse.ui.actions.ActionGroup#fillContextMenu(org.eclipse.jface.action.IMenuManager)
 */
public void fillContextMenu(IMenuManager menu){
  ConnectionsView view=SQLExplorerPlugin.getDefault().getConnectionsView();
  Object[] selection=(view == null) ? null : view.getSelected();
  if (selection == null || selection.length != 1) {
    return;
  }
  if (selection[0] instanceof Alias) {
    Alias alias=(Alias)selection[0];
    addAction(menu,new NewEditorAction());
    addAction(menu,new NewDatabaseStructureViewAction());
    addAction(menu,new ConnectAliasAction());
    menu.add(new Separator());
    for (    User user : alias.getUsers())     if (!user.isAutoCommit()) {
      addAction(menu,new CommitAction());
      addAction(menu,new RollbackAction());
      menu.add(new Separator());
      break;
    }
  }
 else   if (selection[0] instanceof User) {
    User user=(User)selection[0];
    addAction(menu,new NewEditorAction());
    addAction(menu,new NewDatabaseStructureViewAction());
    addAction(menu,new ConnectAliasAction());
    menu.add(new Separator());
    if (!user.isAutoCommit()) {
      addAction(menu,new CommitAction());
      addAction(menu,new RollbackAction());
      menu.add(new Separator());
    }
  }
 else   if (selection[0] instanceof SQLConnection) {
    SQLConnection connection=(SQLConnection)selection[0];
    addAction(menu,new NewEditorAction());
    addAction(menu,new NewDatabaseStructureViewAction());
    menu.add(new Separator());
    if (!connection.getUser().isAutoCommit()) {
      addAction(menu,new CommitAction());
      addAction(menu,new RollbackAction());
      menu.add(new Separator());
    }
  }
}