Program: 104600
Project: 104600
Buggy source:
/** 
 * Enables all key actions on this chat window. For now  closes the window when esc is pressed.
 */
private void enableKeyActions(){
  AbstractAction close=new AbstractAction(){
    public void actionPerformed(    ActionEvent e){
      if (Constants.TABBED_CHAT_WINDOW && chatTabbedPane.getTabCount() > 1) {
        removeContactTab(chatTabbedPane.getSelectedIndex());
      }
 else {
        ChatWindow.this.dispose();
      }
    }
  }
;
  AbstractAction changeTabForword=new AbstractAction(){
    public void actionPerformed(    ActionEvent e){
      if (chatTabbedPane != null && chatTabbedPane.getSelectedIndex() < chatTabbedPane.getTabCount() - 1) {
        ChatWindow.this.chatTabbedPane.setSelectedIndex(chatTabbedPane.getSelectedIndex() + 1);
      }
    }
  }
;
  AbstractAction changeTabBackword=new AbstractAction(){
    public void actionPerformed(    ActionEvent e){
      if (chatTabbedPane != null && chatTabbedPane.getSelectedIndex() != 0) {
        ChatWindow.this.chatTabbedPane.setSelectedIndex(chatTabbedPane.getSelectedIndex() - 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 && chatTabbedPane.getSelectedIndex() < chatTabbedPane.getTabCount() - 1) {
        ChatWindow.this.chatTabbedPane.setSelectedIndex(chatTabbedPane.getSelectedIndex() + 1);
      }
    }
  }
;
  AbstractAction changeTabBackword=new AbstractAction(){
    public void actionPerformed(    ActionEvent e){
      if (chatTabbedPane != null && chatTabbedPane.getSelectedIndex() != 0) {
        ChatWindow.this.chatTabbedPane.setSelectedIndex(chatTabbedPane.getSelectedIndex() - 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");
}