nus-yam/ex-repair huggingface dataset:
Program: 135158
Project: 135158
Buggy source:
@Test public void satisfiesAuthor_validInputs(){
  TurboIssue issue=new TurboIssue(REPO,1,"String_Node_Str","String_Node_Str",null,false);
  IModel model=TestUtils.modelWith(issue,new TurboUser("String_Node_Str","String_Node_Str"));
  assertTrue(Qualifier.process(model,Parser.parse("String_Node_Str"),issue));
  assertTrue(Qualifier.process(model,Parser.parse("String_Node_Str"),issue));
  assertTrue(Qualifier.process(model,Parser.parse("String_Node_Str"),issue));
  assertTrue(Qualifier.process(model,Parser.parse("String_Node_Str"),issue));
}

Fixed version (ground truth):
@Test public void satisfiesAuthor_validInputs(){
  TurboIssue issue=new TurboIssue(REPO,1,"String_Node_Str","String_Node_Str",null,false);
  IModel model=TestUtils.modelWith(issue,new TurboUser("String_Node_Str","String_Node_Str","String_Node_Str"));
  assertTrue(Qualifier.process(model,Parser.parse("String_Node_Str"),issue));
  assertTrue(Qualifier.process(model,Parser.parse("String_Node_Str"),issue));
  assertTrue(Qualifier.process(model,Parser.parse("String_Node_Str"),issue));
  assertTrue(Qualifier.process(model,Parser.parse("String_Node_Str"),issue));
  assertTrue(Qualifier.process(model,Parser.parse("String_Node_Str"),issue));
  assertTrue(Qualifier.process(model,Parser.parse("String_Node_Str"),issue));
  assertTrue(Qualifier.process(model,Parser.parse("String_Node_Str"),issue));
}
Program: 135159
Project: 135159
Buggy source:
private void updateSuggestion(){
  if (matchedBoards.isEmpty() || matchedBoards.size() == boards.size()) {
    suggestion=Optional.empty();
  }
 else {
    suggestion=matchedBoards.stream().min(String::compareToIgnoreCase);
  }
}

Fixed version (ground truth):
private void updateSuggestion(){
  if (matchedBoards.isEmpty() || (matchedBoards.size() == boards.size() && boards.size() != 1)) {
    suggestion=Optional.empty();
  }
 else {
    suggestion=matchedBoards.stream().min(String::compareToIgnoreCase);
  }
}
Program: 135160
Project: 135160
Buggy source:
private void panelFocus_firstPanel_firstPanelShown(PanelControl panelControl) throws IllegalAccessException {
  clickOn("String_Node_Str");
  pushKeys(KeyCode.DOWN);
  pushKeys(KeyCode.DOWN);
  pushKeys(KeyCode.ENTER);
  ((TextField)GuiTest.find(IdGenerator.getBoardNameInputFieldIdReference())).setText("String_Node_Str");
  clickOn("String_Node_Str");
  awaitCondition(() -> 1 == panelControl.getNumberOfSavedBoards());
  pushKeys(CREATE_RIGHT_PANEL);
  awaitCondition(() -> panelControl.getCurrentlySelectedPanel().get() == panelControl.getPanelCount() - 1);
  pushKeys(SWITCH_BOARD);
  awaitCondition(() -> 0 == panelControl.getCurrentlySelectedPanel().get());
  ScrollPane panelsScrollPaneReflection=(ScrollPane)FieldUtils.readField(panelControl,"String_Node_Str",true);
  assertEquals(0,panelsScrollPaneReflection.getHvalue(),0.001);
}

Fixed version (ground truth):
private void panelFocus_firstPanel_firstPanelShown(PanelControl panelControl) throws IllegalAccessException {
  clickOn("String_Node_Str");
  pushKeys(KeyCode.DOWN);
  pushKeys(KeyCode.DOWN);
  pushKeys(KeyCode.ENTER);
  ((TextField)GuiTest.find(IdGenerator.getBoardNameInputFieldIdReference())).setText("String_Node_Str");
  clickOn("String_Node_Str");
  awaitCondition(() -> 1 == panelControl.getNumberOfSavedBoards());
  pushKeys(CREATE_RIGHT_PANEL);
  awaitCondition(() -> panelControl.getCurrentlySelectedPanel().get() == panelControl.getPanelCount() - 1);
  pushKeys(SWITCH_BOARD);
  waitUntilNodeAppears("String_Node_Str");
  type("String_Node_Str");
  pushKeys(KeyCode.ENTER);
  awaitCondition(() -> 0 == panelControl.getCurrentlySelectedPanel().get());
  ScrollPane panelsScrollPaneReflection=(ScrollPane)FieldUtils.readField(panelControl,"String_Node_Str",true);
  assertEquals(0,panelsScrollPaneReflection.getHvalue(),0.001);
}
Program: 135161
Project: 135161
Buggy source:
@Test public void eventTriggerOnIssueSelection_byRightClick_selectionEventNotTriggered(){
  AtomicInteger eventCount=new AtomicInteger(0);
  UI.events.registerEvent((IssueSelectedEventHandler)e -> eventCount.incrementAndGet());
  ListPanel issuePanel=getPanel(0);
  rightClickIssue(0,9);
  ContextMenu contextMenu=issuePanel.getContextMenu();
  for (  MenuItem menuItem : contextMenu.getItems()) {
    assertTrue(!menuItem.isDisable());
  }
  assertEquals(0,eventCount.get());
}

Fixed version (ground truth):
@Test public void eventTriggerOnIssueSelection_byRightClick_selectionEventNotTriggered(){
  AtomicInteger eventCount=new AtomicInteger(0);
  UI.events.registerEvent((IssueSelectedEventHandler)e -> eventCount.incrementAndGet());
  ListPanel issuePanel=getPanel(0);
  waitUntilNodeAppears(PANEL_IDENTIFIER);
  ListPanel issuePanel=GuiTest.find(PANEL_IDENTIFIER);
  rightClickIssue(0,9);
  ContextMenu contextMenu=issuePanel.getContextMenu();
  for (  MenuItem menuItem : contextMenu.getItems()) {
    assertTrue(!menuItem.isDisable());
  }
  assertEquals(0,eventCount.get());
}
Program: 135162
Project: 135162
Buggy source:
/** 
 * Click on menu item with target text
 * @param menu
 * @param target
 */
private void clickMenuItem(String target){
  clickMenuItem(issuePanel.getContextMenu(),target);
}

Fixed version (ground truth):
/** 
 * Clicks on menu item with target text
 * @param menu
 * @param target
 */
