Program: 94681
Project: 94681
Buggy source:
protected void doJoinRoom(final IChatRoomInfo roomInfo,final String password){
  final ID targetRoomID=roomInfo.getRoomID();
  final String targetRoomName=targetRoomID.getName();
  ChatRoom room=(ChatRoom)chatRooms.get(targetRoomName);
  if (room != null && room.isConnected()) {
    room.setSelected();
    return;
  }
  try {
    final IChatRoomContainer chatRoomContainer=roomInfo.createChatRoomContainer();
    final ChatRoom chatroom=new ChatRoom(chatRoomContainer,new ChatRoomTab(rootTabFolder,targetRoomName));
    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(targetRoomID,ConnectContextFactory.createPasswordConnectContext(password));
          chatRooms.put(targetRoomName,chatroom);
        }
 catch (        Exception e) {
          MessageDialog.openError(getSite().getShell(),"String_Node_Str",NLS.bind("String_Node_Str",targetRoomName,e.getLocalizedMessage()));
        }
      }
    }
);
  }
 catch (  Exception e) {
    MessageDialog.openError(getSite().getShell(),"String_Node_Str",NLS.bind("String_Node_Str",targetRoomName,e.getLocalizedMessage()));
  }
}

Fixed version (ground truth):
protected void doJoinRoom(final IChatRoomInfo roomInfo,final String password){
  final ID targetRoomID=roomInfo.getRoomID();
  final String targetRoomName=targetRoomID.getName();
  ChatRoom room=(ChatRoom)chatRooms.get(targetRoomName);
  if (room != null && room.isConnected()) {
    room.setSelected();
    return;
  }
  try {
    final IChatRoomContainer chatRoomContainer=roomInfo.createChatRoomContainer();
    final ChatRoom chatroom=new ChatRoom(chatRoomContainer,new ChatRoomTab(rootTabFolder,targetRoomName));
    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(targetRoomID,ConnectContextFactory.createPasswordConnectContext(password));
          chatRooms.put(targetRoomName,chatroom);
        }
 catch (        Exception e) {
          MessageDialog.openError(getSite().getShell(),"String_Node_Str",NLS.bind("String_Node_Str",targetRoomName,e.getLocalizedMessage()));
        }
      }
    }
);
  }
 catch (  Exception e) {
    MessageDialog.openError(getSite().getShell(),"String_Node_Str",NLS.bind("String_Node_Str",targetRoomName,e.getLocalizedMessage()));
  }
}