nus-yam/ex-repair huggingface dataset:
Program: 135207
Project: 135207
Buggy source:
/** 
 * Refreshes the list of issue cards shown to the user depending on the currently active filter expression in the panel.
 */
@Override public final void refreshItems(){
  final HashSet<Integer> issuesWithNewComments=updateIssueCommentCounts(Qualifier.hasUpdatedQualifier(getCurrentFilterExpression()));
  listView.setCellFactory(list -> new ListPanelCell(this,panelIndex,issuesWithNewComments));
  listView.saveSelection();
  listView.setItems(null);
  listView.setItems(getElementsList());
  issueCount=getElementsList().size();
  listView.restoreSelection();
  this.setId(guiController.getDefaultRepo() + "String_Node_Str" + panelIndex);
  totalLabel.setText(String.format("String_Node_Str",issueCount));
}

Fixed version (ground truth):
/** 
 * Refreshes the list of issue cards shown to the user depending on the currently active filter expression in the panel.
 */
@Override public final void refreshItems(){
  final HashSet<Integer> issuesWithNewComments=updateIssueCommentCounts(Qualifier.hasUpdatedQualifier(getCurrentFilterExpression()));
  listView.setCellFactory(list -> new ListPanelCell(this,panelIndex,issuesWithNewComments));
  listView.saveSelection();
  listView.setItems(null);
  listView.setItems(getElementsList());
  issueCount=getElementsList().size();
  listView.restoreSelection();
  this.setId(guiController.getDefaultRepo() + "String_Node_Str" + panelIndex);
  updateFooter();
}
Program: 135208
Project: 135208
Buggy source:
private void initialiseDialog(Stage stage,TurboIssue issue){
  initOwner(stage);
  initModality(Modality.APPLICATION_MODAL);
  setTitle("String_Node_Str" + (issue.isPullRequest() ? "String_Node_Str" : "String_Node_Str") + issue.getId()+ "String_Node_Str"+ issue.getRepoId());
}

Fixed version (ground truth):
private void initialiseDialog(Stage stage,TurboIssue issue){
  initOwner(stage);
  initModality(Modality.APPLICATION_MODAL);
  setTitle("String_Node_Str" + (issue.isPullRequest() ? "String_Node_Str" : "String_Node_Str") + issue.getId()+ "String_Node_Str"+ issue.getRepoId());
  Platform.runLater(() -> positionDialog(stage));
}
Program: 135209
Project: 135209
Buggy source:
private PickerLabel processSuggestedLabel(String suggestedLabel){
  return getStyledPickerLabel(getRepoTurboLabel(suggestedLabel),true,false,false,false,false);
}

Fixed version (ground truth):
private PickerLabel processSuggestedLabel(String suggestedLabel){
  return getStyledPickerLabel(getRepoTurboLabel(suggestedLabel),true,false,false,false,true);
}
Program: 135210
Project: 135210
Buggy source:
private PickerLabel processInitialLabel(String initialLabel,List<String> removedLabels,Optional<String> suggestion){
  TurboLabel repoInitialLabel=getRepoTurboLabel(initialLabel);
  if (!removedLabels.contains(initialLabel) && !suggestion.isPresent()) {
    return getStyledPickerLabel(repoInitialLabel,false,false,false,false,true);
  }
  if (!removedLabels.contains(initialLabel) && suggestion.isPresent() && initialLabel.equals(suggestion.get())) {
    return getStyledPickerLabel(repoInitialLabel,true,false,true,false,true);
  }
  if (removedLabels.contains(initialLabel) && !suggestion.isPresent()) {
    return getStyledPickerLabel(repoInitialLabel,false,false,true,false,true);
  }
  if (removedLabels.contains(initialLabel) && suggestion.isPresent() && initialLabel.equals(suggestion.get())) {
    return getStyledPickerLabel(repoInitialLabel,true,false,false,false,true);
  }
  return getStyledPickerLabel(repoInitialLabel,false,false,false,false,true);
}

Fixed version (ground truth):
private PickerLabel processInitialLabel(String initialLabel,List<String> removedLabels,Optional<String> suggestion){
  TurboLabel repoInitialLabel=getRepoTurboLabel(initialLabel);
  if (!removedLabels.contains(initialLabel)) {
    if (suggestion.isPresent() && initialLabel.equals(suggestion.get())) {
      return getStyledPickerLabel(repoInitialLabel,true,false,true,false,true);
    }
    return getStyledPickerLabel(repoInitialLabel,false,false,false,false,true);
  }
  if (suggestion.isPresent() && initialLabel.equals(suggestion.get())) {
    return getStyledPickerLabel(repoInitialLabel,true,false,false,false,true);
  }
  return getStyledPickerLabel(repoInitialLabel,false,false,true,false,true);
}
Program: 135211
Project: 135211
Buggy source:
private void positionDialog(Stage stage){
  if (!Double.isNaN(getHeight())) {
    setX(stage.getX() + stage.getScene().getX());
    setY(stage.getY() + stage.getScene().getY() + (stage.getScene().getHeight() - getHeight()) / 2);
  }
}

Fixed version (ground truth):
private void positionDialog(Stage stage){
  if (getDialogHeight().isPresent()) {
    setX(stage.getX() + stage.getScene().getX());
    setY(stage.getY() + stage.getScene().getY() + (stage.getScene().getHeight() - getHeight()) / 2);
  }
}
Program: 135212
Project: 135212
Buggy source:
private void createMainLayout() throws IOException {
  FXMLLoader loader=new FXMLLoader(UI.class.getResource("String_Node_Str"));
  loader.setController(this);
  mainLayout=(VBox)loader.load();
}