private void clickMenuItem(String target){
  clickMenuItem(issuePanel.getContextMenu(),target);
}
Program: 135163
Project: 135163
Buggy source:
@Test public void logoutFunctionTest(){
  selectAll();
  type("String_Node_Str").push(KeyCode.TAB);
  type("String_Node_Str").push(KeyCode.TAB);
  type("String_Node_Str").push(KeyCode.TAB);
  type("String_Node_Str");
  clickOn("String_Node_Str");
  sleep(2000);
  clickOn("String_Node_Str");
  clickOn("String_Node_Str");
  File testConfig=new File(configFileDirectory,testConfigFileName);
  if (!(testConfig.exists() && testConfig.isFile())) {
    fail("String_Node_Str" + testConfig.getAbsolutePath());
  }
  Preferences testPref=TestController.loadTestPreferences();
  assertEquals("String_Node_Str",testPref.getLastLoginUsername());
  assertEquals("String_Node_Str",testPref.getLastLoginPassword());
}

Fixed version (ground truth):
@Test public void logoutFunctionTest(){
  selectAll();
  type("String_Node_Str").push(KeyCode.TAB);
  type("String_Node_Str").push(KeyCode.TAB);
  type("String_Node_Str").push(KeyCode.TAB);
  type("String_Node_Str");
  clickOn("String_Node_Str");
  sleep(EVENT_DELAY);
  clickOn("String_Node_Str");
  clickOn("String_Node_Str");
  File testConfig=new File(configFileDirectory,testConfigFileName);
  if (!(testConfig.exists() && testConfig.isFile())) {
    fail("String_Node_Str" + testConfig.getAbsolutePath());
  }
  Preferences testPref=TestController.loadTestPreferences();
  assertEquals("String_Node_Str",testPref.getLastLoginUsername());
  assertEquals("String_Node_Str",testPref.getLastLoginPassword());
}
Program: 135164
Project: 135164
Buggy source:
/** 
 * Like drag(from).to(to), but does not relocate the mouse if the target moves.
 */
public void dragUnconditionally(FilterPanel panelFrom,FilterPanel panelTo){
  Node from=dragSrc(panelFrom);
  Node to=dragDest(panelTo);
  Bounds fromBound=from.localToScene(from.getBoundsInLocal());
  Bounds toBound=to.localToScene(to.getBoundsInLocal());
  drag(fromBound.getMinX(),fromBound.getMaxY(),MouseButton.PRIMARY).moveTo(toBound.getMaxX(),toBound.getMaxY());
  drop();
}

Fixed version (ground truth):
/** 
 * Like drag(from).to(to), but does not relocate the mouse if the target moves.
 */
public void dragUnconditionally(FilterPanel panelFrom,FilterPanel panelTo){
  Node from=dragSrc(panelFrom);
  Node to=dragDest(panelTo);
  Bounds fromBound=from.localToScene(from.getBoundsInLocal());
  Bounds toBound=to.localToScene(to.getBoundsInLocal());
  drag(fromBound.getMinX(),fromBound.getMaxY(),MouseButton.PRIMARY).moveTo(toBound.getMaxX(),toBound.getMaxY()).drop();
}
Program: 135165
Project: 135165
Buggy source:
/** 
 * Click on menu item with target text
 * @param menu
 * @param target
 */
public void clickMenuItem(ContextMenu menu,String target){
  menu.getItems().stream().filter(item -> item.getText().equals(target)).findFirst().ifPresent(item -> {
    Platform.runLater(item::fire);
  }
);
}

Fixed version (ground truth):
/** 
 * Clicks on menu item with target text
 * @param menu
 * @param target
 */
public void clickMenuItem(ContextMenu menu,String target){
  menu.getItems().stream().filter(item -> item.getText().equals(target)).findFirst().ifPresent(item -> {
    Platform.runLater(item::fire);
  }
);
}
Program: 135166
Project: 135166
Buggy source:
@Test public void isUserInRepo_queryExistingUser_userFound(){
  MultiModel models=new MultiModel(mock(Preferences.class));
  final String REPO="String_Node_Str";
  TurboUser user1=new TurboUser(REPO,"String_Node_Str","String_Node_Str");
  TurboUser user2=new TurboUser(REPO,"String_Node_Str","String_Node_Str");
  List<TurboUser> users=Arrays.asList(user1,user2);
  Model mockedModel=mock(Model.class);
  when(mockedModel.getRepoId()).thenReturn(REPO);
  when(mockedModel.getUsers()).thenReturn(users);
  models.queuePendingRepository(REPO);
  models.addPending(mockedModel);
  assertTrue(models.isUserInRepo(REPO,"String_Node_Str"));
  assertTrue(models.isUserInRepo(REPO,"String_Node_Str"));
  assertTrue(models.isUserInRepo(REPO,"String_Node_Str"));
  assertTrue(models.isUserInRepo(REPO,"String_Node_Str"));
}

Fixed version (ground truth):
@Test public void isUserInRepo_queryExistingUser_userFound(){
  MultiModel models=new MultiModel(mock(Preferences.class));
  TurboUser user1=new TurboUser(REPO,"String_Node_Str","String_Node_Str");
  TurboUser user2=new TurboUser(REPO,"String_Node_Str","String_Node_Str");
  List<TurboUser> users=Arrays.asList(user1,user2);
  Model mockedModel=mock(Model.class);
  when(mockedModel.getRepoId()).thenReturn(REPO);
  when(mockedModel.getUsers()).thenReturn(users);
  models.queuePendingRepository(REPO);
  models.addPending(mockedModel);
  assertTrue(models.isUserInRepo(REPO,"String_Node_Str"));
  assertTrue(models.isUserInRepo(REPO,"String_Node_Str"));
  assertTrue(models.isUserInRepo(REPO,"String_Node_Str"));
  assertTrue(models.isUserInRepo(REPO,"String_Node_Str"));
}
Program: 135167
Project: 135167
Buggy source:
@Test public void isUserInRepo_queryNonExistingUser_userNotFound(){
  MultiModel models=new MultiModel(mock(Preferences.class));
  final String REPO="String_Node_Str";
  TurboUser user1=new TurboUser(REPO,"String_Node_Str","String_Node_Str");
  TurboUser user2=new TurboUser(REPO,"String_Node_Str","String_Node_Str");
  List<TurboUser> users=Arrays.asList(user1,user2);
  Model mockedModel=mock(Model.class);
  when(mockedModel.getRepoId()).thenReturn(REPO);
  when(mockedModel.getUsers()).thenReturn(users);
  models.queuePendingRepository(REPO);
  models.addPending(mockedModel);
  assertFalse(models.isUserInRepo(REPO,"String_Node_Str"));
  assertFalse(models.isUserInRepo(REPO,"String_Node_Str"));
}

