Program: 135278
Project: 135278
Buggy source:
private void setupKeyboardShortcuts(){
  filterTextField.addEventHandler(KeyEvent.KEY_RELEASED,event -> {
    if (KeyboardShortcuts.BOX_TO_LIST.match(event)) {
      event.consume();
      listView.selectFirstItem();
    }
    if (!KeyboardShortcuts.DOUBLE_PRESS.match(event)) {
      currentFilterText=Optional.of(getCurrentFilterString());
    }
    if (KeyPress.isDoublePress(KeyboardShortcuts.DOUBLE_PRESS.getCode(),event.getCode())) {
      event.consume();
      if (currentFilterText.isPresent()) {
        filterTextField.setText(currentFilterText.get());
      }
      listView.selectFirstItem();
    }
    if (KeyboardShortcuts.MAXIMIZE_WINDOW.match(event)) {
      ui.maximizeWindow();
    }
    if (KeyboardShortcuts.MINIMIZE_WINDOW.match(event)) {
      ui.minimizeWindow();
    }
    if (KeyboardShortcuts.DEFAULT_SIZE_WINDOW.match(event)) {
      ui.setDefaultWidth();
    }
    if (KeyboardShortcuts.SWITCH_DEFAULT_REPO.match(event)) {
      ui.switchDefaultRepo();
    }
  }
);
  addEventHandler(KeyEvent.KEY_RELEASED,event -> {
    if (KeyboardShortcuts.markAsRead.match(event)) {
      markAsRead();
    }
    if (KeyboardShortcuts.markAsUnread.match(event)) {
      markAsUnread();
    }
    if (KeyboardShortcuts.SHOW_DOCS.match(event)) {
      ui.getBrowserComponent().showDocs();
    }
    if (KeyboardShortcuts.LIST_TO_BOX.match(event)) {
      setFocusToFilterBox();
    }
    if (KeyboardShortcuts.DOUBLE_PRESS.match(event) && KeyPress.isDoublePress(KeyboardShortcuts.DOUBLE_PRESS.getCode(),event.getCode())) {
      setFocusToFilterBox();
    }
    if (KeyboardShortcuts.SHOW_ISSUES.match(event)) {
      if (KeyPress.isValidKeyCombination(KeyboardShortcuts.GOTO_MODIFIER.getCode(),event.getCode())) {
        ui.getBrowserComponent().showIssues();
      }
    }
    if (KeyboardShortcuts.SHOW_PULL_REQUESTS.match(event)) {
      if (KeyPress.isValidKeyCombination(KeyboardShortcuts.GOTO_MODIFIER.getCode(),event.getCode())) {
        ui.getBrowserComponent().showPullRequests();
      }
    }
    if (KeyboardShortcuts.SHOW_HELP.match(event)) {
      if (KeyPress.isValidKeyCombination(KeyboardShortcuts.GOTO_MODIFIER.getCode(),event.getCode())) {
        ui.getBrowserComponent().showDocs();
      }
    }
    if (KeyboardShortcuts.SHOW_KEYBOARD_SHORTCUTS.match(event)) {
      if (KeyPress.isValidKeyCombination(KeyboardShortcuts.GOTO_MODIFIER.getCode(),event.getCode())) {
        ui.getBrowserComponent().showKeyboardShortcuts();
      }
    }
    if (KeyboardShortcuts.SHOW_CONTRIBUTORS.match(event)) {
      if (KeyPress.isValidKeyCombination(KeyboardShortcuts.GOTO_MODIFIER.getCode(),event.getCode())) {
        ui.getBrowserComponent().showContributors();
        event.consume();
      }
    }
    if (KeyboardShortcuts.scrollToTop.match(event)) {
      ui.getBrowserComponent().scrollToTop();
    }
    if (KeyboardShortcuts.scrollToBottom.match(event)) {
      if (!KeyboardShortcuts.MINIMIZE_WINDOW.match(event)) {
        ui.getBrowserComponent().scrollToBottom();
      }
    }
    if (KeyboardShortcuts.scrollUp.match(event) || KeyboardShortcuts.scrollDown.match(event)) {
      ui.getBrowserComponent().scrollPage(KeyboardShortcuts.scrollDown.match(event));
    }
    if (KeyboardShortcuts.GOTO_MODIFIER.match(event)) {
      KeyPress.setLastKeyPressedCodeAndTime(event.getCode());
    }
    if (KeyboardShortcuts.NEW_COMMENT.match(event) && ui.getBrowserComponent().isCurrentUrlIssue()) {
      ui.getBrowserComponent().switchToConversationTab();
      ui.getBrowserComponent().jumpToComment();
    }
    if (KeyboardShortcuts.SHOW_LABELS.match(event)) {
      if (KeyPress.isValidKeyCombination(KeyboardShortcuts.GOTO_MODIFIER.getCode(),event.getCode())) {
        ui.getBrowserComponent().newLabel();
      }
 else {
        changeLabels();
      }
    }
    if (KeyboardShortcuts.MANAGE_ASSIGNEES.match(event) && ui.getBrowserComponent().isCurrentUrlIssue()) {
      ui.getBrowserComponent().switchToConversationTab();
      ui.getBrowserComponent().manageAssignees(event.getCode().toString());
    }
    if (KeyboardShortcuts.SHOW_MILESTONES.match(event)) {
      if (KeyPress.isValidKeyCombination(KeyboardShortcuts.GOTO_MODIFIER.getCode(),event.getCode())) {
        ui.getBrowserComponent().showMilestones();
      }
 else       if (ui.getBrowserComponent().isCurrentUrlIssue()) {
        ui.getBrowserComponent().switchToConversationTab();
        ui.getBrowserComponent().manageMilestones(event.getCode().toString());
      }
    }
    if (KeyboardShortcuts.MAXIMIZE_WINDOW.match(event)) {
      ui.maximizeWindow();
    }
    if (KeyboardShortcuts.MINIMIZE_WINDOW.match(event)) {
      ui.minimizeWindow();
    }
    if (KeyboardShortcuts.DEFAULT_SIZE_WINDOW.match(event)) {
      ui.setDefaultWidth();
    }
    if (KeyboardShortcuts.SWITCH_DEFAULT_REPO.match(event)) {
      ui.switchDefaultRepo();
    }
    if (KeyboardShortcuts.UNDO_LABEL_CHANGES.match(event)) {
      ui.triggerNotificationPaneAction();
    }
    for (    KeyCodeCombination key : KeyboardShortcuts.jumpToFirstIssueKeys) {
      if (key.match(event)) {
        event.consume();
        listView.selectFirstItem();
      }
    }
  }
);
}