Fixed version (ground truth):
private void createMainLayout(){
  FXMLLoader loader=new FXMLLoader(UI.class.getResource("String_Node_Str"));
  loader.setController(this);
  try {
    mainLayout=(VBox)loader.load();
  }
 catch (  IOException e) {
    logger.error("String_Node_Str" + e.getMessage());
    close();
  }
}
Program: 135213
Project: 135213
Buggy source:
private void setDialogPaneContent(TurboIssue issue){
  try {
    createMainLayout();
    setTitleLabel(issue);
    getDialogPane().setContent(mainLayout);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
private void setDialogPaneContent(TurboIssue issue){
  createMainLayout();
  setTitleLabel(issue);
  getDialogPane().setContent(mainLayout);
}
Program: 135214
Project: 135214
Buggy source:
/** 
 * To return the repo's TurboLabel that contains labelName <p> labelName MUST match a repo label's name
 * @param labelName
 * @return
 */
private TurboLabel getRepoTurboLabel(String labelName){
  assert(repoLabels.stream().filter(label -> label.getActualName().equals(labelName)).findFirst().isPresent());
  return repoLabels.stream().filter(label -> label.getActualName().equals(labelName)).findFirst().get();
}

Fixed version (ground truth):
/** 
 * To return the repo's TurboLabel that contains labelName <p> labelName MUST match a repo label's name
 * @param labelName
 * @return
 */
private TurboLabel getRepoTurboLabel(String labelName){
}
Program: 135215
Project: 135215
Buggy source:
private void populateGrouplessLabels(List<String> finalLabels,List<String> matchedLabels,Optional<String> suggestion){
  FlowPane groupless=createGroupPane(GROUPLESS_PAD);
  repoLabels.stream().filter(label -> !label.getGroup().isPresent()).map(label -> new PickerLabel(this,label,false)).forEach(label -> groupless.getChildren().add(processMatchedLabel(label.getActualName(),matchedLabels,finalLabels,suggestion).getNode()));
  if (!groupless.getChildren().isEmpty())   feedbackLabels.getChildren().add(groupless);
}

Fixed version (ground truth):
private void populateGrouplessLabels(List<String> finalLabels,List<String> matchedLabels,Optional<String> suggestion){
  FlowPane groupless=createGroupPane(GROUPLESS_PAD);
  repoLabels.stream().filter(label -> !label.getGroup().isPresent()).map(label -> new PickerLabel(label,false)).forEach(label -> groupless.getChildren().add(processMatchedLabel(label.getActualName(),matchedLabels,finalLabels,suggestion)));
  if (!groupless.getChildren().isEmpty())   feedbackLabels.getChildren().add(groupless);
}
Program: 135216
Project: 135216
Buggy source:
void handleLabelClick(PickerLabel label){
  if (!queryField.isDisabled()) {
    queryField.setDisable(true);
  }
  finalAssignedLabels=updateFinalAssignedLabels(label);
  populatePanes(new ArrayList<>(),Optional.empty());
}

Fixed version (ground truth):
private void handleLabelClick(PickerLabel label){
  if (!queryField.isDisabled()) {
    queryField.setDisable(true);
  }
  finalAssignedLabels=updateFinalAssignedLabels(label);
  populatePanes(getCleanState(finalAssignedLabels,getRepoLabelsSet()));
}
Program: 135217
Project: 135217
Buggy source:
private boolean hasNewSuggestion(List<String> addedLabels,Optional<String> suggestion){
  return suggestion.isPresent() && !initialLabels.contains(suggestion.get()) && !addedLabels.contains(suggestion.get());
}

Fixed version (ground truth):
private boolean hasNewSuggestion(List<String> addedLabels,Optional<String> suggestion){
  return suggestion.isPresent() && !(issue.getLabels()).contains(suggestion.get()) && !addedLabels.contains(suggestion.get());
}
Program: 135218
Project: 135218
Buggy source:
private void populateAddedLabels(List<String> addedLabels,Optional<String> suggestion){
  addedLabels.stream().forEach(label -> {
    assignedLabels.getChildren().add(processAddedLabel(label,suggestion).getNode());
  }
);
}

Fixed version (ground truth):
private void populateAddedLabels(List<String> addedLabels,Optional<String> suggestion){
  addedLabels.stream().forEach(label -> {
    assignedLabels.getChildren().add(processAddedLabel(label,suggestion));
  }
);
}
Program: 135219
Project: 135219
Buggy source:
private PickerLabel processSuggestedLabel(String suggestedLabel){
  return getStyledPickerLabel(getRepoTurboLabel(suggestedLabel),true,false,false,false,true);
}

Fixed version (ground truth):
private Node processSuggestedLabel(String suggestedLabel){
  return getStyledPickerLabel(getRepoTurboLabel(suggestedLabel),true,false,false,false,true);
}
Program: 135220
Project: 135220
Buggy source:
private PickerLabel getStyledPickerLabel(TurboLabel label,boolean isFaded,boolean isHighlighted,boolean isRemoved,boolean isSelected,boolean isTop){
  PickerLabel styledLabel=new PickerLabel(this,label,isTop);
  styledLabel.setIsFaded(isFaded);
  styledLabel.setIsHighlighted(isHighlighted);
  styledLabel.setIsRemoved(isRemoved);
  styledLabel.setIsSelected(isSelected);
  return styledLabel;
}

Fixed version (ground truth):
private Node getStyledPickerLabel(TurboLabel label,boolean isFaded,boolean isHighlighted,boolean isRemoved,boolean isSelected,boolean isTop){
  PickerLabel styledLabel=new PickerLabel(label,isTop);
  styledLabel.setIsFaded(isFaded);
  styledLabel.setIsHighlighted(isHighlighted);
  styledLabel.setIsRemoved(isRemoved);
  styledLabel.setIsSelected(isSelected);
  Node node=styledLabel.getNode();
  node.setOnMouseClicked(e -> handleLabelClick(styledLabel));
  return node;
}
Program: 135221
Project: 135221
Buggy source:
private Map<String,FlowPane> getGroupContent(List<String> finalLabels,List<String> matchedLabels,Optional<String> suggestion){
  Map<String,FlowPane> groupContent=new HashMap<>();
  repoLabels.stream().sorted().filter(label -> label.getGroup().isPresent()).map(label -> new PickerLabel(this,label,false)).forEach(label -> {
    String group=label.getGroupName().get();
    if (!groupContent.containsKey(group)) {
      groupContent.put(group,createGroupPane(GROUP_PAD));
    }
    groupContent.get(group).getChildren().add(processMatchedLabel(label.getActualName(),matchedLabels,finalLabels,suggestion).getNode());
  }
);
  return groupContent;
}

Fixed version (ground truth):
private Map<String,FlowPane> getGroupContent(List<String> finalLabels,List<String> matchedLabels,Optional<String> suggestion){
  Map<String,FlowPane> groupContent=new HashMap<>();
  repoLabels.stream().sorted().filter(label -> label.getGroup().isPresent()).map(label -> new PickerLabel(label,false)).forEach(label -> {
    String group=label.getGroupName().get();
    if (!groupContent.containsKey(group)) {
      groupContent.put(group,createGroupPane(GROUP_PAD));
    }
    groupContent.get(group).getChildren().add(processMatchedLabel(label.getActualName(),matchedLabels,finalLabels,suggestion));
  }
);
  return groupContent;
}
Program: 135222
Project: 135222
Buggy source:
/** 
 * Populate respective panes with labels that matches current query
 * @param matchedLabels
 * @param suggestion
 */
public void populatePanes(LabelPickerState state){
  populateAssignedLabels(state);
  populateFeedbackLabels(state.getAssignedLabels(),state.getMatchedLabels(),state.getCurrentSuggestion());
}

Fixed version (ground truth):
/** 
 * Populate respective panes with labels that matches current query
 * @param matchedLabels
 * @param suggestion
 */
private void populatePanes(LabelPickerState state){
  populateAssignedLabels(state);
  populateFeedbackLabels(state.getAssignedLabels(),state.getMatchedLabels(),state.getCurrentSuggestion());
}
Program: 135223
Project: 135223
Buggy source:
private void populateSuggestedLabel(List<String> addedLabels,Optional<String> suggestion){
  if (hasNewSuggestion(addedLabels,suggestion)) {
    assignedLabels.getChildren().add(processSuggestedLabel(suggestion.get()).getNode());
  }
}

Fixed version (ground truth):
private void populateSuggestedLabel(List<String> addedLabels,Optional<String> suggestion){
  if (hasNewSuggestion(addedLabels,suggestion)) {
    assignedLabels.getChildren().add(processSuggestedLabel(suggestion.get()));
  }
}
Program: 135224
Project: 135224
Buggy source:
private PickerLabel processInitialLabel(String initialLabel,List<String> removedLabels,Optional<String> suggestion){
  TurboLabel repoInitialLabel=getRepoTurboLabel(initialLabel);
  if (!removedLabels.contains(initialLabel)) {
    if (suggestion.isPresent() && initialLabel.equals(suggestion.get())) {
      return getStyledPickerLabel(repoInitialLabel,true,false,true,false,true);
    }
    return getStyledPickerLabel(repoInitialLabel,false,false,false,false,true);
  }
  if (suggestion.isPresent() && initialLabel.equals(suggestion.get())) {
    return getStyledPickerLabel(repoInitialLabel,true,false,false,false,true);
  }
  return getStyledPickerLabel(repoInitialLabel,false,false,true,false,true);
}

Fixed version (ground truth):
private Node processInitialLabel(String initialLabel,List<String> removedLabels,Optional<String> suggestion){
  TurboLabel repoInitialLabel=getRepoTurboLabel(initialLabel);
  if (!removedLabels.contains(initialLabel)) {
    if (suggestion.isPresent() && initialLabel.equals(suggestion.get())) {
      return getStyledPickerLabel(repoInitialLabel,true,false,true,false,true);
    }
    return getStyledPickerLabel(repoInitialLabel,false,false,false,false,true);
  }
  if (suggestion.isPresent() && initialLabel.equals(suggestion.get())) {
    return getStyledPickerLabel(repoInitialLabel,true,false,false,false,true);
  }
  return getStyledPickerLabel(repoInitialLabel,false,false,true,false,true);
}
Program: 135225
Project: 135225
Buggy source:
private void registerQueryHandler(){
  queryField.textProperty().addListener((observable,oldValue,newValue) -> {
    LabelPickerState state=uiLogic.determineState(getCleanState(initialLabels,getRepoLabelsSet()),repoLabelsSet,queryField.getText().toLowerCase());
    finalAssignedLabels=state.getAssignedLabels();
    populatePanes(state);
  }
);
}

Fixed version (ground truth):
private void registerQueryHandler(){
  queryField.textProperty().addListener((observable,oldValue,newValue) -> {
    LabelPickerState state=uiLogic.determineState(getCleanState(issue.getLabels(),getRepoLabelsSet()),getRepoLabelsSet(),queryField.getText().toLowerCase());
    finalAssignedLabels=state.getAssignedLabels();
    populatePanes(state);
  }
);
}
Program: 135226
Project: 135226
Buggy source:
private void populateInitialLabels(List<String> initialLabels,List<String> removedLabels,Optional<String> suggestion){
  initialLabels.stream().forEach(label -> assignedLabels.getChildren().add(processInitialLabel(label,removedLabels,suggestion).getNode()));
}

Fixed version (ground truth):
private void populateInitialLabels(List<String> initialLabels,List<String> removedLabels,Optional<String> suggestion){
  initialLabels.stream().forEach(label -> assignedLabels.getChildren().add(processInitialLabel(label,removedLabels,suggestion)));
}
Program: 135227
Project: 135227
Buggy source:
private PickerLabel processAddedLabel(String addedLabel,Optional<String> suggestion){
  if (!suggestion.isPresent() || !addedLabel.equals(suggestion.get())) {
    return getStyledPickerLabel(getRepoTurboLabel(addedLabel),false,false,false,false,true);
  }
  return getStyledPickerLabel(getRepoTurboLabel(addedLabel),true,false,true,false,true);
}

Fixed version (ground truth):
private Node processAddedLabel(String addedLabel,Optional<String> suggestion){
  if (!suggestion.isPresent() || !addedLabel.equals(suggestion.get())) {
    return getStyledPickerLabel(getRepoTurboLabel(addedLabel),false,false,false,false,true);
  }
  return getStyledPickerLabel(getRepoTurboLabel(addedLabel),true,false,true,false,true);
}
Program: 135228
Project: 135228
Buggy source:
private PickerLabel processMatchedLabel(String repoLabel,List<String> matchedLabels,List<String> assignedLabels,Optional<String> suggestion){
  boolean shouldHighlight=(suggestion.isPresent()) ? suggestion.get().equals(repoLabel) : false;
  PickerLabel label=getStyledPickerLabel(getRepoTurboLabel(repoLabel),!matchedLabels.contains(repoLabel),shouldHighlight,false,assignedLabels.contains(repoLabel),false);
  return label;
}

Fixed version (ground truth):
private Node processMatchedLabel(String repoLabel,List<String> matchedLabels,List<String> assignedLabels,Optional<String> suggestion){
  boolean shouldHighlight=suggestion.isPresent() && suggestion.get().equals(repoLabel);
  return getStyledPickerLabel(getRepoTurboLabel(repoLabel),!matchedLabels.contains(repoLabel),shouldHighlight,false,assignedLabels.contains(repoLabel),false);
}
Program: 135229
Project: 135229
Buggy source:
public PickerLabel(LabelPickerDialog presenter,TurboLabel label,boolean isTop){
  super(label.getRepoId(),label.getColour(),label.getActualName());
  this.presenter=presenter;
  isSelected=false;
  isHighlighted=false;
  isRemoved=false;
  isFaded=false;
  this.isTop=isTop;
}

Fixed version (ground truth):
public PickerLabel(TurboLabel label,boolean isTop){
  super(label.getRepoId(),label.getColour(),label.getActualName());
  isSelected=false;
  isHighlighted=false;
  isRemoved=false;
  isFaded=false;
  this.isTop=isTop;
}
Program: 135230
Project: 135230
Buggy source:
@Override public Node getNode(){
  Label label=new Label((isTop ? getActualName() : getName()));
  label.getStyleClass().add("String_Node_Str");
  if (isRemoved)   label.getStyleClass().add("String_Node_Str");
  String style=getStyle() + (isHighlighted ? "String_Node_Str" : "String_Node_Str");
  style+=(isFaded ? "String_Node_Str" : "String_Node_Str");
  label.setStyle(style);
  FontLoader fontLoader=Toolkit.getToolkit().getFontLoader();
  double width=(double)fontLoader.computeStringWidth(label.getText(),label.getFont());
  label.setPrefWidth(width + 30);
  label.setText(label.getText() + (!isTop && isSelected ? "String_Node_Str" : "String_Node_Str"));
  if (getGroup().isPresent()) {
    Tooltip groupTooltip=new Tooltip(getGroup().get());
    label.setTooltip(groupTooltip);
  }
  label.setOnMouseClicked(e -> {
    presenter.handleLabelClick(this);
  }
);
  return label;
}

Fixed version (ground truth):
@Override public Node getNode(){
  Label label=new Label((isTop ? getActualName() : getName()));
  label.getStyleClass().add("String_Node_Str");
  if (isRemoved)   label.getStyleClass().add("String_Node_Str");
  String style=getStyle() + (isHighlighted ? "String_Node_Str" : "String_Node_Str");
  style+=(isFaded ? "String_Node_Str" : "String_Node_Str");
  label.setStyle(style);
  FontLoader fontLoader=Toolkit.getToolkit().getFontLoader();
  double width=(double)fontLoader.computeStringWidth(label.getText(),label.getFont());
  label.setPrefWidth(width + 30);
  label.setText(label.getText() + (!isTop && isSelected ? "String_Node_Str" : "String_Node_Str"));
  if (getGroup().isPresent()) {
    Tooltip groupTooltip=new Tooltip(getGroup().get());
    label.setTooltip(groupTooltip);
  }
  return label;
}
Program: 135231
Project: 135231
Buggy source:
private LabelPickerState handleCharAddition(LabelPickerState currentState,String currentString){
  return currentState.updateMatchedLabels(repoLabels,currentString);
}

Fixed version (ground truth):
private LabelPickerState handleCharAddition(LabelPickerState currentState,String currentString){
  String[] keywords=currentString.split("String_Node_Str");
  if (keywords.length > 0) {
    return currentState.updateMatchedLabels(repoLabels,keywords[keywords.length - 1]);
  }
 else {
    return currentState.updateMatchedLabels(repoLabels,"String_Node_Str");
  }
}
Program: 135232
Project: 135232
Buggy source:
private String getName(String name){
  if (hasGroup(name)) {
    return name.substring(name.indexOf(TurboLabel.getDelimiter(name).get()) - 1);
  }
 else {
    return name;
  }
}

Fixed version (ground truth):
private String getName(String name){
  if (hasGroup(name)) {
    return name.substring(name.indexOf(TurboLabel.getDelimiter(name).get()) + 1);
  }
 else {
    return name;
  }
}
Program: 135233
Project: 135233
Buggy source:
private List<String> filterByName(List<String> repoLabels,String labelName){
  return repoLabels.stream().filter(name -> Utility.containsIgnoreCase(getGroup(name),labelName)).collect(Collectors.toList());
}

Fixed version (ground truth):
private List<String> filterByName(List<String> repoLabels,String labelName){
  return repoLabels.stream().filter(name -> Utility.containsIgnoreCase(getName(name),labelName)).collect(Collectors.toList());
}
Program: 135234
Project: 135234
Buggy source:
public LabelPickerState updateMatchedLabels(Set<String> repoLabels,String query){
  List<String> newMatchedLabels=convertToList(repoLabels);
  newMatchedLabels=filterByName(newMatchedLabels,getName(query));
  newMatchedLabels=filterByGroup(newMatchedLabels,getGroup(query));
  return new LabelPickerState(initialLabels,addedLabels,removedLabels,newMatchedLabels,currentSuggestionIndex);
}

Fixed version (ground truth):
public LabelPickerState updateMatchedLabels(Set<String> repoLabels,String query){
  List<String> newMatchedLabels=convertToList(repoLabels);
  newMatchedLabels=filterByName(newMatchedLabels,getName(query));
  newMatchedLabels=filterByGroup(newMatchedLabels,getGroup(query));
  OptionalInt newSuggestionIndex;
  if (newMatchedLabels.isEmpty()) {
    newSuggestionIndex=currentSuggestionIndex;
  }
 else {
    newSuggestionIndex=OptionalInt.of(0);
  }
  return new LabelPickerState(initialLabels,addedLabels,removedLabels,newMatchedLabels,newSuggestionIndex);
}
Program: 135235
Project: 135235
Buggy source:
@Override public Node getNode(){
  Label label=new Label((isTop ? getActualName() : getName()));
  label.getStyleClass().add("String_Node_Str");
  if (isRemoved)   label.getStyleClass().add("String_Node_Str");
  String style=getStyle() + (isHighlighted ? "String_Node_Str" : "String_Node_Str");
  style+=(isFaded ? "String_Node_Str" : "String_Node_Str");
  label.setStyle(style);
  FontLoader fontLoader=Toolkit.getToolkit().getFontLoader();
  double width=(double)fontLoader.computeStringWidth(label.getText(),label.getFont());
  label.setPrefWidth(width + 30);
  label.setText(label.getText() + (!isTop && isSelected ? "String_Node_Str" : "String_Node_Str"));
  if (getGroup().isPresent()) {
    Tooltip groupTooltip=new Tooltip(getGroup().get());
    label.setTooltip(groupTooltip);
  }
  label.setOnMouseClicked(e -> labelPickerUILogic.toggleLabel(getActualName()));
  return label;
}

Fixed version (ground truth):
@Override public Node getNode(){
  Label label=new Label((isTop ? getActualName() : getName()));
  label.getStyleClass().add("String_Node_Str");
  if (isRemoved)   label.getStyleClass().add("String_Node_Str");
  String style=getStyle() + (isHighlighted ? "String_Node_Str" : "String_Node_Str");
  style+=(isFaded ? "String_Node_Str" : "String_Node_Str");
  label.setStyle(style);
  FontLoader fontLoader=Toolkit.getToolkit().getFontLoader();
  double width=(double)fontLoader.computeStringWidth(label.getText(),label.getFont());
  label.setPrefWidth(width + 30);
  label.setText(label.getText() + (!isTop && isSelected ? "String_Node_Str" : "String_Node_Str"));
  if (getGroup().isPresent()) {
    Tooltip groupTooltip=new Tooltip(getGroup().get());
    label.setTooltip(groupTooltip);
  }
  return label;
}
Program: 135236
Project: 135236
Buggy source:
private List<String> convertToList(Set<String> labelSet){
  List<String> resultingList=new ArrayList<>();
  resultingList.addAll(initialLabels);
  return resultingList;
}

Fixed version (ground truth):
private List<String> convertToList(Set<String> labelSet){
  List<String> resultingList=new ArrayList<>();
  resultingList.addAll(labelSet);
  return resultingList;
}
Program: 135237
Project: 135237
Buggy source:
public SemanticException(QualifierType type,String details){
  super(String.format(ERR_MSG,type,details));
  System.out.println(String.format(ERR_MSG,type,details));
}

Fixed version (ground truth):
public SemanticException(QualifierType type,String details){
  super(String.format(ERROR_MESSAGE,type,details));
}
Program: 135238
Project: 135238
Buggy source:
private boolean satisfiesCreationDate(TurboIssue issue){
  LocalDate creationDate=issue.getCreatedAt().toLocalDate();
  if (date.isPresent()) {
    return creationDate.isEqual(date.get());
  }
 else   if (dateRange.isPresent()) {
    return dateRange.get().encloses(creationDate);
  }
 else {
    throw new SemanticException(type,type.getValidInputs());
  }
}

Fixed version (ground truth):
private boolean satisfiesCreationDate(TurboIssue issue){
  LocalDate creationDate=issue.getCreatedAt().toLocalDate();
  if (date.isPresent()) {
    return creationDate.isEqual(date.get());
  }
 else   if (dateRange.isPresent()) {
    return dateRange.get().encloses(creationDate);
  }
 else {
    throw new SemanticException(type,type.getDescriptionOfValidInputs());
  }
}
Program: 135239
Project: 135239
Buggy source:
private boolean stateSatisfies(TurboIssue issue){
  if (!content.isPresent())   return false;
  String content=this.content.get().toLowerCase();
  if (content.contains("String_Node_Str")) {
    return issue.isOpen();
  }
 else   if (content.contains("String_Node_Str")) {
    return !issue.isOpen();
  }
 else {
    throw new SemanticException(type,type.getValidInputs());
  }
}

Fixed version (ground truth):
private boolean stateSatisfies(TurboIssue issue){
  if (!content.isPresent())   return false;
  String content=this.content.get().toLowerCase();
  if (content.contains("String_Node_Str")) {
    return issue.isOpen();
  }
 else   if (content.contains("String_Node_Str")) {
    return !issue.isOpen();
  }
 else {
    throw new SemanticException(type,type.getDescriptionOfValidInputs());
  }
}
Program: 135240
Project: 135240
Buggy source:
private boolean typeSatisfies(TurboIssue issue){
  if (!content.isPresent())   return false;
  String content=this.content.get().toLowerCase();
switch (content) {
case "String_Node_Str":
    return !issue.isPullRequest();
case "String_Node_Str":
case "String_Node_Str":
  return issue.isPullRequest();
default :
throw new SemanticException(type,type.getValidInputs());
}
}

Fixed version (ground truth):
private boolean typeSatisfies(TurboIssue issue){
  if (!content.isPresent())   return false;
  String content=this.content.get().toLowerCase();
switch (content) {
case "String_Node_Str":
    return !issue.isPullRequest();
case "String_Node_Str":
case "String_Node_Str":
  return issue.isPullRequest();
default :
throw new SemanticException(type,type.getDescriptionOfValidInputs());
}
}
Program: 135241
Project: 135241
Buggy source:
private boolean satisfiesUpdatedHours(TurboIssue issue){
  NumberRange updatedRange;
  if (numberRange.isPresent()) {
    updatedRange=numberRange.get();
  }
 else   if (number.isPresent()) {
    updatedRange=new NumberRange(null,number.get(),true);
  }
 else {
    throw new SemanticException(type,type.getValidInputs());
  }
  LocalDateTime dateOfUpdate=issue.getUpdatedAt();
  int hoursSinceUpdate=Utility.safeLongToInt(dateOfUpdate.until(getCurrentTime(),ChronoUnit.HOURS));
  return updatedRange.encloses(hoursSinceUpdate);
}

Fixed version (ground truth):
private boolean satisfiesUpdatedHours(TurboIssue issue){
  NumberRange updatedRange;
  if (numberRange.isPresent()) {
    updatedRange=numberRange.get();
  }
 else   if (number.isPresent()) {
    updatedRange=new NumberRange(null,number.get(),true);
  }
 else {
    throw new SemanticException(type,type.getDescriptionOfValidInputs());
  }
  LocalDateTime dateOfUpdate=issue.getUpdatedAt();
  int hoursSinceUpdate=Utility.safeLongToInt(dateOfUpdate.until(getCurrentTime(),ChronoUnit.HOURS));
  return updatedRange.encloses(hoursSinceUpdate);
}
Program: 135242
Project: 135242
Buggy source:
private boolean idSatisfies(TurboIssue issue){
  if (number.isPresent()) {
    return issue.getId() == number.get();
  }
 else   if (numberRange.isPresent()) {
    return numberRange.get().encloses(issue.getId());
  }
  throw new SemanticException(type,type.getValidInputs());
}

Fixed version (ground truth):
private boolean idSatisfies(TurboIssue issue){
  if (number.isPresent()) {
    return issue.getId() == number.get();
  }
 else   if (numberRange.isPresent()) {
    return numberRange.get().encloses(issue.getId());
  }
  throw new SemanticException(type,type.getDescriptionOfValidInputs());
}
Program: 135243
Project: 135243
Buggy source:
private boolean satisfiesIsConditions(TurboIssue issue){
  if (!content.isPresent())   return false;
switch (content.get()) {
case "String_Node_Str":
case "String_Node_Str":
    return stateSatisfies(issue);
case "String_Node_Str":
case "String_Node_Str":
  return typeSatisfies(issue);
case "String_Node_Str":
return issue.isPullRequest() && !issue.isOpen();
case "String_Node_Str":
return issue.isPullRequest() && issue.isOpen();
case "String_Node_Str":
return issue.isCurrentlyRead();
case "String_Node_Str":
return !issue.isCurrentlyRead();
default :
throw new SemanticException(type,type.getValidInputs());
}
}

Fixed version (ground truth):
private boolean satisfiesIsConditions(TurboIssue issue){
  if (!content.isPresent())   return false;
switch (content.get()) {
case "String_Node_Str":
case "String_Node_Str":
    return stateSatisfies(issue);
case "String_Node_Str":
case "String_Node_Str":
  return typeSatisfies(issue);
case "String_Node_Str":
return issue.isPullRequest() && !issue.isOpen();
case "String_Node_Str":
return issue.isPullRequest() && issue.isOpen();
case "String_Node_Str":
return issue.isCurrentlyRead();
case "String_Node_Str":
return !issue.isCurrentlyRead();
default :
throw new SemanticException(type,type.getDescriptionOfValidInputs());
}
}
Program: 135244
Project: 135244
Buggy source:
private void applyStringFilter(String filterString){
  try {
    FilterExpression filter=Parser.parse(filterString);
    if (filter != null) {
      this.applyFilterExpression(filter);
    }
 else {
      this.applyFilterExpression(Qualifier.EMPTY);
    }
  }
 catch (  FilterException ex) {
    this.applyFilterExpression(Qualifier.EMPTY);
    UI.status.displayMessage("String_Node_Str" + (panelIndex + 1) + "String_Node_Str"+ ex.getMessage());
  }
}

Fixed version (ground truth):
private void applyStringFilter(String filterString){
  try {
    FilterExpression filter=Parser.parse(filterString);
    if (filter != null) {
      this.applyFilterExpression(filter);
    }
 else {
      this.applyFilterExpression(Qualifier.EMPTY);
    }
  }
 catch (  FilterException ex) {
    this.applyFilterExpression(Qualifier.EMPTY);
    UI.status.displayMessage(getUniquePanelName(panelMenuBar.getPanelName()) + "String_Node_Str" + ex.getMessage());
  }
}
Program: 135245
Project: 135245
Buggy source:
@Test public void invalidNo(){
  expectSemanticException(QualifierType.NO,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void invalidNo(){
  verifySemanticException(QualifierType.NO,"String_Node_Str");
}
Program: 135246
Project: 135246
Buggy source:
@Test public void invalidUpdated(){
  expectSemanticException(QualifierType.UPDATED,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void invalidUpdated(){
  verifySemanticException(QualifierType.UPDATED,"String_Node_Str");
}
Program: 135247
Project: 135247
Buggy source:
@Test public void invalidState(){
  expectSemanticException(QualifierType.STATE,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void invalidState(){
  verifySemanticException(QualifierType.STATE,"String_Node_Str");
}
Program: 135248
Project: 135248
Buggy source:
@Test public void invalidIs(){
  expectSemanticException(QualifierType.IS,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void invalidIs(){
  verifySemanticException(QualifierType.IS,"String_Node_Str");
}
Program: 135249
Project: 135249
Buggy source:
@Test public void invalidType(){
  expectSemanticException(QualifierType.TYPE,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void invalidType(){
  verifySemanticException(QualifierType.TYPE,"String_Node_Str");
}
Program: 135250
Project: 135250
Buggy source:
@Test public void invalidId(){
  expectSemanticException(QualifierType.ID,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void invalidId(){
  verifySemanticException(QualifierType.ID,"String_Node_Str");
}
Program: 135251
Project: 135251
Buggy source:
@Test public void invalidCreated(){
  expectSemanticException(QualifierType.CREATED,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void invalidCreated(){
  verifySemanticException(QualifierType.CREATED,"String_Node_Str");
}
Program: 135252
Project: 135252
Buggy source:
@Test public void invalidHas(){
  expectSemanticException(QualifierType.HAS,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void invalidHas(){
  verifySemanticException(QualifierType.HAS,"String_Node_Str");
}
Program: 135253
Project: 135253
Buggy source:
private void addListener(){
  nameField.textProperty().addListener(c -> {
    String newName=nameField.getText().trim();
    if (nameField.getText().length() > BOARD_MAX_NAME_LENGTH) {
      nameField.setText(previousText);
      errorText.setText(ERROR_LONG_NAME);
      submitButton.setDisable(false);
    }
 else     if (isBoardNameInvalid(newName)) {
      errorText.setText(ERROR_INVALID_NAME);
      submitButton.setDisable(true);
    }
 else     if (isBoardNameEmpty(newName)) {
      errorText.setText(ERROR_EMPTY_NAME);
      submitButton.setDisable(true);
    }
 else     if (isBoardNameDuplicate(newName)) {
      errorText.setText(WARNING_DUPLICATE_NAME);
      submitButton.setDisable(false);
    }
 else {
      errorText.setText("String_Node_Str");
      submitButton.setDisable(false);
    }
    previousText=nameField.getText();
  }
);
}

Fixed version (ground truth):
private void addListener(){
  nameField.textProperty().addListener(c -> {
    String newName=nameField.getText().trim();
    if (nameField.getText().length() > BOARD_MAX_NAME_LENGTH) {
      nameField.setText(previousText);
      errorText.setText(String.format(ERROR_LONG_NAME,BOARD_MAX_NAME_LENGTH));
      submitButton.setDisable(false);
    }
 else     if (isBoardNameInvalid(newName)) {
      errorText.setText(ERROR_INVALID_NAME);
      submitButton.setDisable(true);
    }
 else     if (isBoardNameEmpty(newName)) {
      errorText.setText(ERROR_EMPTY_NAME);
      submitButton.setDisable(true);
    }
 else     if (isBoardNameDuplicate(newName)) {
      errorText.setText(WARNING_DUPLICATE_NAME);
      submitButton.setDisable(false);
    }
 else {
      errorText.setText("String_Node_Str");
      submitButton.setDisable(false);
    }
    previousText=nameField.getText();
  }
);
}
Program: 135254
Project: 135254
Buggy source:
private static Optional<Integer> getCurrentMilestoneIndex(List<TurboMilestone> allMilestones){
  if (allMilestones.isEmpty()) {
    return Optional.empty();
  }
  int currentIndex=0;
  for (  TurboMilestone checker : allMilestones) {
    if (checker.isOpen() && isRelevantMilestone(checker)) {
      return Optional.of(currentIndex);
    }
    currentIndex++;
  }
  return Optional.of(allMilestones.size());
}

Fixed version (ground truth):
private static Optional<Integer> getCurrentMilestoneIndex(List<TurboMilestone> allMilestones){
  if (allMilestones.isEmpty()) {
    return Optional.empty();
  }
  Optional<TurboMilestone> openAndRelevantMilestone=allMilestones.stream().filter(ms -> ms.isOpen() && isRelevantMilestone(ms)).findFirst();
  if (openAndRelevantMilestone.isPresent()) {
    return Optional.of(allMilestones.indexOf(openAndRelevantMilestone.get()));
  }
 else {
    int currentIndex=0;
    for (    TurboMilestone checker : allMilestones) {
      if (checker.isOpen()) {
        return Optional.of(currentIndex);
      }
      currentIndex++;
    }
  }
  return Optional.of(allMilestones.size());
}
Program: 135255
Project: 135255
Buggy source:
public static FilterExpression replaceMilestoneAliases(IModel model,FilterExpression expr){
  List<String> repoIds=getMetaQualifierContent(expr,QualifierType.REPO).stream().map(String::toLowerCase).collect(Collectors.toList());
  if (repoIds.isEmpty()) {
    repoIds.add(model.getDefaultRepo().toLowerCase());
  }
  List<TurboMilestone> allMilestones=model.getMilestones().stream().filter(ms -> ms.getDueDate().isPresent()).filter(ms -> repoIds.contains(ms.getRepoId().toLowerCase())).sorted((a,b) -> getMilestoneDueDateComparator().compare(a,b)).collect(Collectors.toList());
  boolean hasRelevantMilestone=allMilestones.stream().anyMatch(ms -> isRelevantMilestone(ms));
  if (!hasRelevantMilestone) {
    List<TurboMilestone> openMilestonesWithoutDueDate=model.getMilestones().stream().filter(ms -> !ms.getDueDate().isPresent()).filter(ms -> repoIds.contains(ms.getRepoId().toLowerCase())).filter(ms -> ms.isOpen()).collect(Collectors.toList());
    if (openMilestonesWithoutDueDate.size() == 1) {
      allMilestones.add(openMilestonesWithoutDueDate.get(0));
    }
  }
  Optional<Integer> currentMilestoneIndex=getCurrentMilestoneIndex(allMilestones);
  if (!currentMilestoneIndex.isPresent()) {
    return expr;
  }
  return expr.map(q -> {
    if (Qualifier.isMilestoneQualifier(q)) {
      return q.convertMilestoneAliasQualifier(allMilestones,currentMilestoneIndex.get());
    }
 else {
      return q;
    }
  }
);
}

Fixed version (ground truth):
public static FilterExpression replaceMilestoneAliases(IModel model,FilterExpression expr){
  List<String> repoIds=getMetaQualifierContent(expr,QualifierType.REPO).stream().map(String::toLowerCase).collect(Collectors.toList());
  if (repoIds.isEmpty()) {
    repoIds.add(model.getDefaultRepo().toLowerCase());
  }
  List<TurboMilestone> allMilestones=model.getMilestones().stream().filter(ms -> ms.getDueDate().isPresent()).filter(ms -> repoIds.contains(ms.getRepoId().toLowerCase())).sorted((a,b) -> getMilestoneDueDateComparator().compare(a,b)).collect(Collectors.toList());
  List<TurboMilestone> openMilestones=model.getMilestones().stream().filter(ms -> ms.isOpen()).collect(Collectors.toList());
  if (openMilestones.size() == 1 && !openMilestones.get(0).getDueDate().isPresent()) {
    allMilestones.addAll(openMilestones);
  }
  Optional<Integer> currentMilestoneIndex=getCurrentMilestoneIndex(allMilestones);
  if (!currentMilestoneIndex.isPresent()) {
    return expr;
  }
  return expr.map(q -> {
    if (Qualifier.isMilestoneQualifier(q)) {
      return q.convertMilestoneAliasQualifier(allMilestones,currentMilestoneIndex.get());
    }
 else {
      return q;
    }
  }
);
}
Program: 135257
Project: 135257
Buggy source:
private CompletableFuture<Boolean> updateIssueLabelsOnRepo(TurboIssue issue,List<String> newLabels){
  logger.info("String_Node_Str" + issue + "String_Node_Str");
  return repoOpControl.replaceIssueLabels(issue,newLabels).thenApply(labels -> labels.containsAll(newLabels)).exceptionally(Futures.withResult(false));
}

Fixed version (ground truth):
private CompletableFuture<Boolean> updateIssueLabelsOnRepo(TurboIssue issue,List<String> newLabels){
  logger.info("String_Node_Str" + issue + "String_Node_Str");
  return repoOpControl.replaceIssueLabels(issue,newLabels).thenApply(labels -> newLabels.containsAll(labels)).exceptionally(Futures.withResult(false));
}
Program: 135258
Project: 135258
Buggy source:
/** 
 * Replaces existing labels with new labels 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 labels are to be replaced.
 * @param newLabels The list of new labels to be assigned to the issue.
 * @return true if label replacement on GitHub was a success, false otherwise.
 */
public CompletableFuture<Boolean> replaceIssueLabels(TurboIssue issue,List<String> newLabels){
  logger.info("String_Node_Str" + issue + "String_Node_Str");
  issue.setLabels(newLabels);
  refreshUI();
  return updateIssueLabelsOnRepo(issue,newLabels);
}

Fixed version (ground truth):
/** 
 * Replaces existing labels with new labels 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 labels are to be replaced.
 * @param newLabels The list of new labels to be assigned to the issue.
 * @return true if label replacement on GitHub was a success, false otherwise.
 */
public CompletableFuture<Boolean> replaceIssueLabels(TurboIssue issue,List<String> newLabels){
  logger.info("String_Node_Str" + issue + "String_Node_Str");
  if (!models.replaceIssueLabels(issue,newLabels)) {
    return CompletableFuture.completedFuture(false);
  }
  refreshUI();
  return updateIssueLabelsOnRepo(issue,newLabels);
}
Program: 135259
Project: 135259
Buggy source:
@Override public Optional<Model> getModelById(String repoId){
  return models.containsKey(repoId) ? Optional.of(models.get(repoId)) : Optional.empty();
}

Fixed version (ground truth):
@Override public synchronized Optional<Model> getModelById(String repoId){
  return models.containsKey(repoId) ? Optional.of(models.get(repoId)) : Optional.empty();
}
Program: 135260
Project: 135260
Buggy source:
public void addLabel(TurboLabel label){
  addLabel(label.getActualName());
}

Fixed version (ground truth):
public void addLabel(TurboLabel label){
  addLabel(label.getActualName());
  this.labelsLastModifiedAt=Optional.of(LocalDateTime.now());
}
Program: 135261
Project: 135261
Buggy source:
public List<String> getLabels(){
  return labels;
}

Fixed version (ground truth):
public List<String> getLabels(){
  return new ArrayList<>(labels);
}
Program: 135262
Project: 135262
Buggy source:
public void setLabels(List<String> labels){
  this.labels=labels;
}

Fixed version (ground truth):
public void setLabels(List<String> labels){
  this.labels=labels;
  this.labelsLastModifiedAt=Optional.of(LocalDateTime.now());
}
Program: 135263
Project: 135263
Buggy source:
/** 
 * Takes lists of TurboIssues and reconciles the changes between them, returning a list of TurboIssues with updates from the second.
 */
public static List<TurboIssue> reconcile(String repoId,List<TurboIssue> existing,List<TurboIssue> changed){
  List<TurboIssue> existingCopy=new ArrayList<>(existing);
  for (  TurboIssue issue : changed) {
    int id=issue.getId();
    Optional<Integer> corresponding=findIssueWithId(existingCopy,id);
    if (corresponding.isPresent()) {
      TurboIssue newIssue=new TurboIssue(issue);
      newIssue.transferTransientState(existingCopy.get(corresponding.get()));
      existingCopy.set(corresponding.get(),newIssue);
    }
 else {
      existingCopy.add(new TurboIssue(issue));
    }
  }
  return existingCopy;
}

Fixed version (ground truth):
/** 
 * Takes lists of TurboIssues and reconciles the changes between them, returning a list of TurboIssues with updates from the second.
 */
public static List<TurboIssue> reconcile(String repoId,List<TurboIssue> existing,List<TurboIssue> changed){
  List<TurboIssue> existingCopy=new ArrayList<>(existing);
  for (  TurboIssue issue : changed) {
    int id=issue.getId();
    Optional<Integer> correspondingIssueIndex=findIssueWithId(existingCopy,id);
    if (correspondingIssueIndex.isPresent()) {
      TurboIssue existingIssue=existingCopy.get(correspondingIssueIndex.get());
      TurboIssue newIssue=new TurboIssue(issue);
      newIssue.transferTransientState(existingIssue);
      newIssue.reconcile(existingIssue);
      existingCopy.set(correspondingIssueIndex.get(),newIssue);
    }
 else {
      existingCopy.add(new TurboIssue(issue));
    }
  }
  return existingCopy;
}
Program: 135264
Project: 135264
Buggy source:
public static Optional<Integer> findIssueWithId(List<TurboIssue> issues,int id){
  int i=0;
  for (  TurboIssue issue : issues) {
    if (issue.getId() == id) {
      return Optional.of(i);
    }
    ++i;
  }
  return Optional.empty();
}

Fixed version (ground truth):
/** 
 * Finds the index of an issue with specified id in a list of issues
 * @param issues
 * @param id
 * @return the list's index of the issue or empty of there is no issue with such id in the list
 */
public static Optional<Integer> findIssueWithId(List<TurboIssue> issues,int id){
  for (int i=0; i < issues.size(); i++) {
    if (issues.get(i).getId() == id) {
      return Optional.of(i);
    }
  }
  return Optional.empty();
}
Program: 135265
Project: 135265
Buggy source:
private Node createFilterBox(){
  filterTextField=new FilterTextField("String_Node_Str").setOnConfirm((text) -> {
    ui.triggerEvent(new PanelReloadingEvent());
    applyStringFilter(text);
    ui.triggerEvent(new PanelReloadedEvent());
    return text;
  }
).setOnCancel(this::requestFocus);
  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("String_Node_Str").setOnConfirm((text) -> {
    Platform.runLater(() -> ui.triggerEvent(new PanelReloadingEvent()));
    applyStringFilter(text);
    Platform.runLater(() -> ui.triggerEvent(new PanelReloadedEvent()));
    return text;
  }
).setOnCancel(this::requestFocus);
  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: 135266
Project: 135266
Buggy source:
public void setDefaultWidth(){
  mainStage.setMaximized(false);
  mainStage.setIconified(false);
  Rectangle dimensions=getDimensions();
  mainStage.setMinWidth(panels.getPanelWidth());
  mainStage.setMinHeight(dimensions.getHeight());
  mainStage.setMaxWidth(panels.getPanelWidth());
  mainStage.setMaxHeight(dimensions.getHeight());
  mainStage.setX(0);
  mainStage.setY(0);
}

Fixed version (ground truth):
public void setDefaultWidth(){
  mainStage.setMaximized(false);
  mainStage.setIconified(false);
  Rectangle dimensions=getDimensions();
  mainStage.setWidth(panels.getPanelWidth());
  mainStage.setHeight(dimensions.getHeight());
  mainStage.setX(0);
  mainStage.setY(0);
}
Program: 135267
Project: 135267
Buggy source:
public void maximizeWindow(){
  mainStage.setMaximized(true);
  Rectangle dimensions=getDimensions();
  mainStage.setMinWidth(dimensions.getWidth());
  mainStage.setMinHeight(dimensions.getHeight());
  mainStage.setMaxWidth(dimensions.getWidth());
  mainStage.setMaxHeight(dimensions.getHeight());
  mainStage.setX(0);
  mainStage.setY(0);
}

Fixed version (ground truth):
public void maximizeWindow(){
  mainStage.setMaximized(true);
  Rectangle dimensions=getDimensions();
  mainStage.setWidth(dimensions.getWidth());
  mainStage.setHeight(dimensions.getHeight());
  mainStage.setX(0);
  mainStage.setY(0);
}