Program: 94941
Project: 94941
Buggy source:
private void makeActions(){
  imAction=new Action(){
    public void run(){
      message((IStructuredSelection)treeViewer.getSelection());
    }
  }
;
  imAction.setImageDescriptor(SharedImages.getImageDescriptor(SharedImages.IMG_MESSAGE));
  removeAction=new Action(){
    public void run(){
      IStructuredSelection iss=(IStructuredSelection)treeViewer.getSelection();
      remove((IRosterEntry)iss.getFirstElement());
    }
  }
;
  removeAction.setText(Messages.MultiRosterView_Remove);
  removeAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
  setAvailableAction=new Action(Messages.MultiRosterView_SetAvailable,IAction.AS_RADIO_BUTTON){
    public void run(){
      if (isChecked()) {
        sendPresence(IPresence.Mode.AVAILABLE);
      }
    }
  }
;
  setAwayAction=new Action(Messages.MultiRosterView_SetAway,IAction.AS_RADIO_BUTTON){
    public void run(){
      if (isChecked()) {
        sendPresence(IPresence.Mode.AWAY);
      }
    }
  }
;
  setDNDAction=new Action(Messages.MultiRosterView_SetDoNotDisturb,IAction.AS_RADIO_BUTTON){
    public void run(){
      if (isChecked()) {
        sendPresence(IPresence.Mode.DND);
      }
    }
  }
;
  setInvisibleAction=new Action(Messages.MultiRosterView_SetInvisible,IAction.AS_RADIO_BUTTON){
    public void run(){
      if (isChecked()) {
        sendPresence(IPresence.Mode.INVISIBLE);
      }
    }
  }
;
  setOfflineAction=new Action(Messages.MultiRosterView_SetOffline,IAction.AS_RADIO_BUTTON){
    public void run(){
      if (isChecked()) {
        for (int i=0; i < rosterAccounts.size(); i++) {
          MultiRosterAccount account=(MultiRosterAccount)rosterAccounts.get(i);
          account.getRosterManager().removeRosterSubscriptionListener(subscriptionListener);
          treeViewer.remove(account);
        }
        rosterAccounts.clear();
        refreshTreeViewer(null,false);
        setStatusMenu.setVisible(false);
        getViewSite().getActionBars().getMenuManager().update(false);
      }
    }
  }
;
  setOfflineAction.setChecked(true);
  openChatRoomAction=new Action(){
    public void run(){
      selectAndJoinChatRoomForAccounts((MultiRosterAccount[])rosterAccounts.toArray(new MultiRosterAccount[]{}));
    }
  }
;
  openChatRoomAction.setText(Messages.MultiRosterView_ENTER_CHATROOM_ACTION_TEXT);
  openChatRoomAction.setToolTipText(Messages.MultiRosterView_ENTER_CHATROOM_TOOLTIP_TEXT);
  openChatRoomAction.setImageDescriptor(SharedImages.getImageDescriptor(SharedImages.IMG_ADD_CHAT));
  openChatRoomAction.setEnabled(true);
  openAccountChatRoomAction=new Action(){
    public void run(){
      IStructuredSelection iss=(IStructuredSelection)treeViewer.getSelection();
      IRoster roster=(IRoster)iss.getFirstElement();
      MultiRosterAccount account=findAccountForUser(roster.getUser().getID());
      if (account != null)       selectAndJoinChatRoomForAccounts(new MultiRosterAccount[]{account});
    }
  }
;
  openAccountChatRoomAction.setText(Messages.MultiRosterView_SHOW_CHAT_ROOMS_FOR_ACCOUNT_ACTION_TEXT);
  openAccountChatRoomAction.setEnabled(true);
  openAccountChatRoomAction.setImageDescriptor(SharedImages.getImageDescriptor(SharedImages.IMG_ADD_CHAT));
  disconnectAllAccountsAction=new Action(){
    public void run(){
      if (MessageDialog.openQuestion(getViewSite().getShell(),Messages.MultiRosterView_DISCONNECT_QUESTION_TITLE,Messages.MultiRosterView_DISCONNECT_ALL_ACCOUNTS_QUESTION_MESSAGE)) {
        disconnectAccounts((MultiRosterAccount[])rosterAccounts.toArray(new MultiRosterAccount[]{}));
      }
    }
  }
;
  disconnectAllAccountsAction.setText(Messages.MultiRosterView_DISCONNECT_ALL_ACCOUNTS_ACTION_TEXT);
  disconnectAllAccountsAction.setEnabled(true);
  disconnectAllAccountsAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
  disconnectAccountAction=new Action(){
    public void run(){
      IStructuredSelection iss=(IStructuredSelection)treeViewer.getSelection();
      IRoster roster=(IRoster)iss.getFirstElement();
      MultiRosterAccount account=findAccountForUser(roster.getUser().getID());
      ID connectedID=account.getContainer().getConnectedID();
      if (account != null && connectedID != null && MessageDialog.openQuestion(getViewSite().getShell(),Messages.MultiRosterView_DISCONNECT_QUESTION_TITLE,NLS.bind(Messages.MultiRosterView_DISCONNECT_ACCOUNT_QUESTION_MESSAGE,connectedID.getName()))) {
        disconnectAccounts(new MultiRosterAccount[]{account});
      }
    }
  }
;
  disconnectAccountAction.setText(Messages.MultiRosterView_DISCONNECT_ACCOUNT_ACTION_TEXT);
  disconnectAccountAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
}