Fixed version (ground truth):
@Test public void isUserInRepo_queryNonExistingUser_userNotFound(){
  MultiModel models=new MultiModel(mock(Preferences.class));
  TurboUser user1=new TurboUser(REPO,"String_Node_Str","String_Node_Str");
  TurboUser user2=new TurboUser(REPO,"String_Node_Str","String_Node_Str");
  List<TurboUser> users=Arrays.asList(user1,user2);
  Model mockedModel=mock(Model.class);
  when(mockedModel.getRepoId()).thenReturn(REPO);
  when(mockedModel.getUsers()).thenReturn(users);
  models.queuePendingRepository(REPO);
  models.addPending(mockedModel);
  assertFalse(models.isUserInRepo(REPO,"String_Node_Str"));
  assertFalse(models.isUserInRepo(REPO,"String_Node_Str"));
}
Program: 135168
Project: 135168
Buggy source:
private void triggerIssuePicker(List<TurboIssue> allIssues){
  Platform.runLater(stage::hide);
  UI.events.triggerEvent(new ShowIssuePickerEvent(allIssues,false));
  waitUntilNodeAppears(QUERY_FIELD_ID);
}

Fixed version (ground truth):
private void triggerIssuePicker(List<TurboIssue> allIssues){
  Platform.runLater(getStage()::hide);
  UI.events.triggerEvent(new ShowIssuePickerEvent(allIssues,false));
  waitUntilNodeAppears(QUERY_FIELD_ID);
}
Program: 135169
Project: 135169
Buggy source:
@Test public void showIssuePicker_typeQuery_displaysCorrectly(){
  triggerIssuePicker(new ArrayList<>());
  TextField issuePickerTextField=find(QUERY_FIELD_ID);
  click(issuePickerTextField);
  type("String_Node_Str");
  assertEquals("String_Node_Str",issuePickerTextField.getText());
}

Fixed version (ground truth):
@Test public void showIssuePicker_typeQuery_displaysCorrectly(){
  triggerIssuePicker(new ArrayList<>());
  TextField issuePickerTextField=GuiTest.find(QUERY_FIELD_ID);
  clickOn(issuePickerTextField);
  type("String_Node_Str");
  assertEquals("String_Node_Str",issuePickerTextField.getText());
}
Program: 135170
Project: 135170
Buggy source:
public Node getNode(){
  Label repoLabel=new Label();
  if (isSelected)   repoLabel.setText(BALLOT_BOX_WITH_CHECK + "String_Node_Str" + repositoryId);
 else   repoLabel.setText(BALLOT_BOX + "String_Node_Str" + repositoryId);
  return repoLabel;
}

Fixed version (ground truth):
public Node getNode(){
  Label repoLabel=new Label();
  if (isSelected) {
    repoLabel.setText(BALLOT_BOX_WITH_CHECK + "String_Node_Str" + repositoryId);
  }
 else {
    repoLabel.setText(BALLOT_BOX + "String_Node_Str" + repositoryId);
  }
  return repoLabel;
}
Program: 135171
Project: 135171
Buggy source:
private void setupMainIssueCard(){
  return;
}

Fixed version (ground truth):
private void setupMainIssueCard(){
  this.backgroundProperty().bind(Bindings.when(this.focusedProperty()).then(new Background(new BackgroundFill(Color.CORNFLOWERBLUE,CornerRadii.EMPTY,Insets.EMPTY))).otherwise(new Background(new BackgroundFill(Color.WHITE,CornerRadii.EMPTY,Insets.EMPTY))));
  this.setStyle("String_Node_Str");
}
Program: 135172
Project: 135172
Buggy source:
private void setup(){
  setupMainIssueCard();
  TurboIssue issue=guiElement.getIssue();
  Text issueTitle=new Text("String_Node_Str" + issue.getId() + "String_Node_Str"+ issue.getTitle());
  issueTitle.setWrappingWidth(CARD_WIDTH);
  issueTitle.getStyleClass().add("String_Node_Str");
  if (issue.isCurrentlyRead()) {
    issueTitle.getStyleClass().add("String_Node_Str");
  }
  if (!issue.isOpen()) {
    issueTitle.getStyleClass().add("String_Node_Str");
  }
  setupIssueDetailsBox();
  setupAuthorAssigneeBox();
  updateDetails();
  setPadding(new Insets(0,0,0,0));
  setSpacing(1);
  getChildren().addAll(issueTitle,issueDetails,authorAssigneeBox);
}

Fixed version (ground truth):
private void setup(){
  setupMainIssueCard();
  TurboIssue issue=guiElement.getIssue();
  Text issueTitle=new Text("String_Node_Str" + issue.getId() + "String_Node_Str"+ issue.getTitle());
  issueTitle.setWrappingWidth(CARD_WIDTH);
  issueTitle.getStyleClass().add("String_Node_Str");
  if (issue.isCurrentlyRead()) {
    issueTitle.getStyleClass().add("String_Node_Str");
  }
  if (!issue.isOpen()) {
    issueTitle.getStyleClass().add("String_Node_Str");
  }
  setupIssueDetailsBox();
  setupAuthorAssigneeBox();
  updateDetails();
  setPadding(new Insets(3,0,3,0));
  setSpacing(1);
  getChildren().addAll(issueTitle,issueDetails,authorAssigneeBox);
}
Program: 135173
Project: 135173
Buggy source:
private void handleIssueClick(TurboIssue issue,IssueCard card){
  issuepickerQueryField.setDisable(true);
  state.updateSelectedIssues(issue);
  populatePanes(state);
}

Fixed version (ground truth):
private void handleIssueClick(TurboIssue issue,IssueCard card){
  issuepickerQueryField.setDisable(true);
  Platform.runLater(card::requestFocus);
  state.updateSelectedIssues(issue);
  populateSelectedIssues(state.getSelectedIssues(),state.getCurrentSuggestion());
}
Program: 135174
Project: 135174
Buggy source:
private void setup(){
  TurboIssue issue=guiElement.getIssue();
  Text issueTitle=new Text("String_Node_Str" + issue.getId() + "String_Node_Str"+ issue.getTitle());
  issueTitle.setWrappingWidth(CARD_WIDTH);
  issueTitle.getStyleClass().add("String_Node_Str");
  if (issue.isCurrentlyRead()) {
    issueTitle.getStyleClass().add("String_Node_Str");
  }
  if (!issue.isOpen()) {
    issueTitle.getStyleClass().add("String_Node_Str");
  }
  setupIssueDetailsBox();
  setupAuthorAssigneeBox();
  updateDetails();
  setPadding(new Insets(0,0,0,0));
  setSpacing(1);
  getChildren().addAll(issueTitle,issueDetails,authorAssigneeBox);
}