Fixed version (ground truth):
private void setupKeyboardShortcuts(){
  filterTextField.addEventHandler(KeyEvent.KEY_RELEASED,event -> {
    if (KeyboardShortcuts.BOX_TO_LIST.match(event)) {
      event.consume();
      listView.selectFirstItem();
    }
    if (!KeyboardShortcuts.DOUBLE_PRESS.match(event)) {
      currentFilterText=Optional.of(getCurrentFilterString());
    }
    if (KeyPress.isDoublePress(KeyboardShortcuts.DOUBLE_PRESS.getCode(),event.getCode())) {
      event.consume();
      if (currentFilterText.isPresent()) {
        filterTextField.setText(currentFilterText.get());
      }
      listView.selectFirstItem();
    }
    if (KeyboardShortcuts.MAXIMIZE_WINDOW.match(event)) {
      ui.maximizeWindow();
    }
    if (KeyboardShortcuts.MINIMIZE_WINDOW.match(event)) {
      ui.minimizeWindow();
    }
    if (KeyboardShortcuts.DEFAULT_SIZE_WINDOW.match(event)) {
      ui.setDefaultWidth();
    }
    if (KeyboardShortcuts.SWITCH_DEFAULT_REPO.match(event)) {
      ui.switchDefaultRepo();
    }
  }
);
  addEventHandler(KeyEvent.KEY_RELEASED,event -> {
    if (KeyboardShortcuts.markAsRead.match(event)) {
      markAsRead();
    }
    if (KeyboardShortcuts.markAsUnread.match(event)) {
      markAsUnread();
    }
    if (KeyboardShortcuts.SHOW_DOCS.match(event)) {
      ui.getBrowserComponent().showDocs();
    }
    if (KeyboardShortcuts.LIST_TO_BOX.match(event)) {
      setFocusToFilterBox();
    }
    if (KeyboardShortcuts.DOUBLE_PRESS.match(event) && KeyPress.isDoublePress(KeyboardShortcuts.DOUBLE_PRESS.getCode(),event.getCode())) {
      setFocusToFilterBox();
    }
    if (KeyboardShortcuts.SHOW_ISSUES.match(event)) {
      if (KeyPress.isValidKeyCombination(KeyboardShortcuts.GOTO_MODIFIER.getCode(),event.getCode())) {
        ui.getBrowserComponent().showIssues();
      }
    }
    if (KeyboardShortcuts.SHOW_PULL_REQUESTS.match(event)) {
      if (KeyPress.isValidKeyCombination(KeyboardShortcuts.GOTO_MODIFIER.getCode(),event.getCode())) {
        ui.getBrowserComponent().showPullRequests();
      }
    }
    if (KeyboardShortcuts.SHOW_HELP.match(event)) {
      if (KeyPress.isValidKeyCombination(KeyboardShortcuts.GOTO_MODIFIER.getCode(),event.getCode())) {
        ui.getBrowserComponent().showDocs();
      }
    }
    if (KeyboardShortcuts.SHOW_KEYBOARD_SHORTCUTS.match(event)) {
      if (KeyPress.isValidKeyCombination(KeyboardShortcuts.GOTO_MODIFIER.getCode(),event.getCode())) {
        ui.getBrowserComponent().showKeyboardShortcuts();
      }
    }
    if (KeyboardShortcuts.SHOW_CONTRIBUTORS.match(event)) {
      if (KeyPress.isValidKeyCombination(KeyboardShortcuts.GOTO_MODIFIER.getCode(),event.getCode())) {
        ui.getBrowserComponent().showContributors();
        event.consume();
      }
    }
    if (KeyboardShortcuts.scrollToTop.match(event)) {
      ui.getBrowserComponent().scrollToTop();
    }
    if (KeyboardShortcuts.scrollToBottom.match(event)) {
      if (!KeyboardShortcuts.MINIMIZE_WINDOW.match(event)) {
        ui.getBrowserComponent().scrollToBottom();
      }
    }
    if (KeyboardShortcuts.scrollUp.match(event) || KeyboardShortcuts.scrollDown.match(event)) {
      ui.getBrowserComponent().scrollPage(KeyboardShortcuts.scrollDown.match(event));
    }
    if (KeyboardShortcuts.GOTO_MODIFIER.match(event)) {
      KeyPress.setLastKeyPressedCodeAndTime(event.getCode());
    }
    if (KeyboardShortcuts.NEW_COMMENT.match(event) && ui.getBrowserComponent().isCurrentUrlIssue()) {
      ui.getBrowserComponent().switchToConversationTab();
      ui.getBrowserComponent().jumpToComment();
    }
    if (KeyboardShortcuts.SHOW_LABELS.match(event)) {
      if (KeyPress.isValidKeyCombination(KeyboardShortcuts.GOTO_MODIFIER.getCode(),event.getCode())) {
        ui.getBrowserComponent().newLabel();
      }
 else {
        changeLabels();
      }
    }
    if (KeyboardShortcuts.MANAGE_ASSIGNEES.match(event) && ui.getBrowserComponent().isCurrentUrlIssue()) {
      ui.getBrowserComponent().switchToConversationTab();
      ui.getBrowserComponent().manageAssignees(event.getCode().toString());
    }
    if (KeyboardShortcuts.SHOW_MILESTONES.match(event)) {
      if (KeyPress.isValidKeyCombination(KeyboardShortcuts.GOTO_MODIFIER.getCode(),event.getCode())) {
        ui.getBrowserComponent().showMilestones();
      }
 else       if (ui.getBrowserComponent().isCurrentUrlIssue()) {
        ui.getBrowserComponent().switchToConversationTab();
        ui.getBrowserComponent().manageMilestones(event.getCode().toString());
      }
    }
    if (KeyboardShortcuts.MAXIMIZE_WINDOW.match(event)) {
      ui.maximizeWindow();
    }
    if (KeyboardShortcuts.MINIMIZE_WINDOW.match(event)) {
      ui.minimizeWindow();
    }
    if (KeyboardShortcuts.DEFAULT_SIZE_WINDOW.match(event)) {
      ui.setDefaultWidth();
    }
    if (KeyboardShortcuts.SWITCH_DEFAULT_REPO.match(event)) {
      ui.switchDefaultRepo();
    }
    if (KeyboardShortcuts.UNDO_LABEL_CHANGES.match(event)) {
      ui.triggerNotificationPaneAction();
    }
    for (    KeyCodeCombination key : KeyboardShortcuts.JUMP_TO_FIRST_ISSUE_KEYS) {
      if (key.match(event)) {
        event.consume();
        listView.selectFirstItem();
      }
    }
  }
);
}