nus-yam/ex-repair huggingface dataset:
Program: 50647
Project: 50647
Buggy source:
/** 
 * This will create a image with with the url passed in by the constructor
 * @author Alec Erasmus <alec.erasmus@a24group.com>
 * @since 02 April 2013
 * @param context -The context the cell is in
 * @param value - The value to be added in the cell but not the image thats going to be displayed
 * @param sb -The save html builder.
 */
@Override public void render(Context context,Boolean value,SafeHtmlBuilder sb){
  String columnString;
  if (value == null) {
    value=false;
  }
  if (value) {
    if (tImageUrl == null) {
      columnString="String_Node_Str" + value + "String_Node_Str";
    }
 else {
      columnString="String_Node_Str" + value + "String_Node_Str"+ tImageUrl+ "String_Node_Str";
    }
  }
 else {
    if (fImageUrl == null) {
      columnString="String_Node_Str" + value + "String_Node_Str";
    }
 else {
      columnString="String_Node_Str" + value + "String_Node_Str"+ fImageUrl+ "String_Node_Str";
    }
  }
  sb.appendHtmlConstant(columnString);
}

Fixed version (ground truth):
/** 
 * This will create a image with the url passed in by the constructor
 * @author Alec Erasmus <alec.erasmus@a24group.com>
 * @since 02 April 2013
 * @param context -The context the cell is in
 * @param value - The value to be added in the cell but not the image thats going to be displayed
 * @param sb -The safe html builder.
 */
@Override public void render(Context context,Boolean value,SafeHtmlBuilder sb){
  String columnString;
  if (value == null) {
    value=false;
  }
  if (value) {
    if (tImageUrl == null) {
      columnString="String_Node_Str" + value + "String_Node_Str";
    }
 else {
      columnString="String_Node_Str" + value + "String_Node_Str"+ tImageUrl+ "String_Node_Str";
    }
  }
 else {
    if (fImageUrl == null) {
      columnString="String_Node_Str" + value + "String_Node_Str";
    }
 else {
      columnString="String_Node_Str" + value + "String_Node_Str"+ fImageUrl+ "String_Node_Str";
    }
  }
  sb.appendHtmlConstant(columnString);
}
Program: 50648
Project: 50648
Buggy source:
/** 
 * This will create a label with text and a tooltip with the same text value
 * @author Ruan Naude <nauderuan777@gmail.com>
 * @since 14 March 2013
 * @param context -The context the cell is in
 * @param value - The value to be added in the cell
 * @param sb -The save html builder.
 */
