Program: 95161
Project: 95161
Buggy source:
private void makeActions(){
  selectedDoubleClickAction=new Action(){
    public void run(){
      TreeObject treeObject=getSelectedTreeObject();
      final ID targetID=treeObject.getUserID();
      if (targetID != null)       openChatWindowForTarget(targetID);
    }
  }
;
  disconnectAction=new Action(){
    public void run(){
      for (Iterator i=accounts.entrySet().iterator(); i.hasNext(); ) {
        Map.Entry entry=(Map.Entry)i.next();
        UserAccount account=(UserAccount)entry.getValue();
        account.getInputHandler().disconnect();
      }
      setToolbarEnabled(false);
      this.setEnabled(false);
    }
  }
;
  disconnectAction.setText("String_Node_Str");
  disconnectAction.setToolTipText("String_Node_Str");
  disconnectAction.setEnabled(false);
  disconnectAction.setImageDescriptor(ImageDescriptor.createFromURL(UiPlugin.getDefault().find(new Path(DISCONNECT_ICON_ENABLED))));
  disconnectAction.setDisabledImageDescriptor(ImageDescriptor.createFromURL(UiPlugin.getDefault().find(new Path(DISCONNECT_ICON_DISABLED))));
  openChatRoomAction=new Action(){
    public void run(){
      IChatRoomManager managers[]=new IChatRoomManager[accounts.size()];
      int j=0;
      for (Iterator i=accounts.values().iterator(); i.hasNext(); ) {
        UserAccount ua=(UserAccount)i.next();
        managers[j++]=ua.getContainer().getChatRoomManager();
      }
      ChatRoomSelectionDialog dialog=new ChatRoomSelectionDialog(RosterView.this.getViewSite().getShell(),managers);
      dialog.setBlockOnOpen(true);
      dialog.open();
      if (dialog.getReturnCode() != Window.OK) {
        return;
      }
      ChatRoomSelectionDialog.Room room=dialog.getSelectedRoom();
      IChatRoomManager selectedManager=room.getManager();
      IRoomInfo selectedInfo=room.getRoomInfo();
      if (room == null || selectedManager == null || selectedInfo == null) {
        MessageDialog.openInformation(RosterView.this.getViewSite().getShell(),"String_Node_Str","String_Node_Str");
        return;
      }
      String secondaryID=getChatRoomSecondaryID(selectedInfo.getRoomID());
      if (secondaryID == null) {
        MessageDialog.openError(RosterView.this.getViewSite().getShell(),"String_Node_Str","String_Node_Str" + selectedInfo.getRoomID());
        return;
      }
      IWorkbenchWindow ww=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
      IWorkbenchPage wp=ww.getActivePage();
      RoomWithAView roomView=getRoomView(secondaryID);
      if (roomView != null) {
        ChatRoomView view=roomView.getView();
        wp.activate(view);
        return;
      }
      IChatRoomContainer chatRoom=null;
      try {
        chatRoom=selectedManager.makeChatRoomContainer();
      }
 catch (      ContainerInstantiationException e1) {
        MessageDialog.openError(RosterView.this.getViewSite().getShell(),"String_Node_Str","String_Node_Str");
      }
      IChatMessageSender sender=chatRoom.getChatMessageSender();
      IViewPart view=null;
      try {
        IViewReference ref=wp.findViewReference(CHAT_ROOM_VIEW_CLASS,secondaryID);
        if (ref == null) {
          view=wp.showView(CHAT_ROOM_VIEW_CLASS,secondaryID,IWorkbenchPage.VIEW_ACTIVATE);
        }
 else {
          view=ref.getView(true);
        }
        final ChatRoomView chatroomview=(ChatRoomView)view;
        chatroomview.initialize(RosterView.this,secondaryID,chatRoom,selectedInfo,sender);
        chatRoom.addMessageListener(new IMessageListener(){
          public void handleMessage(          ID fromID,          ID toID,          Type type,          String subject,          String messageBody){
            chatroomview.handleMessage(fromID,toID,type,subject,messageBody);
          }
        }
);
        chatRoom.addChatParticipantListener(new IChatParticipantListener(){
          public void handlePresence(          ID fromID,          IPresence presence){
            chatroomview.handlePresence(fromID,presence);
          }
          public void joined(          ID user){
            chatroomview.handleJoin(user);
          }
          public void left(          ID user){
            chatroomview.handleLeave(user);
          }
        }
);
        chatRoom.addInvitationListener(new IInvitationListener(){
          public void handleInvitationReceived(          ID roomID,          ID from,          ID toID,          String subject,          String body){
            chatroomview.handleInvitationReceived(roomID,from,toID,subject,body);
          }
        }
);
      }
 catch (      PartInitException e) {
        UiPlugin.log("String_Node_Str" + selectedInfo.getRoomID(),e);
        MessageDialog.openError(getViewSite().getShell(),"String_Node_Str","String_Node_Str" + selectedInfo.getName() + "String_Node_Str");
        return;
      }
      try {
        chatRoom.connect(selectedInfo.getRoomID(),null);
      }
 catch (      ContainerConnectException e1) {
        UiPlugin.log("String_Node_Str" + selectedInfo.getRoomID(),e1);
        MessageDialog.openError(RosterView.this.getViewSite().getShell(),"String_Node_Str","String_Node_Str" + selectedInfo.getName() + "String_Node_Str"+ e1.getMessage());
        return;
      }
      addRoomView(new RoomWithAView(selectedManager,chatRoom,(ChatRoomView)view,secondaryID));
    }
  }
;
  openChatRoomAction.setText("String_Node_Str");
  openChatRoomAction.setToolTipText("String_Node_Str");
  openChatRoomAction.setImageDescriptor(ImageDescriptor.createFromURL(UiPlugin.getDefault().find(new Path(ADDCHAT_ICON))));
  openChatRoomAction.setEnabled(false);
}