Fixed version (ground truth):
private void setup(){
  setupMainIssueCard();
  TurboIssue issue=guiElement.getIssue();
  Text issueTitle=new Text("String_Node_Str" + issue.getId() + "String_Node_Str"+ issue.getTitle());
  issueTitle.setWrappingWidth(CARD_WIDTH);
  issueTitle.getStyleClass().add("String_Node_Str");
  if (issue.isCurrentlyRead()) {
    issueTitle.getStyleClass().add("String_Node_Str");
  }
  if (!issue.isOpen()) {
    issueTitle.getStyleClass().add("String_Node_Str");
  }
  setupIssueDetailsBox();
  setupAuthorAssigneeBox();
  updateDetails();
  setPadding(new Insets(0,0,0,0));
  setSpacing(1);
  getChildren().addAll(issueTitle,issueDetails,authorAssigneeBox);
}
Program: 135175
Project: 135175
Buggy source:
private Node processSuggestedIssue(TurboIssue issue){
  GuiElement element=new GuiElement(issue,models.getLabelsOfIssue(issue),models.getMilestoneOfIssue(issue),models.getAssigneeOfIssue(issue),models.getAuthorOfIssue(issue));
  return new IssueCard(element);
}

Fixed version (ground truth):
private Node processSuggestedIssue(TurboIssue issue){
  GuiElement element=new GuiElement(issue,models.getLabelsOfIssue(issue),models.getMilestoneOfIssue(issue),models.getAssigneeOfIssue(issue),models.getAuthorOfIssue(issue));
  IssueCard card=new IssueCard(element);
  card.setOnMouseClicked(e -> handleIssueClick(issue,card));
  return card;
}
Program: 135176
Project: 135176
Buggy source:
private void createButtons(){
  ButtonType confirmButtonType=new ButtonType("String_Node_Str",ButtonData.OK_DONE);
  getDialogPane().getButtonTypes().addAll(confirmButtonType,ButtonType.CANCEL);
  setResultConverter(dialogButton -> {
    if (dialogButton == confirmButtonType) {
      return state.getSelectedIssues().stream().map(TurboIssue::toString).collect(Collectors.toList());
    }
    return null;
  }
);
}

Fixed version (ground truth):
private void createButtons(){
  ButtonType confirmButtonType=new ButtonType("String_Node_Str",ButtonData.OK_DONE);
  getDialogPane().getButtonTypes().addAll(confirmButtonType,ButtonType.CANCEL);
  setResultConverter(dialogButton -> {
    if (dialogButton == confirmButtonType) {
      if (!issuepickerQueryField.isDisabled())       issuepickerQueryField.appendText("String_Node_Str");
      return state.getSelectedIssues().stream().map(TurboIssue::toString).collect(Collectors.toList());
    }
    return null;
  }
);
}
Program: 135177
Project: 135177
Buggy source:
private void populateSelectedIssues(List<TurboIssue> chosenIssues,Optional<TurboIssue> currentSuggestion){
  selectedIssues.getChildren().clear();
  Map<String,FlowPane> repoContent=getRepoContent(chosenIssues,currentSuggestion);
  repoContent.entrySet().forEach(entry -> {
    selectedIssues.getChildren().addAll(createRepoTitle(entry.getKey()),entry.getValue());
  }
);
  if (selectedIssues.getChildren().isEmpty()) {
    selectedIssues.getChildren().add(createTextLabel(NO_SELECTED_ISSUES));
  }
}

Fixed version (ground truth):
private void populateSelectedIssues(List<TurboIssue> chosenIssues,Optional<TurboIssue> currentSuggestion){
  selectedIssues.getChildren().clear();
  Map<String,FlowPane> repoContent=getRepoContent(chosenIssues,currentSuggestion);
  repoContent.entrySet().forEach(entry -> {
    entry.getValue().getChildren().add(0,createRepoTitle(entry.getKey()));
    selectedIssues.getChildren().addAll(entry.getValue());
  }
);
}
Program: 135178
Project: 135178
Buggy source:
private Label createRepoTitle(String name){
  Label repoName=new Label(name);
  repoName.setPadding(new Insets(0,5,5,0));
  repoName.setMaxWidth(ELEMENT_MAX_WIDTH - 10);
  repoName.setStyle("String_Node_Str");
  return repoName;
}

Fixed version (ground truth):
private Label createRepoTitle(String name){
  Label repoName=new Label(name + "String_Node_Str");
  repoName.setPadding(new Insets(0,5,5,0));
  repoName.setMaxWidth(ELEMENT_MAX_WIDTH - 10);
  repoName.setStyle("String_Node_Str");
  return repoName;
}
Program: 135179
Project: 135179
Buggy source:
private final Map<String,FlowPane> getRepoContent(List<TurboIssue> chosenIssues,Optional<TurboIssue> suggestion){
  Map<String,FlowPane> repoContent=new HashMap<>();
  chosenIssues.stream().forEach(issue -> {
    String repoId=issue.getRepoId();
    if (!repoContent.containsKey(repoId)) {
      repoContent.put(repoId,createRepoPane(GROUP_PAD));
    }
    repoContent.get(repoId).getChildren().add(processSelectedIssue(issue,suggestion));
  }
);
  if (suggestion.isPresent() && !chosenIssues.contains(suggestion.get())) {
    addCurrentSuggestion(repoContent,suggestion.get());
  }
  return repoContent;
}

Fixed version (ground truth):
private final Map<String,FlowPane> getRepoContent(List<TurboIssue> chosenIssues,Optional<TurboIssue> suggestion){
  Map<String,FlowPane> repoContent=new HashMap<>();
  chosenIssues.stream().forEach(issue -> {
    String repoId=issue.getRepoId();
    if (!repoContent.containsKey(repoId)) {
      repoContent.put(repoId,createRepoPane(GROUP_PAD));
    }
    repoContent.get(repoId).getChildren().add(processSelectedIssue(issue,suggestion));
  }
);
  if (canAddSuggestion(chosenIssues,suggestion))   addCurrentSuggestion(repoContent,suggestion.get());
  return repoContent;
}
Program: 135180
Project: 135180
Buggy source:
public Optional<TurboIssue> getCurrentSuggestion(){
  if (suggestedIssues.isEmpty())   return Optional.empty();
  return Optional.of(suggestedIssues.get(0));
}

Fixed version (ground truth):
/** 
 * @return current suggestion if there are matches
 */
public Optional<TurboIssue> getCurrentSuggestion(){
  return currentSuggestion;
}
Program: 135181
Project: 135181
Buggy source:
/** 
 * Updates selected issues if issue is present
 * @param issue
 */
private void updateSelectedIssues(Optional<TurboIssue> issue){
  if (!issue.isPresent())   return;
  TurboIssue selectedIssue=issue.get();
  if (selectedIssues.contains(selectedIssue)) {
    selectedIssues.remove(selectedIssue);
  }
 else {
    selectedIssues.add(selectedIssue);
  }
}

Fixed version (ground truth):
/** 
 * Updates selected issues if issue is present
 * @param issue
 */
public void updateSelectedIssues(TurboIssue selectedIssue){
  if (selectedIssues.contains(selectedIssue)) {
    selectedIssues.remove(selectedIssue);
  }
 else {
    selectedIssues.add(selectedIssue);
  }
}
Program: 135182
Project: 135182
Buggy source:
/** 
 * Updates current state based on given user input
 * @param userInput 
 */