@Override public void render(Context context,String value,SafeHtmlBuilder sb){
  if (value == null) {
    value="String_Node_Str";
  }
  sb.appendHtmlConstant("String_Node_Str" + value + "String_Node_Str"+ value+ "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * This will create a label with text and a tooltip with the same text value
 * @author Ruan Naude <nauderuan777@gmail.com>
 * @since 14 March 2013
 * @param context -The context the cell is in
 * @param value - The value to be added in the cell
 * @param sb -The safe html builder.
 */
@Override public void render(Context context,String value,SafeHtmlBuilder sb){
  if (value == null) {
    value="String_Node_Str";
  }
  sb.appendHtmlConstant("String_Node_Str" + value + "String_Node_Str"+ value+ "String_Node_Str");
}
Program: 50649
Project: 50649
Buggy source:
/** 
 * The SSBooleanImageCell constructor
 * @author Alec Erasmus <alec.erasmus@a24group.com>
 * @since 02 April 2013
 * @param tImageUrl - The image to display if the the boolean value is true
 * @param fImageUrl - The image to display if the the boolean value is false
 */
public SSBooleanImageCell(String tImageUrl,String fImageUrl){
  super();
  this.tImageUrl=tImageUrl;
  this.fImageUrl=fImageUrl;
}

Fixed version (ground truth):
/** 
 * The SSBooleanImageCell constructor
 * @author Alec Erasmus <alec.erasmus@a24group.com>
 * @since 02 April 2013
 * @param trueImageUrl - The image to display if the the boolean value is true
 * @param falseImageUrl - The image to display if the the boolean value is false
 */
public SSBooleanImageCell(String trueImageUrl,String falseImageUrl){
  super();
  this.trueImageUrl=trueImageUrl;
  this.falseImageUrl=falseImageUrl;
}
Program: 50650
Project: 50650
Buggy source:
/** 
 * This will create a image with the url passed in by the constructor
 * @author Alec Erasmus <alec.erasmus@a24group.com>
 * @since 02 April 2013
 * @param context -The context the cell is in
 * @param value - The value to be added in the cell but not the image thats going to be displayed
 * @param sb -The safe html builder.
 */
@Override public void render(Context context,Boolean value,SafeHtmlBuilder sb){
  String columnString;
  if (value == null) {
    value=false;
  }
  if (value) {
    if (tImageUrl == null) {
      columnString="String_Node_Str" + value + "String_Node_Str";
    }
 else {
      columnString="String_Node_Str" + value + "String_Node_Str"+ tImageUrl+ "String_Node_Str";
    }
  }
 else {
    if (fImageUrl == null) {
      columnString="String_Node_Str" + value + "String_Node_Str";
    }
 else {
      columnString="String_Node_Str" + value + "String_Node_Str"+ fImageUrl+ "String_Node_Str";
    }
  }
  sb.appendHtmlConstant(columnString);
}

Fixed version (ground truth):
/** 
 * This will create a image with the url passed in by the constructor
 * @author Alec Erasmus <alec.erasmus@a24group.com>
 * @since 02 April 2013
 * @param context -The context the cell is in
 * @param value - The value to be added in the cell but not the image thats going to be displayed
 * @param sb -The safe html builder.
 */
@Override public void render(Context context,Boolean value,SafeHtmlBuilder sb){
  String columnString;
  if (value == null) {
    value=false;
  }
  if (value) {
    if (trueImageUrl == null) {
      columnString="String_Node_Str" + value + "String_Node_Str";
    }
 else {
      columnString="String_Node_Str" + value + "String_Node_Str"+ trueImageUrl+ "String_Node_Str";
    }
  }
 else {
    if (falseImageUrl == null) {
      columnString="String_Node_Str" + value + "String_Node_Str";
    }
 else {
      columnString="String_Node_Str" + value + "String_Node_Str"+ falseImageUrl+ "String_Node_Str";
    }
  }
  sb.appendHtmlConstant(columnString);
}
Program: 50651
Project: 50651
Buggy source:
/** 
 * Construct a new BooleanImageColumn.
 * @author Alec Erasmus
 * @since 02 April 2013
 * @param tImageUrl - The image to display if the the boolean value is true
 * @param fImageUrl - The image to display if the the boolean value is false
 */
public SSBooleanImageColumn(String tImageUrl,String fImageUrl){
  super(new SSBooleanImageCell(tImageUrl,fImageUrl));
}

Fixed version (ground truth):
/** 
 * Construct a new BooleanImageColumn.
 * @author Alec Erasmus
 * @since 02 April 2013
 * @param trueImageUrl - The image to display if the the boolean value is true
 * @param falseImageUrl - The image to display if the the boolean value is false
 */
public SSBooleanImageColumn(String trueImageUrl,String falseImageUrl){
  super(new SSBooleanImageCell(trueImageUrl,falseImageUrl));
}
Program: 50652
Project: 50652
Buggy source:
/** 
 * This function will clear the listbox items
 * @author Michael Barnard <michael.barnard@a24group.com>
 * @since  16 January 2013
 */
public void emptyListBox(){
  int listCount=listBox.getItemCount();
  for (int x=0; x < listCount; x++) {
    listBox.removeItem(x);
  }
}

Fixed version (ground truth):
/** 
 * This function will clear the listbox items
 * @author Michael Barnard <michael.barnard@a24group.com>
 * @since  16 January 2013
 */
public void emptyListBox(){
  int listCount=listBox.getItemCount();
  for (int x=listCount; x > 0; x--) {
    listBox.removeItem(x - 1);
  }
}
Program: 50653
Project: 50653
Buggy source:
/** 
 * This function will clear the listbox items
 * @author Michael Barnard <michael.barnard@a24group.com>
 * @since  16 January 2013
 */
public void emptyListBox(){
  int listCount=listBox.getItemCount();
  for (int x=0; x < listCount; x++) {
    listBox.removeItem(x);
  }
}

Fixed version (ground truth):
/** 
 * This function will clear the listbox items
 * @author Michael Barnard <michael.barnard@a24group.com>
 * @since  16 January 2013
 */
public void emptyListBox(){
  int listCount=listBox.getItemCount();
  for (int x=listCount; x > 0; x--) {
    listBox.removeItem(x - 1);
  }
}
Program: 50655
Project: 50655
Buggy source:
/** 
 * Updates styles of the fields and hides the required star if the required state of a field changes
 */
public void redraw(){
  for (  Field field : fields.values()) {
    field.fieldLabel.setStyleName(labelStyleName);
    field.inputField.getInputFieldWidget().setStyleName(inputFieldStyleName);
    field.requiredStar.setStyleName(requiredIndicatorStyle);
    field.requiredStar.setVisible(field.inputField.isRequired());
    field.inputField.setReadOnly(this.readOnly);
  }
}

Fixed version (ground truth):
/** 
 * Updates styles of the fields and hides the required star if the required state of a field changes
 */
public void redraw(){
  for (  Field field : fields.values()) {
    field.fieldLabel.addStyleName(labelStyleName);
    field.inputField.getInputFieldWidget().addStyleName(inputFieldStyleName);
    field.requiredStar.addStyleName(requiredIndicatorStyle);
    field.requiredStar.setVisible(field.inputField.isRequired());
    field.inputField.setReadOnly(this.readOnly);
  }
}
Program: 50657
Project: 50657
Buggy source:
@ClassName("String_Node_Str") String noContentLabelStyle();

Fixed version (ground truth):
/** 
 * Applied to the "No Content" label displayed.
 */
@ClassName("String_Node_Str") String noContentLabelStyle();
Program: 50658
Project: 50658
Buggy source:
/** 
 * Set global dynamic form keybord keypress handler on each field
 * @param handler - The handler tp apply to the fields 
 */
public void setKeyPressFieldsHandler(KeyPressHandler handler){
  for (  InputField inputField : fields.keySet()) {
    inputField.getInputFieldWidget().addDomHandler(handler,KeyPressEvent.getType());
  }
}

Fixed version (ground truth):
/** 
 * Set global dynamic form keyboard keypress handler on each field.
 * @param handler - The handler type apply to the fields 
 */
public void setKeyPressFieldsHandler(KeyPressHandler handler){
  for (  InputField inputField : fields.keySet()) {
    inputField.getInputFieldWidget().addDomHandler(handler,KeyPressEvent.getType());
  }
}
Program: 50659
Project: 50659
Buggy source:
/** 
 * The event that fires once you click on the button
 * @param event - The event that fires
 */
@Override public void onClick(ClickEvent event){
  SSFileSelector.clickOnInputFile(fileUpload.getElement());
  if (isForm) {
    Timer timer=new Timer(){
      /** 
 * This method will be called when a timer fires.
 */
      public void run(){
        if (!getFileSelectedComplete()) {
          this.schedule(500);
        }
 else {
          if (isValidation) {
            error=null;
            int x=getFileName().lastIndexOf("String_Node_Str");
            if (x == -1) {
              setError();
            }
 else {
              String extension=getFileName().substring(x);
              if (allowedFiles.contains(extension)) {
                form.submit();
              }
 else {
                setError();
              }
            }
          }
 else {
            form.submit();
          }
        }
      }
    }
;
    timer.run();
  }
}

Fixed version (ground truth):
/** 
 * The event that fires once you click on the button
 * @param event - The event that fires
 */
@Override public void onClick(ClickEvent event){
  SSFileSelector.clickOnInputFile(fileUpload.getElement());
  if (isForm) {
    Timer timer=new Timer(){
      /** 
 * This method will be called when a timer fires.
 */
      public void run(){
        if (!getFileSelectedComplete()) {
          this.schedule(500);
        }
 else {
          if (isValidation) {
            error=null;
            int x=getFileName().lastIndexOf("String_Node_Str");
            if (x == -1) {
              setError();
            }
 else {
              String extension=getFileName().substring(x + 1);
              if (allowedFiles.contains(extension)) {
                form.submit();
              }
 else {
                setError();
              }
            }
          }
 else {
            form.submit();
          }
        }
      }
    }
;
    timer.run();
  }
}
Program: 50660
Project: 50660
Buggy source:
/** 
 * Set the style on the component
 * @param style The stile name
 */
public void setStyleName(String style){
  button.setStyleName(style);
}

Fixed version (ground truth):
/** 
 * Set the style on the component
 * @param style The style name
 */
public void setStyleName(String style){
  button.setStyleName(style);
}
Program: 50661
Project: 50661
Buggy source:
/** 
 * Class constructor
 * @param label The label to display on the button
 */
public SSFileSelector(String label){
  FlowPanel mainContainer=new FlowPanel();
  fileUpload=new FileUpload();
  fileUpload.setWidth("String_Node_Str");
  fileUpload.setHeight("String_Node_Str");
  mainContainer.add(fileUpload);
  button=new Button(label);
  button.addClickHandler(new ClickHandler(){
    /** 
 * The event that fires once you click on the button
 * @param event - The event that fires
 */
    @Override public void onClick(    ClickEvent event){
      SSFileSelector.clickOnInputFile(fileUpload.getElement());
      if (isForm) {
        Timer timer=new Timer(){
          /** 
 * This method will be called when a timer fires.
 */
          public void run(){
            if (!getFileSelectedComplete()) {
              this.schedule(500);
            }
 else {
              if (isValidation) {
                error=null;
                int x=getFileName().lastIndexOf("String_Node_Str");
                if (x == -1) {
                  setError();
                }
 else {
                  String extension=getFileName().substring(x);
                  if (allowedFiles.contains(extension)) {
                    form.submit();
                  }
 else {
                    setError();
                  }
                }
              }
 else {
                form.submit();
              }
            }
          }
        }
;
        timer.run();
      }
    }
  }
);
  mainContainer.add(button);
  initWidget(mainContainer);
}

Fixed version (ground truth):
/** 
 * Class constructor
 * @param label The label to display on the button
 */
public SSFileSelector(String label){
  FlowPanel mainContainer=new FlowPanel();
  fileUpload=new FileUpload();
  fileUpload.setWidth("String_Node_Str");
  fileUpload.setHeight("String_Node_Str");
  mainContainer.add(fileUpload);
  button=new Button(label);
  button.addClickHandler(new ClickHandler(){
    /** 
 * The event that fires once you click on the button
 * @param event - The event that fires
 */
    @Override public void onClick(    ClickEvent event){
      SSFileSelector.clickOnInputFile(fileUpload.getElement());
      if (isForm) {
        Timer timer=new Timer(){
          /** 
 * This method will be called when a timer fires.
 */
          public void run(){
            if (!getFileSelectedComplete()) {
              this.schedule(500);
            }
 else {
              if (isValidation) {
                error=null;
                int x=getFileName().lastIndexOf("String_Node_Str");
                if (x == -1) {
                  setError();
                }
 else {
                  String extension=getFileName().substring(x + 1);
                  if (allowedFiles.contains(extension)) {
                    form.submit();
                  }
 else {
                    setError();
                  }
                }
              }
 else {
                form.submit();
              }
            }
          }
        }
;
        timer.run();
      }
    }
  }
);
  mainContainer.add(button);
  initWidget(mainContainer);
}
Program: 50662
Project: 50662
Buggy source:
/** 
 * This method will be called when a timer fires.
 */
public void run(){
  if (!getFileSelectedComplete()) {
    this.schedule(500);
  }
 else {
    if (isValidation) {
      error=null;
      int x=getFileName().lastIndexOf("String_Node_Str");
      if (x == -1) {
        setError();
      }
 else {
        String extension=getFileName().substring(x);
        if (allowedFiles.contains(extension)) {
          form.submit();
        }
 else {
          setError();
        }
      }
    }
 else {
      form.submit();
    }
  }
}

Fixed version (ground truth):
/** 
 * This method will be called when a timer fires.
 */
public void run(){
  if (!getFileSelectedComplete()) {
    this.schedule(500);
  }
 else {
    if (isValidation) {
      error=null;
      int x=getFileName().lastIndexOf("String_Node_Str");
      if (x == -1) {
        setError();
      }
 else {
        String extension=getFileName().substring(x + 1);
        if (allowedFiles.contains(extension)) {
          form.submit();
        }
 else {
          setError();
        }
      }
    }
 else {
      form.submit();
    }
  }
}
Program: 50663
Project: 50663
Buggy source:
/** 
 * Hides or shows the action bar
 * @param visible - The visibility of the action bar
 */
public void setActionBarVisible(boolean visible){
  actionBar.setVisible(visible);
}

Fixed version (ground truth):
/** 
 * Hides or shows the action bar
 * @param visible - The visibility of the action bar
 */
public void setActionBarVisible(boolean visible){
  actionBar.setVisible(visible);
  int actionBarHeight=0;
  if (visible) {
    actionBarHeight=32;
  }
  mainContainer.setWidgetBottomHeight(actionBar,0,Unit.PX,actionBarHeight,Unit.PX);
  mainContainer.setWidgetTopBottom(dataGrid,actionBarHeight,Unit.PX,0,Unit.PX);
}
Program: 50664
Project: 50664
Buggy source:
/** 
 * This function will set the state of the left menu item to the selected state
 * @author Ruan Naude <ruan.naude@a24group.com>
 * @since 09 July 2012
 */
public void setSelected(){
  if (!isAnimating) {
    LeftMenuItem.this.menuItem.getCommand().execute();
    isAnimating=true;
    leftMenuItem.setWidgetLeftRight(selectedPanel,0,Unit.PX,0,Unit.PX);
    leftMenuItem.setWidgetLeftWidth(notSelectedFlowPanel,-100,Unit.PCT,100,Unit.PCT);
    leftMenuItem.animate(600);
    Timer timer=new Timer(){
      public void run(){
        isAnimating=false;
        if (isUnselectQued) {
          isUnselectQued=false;
          setUnselected();
        }
      }
    }
;
    timer.schedule(680);
  }
}

Fixed version (ground truth):
/** 
 * This function will set the state of the left menu item to the selected state
 * @author Ruan Naude <ruan.naude@a24group.com>
 * @since 09 July 2012
 */
public void setSelected(){
  if (!isAnimating) {
    LeftMenuItem.this.menuItem.getCommand().execute();
    isAnimating=true;
    leftMenuItem.setWidgetLeftRight(selectedPanel,0,Unit.PX,0,Unit.PX);
    leftMenuItem.setWidgetLeftWidth(notSelectedFlowPanel,-100,Unit.PCT,100,Unit.PCT);
    Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand(){
      public void execute(){
        leftMenuItem.animate(600);
      }
    }
);
    Timer timer=new Timer(){
      public void run(){
        isAnimating=false;
        if (isUnselectQued) {
          isUnselectQued=false;
          setUnselected();
        }
      }
    }
;
    timer.schedule(680);
  }
}
Program: 50665
Project: 50665
Buggy source:
/** 
 * Hides the placeholder by removing the placeholder text from the datepicker and also removing the placeholder style name from the datepicker.
 * @author Michael Barnard <michael.barnard@a24group.com>
 * @since 18 July 2012
 */
public void hidePlaceholder(){
  if (super.getTextBox().getText().equals(this.getPlaceholderText())) {
    super.getTextBox().setText("String_Node_Str");
    super.getTextBox().removeStyleName(this.getPlaceholderStyleName());
  }
}

Fixed version (ground truth):
/** 
 * Hides the placeholder by removing the placeholder text from the datepicker and also removing the placeholder style name from the datepicker.
 * @author Michael Barnard <michael.barnard@a24group.com>
 * @since 18 July 2012
 */
public void hidePlaceholder(){
  if (super.getTextBox().getText().equals(this.getPlaceholderText())) {
    super.getTextBox().setText("String_Node_Str");
  }
  super.getTextBox().removeStyleName(this.getPlaceholderStyleName());
}
Program: 50666
Project: 50666
Buggy source:
/** 
 * Sets the inner text of the element.
 * @param value The new value
 */
private void setText(String value){
  Element divChild;
  if (getElement().getChild(0).getNodeType() == Node.ELEMENT_NODE) {
    divChild=(Element)getElement().getChild(0);
  }
 else {
    divChild=DOM.createDiv();
    divChild.addClassName(css().wrap("String_Node_Str"));
    getElement().appendChild(divChild);
  }
  DOM.setInnerText(divChild,value);
  DOM.setInnerText(getElement(),"String_Node_Str");
  DOM.appendChild(getElement(),divChild);
}

Fixed version (ground truth):
/** 
 * Sets the inner text of the element.
 * @param value The new value
 */
private void setText(String value){
  Element divChild;
  if (getElement().getChild(0).getNodeType() == Node.ELEMENT_NODE) {
    divChild=(Element)getElement().getChild(0);
  }
 else {
    divChild=DOM.createDiv();
    divChild.addClassName(css().wrap("String_Node_Str"));
    getElement().appendChild(divChild);
  }
  DOM.setInnerText(getElement(),"String_Node_Str");
  DOM.setInnerText(divChild,value);
  DOM.appendChild(getElement(),divChild);
}
Program: 50667
Project: 50667
Buggy source:
/** 
 * Sets the inner text of the element.
 * @param value The new value
 */
private void setText(String value){
  Element divChild;
  if (getElement().getChild(0).getNodeType() == Node.ELEMENT_NODE) {
    divChild=(Element)getElement().getChild(0);
  }
 else {
    divChild=DOM.createDiv();
    divChild.addClassName(css().wrap("String_Node_Str"));
    getElement().appendChild(divChild);
  }
  DOM.setInnerText(divChild,value);
  DOM.setInnerText(getElement(),"String_Node_Str");
  DOM.appendChild(getElement(),divChild);
}

Fixed version (ground truth):
/** 
 * Sets the inner text of the element.
 * @param value The new value
 */
private void setText(String value){
  Element divChild;
  if (getElement().getChild(0).getNodeType() == Node.ELEMENT_NODE) {
    divChild=(Element)getElement().getChild(0);
  }
 else {
    divChild=DOM.createDiv();
    divChild.addClassName(css().wrap("String_Node_Str"));
    getElement().appendChild(divChild);
  }
  DOM.setInnerText(getElement(),"String_Node_Str");
  DOM.setInnerText(divChild,value);
  DOM.appendChild(getElement(),divChild);
}
Program: 50669
Project: 50669
Buggy source:
@Override public void onSelectAllEvent(SelectAllEvent event){
  DataGrid dataGrid=SSDataGrid.this.dataGrid;
  Range rows=dataGrid.getVisibleRange();
  int end=rows.getStart() + rows.getLength();
  int numRecordsDisplayed=rows.getLength();
  if (end > dataGrid.getRowCount()) {
    end=dataGrid.getRowCount();
    numRecordsDisplayed=end % numRecordsDisplayed;
  }
  boolean allSelected=true;
  for (int i=rows.getStart(); i < end; i++) {
    if (!dataProvider.getList().get(i).isSelected()) {
      allSelected=false;
      break;
    }
  }
  for (int i=rows.getStart(); i < end; i++) {
    dataProvider.getList().get(i).setSelected(!allSelected);
  }
  dataProvider.refresh();
  for (int i=0; i < numRecordsDisplayed; i++) {
    setRowSelectedStyle(i,!allSelected);
  }
}

Fixed version (ground truth):
/** 
 * Event triggered when the select all button is clicked
 * @param event - The event that was fired
 */
@Override public void onSelectAllEvent(SelectAllEvent event){
  DataGrid dataGrid=SSDataGrid.this.dataGrid;
  Range rows=dataGrid.getVisibleRange();
  int end=rows.getStart() + rows.getLength();
  int numRecordsDisplayed=rows.getLength();
  if (end > dataGrid.getRowCount()) {
    end=dataGrid.getRowCount();
    numRecordsDisplayed=end % numRecordsDisplayed;
  }
  boolean allSelected=true;
  for (int i=rows.getStart(); i < end; i++) {
    if (!dataProvider.getList().get(i).isSelected()) {
      allSelected=false;
      break;
    }
  }
  for (int i=rows.getStart(); i < end; i++) {
    dataProvider.getList().get(i).setSelected(!allSelected);
  }
  refresh();
}
Program: 50670
Project: 50670
Buggy source:
/** 
 * Update the selection state 
 * @param index - the index of the row to be updated
 * @param object - The object currently being referenced
 * @param value - the selected state of the current row
 */
@Override public void update(int index,T object,Boolean value){
  setRowSelectedStyle((index - SSDataGrid.this.dataGrid.getVisibleRange().getStart()),value);
  object.setSelected(value);
}

Fixed version (ground truth):
/** 
 * Update the selection state 
 * @param index - the index of the row to be updated
 * @param object - The object currently being referenced
 * @param value - the selected state of the current row
 */
@Override public void update(int index,T object,Boolean value){
  object.setSelected(value);
  refresh();
}
Program: 50672
Project: 50672
Buggy source:
private void setRowSelectedStyle(int rowIndex,boolean selected){
  TableRowElement tableRow=dataGrid.getRowElement(rowIndex);
  String styleNames=tableRow.getAttribute("String_Node_Str");
  String newStyles=styleNames;
  boolean containsStyle=styleNames.contains("String_Node_Str");
  if (containsStyle && !selected) {
    newStyles="String_Node_Str";
    String[] styles=styleNames.split("String_Node_Str");
    for (int i=0; i < styles.length; i++) {
      if (!styles[i].equals("String_Node_Str")) {
        newStyles+="String_Node_Str" + styles[i];
      }
    }
  }
 else   if (!containsStyle && selected) {
    newStyles+="String_Node_Str";
  }
  tableRow.setAttribute("String_Node_Str",newStyles);
}

Fixed version (ground truth):
/** 
 * Sets the style of a selected row at a certain index
 * @param rowIndex - The index of the row that needs to change
 * @param selected - Whether or not the row is selected
 */
private void setRowSelectedStyle(int rowIndex,boolean selected){
  TableRowElement tableRow=dataGrid.getRowElement(rowIndex);
  String styleNames=tableRow.getClassName();
  String newStyles=styleNames;
  boolean containsStyle=styleNames.contains("String_Node_Str");
  if (containsStyle && !selected) {
    newStyles="String_Node_Str";
    String[] styles=styleNames.split("String_Node_Str");
    for (int i=0; i < styles.length; i++) {
      if (!styles[i].equals("String_Node_Str")) {
        newStyles+="String_Node_Str" + styles[i];
      }
    }
  }
 else   if (!containsStyle && selected) {
    if (!newStyles.equals("String_Node_Str")) {
      newStyles+="String_Node_Str";
    }
    newStyles+="String_Node_Str";
  }
  tableRow.setClassName(newStyles);
  Label l=new Label("String_Node_Str");
  if (Window.Navigator.getAppName().equals("String_Node_Str")) {
    tableRow.appendChild(l.getElement());
    tableRow.removeChild(l.getElement());
  }
}
Program: 50674
Project: 50674
Buggy source:
/** 
 * Hides the action bar by setting it invisible
 */
public void hideActionBar(){
  actionBar.setVisible(false);
}

Fixed version (ground truth):
/** 
 * Hides or shows the action bar
 * @param visible - The visibility of the action bar
 */
public void hideActionBar(boolean visible){
  actionBar.setVisible(visible);
}
Program: 50675
Project: 50675
Buggy source:
/** 
 * Does the validation and sets styles accordingly
 * @return String - The error string or null if the validation passes
 */
public String doValidation(){
  for (int i=0; i < fields.size(); i++) {
    if (fields.get(i).errorStyleName != null) {
      fields.get(i).uiField.removeStyleName(fields.get(i).errorStyleName.toString());
    }
  }
  for (int i=0; i < fields.size(); i++) {
    ValidatorInterface<String> validator=(ValidatorInterface<String>)validatorFactory(fields.get(i).validatorReferenceName);
    validator.setConfiguration(fields.get(i).config);
    boolean valid=validator.isValid(((AdvancedTextbox)fields.get(i).uiField).getValue());
    if (!valid) {
      if (fields.get(i).errorStyleName != null) {
        fields.get(i).uiField.addStyleName(fields.get(i).errorStyleName.toString());
      }
      if (fields.get(i).errorMessage != null) {
        return fields.get(i).errorMessage;
      }
 else {
        return validator.getDefaultValidationMessage();
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Does the validation and sets styles accordingly
 * @return String - The error string or null if the validation passes
 */
public String doValidation(){
  int fieldSize=fields.size();
  for (int i=0; i < fieldSize; i++) {
    if (fields.get(i).errorStyleName != null) {
      fields.get(i).uiField.removeStyleName(fields.get(i).errorStyleName.toString());
    }
  }
  for (int i=0; i < fieldSize; i++) {
    ValidatorInterface<String> validator=(ValidatorInterface<String>)validatorFactory(fields.get(i).validatorReferenceName);
    validator.setConfiguration(fields.get(i).config);
    boolean valid=validator.isValid(((AdvancedTextbox)fields.get(i).uiField).getValue());
    if (!valid) {
      if (fields.get(i).errorStyleName != null) {
        fields.get(i).uiField.addStyleName(fields.get(i).errorStyleName.toString());
      }
      if (fields.get(i).errorMessage != null) {
        return fields.get(i).errorMessage;
      }
 else {
        return validator.getDefaultValidationMessage();
      }
    }
  }
  return null;
}
Program: 50676
Project: 50676
Buggy source:
@Override public LocalOperation adaptTo(CRDT replica){
  int sizeDoc=((MergeAlgorithm)replica).getDoc().viewLength();
  if (getType() == OpType.insert) {
    if (position > sizeDoc) {
      position=sizeDoc;
    }
  }
 else   if (this.position >= sizeDoc) {
    position=sizeDoc - 1;
  }
  if ((getType() == OpType.delete || getType() == OpType.update) && position + argument > sizeDoc) {
    argument=sizeDoc - position;
  }
  if ((getType() == OpType.update || getType() == OpType.move) && position + content.size() > sizeDoc) {
    content=content.subList(0,sizeDoc - position);
  }
  return this;
}

Fixed version (ground truth):
@Override public LocalOperation adaptTo(CRDT replica){
  int sizeDoc=((MergeAlgorithm)replica).getDoc().viewLength();
  if (getType() == OpType.insert) {
    if (position > sizeDoc) {
      position=sizeDoc;
    }
  }
 else   if (this.type == OpType.delete && sizeDoc == 0) {
    return new SequenceOperation(OpType.noop,0,0,null);
  }
 else   if (this.position >= sizeDoc) {
    position=sizeDoc - 1;
  }
  if ((getType() == OpType.delete || getType() == OpType.update) && position + argument > sizeDoc) {
    argument=sizeDoc - position;
  }
  if ((getType() == OpType.update || getType() == OpType.move) && position + content.size() > sizeDoc) {
    content=content.subList(0,sizeDoc - position);
  }
  return this;
}
Program: 50677
Project: 50677
Buggy source:
@Override void delBlock(int begin,int end,int nbElement){
  nbElement-=nbElement;
}

Fixed version (ground truth):
@Override void delBlock(int begin,int end,int nbElement){
  this.nbElement-=nbElement;
}
Program: 50678
Project: 50678
Buggy source:
@Override public void remove(int position,int offset){
  idTable.removeRangeOffset(position + 1,offset);
  document.delete(position,position + offset);
}

Fixed version (ground truth):
@Override public void remove(int position,int offset){
  idTable.removeRangeOffset(position + 1,offset);
  document.delete(position,position + offset + 1);
}
Program: 50679
Project: 50679
Buggy source:
@Override public int viewLength(){
  return document.length();
}

Fixed version (ground truth):
@Override public int viewLength(){
  return documentStr.length();
}
Program: 50680
Project: 50680
Buggy source:
@Override public String view(){
  return document.toString();
}

Fixed version (ground truth):
@Override public String view(){
  return documentStr.toString();
}
Program: 50681
Project: 50681
Buggy source:
@Override public void apply(Operation op){
  LogootOperation lg=(LogootOperation)op;
  ListIdentifier idToSearch=lg.getIdentifiant();
  int pos=dicho(idToSearch);
  if (lg.getType() == SequenceMessage.MessageType.ins) {
    idTable.add(pos,idToSearch);
    document.insert(pos - 1,lg.getContent());
  }
 else   if (idTable.get(pos).equals(idToSearch)) {
    idTable.remove(pos);
    document.deleteCharAt(pos - 1);
  }
}

Fixed version (ground truth):
@Override public void apply(Operation op){
  LogootOperation lg=(LogootOperation)op;
  ListIdentifier idToSearch=lg.getIdentifiant();
  int pos=dicho(idToSearch);
  if (lg.getType() == SequenceMessage.MessageType.ins) {
    idTable.add(pos,idToSearch);
    documentStr.insert(pos - 1,lg.getContent());
  }
 else   if (idTable.get(pos).equals(idToSearch)) {
    idTable.remove(pos);
    documentStr.deleteCharAt(pos - 1);
  }
}
Program: 50682
Project: 50682
Buggy source:
public LogootDocumentChar(int r,LogootStrategy strategy){
  super(r,strategy);
  document=new StringBuilder();
  this.replicaNumber=r;
  myClock=0;
}

Fixed version (ground truth):
public LogootDocumentChar(int r,LogootStrategy strategy){
  super(r,strategy);
  documentStr=new StringBuilder();
  this.replicaNumber=r;
  myClock=0;
}
Program: 50683
Project: 50683
Buggy source:
@Override public int hashCode(){
  int hash=7;
  hash=97 * hash + (this.idTable != null ? this.idTable.hashCode() : 0);
  hash=97 * hash + (this.document != null ? this.document.hashCode() : 0);
  return hash;
}

Fixed version (ground truth):
@Override public int hashCode(){
  int hash=7;
  hash=97 * hash + (this.idTable != null ? this.idTable.hashCode() : 0);
  hash=97 * hash + (this.documentStr != null ? this.documentStr.hashCode() : 0);
  return hash;
}
Program: 50684
Project: 50684
Buggy source:
@Override public boolean equals(Object obj){
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  final LogootDocumentChar other=(LogootDocumentChar)obj;
  if (this.idTable != other.idTable && (this.idTable == null || !this.idTable.equals(other.idTable))) {
    return false;
  }
  if (this.document != other.document && (this.document == null || !this.document.equals(other.document))) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean equals(Object obj){
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  final LogootDocumentChar other=(LogootDocumentChar)obj;
  if (this.idTable != other.idTable && (this.idTable == null || !this.idTable.equals(other.idTable))) {
    return false;
  }
  if (this.documentStr != other.documentStr && (this.documentStr == null || !this.documentStr.equals(other.documentStr))) {
    return false;
  }
  return true;
}
Program: 50685
Project: 50685
Buggy source:
@Override public void insert(int position,List<ListIdentifier> patch,List<Character> lc){
  idTable.addAll(position + 1,patch);
  document.insert(position,makeChar(lc));
}

Fixed version (ground truth):
@Override public void insert(int position,List<ListIdentifier> patch,List<Character> lc){
  idTable.addAll(position + 1,patch);
  documentStr.insert(position,makeChar(lc));
}
Program: 50686
Project: 50686
Buggy source:
@Override public void remove(int position,int offset){
  idTable.removeRangeOffset(position + 1,offset);
  document.delete(position,position + offset + 1);
}

Fixed version (ground truth):
@Override public void remove(int position,int offset){
  idTable.removeRangeOffset(position + 1,offset);
  documentStr.delete(position,position + offset);
}
Program: 50687
Project: 50687
Buggy source:
@Override public LocalOperation adaptTo(CRDT replica){
  OrderedNode root=(OrderedNode)replica.lookup();
  int i=0;
  List<Integer> nPath=new LinkedList();
  OrderedNode node=adaptPath(this.path,root,nPath);
  int nPos=this.position;
switch (this.type) {
case add:
    if (nPos > node.getChildrenNumber()) {
      nPos=node.getChildrenNumber();
    }
  return new OrderedTreeOperation(nPath,nPos,this.content);
case del:
return new OrderedTreeOperation(nPath);
case move:
List<Integer> nPathDst=new LinkedList();
OrderedNode nodedst=adaptPath(this.dstPath,root,nPathDst);
if (nPos > nodedst.getChildrenNumber()) {
nPos=nodedst.getChildrenNumber();
}
return new OrderedTreeOperation(type,nPath,nPathDst,nPos,null);
case chContent:
return new OrderedTreeOperation(type,nPath,null,0,this.content);
default :
throw new UnsupportedOperationException("String_Node_Str");
}
}

Fixed version (ground truth):
@Override public LocalOperation adaptTo(CRDT replica){
  OrderedNode root=(OrderedNode)replica.lookup();
  int i=0;
  List<Integer> nPath=new LinkedList();
  OrderedNode node=adaptPath(this.path,root,nPath);
  int nPos=this.position;
switch (this.type) {
case add:
    if (nPos > node.getChildrenNumber()) {
      nPos=node.getChildrenNumber();
    }
  return new OrderedTreeOperation(nPath,nPos,this.content);
case del:
if (nPath.isEmpty()) {
  return new OrderedTreeOperation(nPath,nPos,root.getValue());
}
 else {
  return new OrderedTreeOperation(nPath);
}
case move:
List<Integer> nPathDst=new LinkedList();
OrderedNode nodedst=adaptPath(this.dstPath,root,nPathDst);
if (nPos > nodedst.getChildrenNumber()) {
nPos=nodedst.getChildrenNumber();
}
return new OrderedTreeOperation(type,nPath,nPathDst,nPos,null);
case chContent:
return new OrderedTreeOperation(type,nPath,null,0,this.content);
default :
throw new UnsupportedOperationException("String_Node_Str");
}
}
Program: 50688
Project: 50688
Buggy source:
@Override public void postDel(Del operation,FCNode node){
  for (  Object n : node.getElements()) {
    postDel(operation,node);
    tree.getMap().remove((FCNode)n);
  }
}

Fixed version (ground truth):
@Override public void postDel(Del operation,FCNode node){
  for (  Object n : node.getElements()) {
    postDel(operation,node);
    tree.getMap().remove(((FCNode)n).getId());
  }
}
Program: 50690
Project: 50690
Buggy source:
public String view(){
  StringBuilder s=new StringBuilder();
  RGANode node=head.getNext();
  while (node != null) {
    if (node.isVisible()) {
      s.append(node.getContent());
    }
    node=node.getNext();
  }
  return s.toString();
}

Fixed version (ground truth):
@Override public String view(){
  StringBuilder s=new StringBuilder();
  RGANode node=head.getNext();
  while (node != null) {
    if (node.isVisible()) {
      s.append(node.getContent());
    }
    node=node.getNext();
  }
  return s.toString();
}
Program: 50692
Project: 50692
Buggy source:
@Test public void testDelete() throws PreconditionException {
  String content="String_Node_Str";
  int pos=3, off=4;
  replica.applyLocal(SequenceOperation.insert(0,content));
  assertEquals(content,replica.lookup());
  replica.localDelete(SequenceOperation.delete(pos,off));
  assertEquals(content.substring(0,pos) + content.substring(pos + off),replica.lookup());
}

Fixed version (ground truth):
@Test public void testDelete() throws PreconditionException {
  String content="String_Node_Str";
  int pos=3, off=4;
  replica.applyLocal(SequenceOperation.insert(0,content));
  assertEquals(content,replica.lookup());
  replica.applyLocal(SequenceOperation.delete(pos,off));
  assertEquals(content.substring(0,pos) + content.substring(pos + off),replica.lookup());
}
Program: 50693
Project: 50693
Buggy source:
@Override protected List<SequenceMessage> localDelete(SequenceOperation opt) throws IncorrectTraceException {
  final TreedocDocument doc=((TreedocDocument)getDoc());
  final List<SequenceMessage> ops=new LinkedList<SequenceMessage>();
  for (int i=opt.getPosition(); i < opt.getPosition() + opt.getLenghOfADel(); i++) {
    final TreedocIdentifier deletedId=doc.deleteAt(restrictedIndex(i,false));
    ops.add(new TreedocOperation(opt,deletedId));
  }
  return ops;
}

Fixed version (ground truth):
@Override protected List<SequenceMessage> localDelete(SequenceOperation opt) throws IncorrectTraceException {
  final TreedocDocument doc=((TreedocDocument)getDoc());
  final List<SequenceMessage> ops=new LinkedList<SequenceMessage>();
  for (int i=opt.getPosition(); i < opt.getPosition() + opt.getLenghOfADel(); i++) {
    final TreedocIdentifier deletedId=doc.deleteAt(restrictedIndex(opt.getPosition(),false));
    ops.add(new TreedocOperation(opt,deletedId));
  }
  return ops;
}
Program: 50694
Project: 50694
Buggy source:
@Override protected List<SequenceMessage> generateLocal(SequenceOperation opt) throws IncorrectTraceException {
  final TreedocDocument doc=((TreedocDocument)getDoc());
  final List<SequenceMessage> ops=new LinkedList<SequenceMessage>();
switch (opt.getType()) {
case ins:
    final TreedocIdentifier id=doc.insertAt(restrictedIndex(opt.getPosition(),true),opt.getContentAsString());
  ops.add(new TreedocOperation(opt,id,opt.getContentAsString()));
break;
case del:
for (int i=opt.getPosition(); i < opt.getPosition() + opt.getNumberOf(); i++) {
final TreedocIdentifier deletedId=doc.deleteAt(restrictedIndex(i,false));
ops.add(new TreedocOperation(opt,deletedId));
}
break;
default :
throw new IncorrectTraceException("String_Node_Str");
}
return ops;
}

Fixed version (ground truth):
@Override protected List<SequenceMessage> generateLocal(SequenceOperation opt) throws IncorrectTraceException {
  final TreedocDocument doc=((TreedocDocument)getDoc());
  final List<SequenceMessage> ops=new LinkedList<SequenceMessage>();
switch (opt.getType()) {
case ins:
    final TreedocIdentifier id=doc.insertAt(restrictedIndex(opt.getPosition(),true),opt.getContentAsString(),getReplicaNumber());
  ops.add(new TreedocOperation(opt,id,opt.getContentAsString()));
break;
case del:
for (int i=opt.getPosition(); i < opt.getPosition() + opt.getNumberOf(); i++) {
final TreedocIdentifier deletedId=doc.deleteAt(restrictedIndex(i,false));
ops.add(new TreedocOperation(opt,deletedId));
}
break;
default :
throw new IncorrectTraceException("String_Node_Str");
}
return ops;
}
Program: 50695
Project: 50695
Buggy source:
public TreedocMerge(int r){
  super(new TreedocDocument(UniqueTag.createGenerator(r)),r);
}

Fixed version (ground truth):
public TreedocMerge(int r){
  super(new TreedocDocument(UniqueTag.createGenerator()),r);
}
Program: 50696
Project: 50696
Buggy source:
public TreedocIdentifier insertAt(final int index,final String content){
  final TreedocNode newNode=new TreedocNode(tagGenerator.nextTag());
  newNode.createBalancedSubtreeOfContent(content,0,content.length());
  final Recorder idRecorder=new Recorder();
  final TreedocNode precedingNode;
  if (index == 0) {
    precedingNode=this;
    precedingNode.subtreeSize+=content.length();
  }
 else {
    precedingNode=findNthContentAndAlterSize(new DecreasingCounter(index),idRecorder,content.length());
  }
  precedingNode.insertAfter(newNode,idRecorder);
  return idRecorder.createIdentifier();
}

Fixed version (ground truth):
public TreedocIdentifier insertAt(final int index,final String content,final int replicaId){
  final TreedocNode newNode=new TreedocNode(tagGenerator.nextTag(replicaId));
  newNode.createBalancedSubtreeOfContent(content,0,content.length());
  final Recorder idRecorder=new Recorder();
  final TreedocNode precedingNode;
  if (index == 0) {
    precedingNode=this;
    precedingNode.subtreeSize+=content.length();
  }
 else {
    precedingNode=findNthContentAndAlterSize(new DecreasingCounter(index),idRecorder,content.length());
  }
  precedingNode.insertAfter(newNode,idRecorder);
  return idRecorder.createIdentifier();
}
Program: 50697
Project: 50697
Buggy source:
@Override public UniqueTag nextTag(){
  return new UniqueTag(replicaId,currentStamp++);
}

Fixed version (ground truth):
@Override public UniqueTag nextTag(final int replicaId){
  return new UniqueTag(replicaId,currentStamp++);
}
Program: 50698
Project: 50698
Buggy source:
public static UniqueTagGenerator createGenerator(final int replicaId){
  return new UniqueTagGenerator(){
    int currentStamp;
    @Override public UniqueTag nextTag(){
      return new UniqueTag(replicaId,currentStamp++);
    }
  }
;
}

Fixed version (ground truth):
public static UniqueTagGenerator createGenerator(){
  return new UniqueTagGenerator(){
    int currentStamp;
    @Override public UniqueTag nextTag(    final int replicaId){
      return new UniqueTag(replicaId,currentStamp++);
    }
  }
;
}
Program: 50699
Project: 50699
Buggy source:
UniqueTag nextTag();

Fixed version (ground truth):
UniqueTag nextTag(int replicaId);
Program: 50700
Project: 50700
Buggy source:
@Test public void testCreateSingle(){
  root.insertAt(0,"String_Node_Str");
  assertEquals(1,root.getSubtreeSize());
  assertEquals("String_Node_Str",root.getContent());
}

Fixed version (ground truth):
@Test public void testCreateSingle(){
  root.insertAt(0,"String_Node_Str",REPLICA_ID);
  assertEquals(1,root.getSubtreeSize());
  assertEquals("String_Node_Str",root.getContent());
}
Program: 50701
Project: 50701
Buggy source:
@Test public void test(){
  root.insertAt(0,"String_Node_Str");
  root.deleteAt(0);
  root.insertAt(0,"String_Node_Str");
}

Fixed version (ground truth):
@Test public void test(){
  root.insertAt(0,"String_Node_Str",REPLICA_ID);
  root.deleteAt(0);
  root.insertAt(0,"String_Node_Str",REPLICA_ID);
}
Program: 50702
Project: 50702
Buggy source:
@Test public void testInsertAtMiddle(){
  root.insertAt(0,"String_Node_Str");
  root.insertAt(1,"String_Node_Str");
  root.insertAt(1,"String_Node_Str");
  assertEquals("String_Node_Str",root.getContent());
}

Fixed version (ground truth):
@Test public void testInsertAtMiddle(){
  root.insertAt(0,"String_Node_Str",REPLICA_ID);
  root.insertAt(1,"String_Node_Str",REPLICA_ID);
  root.insertAt(1,"String_Node_Str",REPLICA_ID);
  assertEquals("String_Node_Str",root.getContent());
}
Program: 50703
Project: 50703
Buggy source:
@Test public void testInsertAtBeginning(){
  root.insertAt(0,"String_Node_Str");
  root.insertAt(0,"String_Node_Str");
  assertEquals(2,root.getSubtreeSize());
  assertEquals("String_Node_Str",root.getContent());
}

Fixed version (ground truth):
@Test public void testInsertAtBeginning(){
  root.insertAt(0,"String_Node_Str",REPLICA_ID);
  root.insertAt(0,"String_Node_Str",REPLICA_ID);
  assertEquals(2,root.getSubtreeSize());
  assertEquals("String_Node_Str",root.getContent());
}
Program: 50704
Project: 50704
Buggy source:
@Before public void setUp() throws Exception {
  root=new TreedocRoot(UniqueTag.createGenerator(0));
}

Fixed version (ground truth):
@Before public void setUp() throws Exception {
  root=new TreedocRoot(UniqueTag.createGenerator());
}
Program: 50705
Project: 50705
Buggy source:
@Test public void testInsertAtEnd(){
  root.insertAt(0,"String_Node_Str");
  root.insertAt(1,"String_Node_Str");
  assertEquals(2,root.getSubtreeSize());
  assertEquals("String_Node_Str",root.getContent());
}

Fixed version (ground truth):
@Test public void testInsertAtEnd(){
  root.insertAt(0,"String_Node_Str",REPLICA_ID);
  root.insertAt(1,"String_Node_Str",REPLICA_ID);
  assertEquals(2,root.getSubtreeSize());
  assertEquals("String_Node_Str",root.getContent());
}
Program: 50706
Project: 50706
Buggy source:
@Test public void testInsertsDeletesInterleaved(){
  root.insertAt(0,"String_Node_Str");
  root.insertAt(1,"String_Node_Str");
  root.insertAt(1,"String_Node_Str");
  root.deleteAt(1);
  root.insertAt(1,"String_Node_Str");
  root.deleteAt(0);
  root.insertAt(0,"String_Node_Str");
  root.deleteAt(2);
  root.insertAt(2,"String_Node_Str");
  assertEquals("String_Node_Str",root.getContent());
}

Fixed version (ground truth):
@Test public void testInsertsDeletesInterleaved(){
  root.insertAt(0,"String_Node_Str",REPLICA_ID);
  root.insertAt(1,"String_Node_Str",REPLICA_ID);
  root.insertAt(1,"String_Node_Str",REPLICA_ID);
  root.deleteAt(1);
  root.insertAt(1,"String_Node_Str",REPLICA_ID);
  root.deleteAt(0);
  root.insertAt(0,"String_Node_Str",REPLICA_ID);
  root.deleteAt(2);
  root.insertAt(2,"String_Node_Str",REPLICA_ID);
  assertEquals("String_Node_Str",root.getContent());
}
Program: 50707
Project: 50707
Buggy source:
@Test public void testInsertsDeletesInserts(){
  root.insertAt(0,"String_Node_Str");
  root.deleteAt(0);
  root.insertAt(0,"String_Node_Str");
  root.insertAt(1,"String_Node_Str");
  root.insertAt(2,"String_Node_Str");
  assertEquals("String_Node_Str",root.getContent());
}

Fixed version (ground truth):
@Test public void testInsertsDeletesInserts(){
  root.insertAt(0,"String_Node_Str",REPLICA_ID);
  root.deleteAt(0);
  root.insertAt(0,"String_Node_Str",REPLICA_ID);
  root.insertAt(1,"String_Node_Str",REPLICA_ID);
  root.insertAt(2,"String_Node_Str",REPLICA_ID);
  assertEquals("String_Node_Str",root.getContent());
}
Program: 50708
Project: 50708
Buggy source:
@Test public void testGenerator(){
  final UniqueTagGenerator generator=UniqueTag.createGenerator(123);
  assertEquals(new UniqueTag(123,0),generator.nextTag());
  assertEquals(new UniqueTag(123,1),generator.nextTag());
}

Fixed version (ground truth):
@Test public void testGenerator(){
  final UniqueTagGenerator generator=UniqueTag.createGenerator();
  assertEquals(new UniqueTag(123,0),generator.nextTag(123));
  assertEquals(new UniqueTag(123,1),generator.nextTag(123));
}