Fixed version (ground truth):
private void makeActions(){
  selectedDoubleClickAction=new Action(){
    public void run(){
      TreeObject treeObject=getSelectedTreeObject();
      final ID targetID=treeObject.getUserID();
      if (targetID != null)       openChatWindowForTarget(targetID);
    }
  }
;
  disconnectAction=new Action(){
    public void run(){
      for (Iterator i=accounts.entrySet().iterator(); i.hasNext(); ) {
        Map.Entry entry=(Map.Entry)i.next();
        UserAccount account=(UserAccount)entry.getValue();
        account.getInputHandler().disconnect();
      }
      setToolbarEnabled(false);
      this.setEnabled(false);
    }
  }
;
  disconnectAction.setText("String_Node_Str");
  disconnectAction.setToolTipText("String_Node_Str");
  disconnectAction.setEnabled(false);
  disconnectAction.setImageDescriptor(ImageDescriptor.createFromURL(UiPlugin.getDefault().find(new Path(DISCONNECT_ICON_ENABLED))));
  disconnectAction.setDisabledImageDescriptor(ImageDescriptor.createFromURL(UiPlugin.getDefault().find(new Path(DISCONNECT_ICON_DISABLED))));
  openChatRoomAction=new Action(){
    public void run(){
      IChatRoomManager managers[]=new IChatRoomManager[accounts.size()];
      int j=0;
      for (Iterator i=accounts.values().iterator(); i.hasNext(); ) {
        UserAccount ua=(UserAccount)i.next();
        managers[j++]=ua.getContainer().getChatRoomManager();
      }
      ChatRoomSelectionDialog dialog=new ChatRoomSelectionDialog(RosterView.this.getViewSite().getShell(),managers);
      dialog.setBlockOnOpen(true);
      dialog.open();
      if (dialog.getReturnCode() != Window.OK) {
        return;
      }
      ChatRoomSelectionDialog.Room room=dialog.getSelectedRoom();
      IChatRoomManager selectedManager=room.getManager();
      IRoomInfo selectedInfo=room.getRoomInfo();
      if (room == null || selectedManager == null || selectedInfo == null) {
        MessageDialog.openInformation(RosterView.this.getViewSite().getShell(),"String_Node_Str","String_Node_Str");
        return;
      }
      String secondaryID=getChatRoomSecondaryID(selectedInfo.getRoomID());
      if (secondaryID == null) {
        MessageDialog.openError(RosterView.this.getViewSite().getShell(),"String_Node_Str","String_Node_Str" + selectedInfo.getRoomID());
        return;
      }
      IWorkbenchWindow ww=PlatformUI.getWorkbench().getActiveWorkbenchWindow();
      IWorkbenchPage wp=ww.getActivePage();
      RoomWithAView roomView=getRoomView(secondaryID);
      if (roomView != null) {
        ChatRoomView view=roomView.getView();
        wp.activate(view);
        return;
      }
      IChatRoomContainer chatRoom=null;
      try {
        chatRoom=selectedManager.makeChatRoomContainer();
      }
 catch (      ContainerInstantiationException e1) {
        MessageDialog.openError(RosterView.this.getViewSite().getShell(),"String_Node_Str","String_Node_Str");
      }
      IChatMessageSender sender=chatRoom.getChatMessageSender();
      IViewPart view=null;
      try {
        IViewReference ref=wp.findViewReference(CHAT_ROOM_VIEW_CLASS,secondaryID);
        if (ref == null) {
          view=wp.showView(CHAT_ROOM_VIEW_CLASS,secondaryID,IWorkbenchPage.VIEW_ACTIVATE);
        }
 else {
          view=ref.getView(true);
        }
        final ChatRoomView chatroomview=(ChatRoomView)view;
        chatroomview.initialize(RosterView.this,secondaryID,chatRoom,selectedInfo,sender);
        chatRoom.addMessageListener(new IMessageListener(){
          public void handleMessage(          ID fromID,          ID toID,          Type type,          String subject,          String messageBody){
            chatroomview.handleMessage(fromID,toID,type,subject,messageBody);
          }
        }
);
        chatRoom.addChatParticipantListener(new IChatParticipantListener(){
          public void handlePresence(          ID fromID,          IPresence presence){
            chatroomview.handlePresence(fromID,presence);
          }
          public void joined(          ID user){
            chatroomview.handleJoin(user);
          }
          public void left(          ID user){
            chatroomview.handleLeave(user);
          }
        }
);
        chatRoom.addInvitationListener(new IInvitationListener(){
          public void handleInvitationReceived(          ID roomID,          ID from,          ID toID,          String subject,          String body){
            chatroomview.handleInvitationReceived(roomID,from,toID,subject,body);
          }
        }
);
      }
 catch (      PartInitException e) {
        UiPlugin.log("String_Node_Str" + selectedInfo.getRoomID(),e);
        MessageDialog.openError(getViewSite().getShell(),"String_Node_Str","String_Node_Str" + selectedInfo.getName() + "String_Node_Str");
        return;
      }
      try {
        chatRoom.connect(selectedInfo.getRoomID(),getChatJoinContext("String_Node_Str" + selectedInfo.getName()));
      }
 catch (      ContainerConnectException e1) {
        UiPlugin.log("String_Node_Str" + selectedInfo.getRoomID(),e1);
        MessageDialog.openError(RosterView.this.getViewSite().getShell(),"String_Node_Str","String_Node_Str" + selectedInfo.getName() + "String_Node_Str"+ e1.getMessage());
        return;
      }
      addRoomView(new RoomWithAView(selectedManager,chatRoom,(ChatRoomView)view,secondaryID));
    }
  }
;
  openChatRoomAction.setText("String_Node_Str");
  openChatRoomAction.setToolTipText("String_Node_Str");
  openChatRoomAction.setImageDescriptor(ImageDescriptor.createFromURL(UiPlugin.getDefault().find(new Path(ADDCHAT_ICON))));
  openChatRoomAction.setEnabled(false);
}