Program: 104594
Project: 104594
Buggy source:
/** 
 * Enables all key actions on this chat window. Closes  tab or window when esc is pressed and changes tabs when  Alt+Right/Left Arrow is pressed. 
 */
private void enableKeyActions(){
  AbstractAction close=new AbstractAction(){
    public void actionPerformed(    ActionEvent e){
      if (chatTabbedPane.getTabCount() > 1) {
        removeContactTab(chatTabbedPane.getSelectedIndex());
      }
 else {
        ChatWindow.this.dispose();
        mainFrame.getTabbedPane().getContactListPanel().setTabbedChatWindow(null);
      }
    }
  }
;
  AbstractAction changeTabForword=new AbstractAction(){
    public void actionPerformed(    ActionEvent e){
      if (chatTabbedPane != null) {
        if (chatTabbedPane.getSelectedIndex() < chatTabbedPane.getTabCount() - 1) {
          ChatWindow.this.chatTabbedPane.setSelectedIndex(chatTabbedPane.getSelectedIndex() + 1);
        }
 else {
          ChatWindow.this.chatTabbedPane.setSelectedIndex(0);
        }
      }
    }
  }
;
  AbstractAction changeTabBackword=new AbstractAction(){
    public void actionPerformed(    ActionEvent e){
      if (chatTabbedPane != null) {
        if (chatTabbedPane.getSelectedIndex() != 0) {
          ChatWindow.this.chatTabbedPane.setSelectedIndex(chatTabbedPane.getSelectedIndex() - 1);
        }
 else {
          ChatWindow.this.chatTabbedPane.setSelectedIndex(chatTabbedPane.getTabCount() - 1);
        }
      }
    }
  }
;
  getRootPane().getActionMap().put("String_Node_Str",close);
  getRootPane().getActionMap().put("String_Node_Str",changeTabForword);
  getRootPane().getActionMap().put("String_Node_Str",changeTabBackword);
  InputMap imap=this.getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
  imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,0),"String_Node_Str");
  imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT,KeyEvent.ALT_DOWN_MASK),"String_Node_Str");
  imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT,KeyEvent.ALT_DOWN_MASK),"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Enables all key actions on this chat window. Closes  tab or window when esc is pressed and changes tabs when  Alt+Right/Left Arrow is pressed. 
 */
private void enableKeyActions(){
  AbstractAction close=new AbstractAction(){
    public void actionPerformed(    ActionEvent e){
      if (chatTabbedPane.getTabCount() > 1) {
        removeContactTab(chatTabbedPane.getSelectedIndex());
      }
 else {
        ChatWindow.this.dispose();
        mainFrame.getTabbedPane().getContactListPanel().setTabbedChatWindow(null);
      }
    }
  }
;
  AbstractAction changeTabForword=new AbstractAction(){
    public void actionPerformed(    ActionEvent e){
      if (chatTabbedPane != null) {
        int selectedIndex=chatTabbedPane.getSelectedIndex();
        if (selectedIndex < chatTabbedPane.getTabCount() - 1) {
          setSelectedContactTab(selectedIndex + 1);
        }
 else {
          setSelectedContactTab(0);
        }
      }
    }
  }
;
  AbstractAction changeTabBackword=new AbstractAction(){
    public void actionPerformed(    ActionEvent e){
      if (chatTabbedPane != null) {
        int selectedIndex=chatTabbedPane.getSelectedIndex();
        if (selectedIndex != 0) {
          setSelectedContactTab(selectedIndex - 1);
        }
 else {
          setSelectedContactTab(chatTabbedPane.getTabCount() - 1);
        }
      }
    }
  }
;
  getRootPane().getActionMap().put("String_Node_Str",close);
  getRootPane().getActionMap().put("String_Node_Str",changeTabForword);
  getRootPane().getActionMap().put("String_Node_Str",changeTabBackword);
  InputMap imap=this.getRootPane().getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
  imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,0),"String_Node_Str");
  imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT,KeyEvent.ALT_DOWN_MASK),"String_Node_Str");
  imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT,KeyEvent.ALT_DOWN_MASK),"String_Node_Str");
}