Program: 103904
Project: 103904
Buggy source:
public void setChatSession(ChatSession chatSession){
  this.chatSession=chatSession;
  if ((this.chatSession != null) && this.chatSession.isContactListSupported()) {
    messagePane.remove(conversationPanel);
    TransparentPanel rightPanel=new TransparentPanel(new BorderLayout(5,5));
    Dimension chatContactPanelSize=new Dimension(150,100);
    rightPanel.setMinimumSize(chatContactPanelSize);
    rightPanel.setPreferredSize(chatContactPanelSize);
    this.chatContactListPanel=new ChatRoomMemberListPanel(this);
    this.chatContactListPanel.setOpaque(false);
    topSplitPane=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    topSplitPane.setBorder(null);
    topSplitPane.setOneTouchExpandable(true);
    topSplitPane.setOpaque(false);
    topSplitPane.setResizeWeight(1.0D);
    ChatTransport chatTransport=chatSession.getCurrentChatTransport();
    JLabel localUserLabel=new JLabel(chatTransport.getProtocolProvider().getAccountID().getDisplayName());
    localUserLabel.setFont(localUserLabel.getFont().deriveFont(Font.BOLD));
    rightPanel.add(localUserLabel,BorderLayout.NORTH);
    rightPanel.add(chatContactListPanel,BorderLayout.CENTER);
    topSplitPane.setLeftComponent(conversationPanel);
    topSplitPane.setRightComponent(rightPanel);
    messagePane.setTopComponent(topSplitPane);
  }
 else {
    if (topSplitPane != null) {
      if (chatContactListPanel != null) {
        topSplitPane.remove(chatContactListPanel);
        chatContactListPanel=null;
      }
      this.messagePane.remove(topSplitPane);
      topSplitPane=null;
    }
    this.messagePane.setTopComponent(conversationPanel);
  }
  if (chatSession instanceof MetaContactChatSession) {
    if (subjectPanel != null) {
      this.remove(subjectPanel);
      subjectPanel=null;
      this.revalidate();
      this.repaint();
    }
    initChatTransportSelectorBox();
    if (!transportSelectorBox.getMenu().isEnabled()) {
      getChatConversationPanel().appendMessageToEnd("String_Node_Str" + GuiActivator.getResources().getI18NString("String_Node_Str") + "String_Node_Str");
    }
    ActionMap amap=this.getActionMap();
    amap.put("String_Node_Str",new ChangeTransportAction());
    InputMap imap=this.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_P,KeyEvent.CTRL_DOWN_MASK),"String_Node_Str");
  }
 else   if (chatSession instanceof ConferenceChatSession) {
    removeChatTransportSelectorBox();
  }
  if (chatContactListPanel != null) {
    Iterator<ChatContact> chatParticipants=chatSession.getParticipants();
    while (chatParticipants.hasNext()) {
      chatContactListPanel.addContact(chatParticipants.next());
    }
  }
  if (!chatSession.getCurrentChatTransport().allowsSmsMessage())   sendSmsCheckBox.setEnabled(false);
}

Fixed version (ground truth):
/** 
 * Sets the chat session to associate to this chat panel.
 * @param chatSession the chat session to associate to this chat panel
 */
public void setChatSession(ChatSession chatSession){
  this.chatSession=chatSession;
  if ((this.chatSession != null) && this.chatSession.isContactListSupported()) {
    messagePane.remove(conversationPanel);
    TransparentPanel rightPanel=new TransparentPanel(new BorderLayout(5,5));
    Dimension chatContactPanelSize=new Dimension(150,100);
    rightPanel.setMinimumSize(chatContactPanelSize);
    rightPanel.setPreferredSize(chatContactPanelSize);
    this.chatContactListPanel=new ChatRoomMemberListPanel(this);
    this.chatContactListPanel.setOpaque(false);
    topSplitPane=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
    topSplitPane.setBorder(null);
    topSplitPane.setOneTouchExpandable(true);
    topSplitPane.setOpaque(false);
    topSplitPane.setResizeWeight(1.0D);
    ChatTransport chatTransport=chatSession.getCurrentChatTransport();
    JLabel localUserLabel=new JLabel(chatTransport.getProtocolProvider().getAccountID().getDisplayName());
    localUserLabel.setFont(localUserLabel.getFont().deriveFont(Font.BOLD));
    rightPanel.add(localUserLabel,BorderLayout.NORTH);
    rightPanel.add(chatContactListPanel,BorderLayout.CENTER);
    topSplitPane.setLeftComponent(conversationPanel);
    topSplitPane.setRightComponent(rightPanel);
    messagePane.setTopComponent(topSplitPane);
  }
 else {
    if (topSplitPane != null) {
      if (chatContactListPanel != null) {
        topSplitPane.remove(chatContactListPanel);
        chatContactListPanel=null;
      }
      this.messagePane.remove(topSplitPane);
      topSplitPane=null;
    }
    this.messagePane.setTopComponent(conversationPanel);
  }
  if (chatSession instanceof MetaContactChatSession) {
    if (subjectPanel != null) {
      this.remove(subjectPanel);
      subjectPanel=null;
      this.revalidate();
      this.repaint();
    }
    initChatTransportSelectorBox();
    if (!transportSelectorBox.getMenu().isEnabled()) {
      getChatConversationPanel().appendMessageToEnd("String_Node_Str" + GuiActivator.getResources().getI18NString("String_Node_Str") + "String_Node_Str");
    }
    ActionMap amap=this.getActionMap();
    amap.put("String_Node_Str",new ChangeTransportAction());
    InputMap imap=this.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
    imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_P,KeyEvent.CTRL_DOWN_MASK),"String_Node_Str");
  }
 else   if (chatSession instanceof ConferenceChatSession) {
    removeChatTransportSelectorBox();
  }
  if (chatContactListPanel != null) {
    Iterator<ChatContact> chatParticipants=chatSession.getParticipants();
    while (chatParticipants.hasNext()) {
      chatContactListPanel.addContact(chatParticipants.next());
    }
  }
  if (!chatSession.getCurrentChatTransport().allowsSmsMessage())   sendSmsCheckBox.setEnabled(false);
}