Program: 94680
Project: 94680
Buggy source:
private void setupNewView() throws Exception {
  IChatRoomInfo roomInfo=manager.getChatRoomInfo(null);
  Assert.isNotNull(roomInfo,Messages.ChatRoomManagerUI_EXCEPTION_NO_ROOT_CHAT_ROOM_MANAGER);
  final IChatRoomContainer managerChatRoom=roomInfo.createChatRoomContainer();
  chatroomview.initializeWithManager(ChatRoomManagerView.getUsernameFromID(targetID),ChatRoomManagerView.getHostnameFromID(targetID),managerChatRoom,this,createChatRoomViewCloseListener());
  chatroomview.setMessageRenderer(getDefaultMessageRenderer());
  container.addListener(new IContainerListener(){
    public void handleEvent(    final IContainerEvent evt){
      Display.getDefault().syncExec(new Runnable(){
        public void run(){
          if (evt instanceof IContainerDisconnectedEvent) {
            IContainerDisconnectedEvent cd=(IContainerDisconnectedEvent)evt;
            final ID departedContainerID=cd.getTargetID();
            ID connectedID=targetID;
            if (connectedID == null || connectedID.equals(departedContainerID)) {
              chatroomview.disconnected();
              isContainerConnected=false;
            }
          }
 else           if (evt instanceof IContainerConnectedEvent) {
            isContainerConnected=true;
            chatroomview.setEnabled(true);
            String[] roomsForTarget=getRoomsForTarget();
            for (int i=0; i < roomsForTarget.length; i++) {
              IChatRoomInfo info=manager.getChatRoomInfo(roomsForTarget[i]);
              chatroomview.joinRoom(info,getPasswordForChatRoomConnect(info));
            }
          }
        }
      }
);
    }
  }
);
  managerChatRoom.addMessageListener(new IIMMessageListener(){
    public void handleMessageEvent(    IIMMessageEvent messageEvent){
      if (messageEvent instanceof IChatRoomMessageEvent) {
        IChatRoomMessage m=((IChatRoomMessageEvent)messageEvent).getChatRoomMessage();
        chatroomview.handleMessage(m.getFromID(),m.getMessage());
      }
 else       if (messageEvent instanceof IChatMessageEvent) {
        final IChatMessage chatMessage=((IChatMessageEvent)messageEvent).getChatMessage();
        chatroomview.handleChatMessage(chatMessage);
      }
    }
  }
);
}

Fixed version (ground truth):
private void setupNewView() throws Exception {
  IChatRoomInfo roomInfo=manager.getChatRoomInfo(null);
  Assert.isNotNull(roomInfo,Messages.ChatRoomManagerUI_EXCEPTION_NO_ROOT_CHAT_ROOM_MANAGER);
  final IChatRoomContainer managerChatRoom=roomInfo.createChatRoomContainer();
  chatroomview.initializeWithManager(ChatRoomManagerView.getUsernameFromID(targetID),ChatRoomManagerView.getHostnameFromID(targetID),managerChatRoom,this,createChatRoomViewCloseListener());
  chatroomview.setMessageRenderer(getDefaultMessageRenderer());
  container.addListener(new IContainerListener(){
    public void handleEvent(    final IContainerEvent evt){
      Display.getDefault().syncExec(new Runnable(){
        public void run(){
          if (evt instanceof IContainerDisconnectedEvent || evt instanceof IContainerEjectedEvent) {
            final ID departedContainerID=((evt instanceof IContainerDisconnectedEvent) ? ((IContainerDisconnectedEvent)evt).getTargetID() : ((IContainerEjectedEvent)evt).getTargetID());
            ID connectedID=targetID;
            if (connectedID == null || connectedID.equals(departedContainerID)) {
              chatroomview.disconnected();
              isContainerConnected=false;
            }
          }
 else           if (evt instanceof IContainerConnectedEvent) {
            isContainerConnected=true;
            chatroomview.setEnabled(true);
            String[] roomsForTarget=getRoomsForTarget();
            for (int i=0; i < roomsForTarget.length; i++) {
              IChatRoomInfo info=manager.getChatRoomInfo(roomsForTarget[i]);
              chatroomview.joinRoom(info,getPasswordForChatRoomConnect(info));
            }
          }
        }
      }
);
    }
  }
);
  managerChatRoom.addMessageListener(new IIMMessageListener(){
    public void handleMessageEvent(    IIMMessageEvent messageEvent){
      if (messageEvent instanceof IChatRoomMessageEvent) {
        IChatRoomMessage m=((IChatRoomMessageEvent)messageEvent).getChatRoomMessage();
        chatroomview.handleMessage(m.getFromID(),m.getMessage());
      }
 else       if (messageEvent instanceof IChatMessageEvent) {
        final IChatMessage chatMessage=((IChatMessageEvent)messageEvent).getChatMessage();
        chatroomview.handleChatMessage(chatMessage);
      }
    }
  }
);
}