private final void update(String userInput){
  if (userInput.isEmpty())   return;
  List<String> confirmedKeywords=getConfirmedKeywords(userInput);
  for (  String confirmedKeyword : confirmedKeywords) {
    updateSelectedIssues(Optional.ofNullable(TurboIssue.getMatchedIssues(allIssues,confirmedKeyword).get(0)));
  }
  Optional<String> keywordInProgress=getKeywordInProgress(userInput);
  if (keywordInProgress.isPresent()) {
    updateSuggestedIssues(allIssues,keywordInProgress.get());
  }
}

Fixed version (ground truth):
/** 
 * Updates current state based on given user input
 * @param userInput 
 */
private final void update(String userInput){
  List<String> confirmedKeywords=getConfirmedKeywords(userInput);
  for (  String confirmedKeyword : confirmedKeywords) {
    TurboIssue.getMatchedIssues(allIssues,confirmedKeyword).stream().findFirst().ifPresent(this::updateSelectedIssues);
  }
  Optional<String> keywordInProgress=getKeywordInProgress(userInput);
  if (keywordInProgress.isPresent()) {
    updateSuggestedIssues(allIssues,keywordInProgress.get());
    if (!userInput.isEmpty())     currentSuggestion=suggestedIssues.stream().findFirst();
  }
}
Program: 135183
Project: 135183
Buggy source:
public CompletableFuture<Boolean> replaceIssueMilestone(TurboIssue issue,Integer milestone){
  logger.info("String_Node_Str" + issue + "String_Node_Str");
  return repoIO.replaceIssueMilestone(issue,milestone).thenApply(resultingIssue -> {
    logger.info("String_Node_Str" + issue + "String_Node_Str");
    if (resultingIssue.getMilestone() != null) {
      issue.setMilestoneById(resultingIssue.getMilestone().getNumber());
    }
 else {
      issue.setMilestoneById(null);
    }
    refreshUI();
    return true;
  }
).exceptionally(Futures.withResult(false));
}

Fixed version (ground truth):
public CompletableFuture<Boolean> replaceIssueMilestone(TurboIssue issue,Integer milestone){
  Optional<Integer> originalMilestone=issue.getMilestone();
  logger.info("String_Node_Str" + issue + "String_Node_Str");
  Optional<TurboIssue> localReplaceResult=models.replaceIssueMilestone(issue.getRepoId(),issue.getId(),milestone);
  if (!localReplaceResult.isPresent()) {
    return CompletableFuture.completedFuture(false);
  }
  refreshUI();
  return updateIssueMilestonesOnServer(issue,milestone).thenApply((isUpdateSuccessful) -> handleIssueMilestoneUpdateOnServerResult(isUpdateSuccessful,localReplaceResult.get(),originalMilestone.orElseGet(() -> null)));
}
Program: 135184
Project: 135184
Buggy source:
public CompletableFuture<Issue> replaceIssueMilestone(TurboIssue issue,Integer milestone){
  return repoSource.replaceIssueMilestone(issue,milestone);
}

Fixed version (ground truth):
public CompletableFuture<Boolean> replaceIssueMilestone(TurboIssue issue,Integer milestone){
  return repoSource.replaceIssueMilestone(issue,milestone);
}
Program: 135185
Project: 135185
Buggy source:
@Override public CompletableFuture<Issue> replaceIssueMilestone(TurboIssue issue,Integer milestone){
  return addTask(new ReplaceIssueMilestoneTask(this,gitHub,issue.getRepoId(),issue.getId(),issue.getTitle(),milestone)).response;
}

Fixed version (ground truth):
@Override public CompletableFuture<Boolean> replaceIssueMilestone(TurboIssue issue,Integer milestone){
  return addTask(new ReplaceIssueMilestoneTask(this,gitHub,issue.getRepoId(),issue.getId(),issue.getTitle(),milestone)).response;
}
Program: 135186
Project: 135186
Buggy source:
@Override public void run(){
  try {
    response.complete(repo.setMilestone(repoId,issueId,issueTitle,issueMilestone));
  }
 catch (  IOException e) {
    response.completeExceptionally(e);
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    Issue result=repo.setMilestone(repoId,issueId,issueTitle,issueMilestone);
    if (result.getMilestone() == null) {
      response.complete(issueMilestone == null);
    }
 else {
      response.complete(result.getMilestone().getNumber() == issueMilestone);
    }
  }
 catch (  IOException e) {
    response.completeExceptionally(e);
  }
}
Program: 135187
Project: 135187
Buggy source:
public abstract CompletableFuture<Issue> replaceIssueMilestone(TurboIssue issue,Integer milestone);

Fixed version (ground truth):
public abstract CompletableFuture<Boolean> replaceIssueMilestone(TurboIssue issue,Integer milestone);
Program: 135188
Project: 135188
Buggy source:
public void setMilestone(TurboMilestone milestone){
  setMilestoneById(milestone.getId());
}

Fixed version (ground truth):
public void setMilestone(TurboMilestone milestone){
  setMilestoneById(milestone.getId());
  this.milestoneLastModifiedAt=Optional.of(LocalDateTime.now());
}
Program: 135189
Project: 135189
Buggy source:
public void setMilestoneById(Integer milestone){
  this.milestone=(milestone == null) ? Optional.empty() : Optional.of(milestone);
}

Fixed version (ground truth):
public void setMilestoneById(Integer milestone){
  this.milestone=(milestone == null) ? Optional.empty() : Optional.of(milestone);
  this.milestoneLastModifiedAt=Optional.of(LocalDateTime.now());
}
Program: 135190
Project: 135190
Buggy source:
@Override public CompletableFuture<Issue> replaceIssueMilestone(TurboIssue issue,Integer milestone){
  return addTask(new ReplaceIssueMilestoneTask(this,dummy,issue.getRepoId(),issue.getId(),issue.getTitle(),milestone)).response;
}

Fixed version (ground truth):
@Override public CompletableFuture<Boolean> replaceIssueMilestone(TurboIssue issue,Integer milestone){
  return addTask(new ReplaceIssueMilestoneTask(this,dummy,issue.getRepoId(),issue.getId(),issue.getTitle(),milestone)).response;
}
Program: 135191
Project: 135191
Buggy source:
/** 
 * Replaces the milestone of the issue in the   {@link Logic#models} corresponding to {@code modifiedIssue} with{@code originalLabels} if the current labels on the issue is assigned at the same time as {@code modifiedIssue}
 * @param modifiedIssue
 * @param originalMilestone
 */
