Program: 94684
Project: 94684
Buggy source:
protected void doJoinRoom(final String target,final String key){
  ChatRoom room=(ChatRoom)chatRooms.get(target);
  if (room != null && room.isConnected()) {
    room.setSelected();
    return;
  }
  IChatRoomInfo roomInfo=rootChatRoomManager.getChatRoomInfo(target);
  if (roomInfo == null)   return;
 else {
    try {
      final IChatRoomContainer chatRoomContainer=roomInfo.createChatRoomContainer();
      final ChatRoom chatroom=new ChatRoom(chatRoomContainer,new ChatRoomTab(rootTabFolder,target));
      chatRoomContainer.addMessageListener(new IIMMessageListener(){
        public void handleMessageEvent(        IIMMessageEvent messageEvent){
          if (messageEvent instanceof IChatRoomMessageEvent) {
            IChatRoomMessage m=((IChatRoomMessageEvent)messageEvent).getChatRoomMessage();
            chatroom.handleMessage(m.getFromID(),m.getMessage());
          }
        }
      }
);
      chatRoomContainer.addChatRoomParticipantListener(new IChatRoomParticipantListener(){
        public void handlePresenceUpdated(        ID fromID,        IPresence presence){
          chatroom.handlePresence(fromID,presence);
        }
        public void handleArrived(        IUser participant){
        }
        public void handleUpdated(        IUser updatedParticipant){
        }
        public void handleDeparted(        IUser participant){
        }
      }
);
      chatRoomContainer.addListener(new IContainerListener(){
        public void handleEvent(        IContainerEvent evt){
          if (evt instanceof IContainerDisconnectedEvent) {
            chatroom.disconnected();
          }
        }
      }
);
      Display.getDefault().asyncExec(new Runnable(){
        public void run(){
          try {
            chatRoomContainer.connect(IDFactory.getDefault().createID(chatRoomContainer.getConnectNamespace(),target),ConnectContextFactory.createPasswordConnectContext(key));
            chatRooms.put(target,chatroom);
          }
 catch (          Exception e) {
            MessageDialog.openError(getSite().getShell(),"String_Node_Str",NLS.bind("String_Node_Str",target,e.getLocalizedMessage()));
          }
        }
      }
);
    }
 catch (    Exception e) {
      MessageDialog.openError(getSite().getShell(),"String_Node_Str",NLS.bind("String_Node_Str",target,e.getLocalizedMessage()));
    }
  }
}

Fixed version (ground truth):
protected void doJoinRoom(final String target,final String key){
  ChatRoom room=(ChatRoom)chatRooms.get(target);
  if (room != null && room.isConnected()) {
    room.setSelected();
    return;
  }
  IChatRoomInfo roomInfo=rootChatRoomManager.getChatRoomInfo(target);
  if (roomInfo == null)   return;
 else {
    try {
      final IChatRoomContainer chatRoomContainer=roomInfo.createChatRoomContainer();
      final ChatRoom chatroom=new ChatRoom(chatRoomContainer,new ChatRoomTab(rootTabFolder,target));
      chatRoomContainer.addMessageListener(new IIMMessageListener(){
        public void handleMessageEvent(        IIMMessageEvent messageEvent){
          if (messageEvent instanceof IChatRoomMessageEvent) {
            IChatRoomMessage m=((IChatRoomMessageEvent)messageEvent).getChatRoomMessage();
            chatroom.handleMessage(m.getFromID(),m.getMessage());
          }
        }
      }
);
      chatRoomContainer.addChatRoomParticipantListener(new IChatRoomParticipantListener(){
        public void handlePresenceUpdated(        ID fromID,        IPresence presence){
          chatroom.handlePresence(fromID,presence);
        }
        public void handleArrived(        IUser participant){
        }
        public void handleUpdated(        IUser updatedParticipant){
        }
        public void handleDeparted(        IUser participant){
        }
      }
);
      chatRoomContainer.addListener(new IContainerListener(){
        public void handleEvent(        IContainerEvent evt){
          if (evt instanceof IContainerDisconnectedEvent || evt instanceof IContainerEjectedEvent) {
            chatroom.disconnected();
          }
        }
      }
);
      Display.getDefault().asyncExec(new Runnable(){
        public void run(){
          try {
            chatRoomContainer.connect(IDFactory.getDefault().createID(chatRoomContainer.getConnectNamespace(),target),ConnectContextFactory.createPasswordConnectContext(key));
            chatRooms.put(target,chatroom);
          }
 catch (          Exception e) {
            MessageDialog.openError(getSite().getShell(),"String_Node_Str",NLS.bind("String_Node_Str",target,e.getLocalizedMessage()));
          }
        }
      }
);
    }
 catch (    Exception e) {
      MessageDialog.openError(getSite().getShell(),"String_Node_Str",NLS.bind("String_Node_Str",target,e.getLocalizedMessage()));
    }
  }
}