Fixed version (ground truth):
private void makeActions(){
  imAction=new Action(){
    public void run(){
      message((IStructuredSelection)treeViewer.getSelection());
    }
  }
;
  imAction.setImageDescriptor(SharedImages.getImageDescriptor(SharedImages.IMG_MESSAGE));
  removeAction=new Action(){
    public void run(){
      IStructuredSelection iss=(IStructuredSelection)treeViewer.getSelection();
      remove((IRosterEntry)iss.getFirstElement());
    }
  }
;
  removeAction.setText(Messages.MultiRosterView_Remove);
  removeAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
  setAvailableAction=new Action(Messages.MultiRosterView_SetAvailable,IAction.AS_RADIO_BUTTON){
    public void run(){
      if (isChecked()) {
        sendPresence(IPresence.Mode.AVAILABLE);
      }
    }
  }
;
  setAwayAction=new Action(Messages.MultiRosterView_SetAway,IAction.AS_RADIO_BUTTON){
    public void run(){
      if (isChecked()) {
        sendPresence(IPresence.Mode.AWAY);
      }
    }
  }
;
  setDNDAction=new Action(Messages.MultiRosterView_SetDoNotDisturb,IAction.AS_RADIO_BUTTON){
    public void run(){
      if (isChecked()) {
        sendPresence(IPresence.Mode.DND);
      }
    }
  }
;
  setInvisibleAction=new Action(Messages.MultiRosterView_SetInvisible,IAction.AS_RADIO_BUTTON){
    public void run(){
      if (isChecked()) {
        sendPresence(IPresence.Mode.INVISIBLE);
      }
    }
  }
;
  setOfflineAction=new Action(Messages.MultiRosterView_SetOffline,IAction.AS_RADIO_BUTTON){
    public void run(){
      if (isChecked()) {
        for (int i=0; i < rosterAccounts.size(); i++) {
          MultiRosterAccount account=(MultiRosterAccount)rosterAccounts.get(i);
          account.getRosterManager().removeRosterSubscriptionListener(subscriptionListener);
          treeViewer.remove(account);
        }
        rosterAccounts.clear();
        refreshTreeViewer(null,false);
        setStatusMenu.setVisible(false);
        getViewSite().getActionBars().getMenuManager().update(false);
      }
    }
  }
;
  setOfflineAction.setChecked(true);
  showOfflineAction=new Action(Messages.MultiRosterView_ShowOffline,Action.AS_CHECK_BOX){
    public void run(){
      if (isChecked()) {
        treeViewer.removeFilter(hideOfflineFilter);
      }
 else {
        treeViewer.addFilter(hideOfflineFilter);
      }
    }
  }
;
  showEmptyGroupsAction=new Action(Messages.MultiRosterView_ShowEmptyGroups,Action.AS_CHECK_BOX){
    public void run(){
      if (isChecked()) {
        treeViewer.removeFilter(hideEmptyGroupsFilter);
      }
 else {
        treeViewer.addFilter(hideEmptyGroupsFilter);
      }
    }
  }
;
  addContactAction=new Action(Messages.MultiRosterView_AddContact,SharedImages.getImageDescriptor(SharedImages.IMG_ADD_BUDDY)){
    public void run(){
      AddContactDialog dialog=new AddContactDialog(treeViewer.getControl().getShell());
      dialog.setInput(rosterAccounts);
      if (Window.OK == dialog.open()) {
        IPresenceContainerAdapter ipca=dialog.getSelection();
        IRosterSubscriptionSender sender=ipca.getRosterManager().getRosterSubscriptionSender();
        try {
          sender.sendRosterAdd(dialog.getAccountID(),dialog.getAlias(),null);
        }
 catch (        ECFException e) {
          e.printStackTrace();
        }
      }
    }
  }
;
  openChatRoomAction=new Action(){
    public void run(){
      selectAndJoinChatRoomForAccounts((MultiRosterAccount[])rosterAccounts.toArray(new MultiRosterAccount[]{}));
    }
  }
;
  openChatRoomAction.setText(Messages.MultiRosterView_ENTER_CHATROOM_ACTION_TEXT);
  openChatRoomAction.setToolTipText(Messages.MultiRosterView_ENTER_CHATROOM_TOOLTIP_TEXT);
  openChatRoomAction.setImageDescriptor(SharedImages.getImageDescriptor(SharedImages.IMG_ADD_CHAT));
  openChatRoomAction.setEnabled(true);
  openAccountChatRoomAction=new Action(){
    public void run(){
      IStructuredSelection iss=(IStructuredSelection)treeViewer.getSelection();
      IRoster roster=(IRoster)iss.getFirstElement();
      MultiRosterAccount account=findAccountForUser(roster.getUser().getID());
      if (account != null)       selectAndJoinChatRoomForAccounts(new MultiRosterAccount[]{account});
    }
  }
;
  openAccountChatRoomAction.setText(Messages.MultiRosterView_SHOW_CHAT_ROOMS_FOR_ACCOUNT_ACTION_TEXT);
  openAccountChatRoomAction.setEnabled(true);
  openAccountChatRoomAction.setImageDescriptor(SharedImages.getImageDescriptor(SharedImages.IMG_ADD_CHAT));
  disconnectAllAccountsAction=new Action(){
    public void run(){
      if (MessageDialog.openQuestion(getViewSite().getShell(),Messages.MultiRosterView_DISCONNECT_QUESTION_TITLE,Messages.MultiRosterView_DISCONNECT_ALL_ACCOUNTS_QUESTION_MESSAGE)) {
        disconnectAccounts((MultiRosterAccount[])rosterAccounts.toArray(new MultiRosterAccount[]{}));
      }
    }
  }
;
  disconnectAllAccountsAction.setText(Messages.MultiRosterView_DISCONNECT_ALL_ACCOUNTS_ACTION_TEXT);
  disconnectAllAccountsAction.setEnabled(true);
  disconnectAllAccountsAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
  disconnectAccountAction=new Action(){
    public void run(){
      IStructuredSelection iss=(IStructuredSelection)treeViewer.getSelection();
      IRoster roster=(IRoster)iss.getFirstElement();
      MultiRosterAccount account=findAccountForUser(roster.getUser().getID());
      ID connectedID=account.getContainer().getConnectedID();
      if (account != null && connectedID != null && MessageDialog.openQuestion(getViewSite().getShell(),Messages.MultiRosterView_DISCONNECT_QUESTION_TITLE,NLS.bind(Messages.MultiRosterView_DISCONNECT_ACCOUNT_QUESTION_MESSAGE,connectedID.getName()))) {
        disconnectAccounts(new MultiRosterAccount[]{account});
      }
    }
  }
;
  disconnectAccountAction.setText(Messages.MultiRosterView_DISCONNECT_ACCOUNT_ACTION_TEXT);
  disconnectAccountAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
}