private void revertLocalMilestoneReplace(TurboIssue modifiedIssue,Integer originalMilestone){
  TurboIssue currentIssue=getIssue(modifiedIssue.getRepoId(),modifiedIssue.getId()).orElse(modifiedIssue);
  LocalDateTime originalMilestoneModifiedAt=modifiedIssue.getMilestoneLastModifiedAt();
  LocalDateTime currentMilestoneAssignedAt=currentIssue.getMilestoneLastModifiedAt();
  boolean isCurrentMilestoneModifiedFromOriginalMilestone=originalMilestoneModifiedAt.isEqual(currentMilestoneAssignedAt);
  if (isCurrentMilestoneModifiedFromOriginalMilestone) {
    logger.info("String_Node_Str" + currentIssue);
    models.replaceIssueMilestone(currentIssue.getRepoId(),currentIssue.getId(),originalMilestone);
    refreshUI();
  }
}

Fixed version (ground truth):
/** 
 * Replaces the milestone of the issue in the   {@link Logic#models} corresponding to {@code modifiedIssue} with{@code originalMilestone} if they were both issues have the same last modified LocalDateTime
 * @param modifiedIssue
 * @param originalMilestone
 */
private void revertLocalMilestoneReplace(TurboIssue modifiedIssue,Integer originalMilestone){
  TurboIssue currentIssue=getIssue(modifiedIssue.getRepoId(),modifiedIssue.getId()).orElse(modifiedIssue);
  LocalDateTime originalMilestoneModifiedAt=modifiedIssue.getMilestoneLastModifiedAt();
  LocalDateTime currentMilestoneAssignedAt=currentIssue.getMilestoneLastModifiedAt();
  boolean isCurrentMilestoneModifiedFromOriginalMilestone=originalMilestoneModifiedAt.isEqual(currentMilestoneAssignedAt);
  if (!isCurrentMilestoneModifiedFromOriginalMilestone)   return;
  logger.info("String_Node_Str" + currentIssue);
  models.replaceIssueMilestone(currentIssue.getRepoId(),currentIssue.getId(),originalMilestone);
  refreshUI();
}
Program: 135192
Project: 135192
Buggy source:
/** 
 * Handles the result of updating an issue's milestone on server. Current implementation includes reverting back to the original labels locally if the server update failed.
 * @param isUpdateSuccessful
 * @param localModifiedIssue
 * @param originalMilestone
 * @return true if the server update is successful
 */
private boolean handleIssueMilestoneUpdateOnServerResult(boolean isUpdateSuccessful,TurboIssue localModifiedIssue,Integer originalMilestone){
  if (isUpdateSuccessful) {
    return true;
  }
  logger.error("String_Node_Str");
  revertLocalMilestoneReplace(localModifiedIssue,originalMilestone);
  return false;
}

Fixed version (ground truth):
/** 
 * Handles the result of updating an issue's milestone on server. Current implementation includes reverting back to the original labels locally if the server update failed.
 * @param isUpdateSuccessful
 * @param localModifiedIssue
 * @param originalMilestone
 * @return true if the server update is successful
 */
private boolean handleIssueMilestoneUpdateOnServerResult(boolean isUpdateSuccessful,TurboIssue localModifiedIssue,Integer originalMilestone){
  if (isUpdateSuccessful)   return true;
  logger.error("String_Node_Str");
  revertLocalMilestoneReplace(localModifiedIssue,originalMilestone);
  return false;
}
Program: 135193
Project: 135193
Buggy source:
public CompletableFuture<Boolean> replaceIssueMilestone(TurboIssue issue,Integer milestone){
  Optional<Integer> originalMilestone=issue.getMilestone();
  logger.info("String_Node_Str" + issue + "String_Node_Str");
  Optional<TurboIssue> localReplaceResult=models.replaceIssueMilestone(issue.getRepoId(),issue.getId(),milestone);
  if (!localReplaceResult.isPresent()) {
    return CompletableFuture.completedFuture(false);
  }
  refreshUI();
  return updateIssueMilestonesOnServer(issue,milestone).thenApply((isUpdateSuccessful) -> handleIssueMilestoneUpdateOnServerResult(isUpdateSuccessful,localReplaceResult.get(),originalMilestone.orElseGet(() -> null)));
}

Fixed version (ground truth):
/** 
 * Replaces existing milestone with the newMilestone in the issue object, the UI, and the server, in that order. Server update is done after the local update to reduce the lag between the user action and the UI response
 * @param issue The issue object whose milestone is to be replaced.
 * @param newMilestone The new milestone to be assigned to the issue
 * @return true if milestone replacement on GitHub was a success, false otherwise.
 */
public CompletableFuture<Boolean> replaceIssueMilestone(TurboIssue issue,Integer newMilestone){
  Optional<Integer> originalMilestone=issue.getMilestone();
  logger.info("String_Node_Str" + issue + "String_Node_Str");
  Optional<TurboIssue> localReplaceResult=models.replaceIssueMilestone(issue.getRepoId(),issue.getId(),newMilestone);
  if (!localReplaceResult.isPresent())   return CompletableFuture.completedFuture(false);
  refreshUI();
  return updateIssueMilestonesOnServer(issue,newMilestone).thenApply((isUpdateSuccessful) -> handleIssueMilestoneUpdateOnServerResult(isUpdateSuccessful,localReplaceResult.get(),originalMilestone.orElseGet(() -> null)));
}
Program: 135194
Project: 135194
Buggy source:
private boolean isExistingMilestone(TurboIssue issue,PickerMilestone milestone){
  if (issue.getMilestone().isPresent()) {
    return issue.getMilestone().get() == milestone.getId();
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
private boolean isExistingMilestone(TurboIssue issue,PickerMilestone milestone){
  if (!issue.getMilestone().isPresent())   return false;
  return issue.getMilestone().get() == milestone.getId();
}
Program: 135195
Project: 135195
Buggy source:
private void updateExistingMilestones(List<PickerMilestone> pickerMilestoneList,FlowPane assignedMilestoneStatus,boolean hasSuggestion){
  if (hasExistingMilestone(pickerMilestoneList)) {
    PickerMilestone existingMilestone=getExistingMilestone(pickerMilestoneList);
    Node existingMilestoneNode=setMouseClickForNode(existingMilestone.getExistingMilestoneNode(hasSuggestion),existingMilestone.getTitle());
    assignedMilestoneStatus.getChildren().add(existingMilestoneNode);
  }
}

Fixed version (ground truth):
private void updateExistingMilestones(List<PickerMilestone> pickerMilestoneList,FlowPane assignedMilestoneStatus,boolean hasSuggestion){
  if (!hasExistingMilestone(pickerMilestoneList))   return;
  PickerMilestone existingMilestone=getExistingMilestone(pickerMilestoneList);
  Node existingMilestoneNode=setMouseClickForNode(existingMilestone.getExistingMilestoneNode(hasSuggestion),existingMilestone.getTitle());
  assignedMilestoneStatus.getChildren().add(existingMilestoneNode);
}
Program: 135196
Project: 135196
Buggy source:
private void highlightFirstMatchingMilestone(){
  if (hasMatchingMilestone(this.currentMilestonesList)) {
    this.currentMilestonesList.stream().filter(milestone -> !milestone.isFaded()).findAny().get().setHighlighted(true);
  }
}

Fixed version (ground truth):
private void highlightFirstMatchingMilestone(){
  if (!hasMatchingMilestone(this.currentMilestonesList))   return;
  this.currentMilestonesList.stream().filter(milestone -> !milestone.isFaded()).findAny().get().setHighlighted(true);
}
Program: 135197
Project: 135197
Buggy source:
private FilterExpression parseExpression(int precedence){
  Token token=consume();
  if (token.getType() == TokenType.EOF) {
    throw new ParseException("String_Node_Str" + sourcePosition + "String_Node_Str"+ position+ "String_Node_Str");
  }
  FilterExpression left;
switch (token.getType()) {
case LBRACKET:
    left=parseGroup();
  break;
case NOT:
left=parseNegation();
break;
case QUALIFIER:
left=parseQualifier(token);
break;
case QUOTED_CONTENT:
left=parseQuotedContent(QualifierType.KEYWORD,token);
break;
case SYMBOL:
left=parseKeyword(token);
break;
default :
throw new ParseException("String_Node_Str" + token);
}
if (lookAhead().getType() == TokenType.EOF) return left;
while (precedence < getInfixPrecedence(token=lookAhead())) {
switch (token.getType()) {
case AND:
consume();
left=parseConjunction(left);
break;
case OR:
consume();
left=parseDisjunction(left);
break;
case QUALIFIER:
case SYMBOL:
case NOT:
case LBRACKET:
left=parseConjunction(left);
break;
default :
throw new ParseException("String_Node_Str" + token);
}
}
return left;
}

Fixed version (ground truth):
private FilterExpression parseExpression(int precedence){
  Token token=consume();
  if (token.getType() == TokenType.EOF) {
    if (isCheckingSyntax) {
      throw new IncompleteInputException();
    }
 else {
      throw new ParseException(String.format("String_Node_Str",sourcePosition));
    }
  }
  FilterExpression left;
switch (token.getType()) {
case LBRACKET:
    left=parseGroup();
  break;
case NOT:
left=parseNegation();
break;
case QUALIFIER:
left=parseQualifier(token);
break;
case QUOTED_CONTENT:
left=parseQuotedContent(QualifierType.KEYWORD,token);
break;
case SYMBOL:
left=parseKeyword(token);
break;
default :
throw new ParseException(String.format("String_Node_Str",token));
}
if (lookAhead().getType() == TokenType.EOF) {
return left;
}
while (precedence < getInfixPrecedence(token=lookAhead())) {
switch (token.getType()) {
case AND:
consume();
left=parseConjunction(left);
break;
case OR:
consume();
left=parseDisjunction(left);
break;
case QUALIFIER:
case SYMBOL:
case NOT:
case LBRACKET:
left=parseConjunction(left);
break;
default :
throw new ParseException("String_Node_Str" + token);
}
}
return left;
}
Program: 135198
Project: 135198
Buggy source:
public static FilterExpression parse(String input){
  if (input == null || input.isEmpty())   return Qualifier.EMPTY;
  return new Parser(new Lexer(input).lex()).parseExpression(0);
}

Fixed version (ground truth):
/** 
 * Parses an input string, returning an abstract syntax tree. Throws a   {@link ParseException} on syntax error.
 */
public static FilterExpression parse(String input){
  if (input.isEmpty()) {
    return Qualifier.EMPTY;
  }
  return new Parser(new Lexer(input).lex(),false).parseExpression(0);
}
Program: 135199
Project: 135199
Buggy source:
private Parser(ArrayList<Token> input){
  this.input=input;
}

Fixed version (ground truth):
private Parser(List<Token> input,boolean isCheckingSyntax){
  this.input=input;
  this.isCheckingSyntax=isCheckingSyntax;
}
Program: 135200
Project: 135200
Buggy source:
private FilterExpression parseQualifierContent(QualifierType type){
  if (type == QualifierType.SORT) {
    return parseSortKeys();
  }
 else   if (isCompoundIdToken(type,lookAhead())) {
    return parseCompoundId();
  }
 else   if (isRangeOperatorToken(lookAhead())) {
    return parseRangeOperator(type,lookAhead());
  }
 else   if (isDateToken(lookAhead())) {
    return parseDateOrDateRange(type);
  }
 else   if (isNumberToken(lookAhead())) {
    return parseNumberOrNumberRange(type);
  }
 else   if (isQuotedContentToken(lookAhead())) {
    Token quotedContent=consume();
    return parseQuotedContent(type,quotedContent);
  }
 else   if (isKeywordToken(lookAhead())) {
    return new Qualifier(type,consume().getValue());
  }
 else {
    throw new ParseException(String.format("String_Node_Str",type,lookAhead()));
  }
}

Fixed version (ground truth):
private FilterExpression parseQualifierContent(QualifierType type){
  if (type == QualifierType.SORT) {
    return parseSortKeys();
  }
 else   if (isCompoundIdToken(type,lookAhead())) {
    return parseCompoundId();
  }
 else   if (isRangeOperatorToken(lookAhead())) {
    return parseRangeOperator(type,lookAhead());
  }
 else   if (isDateToken(lookAhead())) {
    return parseDateOrDateRange(type);
  }
 else   if (isNumberToken(lookAhead())) {
    return parseNumberOrNumberRange(type);
  }
 else   if (isQuotedContentToken(lookAhead())) {
    return parseQuotedContent(type,consume());
  }
 else   if (isKeywordToken(lookAhead())) {
    return new Qualifier(type,consume().getValue());
  }
 else   if (lookAhead().getType() == TokenType.EOF) {
    if (isCheckingSyntax) {
      throw new IncompleteInputException();
    }
 else {
      throw new ParseException(String.format("String_Node_Str",type));
    }
  }
 else {
    throw new ParseException(String.format("String_Node_Str",type,lookAhead()));
  }
}
Program: 135201
Project: 135201
Buggy source:
public ArrayList<Token> lex(){
  ArrayList<Token> result=new ArrayList<>();
  Token previous=null;
  while (position < input.length() && (previous == null || previous.getType() != TokenType.EOF)) {
    previous=nextToken();
    result.add(previous);
  }
  result.add(nextToken());
  return result;
}

Fixed version (ground truth):
public List<Token> lex(){
  List<Token> result=new ArrayList<>();
  Token previous=null;
  while (position < input.length() && (previous == null || previous.getType() != TokenType.EOF)) {
    previous=nextToken();
    result.add(previous);
  }
  result.add(nextToken());
  return result;
}
Program: 135202
Project: 135202
Buggy source:
public FilterTextField(String initialText){
  super(initialText);
  previousText=initialText;
  setup();
}

Fixed version (ground truth):
public FilterTextField(Predicate<String> validation){
  super("String_Node_Str");
  setup(validation);
}
Program: 135203
Project: 135203
Buggy source:
private void setup(){
  setPrefColumnCount(30);
  validationSupport.registerValidator(this,(c,newValue) -> {
    boolean wasError=false;
    try {
      Parser.parse(getText());
      setStyleForValidFilter();
    }
 catch (    ParseException e) {
      wasError=true;
      setStyleForInvalidFilter();
    }
    return ValidationResult.fromErrorIf(this,"String_Node_Str",wasError);
  }
);
  setOnKeyTyped(e -> {
    boolean isModifierKeyPress=e.isAltDown() || e.isMetaDown() || e.isControlDown();
    String key=e.getCharacter();
    if (key == null || key.isEmpty() || isModifierKeyPress) {
      return;
    }
    char typed=e.getCharacter().charAt(0);
    if (typed == '\t') {
      e.consume();
      if (!getSelectedText().isEmpty()) {
        confirmCompletion();
      }
    }
 else     if (Character.isAlphabetic(typed) && shouldStartCompletion()) {
      startCompletion(e);
    }
  }
);
  setOnKeyPressed(e -> {
    if (e.getCode() == KeyCode.TAB) {
      e.consume();
    }
  }
);
  setOnKeyReleased(e -> {
    e.consume();
    if (e.getCode() == KeyCode.ENTER) {
      confirmEdit();
    }
 else     if (e.getCode() == KeyCode.ESCAPE) {
      if (getText().equals(previousText)) {
        onCancel.run();
      }
 else {
        revertEdit();
      }
    }
  }
);
  addEventHandler(KeyEvent.KEY_PRESSED,event -> {
    if (SHOW_DOCS.match(event)) {
      onShowDocs.run();
    }
  }
);
}

Fixed version (ground truth):
private void setup(Predicate<String> validation){
  setPrefColumnCount(30);
  validationSupport.registerValidator(this,(c,newValue) -> {
    boolean isError=!validation.test(getText());
    if (isError) {
      setStyleForInvalidFilter();
    }
 else {
      setStyleForValidFilter();
    }
    return ValidationResult.fromErrorIf(this,"String_Node_Str",isError);
  }
);
  setOnKeyTyped(e -> {
    boolean isModifierKeyPress=e.isAltDown() || e.isMetaDown() || e.isControlDown();
    String key=e.getCharacter();
    if (key == null || key.isEmpty() || isModifierKeyPress) {
      return;
    }
    char typed=e.getCharacter().charAt(0);
    if (typed == '\t') {
      e.consume();
      if (!getSelectedText().isEmpty()) {
        confirmCompletion();
      }
    }
 else     if (Character.isAlphabetic(typed) && shouldStartCompletion()) {
      startCompletion(e);
    }
  }
);
  setOnKeyPressed(e -> {
    if (e.getCode() == KeyCode.TAB) {
      e.consume();
    }
  }
);
  setOnKeyReleased(e -> {
    e.consume();
    if (e.getCode() == KeyCode.ENTER) {
      confirmEdit();
    }
 else     if (e.getCode() == KeyCode.ESCAPE) {
      if (getText().equals(previousText)) {
        onCancel.run();
      }
 else {
        revertEdit();
      }
    }
  }
);
  addEventHandler(KeyEvent.KEY_PRESSED,event -> {
    if (SHOW_DOCS.match(event)) {
      onShowDocs.run();
    }
  }
);
}
Program: 135204
Project: 135204
Buggy source:
private Node createFilterBox(){
  filterTextField=new FilterTextField("String_Node_Str").setOnCancel(this::requestFocus).setOnShowDocs(ui.getBrowserComponent()::showFilterDocs).setOnConfirm((text) -> {
    Platform.runLater(() -> ui.triggerEvent(new ApplyingFilterEvent(this)));
    applyStringFilter(text);
    return text;
  }
);
  filterTextField.setId(guiController.getDefaultRepo() + "String_Node_Str" + panelIndex+ "String_Node_Str");
  filterTextField.setMinWidth(388);
  filterTextField.setMaxWidth(388);
  ui.registerEvent(onModelUpdate);
  filterTextField.setOnMouseClicked(e -> ui.triggerEvent(new PanelClickedEvent(panelIndex)));
  HBox layout=new HBox();
  layout.getChildren().addAll(filterTextField);
  layout.setPadding(new Insets(0,0,3,0));
  setupPanelDragEvents(layout);
  return layout;
}

Fixed version (ground truth):
private Node createFilterBox(){
  filterTextField=new FilterTextField(Parser::check).setOnCancel(this::requestFocus).setOnShowDocs(ui.getBrowserComponent()::showFilterDocs).setOnConfirm((text) -> {
    Platform.runLater(() -> ui.triggerEvent(new ApplyingFilterEvent(this)));
    applyStringFilter(text);
    return text;
  }
);
  filterTextField.setId(guiController.getDefaultRepo() + "String_Node_Str" + panelIndex+ "String_Node_Str");
  filterTextField.setMinWidth(388);
  filterTextField.setMaxWidth(388);
  ui.registerEvent(onModelUpdate);
  filterTextField.setOnMouseClicked(e -> ui.triggerEvent(new PanelClickedEvent(panelIndex)));
  HBox layout=new HBox();
  layout.getChildren().addAll(filterTextField);
  layout.setPadding(new Insets(0,0,3,0));
  setupPanelDragEvents(layout);
  return layout;
}
Program: 135205
Project: 135205
Buggy source:
@Test public void filterTextFieldColor_invalidFilter_invalidFilterStyleApplied(){
  testInvalidFilterStyleApplied("String_Node_Str");
  testInvalidFilterStyleApplied("String_Node_Str");
  testInvalidFilterStyleApplied("String_Node_Str");
  testInvalidFilterStyleApplied("String_Node_Str");
  testInvalidFilterStyleAppliedAfterEnter("String_Node_Str");
}

Fixed version (ground truth):
@Test public void filterTextFieldColor_invalidFilter_invalidFilterStyleApplied(){
  testInvalidFilterStyleApplied("String_Node_Str");
  testInvalidFilterStyleAppliedAfterEnter("String_Node_Str");
}
Program: 135206
Project: 135206
Buggy source:
public ListPanel(UI ui,GUIController guiController,PanelControl parentPanelControl,int panelIndex){
  super(ui,guiController,parentPanelControl,panelIndex);
  this.ui=ui;
  this.guiController=guiController;
  totalLabel=new Label("String_Node_Str");
  listView=new IssueListView();
  setupListView();
  getChildren().add(listView);
  getChildren().add(createPanelStats());
}

Fixed version (ground truth):
public ListPanel(UI ui,GUIController guiController,PanelControl parentPanelControl,int panelIndex){
  super(ui,guiController,parentPanelControl,panelIndex);
  this.ui=ui;
  this.guiController=guiController;
  listView=new IssueListView();
  setupListView();
  getChildren().add(listView);
  getChildren().add(createPanelFooter());
}