nus-yam/ex-repair huggingface dataset:
Program: 53906
Project: 53906
Buggy source:
@Override protected void renderRowValues(SafeHtmlBuilder sb,List<T> values,int start,SelectionModel<? super T> selectionModel){
  String keyboardSelectedItem="String_Node_Str" + style.cellListKeyboardSelectedItem();
  String selectedItem="String_Node_Str" + style.cellListSelectedItem();
  String evenItem=style.cellListEvenItem();
  String oddItem=style.cellListOddItem();
  int keyboardSelectedRow=getKeyboardSelectedRow() + getPageStart();
  int length=values.size();
  int end=start + length;
  for (int i=start; i < end; i++) {
    T value=values.get(i - start);
    boolean isSelected=selectionModel == null ? false : selectionModel.isSelected(value);
    StringBuilder classesBuilder=new StringBuilder();
    classesBuilder.append(i % 2 == 0 ? evenItem : oddItem);
    if (isSelected) {
      classesBuilder.append(selectedItem);
    }
    SafeHtmlBuilder cellBuilder=new SafeHtmlBuilder();
    cell.render(value,null,cellBuilder);
    if (i == keyboardSelectedRow) {
      if (isFocused) {
        classesBuilder.append(keyboardSelectedItem);
      }
      char accessKey=getAccessKey();
      if (accessKey != 0) {
        sb.append(TEMPLATE.divFocusableWithKey(i,classesBuilder.toString(),getTabIndex(),accessKey,cellBuilder.toSafeHtml()));
      }
 else {
        sb.append(TEMPLATE.divFocusable(i,classesBuilder.toString(),getTabIndex(),cellBuilder.toSafeHtml()));
      }
    }
 else {
      sb.append(TEMPLATE.div(i,classesBuilder.toString(),cellBuilder.toSafeHtml()));
    }
  }
}

Fixed version (ground truth):
@Override protected void renderRowValues(SafeHtmlBuilder sb,List<T> values,int start,SelectionModel<? super T> selectionModel){
  String keyboardSelectedItem="String_Node_Str" + style.cellListKeyboardSelectedItem();
  String selectedItem="String_Node_Str" + style.cellListSelectedItem();
  String evenItem=style.cellListEvenItem();
  String oddItem=style.cellListOddItem();
  int keyboardSelectedRow=getKeyboardSelectedRow() + getPageStart();
  int length=values.size();
  int end=start + length;
  for (int i=start; i < end; i++) {
    T value=values.get(i - start);
    boolean isSelected=selectionModel == null ? false : selectionModel.isSelected(value);
    StringBuilder classesBuilder=new StringBuilder();
    classesBuilder.append(i % 2 == 0 ? evenItem : oddItem);
    if (isSelected) {
      classesBuilder.append(selectedItem);
    }
    SafeHtmlBuilder cellBuilder=new SafeHtmlBuilder();
    cell.render(value,getValueKey(value),cellBuilder);
    if (i == keyboardSelectedRow) {
      if (isFocused) {
        classesBuilder.append(keyboardSelectedItem);
      }
      char accessKey=getAccessKey();
      if (accessKey != 0) {
        sb.append(TEMPLATE.divFocusableWithKey(i,classesBuilder.toString(),getTabIndex(),accessKey,cellBuilder.toSafeHtml()));
      }
 else {
        sb.append(TEMPLATE.divFocusable(i,classesBuilder.toString(),getTabIndex(),cellBuilder.toSafeHtml()));
      }
    }
 else {
      sb.append(TEMPLATE.div(i,classesBuilder.toString(),cellBuilder.toSafeHtml()));
    }
  }
}
Program: 53907
Project: 53907
Buggy source:
@SuppressWarnings("String_Node_Str") @Override protected void onBrowserEvent2(Event event){
  EventTarget eventTarget=event.getEventTarget();
  if (!Element.is(eventTarget)) {
    return;
  }
  final Element target=event.getEventTarget().cast();
  String idxString="String_Node_Str";
  Element cellTarget=target;
  while ((cellTarget != null) && ((idxString=cellTarget.getAttribute("String_Node_Str")).length() == 0)) {
    cellTarget=cellTarget.getParentElement();
  }
  if (idxString.length() > 0) {
    String eventType=event.getType();
    boolean isClick="String_Node_Str".equals(eventType);
    int idx=Integer.parseInt(idxString);
    int indexOnPage=idx - getPageStart();
    if (!isRowWithinBounds(indexOnPage)) {
      return;
    }
    boolean isSelectionHandled=cell.handlesSelection() || KeyboardSelectionPolicy.BOUND_TO_SELECTION == getKeyboardSelectionPolicy();
    Element cellParent=getCellParent(cellTarget);
    T value=getVisibleItem(indexOnPage);
    CellPreviewEvent<T> previewEvent=CellPreviewEvent.fire(this,event,this,indexOnPage,value,cellIsEditing,isSelectionHandled);
    if (isClick && !cellIsEditing && !isSelectionHandled) {
      doSelection(event,value,indexOnPage);
    }
    if (isClick && getPresenter().getKeyboardSelectedRowInView() != indexOnPage) {
      boolean isFocusable=CellBasedWidgetImpl.get().isFocusable(target);
      isFocused=isFocused || isFocusable;
      getPresenter().setKeyboardSelectedRow(indexOnPage,!isFocusable);
    }
    if (!previewEvent.isCanceled()) {
      fireEventToCell(event,cellParent,value);
    }
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") @Override protected void onBrowserEvent2(Event event){
  EventTarget eventTarget=event.getEventTarget();
  if (!Element.is(eventTarget)) {
    return;
  }
  final Element target=event.getEventTarget().cast();
  String idxString="String_Node_Str";
  Element cellTarget=target;
  while ((cellTarget != null) && ((idxString=cellTarget.getAttribute("String_Node_Str")).length() == 0)) {
    cellTarget=cellTarget.getParentElement();
  }
  if (idxString.length() > 0) {
    String eventType=event.getType();
    boolean isClick="String_Node_Str".equals(eventType);
    int idx=Integer.parseInt(idxString);
    int indexOnPage=idx - getPageStart();
    if (!isRowWithinBounds(indexOnPage)) {
      return;
    }
    boolean isSelectionHandled=cell.handlesSelection() || KeyboardSelectionPolicy.BOUND_TO_SELECTION == getKeyboardSelectionPolicy();
    Element cellParent=getCellParent(cellTarget);
    T value=getVisibleItem(indexOnPage);
    CellPreviewEvent<T> previewEvent=CellPreviewEvent.fire(this,event,this,indexOnPage,value,cellIsEditing,isSelectionHandled);
    if (isClick && !cellIsEditing && !isSelectionHandled) {
      doSelection(event,value,indexOnPage);
    }
    if (isClick) {
      boolean isFocusable=CellBasedWidgetImpl.get().isFocusable(target);
      isFocused=isFocused || isFocusable;
      getPresenter().setKeyboardSelectedRow(indexOnPage,!isFocusable,false);
    }
    if (!previewEvent.isCanceled()) {
      fireEventToCell(event,cellParent,value);
    }
  }
}
Program: 53908
Project: 53908
Buggy source:
@Override protected void setKeyboardSelected(int index,boolean selected,boolean stealFocus){
  if (!isRowWithinBounds(index)) {
    return;
  }
  Element elem=getRowElement(index);
  if (!selected || isFocused || stealFocus) {
    setStyleName(elem,style.cellListKeyboardSelectedItem(),selected);
  }
  setFocusable(elem,selected);
  if (selected && stealFocus) {
    elem.focus();
    onFocus();
  }
}

Fixed version (ground truth):
@Override protected void setKeyboardSelected(int index,boolean selected,boolean stealFocus){
  if (!isRowWithinBounds(index)) {
    return;
  }
  Element elem=getRowElement(index);
  if (!selected || isFocused || stealFocus) {
    setStyleName(elem,style.cellListKeyboardSelectedItem(),selected);
  }
  setFocusable(elem,selected);
  if (selected && stealFocus && !cellIsEditing) {
    elem.focus();
    onFocus();
  }
}
Program: 53910
Project: 53910
Buggy source:
private boolean handleKey(Event event){
  HasDataPresenter<T> presenter=getPresenter();
  int oldRow=getKeyboardSelectedRow();
  boolean isRtl=LocaleInfo.getCurrentLocale().isRTL();
  int keyCodeLineEnd=isRtl ? KeyCodes.KEY_LEFT : KeyCodes.KEY_RIGHT;
  int keyCodeLineStart=isRtl ? KeyCodes.KEY_RIGHT : KeyCodes.KEY_LEFT;
  int keyCode=event.getKeyCode();
  if (keyCode == keyCodeLineEnd) {
    int nextColumn=findInteractiveColumn(keyboardSelectedColumn,false);
    if (nextColumn <= keyboardSelectedColumn) {
      if (presenter.hasKeyboardNext()) {
        keyboardSelectedColumn=nextColumn;
        presenter.keyboardNext();
        event.preventDefault();
        return true;
      }
    }
 else {
      keyboardSelectedColumn=nextColumn;
      getPresenter().setKeyboardSelectedRow(oldRow,true);
      event.preventDefault();
      return true;
    }
  }
 else   if (keyCode == keyCodeLineStart) {
    int prevColumn=findInteractiveColumn(keyboardSelectedColumn,true);
    if (prevColumn >= keyboardSelectedColumn) {
      if (presenter.hasKeyboardPrev()) {
        keyboardSelectedColumn=prevColumn;
        presenter.keyboardPrev();
        event.preventDefault();
        return true;
      }
    }
 else {
      keyboardSelectedColumn=prevColumn;
      getPresenter().setKeyboardSelectedRow(oldRow,true);
      event.preventDefault();
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
private boolean handleKey(Event event){
  HasDataPresenter<T> presenter=getPresenter();
  int oldRow=getKeyboardSelectedRow();
  boolean isRtl=LocaleInfo.getCurrentLocale().isRTL();
  int keyCodeLineEnd=isRtl ? KeyCodes.KEY_LEFT : KeyCodes.KEY_RIGHT;
  int keyCodeLineStart=isRtl ? KeyCodes.KEY_RIGHT : KeyCodes.KEY_LEFT;
  int keyCode=event.getKeyCode();
  if (keyCode == keyCodeLineEnd) {
    int nextColumn=findInteractiveColumn(keyboardSelectedColumn,false);
    if (nextColumn <= keyboardSelectedColumn) {
      if (presenter.hasKeyboardNext()) {
        keyboardSelectedColumn=nextColumn;
        presenter.keyboardNext();
        event.preventDefault();
        return true;
      }
    }
 else {
      keyboardSelectedColumn=nextColumn;
      getPresenter().setKeyboardSelectedRow(oldRow,true,true);
      event.preventDefault();
      return true;
    }
  }
 else   if (keyCode == keyCodeLineStart) {
    int prevColumn=findInteractiveColumn(keyboardSelectedColumn,true);
    if (prevColumn >= keyboardSelectedColumn) {
      if (presenter.hasKeyboardPrev()) {
        keyboardSelectedColumn=prevColumn;
        presenter.keyboardPrev();
        event.preventDefault();
        return true;
      }
    }
 else {
      keyboardSelectedColumn=prevColumn;
      getPresenter().setKeyboardSelectedRow(oldRow,true,true);
      event.preventDefault();
      return true;
    }
  }
  return false;
}
Program: 53911
Project: 53911
Buggy source:
@Override protected void setKeyboardSelected(int index,boolean selected,boolean stealFocus){
  if (KeyboardSelectionPolicy.DISABLED == getKeyboardSelectionPolicy() || !isRowWithinBounds(index) || columns.size() == 0) {
    return;
  }
  TableRowElement tr=getRowElement(index);
  String cellStyle=style.cellTableKeyboardSelectedCell();
  boolean updatedSelection=!selected || isFocused || stealFocus;
  setRowStyleName(tr,style.cellTableKeyboardSelectedRow(),style.cellTableKeyboardSelectedRowCell(),selected);
  NodeList<TableCellElement> cells=tr.getCells();
  for (int i=0; i < cells.getLength(); i++) {
    TableCellElement td=cells.getItem(i);
    setStyleName(td,cellStyle,updatedSelection && selected && i == keyboardSelectedColumn);
    final com.google.gwt.user.client.Element cellParent=getCellParent(td).cast();
    setFocusable(cellParent,selected && i == keyboardSelectedColumn);
  }
  if (selected && stealFocus) {
    TableCellElement td=tr.getCells().getItem(keyboardSelectedColumn);
    final com.google.gwt.user.client.Element cellParent=getCellParent(td).cast();
    CellBasedWidgetImpl.get().resetFocus(new Scheduler.ScheduledCommand(){
      public void execute(){
        cellParent.focus();
      }
    }
);
  }
}

Fixed version (ground truth):
@Override protected void setKeyboardSelected(int index,boolean selected,boolean stealFocus){
  if (KeyboardSelectionPolicy.DISABLED == getKeyboardSelectionPolicy() || !isRowWithinBounds(index) || columns.size() == 0) {
    return;
  }
  TableRowElement tr=getRowElement(index);
  String cellStyle=style.cellTableKeyboardSelectedCell();
  boolean updatedSelection=!selected || isFocused || stealFocus;
  setRowStyleName(tr,style.cellTableKeyboardSelectedRow(),style.cellTableKeyboardSelectedRowCell(),selected);
  NodeList<TableCellElement> cells=tr.getCells();
  for (int i=0; i < cells.getLength(); i++) {
    TableCellElement td=cells.getItem(i);
    setStyleName(td,cellStyle,updatedSelection && selected && i == keyboardSelectedColumn);
    final com.google.gwt.user.client.Element cellParent=getCellParent(td).cast();
    setFocusable(cellParent,selected && i == keyboardSelectedColumn);
  }
  if (selected && stealFocus && !cellIsEditing) {
    TableCellElement td=tr.getCells().getItem(keyboardSelectedColumn);
    final com.google.gwt.user.client.Element cellParent=getCellParent(td).cast();
    CellBasedWidgetImpl.get().resetFocus(new Scheduler.ScheduledCommand(){
      public void execute(){
        cellParent.focus();
      }
    }
);
  }
}
Program: 53912
Project: 53912
Buggy source:
/** 
 * Select or deselect this node with the keyboard.
 * @param selected true if selected, false if not
 * @param stealFocus true to steal focus
 */
void setKeyboardSelected(boolean selected,boolean stealFocus){
  if (tree.isKeyboardSelectionDisabled()) {
    return;
  }
  if (!selected || tree.isFocused || stealFocus) {
    setKeyboardSelectedStyle(selected);
  }
  Element cellParent=getCellParent();
  if (!selected) {
    cellParent.setTabIndex(-1);
    cellParent.removeAttribute("String_Node_Str");
    cellParent.removeAttribute("String_Node_Str");
  }
 else {
    FocusImpl focusImpl=FocusImpl.getFocusImplForWidget();
    com.google.gwt.user.client.Element cellElem=cellParent.cast();
    focusImpl.setTabIndex(cellElem,tree.getTabIndex());
    char accessKey=tree.getAccessKey();
    if (accessKey != 0) {
      focusImpl.setAccessKey(cellElem,accessKey);
    }
    if (stealFocus) {
      cellElem.focus();
    }
  }
  if (KeyboardSelectionPolicy.BOUND_TO_SELECTION == tree.getKeyboardSelectionPolicy()) {
    setSelected(selected);
  }
}

Fixed version (ground truth):
/** 
 * Select or deselect this node with the keyboard.
 * @param selected true if selected, false if not
 * @param stealFocus true to steal focus
 */
void setKeyboardSelected(boolean selected,boolean stealFocus){
  if (tree.isKeyboardSelectionDisabled()) {
    return;
  }
  if (!selected || tree.isFocused || stealFocus) {
    setKeyboardSelectedStyle(selected);
  }
  Element cellParent=getCellParent();
  if (!selected) {
    cellParent.setTabIndex(-1);
    cellParent.removeAttribute("String_Node_Str");
    cellParent.removeAttribute("String_Node_Str");
  }
 else {
    FocusImpl focusImpl=FocusImpl.getFocusImplForWidget();
    com.google.gwt.user.client.Element cellElem=cellParent.cast();
    focusImpl.setTabIndex(cellElem,tree.getTabIndex());
    char accessKey=tree.getAccessKey();
    if (accessKey != 0) {
      focusImpl.setAccessKey(cellElem,accessKey);
    }
    if (stealFocus && !tree.cellIsEditing) {
      cellElem.focus();
    }
  }
  if (KeyboardSelectionPolicy.BOUND_TO_SELECTION == tree.getKeyboardSelectionPolicy()) {
    setSelected(selected);
  }
}
Program: 53913
Project: 53913
Buggy source:
/** 
 * Move keyboard selection to the absolute 0th row.
 */
public void keyboardHome(){
  if (!keyboardPagingPolicy.isLimitedToRange()) {
    setKeyboardSelectedRow(-getPageStart(),true);
  }
}

Fixed version (ground truth):
/** 
 * Move keyboard selection to the absolute 0th row.
 */
public void keyboardHome(){
  if (!keyboardPagingPolicy.isLimitedToRange()) {
    setKeyboardSelectedRow(-getPageStart(),true,false);
  }
}
Program: 53914
Project: 53914
Buggy source:
/** 
 * Move keyboard selection to the next row.
 */
public void keyboardNext(){
  if (hasKeyboardNext()) {
    setKeyboardSelectedRow(getKeyboardSelectedRow() + 1,true);
  }
}

Fixed version (ground truth):
/** 
 * Move keyboard selection to the next row.
 */
public void keyboardNext(){
  if (hasKeyboardNext()) {
    setKeyboardSelectedRow(getKeyboardSelectedRow() + 1,true,false);
  }
}
Program: 53915
Project: 53915
Buggy source:
/** 
 * Move keyboard selection to the last row.
 */
public void keyboardEnd(){
  if (!keyboardPagingPolicy.isLimitedToRange()) {
    setKeyboardSelectedRow(getRowCount() - 1,true);
  }
}

Fixed version (ground truth):
/** 
 * Move keyboard selection to the last row.
 */
public void keyboardEnd(){
  if (!keyboardPagingPolicy.isLimitedToRange()) {
    setKeyboardSelectedRow(getRowCount() - 1,true,false);
  }
}
Program: 53917
Project: 53917
Buggy source:
/** 
 * Move keyboard selection to the previous row.
 */
public void keyboardPrev(){
  if (hasKeyboardPrev()) {
    setKeyboardSelectedRow(getKeyboardSelectedRow() - 1,true);
  }
}

Fixed version (ground truth):
/** 
 * Move keyboard selection to the previous row.
 */
public void keyboardPrev(){
  if (hasKeyboardPrev()) {
    setKeyboardSelectedRow(getKeyboardSelectedRow() - 1,true,false);
  }
}
Program: 53918
Project: 53918
Buggy source:
/** 
 * Move keyboard selection to the next page.
 */
public void keyboardNextPage(){
  if (KeyboardPagingPolicy.CHANGE_PAGE == keyboardPagingPolicy) {
    setKeyboardSelectedRow(getPageSize(),true);
  }
 else   if (KeyboardPagingPolicy.INCREASE_RANGE == keyboardPagingPolicy) {
    setKeyboardSelectedRow(getKeyboardSelectedRow() + PAGE_INCREMENT,true);
  }
}

Fixed version (ground truth):
/** 
 * Move keyboard selection to the next page.
 */
public void keyboardNextPage(){
  if (KeyboardPagingPolicy.CHANGE_PAGE == keyboardPagingPolicy) {
    setKeyboardSelectedRow(getPageSize(),true,false);
  }
 else   if (KeyboardPagingPolicy.INCREASE_RANGE == keyboardPagingPolicy) {
    setKeyboardSelectedRow(getKeyboardSelectedRow() + PAGE_INCREMENT,true,false);
  }
}
Program: 53919
Project: 53919
Buggy source:
/** 
 * Move keyboard selection to the previous page.
 */
public void keyboardPrevPage(){
  if (KeyboardPagingPolicy.CHANGE_PAGE == keyboardPagingPolicy) {
    setKeyboardSelectedRow(-getPageSize(),true);
  }
 else   if (KeyboardPagingPolicy.INCREASE_RANGE == keyboardPagingPolicy) {
    setKeyboardSelectedRow(getKeyboardSelectedRow() - PAGE_INCREMENT,true);
  }
}

Fixed version (ground truth):
/** 
 * Move keyboard selection to the previous page.
 */
public void keyboardPrevPage(){
  if (KeyboardPagingPolicy.CHANGE_PAGE == keyboardPagingPolicy) {
    setKeyboardSelectedRow(-getPageSize(),true,false);
  }
 else   if (KeyboardPagingPolicy.INCREASE_RANGE == keyboardPagingPolicy) {
    setKeyboardSelectedRow(getKeyboardSelectedRow() - PAGE_INCREMENT,true,false);
  }
}
Program: 53920
Project: 53920
Buggy source:
private boolean classImplementsMethod(JClassType cls,JMethod meth){
  while (cls != null) {
    JMethod found=cls.findMethod(meth.getName(),methodParamTypes(meth));
    if ((found != null) && !found.isAbstract()) {
      return true;
    }
    cls=cls.getSuperclass();
  }
  return false;
}

Fixed version (ground truth):
private boolean classImplementsMethod(JClassType cls,JMethod meth){
  while (cls != null) {
    JMethod found=cls.findMethod(meth.getName(),meth.getParameterTypes());
    if ((found != null) && !found.isAbstract()) {
      return true;
    }
    cls=cls.getSuperclass();
  }
  return false;
}
Program: 53921
Project: 53921
Buggy source:
/** 
 * Updates the list of jsoSingleImpl types from recently-added types.
 */
private void computeSingleJsoImplData(JClassType... newTypes){
  JClassType jsoType=findType(JSO_CLASS);
  if (jsoType == null) {
    return;
  }
  for (  JClassType type : newTypes) {
    if (!jsoType.isAssignableFrom(type)) {
      continue;
    }
    for (    JClassType intf : JClassType.getFlattenedSuperTypeHierarchy(type)) {
      if (intf.isInterface() == null) {
        continue;
      }
      if (intf.getOverridableMethods().length == 0) {
        jsoSingleImpls.put(intf,jsoType);
        continue;
      }
      JClassType previousType=jsoSingleImpls.get(intf);
      if (previousType == null) {
        jsoSingleImpls.put(intf,type);
      }
 else       if (type.isAssignableFrom(previousType)) {
        jsoSingleImpls.put(intf,type);
      }
 else       if (type.isAssignableTo(previousType)) {
      }
 else {
        JClassType impl=findFullyImplementingBase(intf,type,previousType);
        if (impl != null) {
          jsoSingleImpls.put(intf,impl);
        }
 else {
          throw new InternalCompilerException("String_Node_Str" + previousType.getName() + "String_Node_Str"+ intf.getName()+ "String_Node_Str"+ type.getName()+ "String_Node_Str"+ "String_Node_Str");
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates the list of jsoSingleImpl types from recently-added types.
 */
private void computeSingleJsoImplData(JClassType... newTypes){
  JClassType jsoType=findType(JSO_CLASS);
  if (jsoType == null) {
    return;
  }
  for (  JClassType type : newTypes) {
    if (!jsoType.isAssignableFrom(type)) {
      continue;
    }
    for (    JClassType intf : JClassType.getFlattenedSuperTypeHierarchy(type)) {
      if (intf instanceof JParameterizedType) {
        intf=((JParameterizedType)intf).getBaseType();
      }
      if (intf.isInterface() == null) {
        continue;
      }
      if (intf.getOverridableMethods().length == 0) {
        jsoSingleImpls.put(intf,jsoType);
        continue;
      }
      JClassType previousType=jsoSingleImpls.get(intf);
      if (previousType == null) {
        jsoSingleImpls.put(intf,type);
      }
 else       if (type.isAssignableFrom(previousType)) {
        jsoSingleImpls.put(intf,type);
      }
 else       if (type.isAssignableTo(previousType)) {
      }
 else {
        JClassType impl=findFullyImplementingBase(intf,type,previousType);
        if (impl != null) {
          jsoSingleImpls.put(intf,impl);
        }
 else {
          throw new InternalCompilerException("String_Node_Str" + previousType.getName() + "String_Node_Str"+ intf.getName()+ "String_Node_Str"+ type.getName()+ "String_Node_Str"+ "String_Node_Str");
        }
      }
    }
  }
}
Program: 53922
Project: 53922
Buggy source:
public Object getKey(T item){
  return keyProvider == null ? item : keyProvider.getKey(item);
}

Fixed version (ground truth):
public Object getKey(T item){
  return (keyProvider == null || item == null) ? item : keyProvider.getKey(item);
}
Program: 53923
Project: 53923
Buggy source:
public void setSelected(T object,boolean selected){
  newSelectedObject=object;
  newSelected=selected;
  newSelectedPending=true;
  scheduleSelectionChangeEvent();
}

Fixed version (ground truth):
public void setSelected(T object,boolean selected){
  if (!selected) {
    Object oldKey=newSelectedPending ? getKey(newSelectedObject) : curKey;
    Object newKey=getKey(object);
    if (!equalsOrBothNull(oldKey,newKey)) {
      return;
    }
  }
  newSelectedObject=object;
  newSelected=selected;
  newSelectedPending=true;
  scheduleSelectionChangeEvent();
}
Program: 53924
Project: 53924
Buggy source:
private void resolveChanges(){
  if (!newSelectedPending) {
    return;
  }
  Object key=(newSelectedObject == null) ? null : getKey(newSelectedObject);
  boolean sameKey=curKey == null ? key == null : curKey.equals(key);
  boolean changed=false;
  if (newSelected) {
    changed=!sameKey;
    curSelection=newSelectedObject;
    curKey=key;
  }
 else   if (sameKey) {
    changed=true;
    curSelection=null;
    curKey=null;
  }
  newSelectedObject=null;
  newSelectedPending=false;
  if (changed) {
    SelectionChangeEvent.fire(this);
  }
}

Fixed version (ground truth):
private void resolveChanges(){
  if (!newSelectedPending) {
    return;
  }
  Object key=getKey(newSelectedObject);
  boolean sameKey=equalsOrBothNull(curKey,key);
  boolean changed=false;
  if (newSelected) {
    changed=!sameKey;
    curSelection=newSelectedObject;
    curKey=key;
  }
 else   if (sameKey) {
    changed=true;
    curSelection=null;
    curKey=null;
  }
  newSelectedObject=null;
  newSelectedPending=false;
  if (changed) {
    SelectionChangeEvent.fire(this);
  }
}
Program: 53925
Project: 53925
Buggy source:
private void registerParsers(){
  addElementParser("String_Node_Str","String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
}

Fixed version (ground truth):
private void registerParsers(){
  addElementParser("String_Node_Str","String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
  addWidgetParser("String_Node_Str");
}
Program: 53927
Project: 53927
Buggy source:
public <T>NodeInfo<?> getNodeInfo(T value){
  if (value == ROOT_VALUE) {
    return new DefaultNodeInfo<String>(rootDataProvider,cell);
  }
 else   if (value instanceof String) {
    String prefix=(String)value;
    if (prefix.length() > 3) {
      throw new IllegalStateException("String_Node_Str");
    }
    return new DefaultNodeInfo<String>(createDataProvider(prefix),cell);
  }
  throw new IllegalArgumentException("String_Node_Str");
}

Fixed version (ground truth):
public NodeInfo<?> getNodeInfo(Object value){
  ProvidesKey<String> keyProvider=new ProvidesKey<String>(){
    public Object getKey(    String item){
      return Integer.parseInt(item.substring(0,1));
    }
  }
;
  ListDataProvider<String> dataProvider=new ListDataProvider<String>(keyProvider);
  dataProvider.getList().add("String_Node_Str");
  dataProvider.getList().add("String_Node_Str");
  dataProvider.getList().add("String_Node_Str");
  return new DefaultNodeInfo<String>(dataProvider,cell);
}
Program: 53928
Project: 53928
Buggy source:
public boolean isLeaf(Object value){
  if (value == ROOT_VALUE) {
    return false;
  }
 else   if (value instanceof String) {
    String s=(String)value;
    if (s.length() > 4) {
      throw new IllegalStateException("String_Node_Str");
    }
    return ((String)value).length() == 4;
  }
  throw new IllegalArgumentException("String_Node_Str");
}

Fixed version (ground truth):
public boolean isLeaf(Object value){
  return value != null;
}
Program: 53929
Project: 53929
Buggy source:
public static StringBuffer injectResources(StringBuffer selectionScript,ArtifactSet artifacts){
  int startPos=selectionScript.indexOf("String_Node_Str");
  if (startPos != -1) {
    for (    StylesheetReference resource : artifacts.find(StylesheetReference.class)) {
      String text=generateStylesheetInjector(resource.getSrc());
      selectionScript.insert(startPos,text);
      startPos+=text.length();
    }
  }
  startPos=selectionScript.indexOf("String_Node_Str");
  if (startPos != -1) {
    for (    ScriptReference resource : artifacts.find(ScriptReference.class)) {
      String text=generateScriptInjector(resource.getSrc());
      selectionScript.insert(startPos,text);
      startPos+=text.length();
    }
  }
  return selectionScript;
}

Fixed version (ground truth):
/** 
 * Installs stylesheets and scripts
 */
public static StringBuffer injectResources(StringBuffer selectionScript,ArtifactSet artifacts){
  int startPos=selectionScript.indexOf("String_Node_Str");
  if (startPos != -1) {
    for (    StylesheetReference resource : artifacts.find(StylesheetReference.class)) {
      String text=generateStylesheetInjector(resource.getSrc());
      selectionScript.insert(startPos,text);
      startPos+=text.length();
    }
  }
  startPos=selectionScript.indexOf("String_Node_Str");
  if (startPos != -1) {
    for (    ScriptReference resource : artifacts.find(ScriptReference.class)) {
      String text=generateScriptInjector(resource.getSrc());
      selectionScript.insert(startPos,text);
      startPos+=text.length();
    }
  }
  return selectionScript;
}
Program: 53930
Project: 53930
Buggy source:
/** 
 * Generate the primary fragment. The default implementation is based on  {@link #getModulePrefix(TreeLogger,LinkerContext,String,int)} and{@link #getModuleSuffix(TreeLogger,LinkerContext)}.
 */
protected byte[] generatePrimaryFragment(TreeLogger logger,LinkerContext context,CompilationResult result,String[] js) throws UnableToCompleteException {
  TextOutput to=new DefaultTextOutput(context.isOutputCompact());
  to.print(generatePrimaryFragmentString(logger,context,result.getStrongName(),js[0],js.length));
  return Util.getBytes(to.toString());
}

Fixed version (ground truth):
/** 
 * Generate the primary fragment. The default implementation is based on  {@link #getModulePrefix(TreeLogger,LinkerContext,String,int)} and{@link #getModuleSuffix(TreeLogger,LinkerContext)}.
 */
protected byte[] generatePrimaryFragment(TreeLogger logger,LinkerContext context,CompilationResult result,String[] js,ArtifactSet artifacts) throws UnableToCompleteException {
  TextOutput to=new DefaultTextOutput(context.isOutputCompact());
  to.print(generatePrimaryFragmentString(logger,context,result.getStrongName(),js[0],js.length,artifacts));
  return Util.getBytes(to.toString());
}
Program: 53931
Project: 53931
Buggy source:
protected String generatePrimaryFragmentString(TreeLogger logger,LinkerContext context,String strongName,String js,int length) throws UnableToCompleteException {
  StringBuffer b=new StringBuffer();
  b.append(getModulePrefix(logger,context,strongName,length));
  b.append(js);
  b.append(getModuleSuffix(logger,context));
  return wrapPrimaryFragment(logger,context,b.toString());
}

Fixed version (ground truth):
protected String generatePrimaryFragmentString(TreeLogger logger,LinkerContext context,String strongName,String js,int length,ArtifactSet artifacts) throws UnableToCompleteException {
  StringBuffer b=new StringBuffer();
  b.append(getModulePrefix(logger,context,strongName,length));
  b.append(js);
  b.append(getModuleSuffix(logger,context));
  return wrapPrimaryFragment(logger,context,b.toString(),artifacts);
}
Program: 53932
Project: 53932
Buggy source:
@Override public ArtifactSet link(TreeLogger logger,LinkerContext context,ArtifactSet artifacts,boolean onePermutation) throws UnableToCompleteException {
  if (onePermutation) {
    ArtifactSet toReturn=new ArtifactSet(artifacts);
    for (    CompilationResult compilation : toReturn.find(CompilationResult.class)) {
      toReturn.addAll(doEmitCompilation(logger,context,compilation));
    }
    return toReturn;
  }
 else {
    permutationsUtil.setupPermutationsMap(artifacts);
    ArtifactSet toReturn=new ArtifactSet(artifacts);
    EmittedArtifact art=emitSelectionScript(logger,context,artifacts);
    if (art != null) {
      toReturn.add(art);
    }
    maybeOutputPropertyMap(logger,context,toReturn);
    maybeAddHostedModeFile(logger,context,toReturn);
    return toReturn;
  }
}

Fixed version (ground truth):
@Override public ArtifactSet link(TreeLogger logger,LinkerContext context,ArtifactSet artifacts,boolean onePermutation) throws UnableToCompleteException {
  if (onePermutation) {
    ArtifactSet toReturn=new ArtifactSet(artifacts);
    for (    CompilationResult compilation : toReturn.find(CompilationResult.class)) {
      toReturn.addAll(doEmitCompilation(logger,context,compilation,artifacts));
    }
    return toReturn;
  }
 else {
    permutationsUtil.setupPermutationsMap(artifacts);
    ArtifactSet toReturn=new ArtifactSet(artifacts);
    EmittedArtifact art=emitSelectionScript(logger,context,artifacts);
    if (art != null) {
      toReturn.add(art);
    }
    maybeOutputPropertyMap(logger,context,toReturn);
    maybeAddHostedModeFile(logger,context,toReturn);
    return toReturn;
  }
}
Program: 53933
Project: 53933
Buggy source:
protected String wrapPrimaryFragment(TreeLogger logger,LinkerContext context,String script){
  return script;
}

Fixed version (ground truth):
protected String wrapPrimaryFragment(TreeLogger logger,LinkerContext context,String script,ArtifactSet artifacts){
  return script;
}
Program: 53934
Project: 53934
Buggy source:
protected Collection<Artifact<?>> doEmitCompilation(TreeLogger logger,LinkerContext context,CompilationResult result) throws UnableToCompleteException {
  String[] js=result.getJavaScript();
  byte[][] bytes=new byte[js.length][];
  bytes[0]=generatePrimaryFragment(logger,context,result,js);
  for (int i=1; i < js.length; i++) {
    bytes[i]=Util.getBytes(generateDeferredFragment(logger,context,i,js[i]));
  }
  Collection<Artifact<?>> toReturn=new ArrayList<Artifact<?>>();
  toReturn.add(emitBytes(logger,bytes[0],result.getStrongName() + getCompilationExtension(logger,context)));
  for (int i=1; i < js.length; i++) {
    toReturn.add(emitBytes(logger,bytes[i],FRAGMENT_SUBDIR + File.separator + result.getStrongName()+ File.separator+ i+ FRAGMENT_EXTENSION));
  }
  toReturn.addAll(emitSelectionInformation(result.getStrongName(),result));
  return toReturn;
}

Fixed version (ground truth):
protected Collection<Artifact<?>> doEmitCompilation(TreeLogger logger,LinkerContext context,CompilationResult result,ArtifactSet artifacts) throws UnableToCompleteException {
  String[] js=result.getJavaScript();
  byte[][] bytes=new byte[js.length][];
  bytes[0]=generatePrimaryFragment(logger,context,result,js,artifacts);
  for (int i=1; i < js.length; i++) {
    bytes[i]=Util.getBytes(generateDeferredFragment(logger,context,i,js[i]));
  }
  Collection<Artifact<?>> toReturn=new ArrayList<Artifact<?>>();
  toReturn.add(emitBytes(logger,bytes[0],result.getStrongName() + getCompilationExtension(logger,context)));
  for (int i=1; i < js.length; i++) {
    toReturn.add(emitBytes(logger,bytes[i],FRAGMENT_SUBDIR + File.separator + result.getStrongName()+ File.separator+ i+ FRAGMENT_EXTENSION));
  }
  toReturn.addAll(emitSelectionInformation(result.getStrongName(),result));
  return toReturn;
}
Program: 53935
Project: 53935
Buggy source:
@Override protected String wrapPrimaryFragment(TreeLogger logger,LinkerContext context,String script){
  StringBuffer out=new StringBuffer();
  if (shouldIncludeBootstrapInPrimaryFragment(context)) {
    try {
      out.append(generateSelectionScript(logger,context,null));
    }
 catch (    UnableToCompleteException e) {
      logger.log(TreeLogger.ERROR,"String_Node_Str",e);
      e.printStackTrace();
    }
  }
  if (shouldInstallCode(context)) {
    out.append(context.getModuleFunctionName());
    out.append("String_Node_Str");
    out.append(JsToStringGenerationVisitor.javaScriptString(script.toString()));
    out.append("String_Node_Str");
  }
 else {
    out.append(script.toString());
  }
  return out.toString();
}

Fixed version (ground truth):
@Override protected String wrapPrimaryFragment(TreeLogger logger,LinkerContext context,String script,ArtifactSet artifacts){
  StringBuffer out=new StringBuffer();
  if (shouldIncludeBootstrapInPrimaryFragment(context)) {
    try {
      out.append(generateSelectionScript(logger,context,artifacts));
    }
 catch (    UnableToCompleteException e) {
      logger.log(TreeLogger.ERROR,"String_Node_Str",e);
      e.printStackTrace();
    }
  }
  if (shouldInstallCode(context)) {
    out.append(context.getModuleFunctionName());
    out.append("String_Node_Str");
    out.append(JsToStringGenerationVisitor.javaScriptString(script.toString()));
    out.append("String_Node_Str");
  }
 else {
    out.append(script.toString());
  }
  return out.toString();
}
Program: 53936
Project: 53936
Buggy source:
@Override protected void maybeAddHostedModeFile(TreeLogger logger,LinkerContext context,ArtifactSet artifacts) throws UnableToCompleteException {
  String filename=getHostedFilename();
  if ("String_Node_Str".equals(filename)) {
    return;
  }
  long lastModified=System.currentTimeMillis();
  StringBuffer buffer=readFileToStringBuffer("String_Node_Str" + filename,logger);
  String script=generatePrimaryFragmentString(logger,context,"String_Node_Str",buffer.toString(),1);
  EmittedArtifact devArtifact=emitString(logger,script,filename,lastModified);
  artifacts.add(devArtifact);
}

Fixed version (ground truth):
@Override protected void maybeAddHostedModeFile(TreeLogger logger,LinkerContext context,ArtifactSet artifacts) throws UnableToCompleteException {
  String filename=getHostedFilename();
  if ("String_Node_Str".equals(filename)) {
    return;
  }
  long lastModified=System.currentTimeMillis();
  StringBuffer buffer=readFileToStringBuffer("String_Node_Str" + filename,logger);
  String script=generatePrimaryFragmentString(logger,context,"String_Node_Str",buffer.toString(),1,artifacts);
  EmittedArtifact devArtifact=emitString(logger,script,filename,lastModified);
  artifacts.add(devArtifact);
}
Program: 53937
Project: 53937
Buggy source:
@Override protected byte[] generatePrimaryFragment(TreeLogger logger,LinkerContext context,CompilationResult result,String[] js) throws UnableToCompleteException {
  StringBuffer b=new StringBuffer();
  b.append(getModulePrefix(logger,context,result.getStrongName(),js.length));
  b.append(splitPrimaryJavaScript(result.getStatementRanges()[0],js[0],charsPerChunk(context,logger)));
  b.append(getModuleSuffix(logger,context));
  return Util.getBytes(b.toString());
}

Fixed version (ground truth):
@Override protected byte[] generatePrimaryFragment(TreeLogger logger,LinkerContext context,CompilationResult result,String[] js,ArtifactSet artifacts) throws UnableToCompleteException {
  StringBuffer b=new StringBuffer();
  b.append(getModulePrefix(logger,context,result.getStrongName(),js.length));
  b.append(splitPrimaryJavaScript(result.getStatementRanges()[0],js[0],charsPerChunk(context,logger)));
  b.append(getModuleSuffix(logger,context));
  return Util.getBytes(b.toString());
}
Program: 53938
Project: 53938
Buggy source:
@Override protected Collection<Artifact<?>> doEmitCompilation(TreeLogger logger,LinkerContext context,CompilationResult result) throws UnableToCompleteException {
  if (result.getJavaScript().length != 1) {
    logger.branch(TreeLogger.ERROR,"String_Node_Str" + getDescription() + "String_Node_Str",null);
    throw new UnableToCompleteException();
  }
  return super.doEmitCompilation(logger,context,result);
}

Fixed version (ground truth):
@Override protected Collection<Artifact<?>> doEmitCompilation(TreeLogger logger,LinkerContext context,CompilationResult result,ArtifactSet artifacts) throws UnableToCompleteException {
  if (result.getJavaScript().length != 1) {
    logger.branch(TreeLogger.ERROR,"String_Node_Str" + getDescription() + "String_Node_Str",null);
    throw new UnableToCompleteException();
  }
  return super.doEmitCompilation(logger,context,result,artifacts);
}
Program: 53939
Project: 53939
Buggy source:
private PersonEditorWorkflow(DynaTableRequestFactory requestFactory,FavoritesManager manager,PersonProxy person){
  this.requestFactory=requestFactory;
  this.manager=manager;
  this.person=person;
  personEditor=new PersonEditor(requestFactory);
  Binder.BINDER.createAndBindUi(this);
  contents.addDomHandler(new KeyUpHandler(){
    public void onKeyUp(    KeyUpEvent event){
      if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) {
        onCancel(null);
      }
    }
  }
,KeyUpEvent.getType());
}

Fixed version (ground truth):
private PersonEditorWorkflow(DynaTableRequestFactory requestFactory,FavoritesManager manager,PersonProxy person){
  this.requestFactory=requestFactory;
  this.manager=manager;
  this.person=person;
  personEditor=new PersonEditor(requestFactory);
  Binder.BINDER.createAndBindUi(this);
  contents.addDomHandler(new KeyUpHandler(){
    public void onKeyUp(    KeyUpEvent event){
      if (event.getNativeKeyCode() == KeyCodes.KEY_ESCAPE) {
        onCancel(null);
      }
    }
  }
,KeyUpEvent.getType());
  this.favorite.setVisible(false);
}
Program: 53940
Project: 53940
Buggy source:
/** 
 * Construct and display the UI that will be used to edit the current PersonProxy, using the given RequestContext to accumulate the edits.
 */
private void edit(RequestContext requestContext){
  editorDriver=GWT.create(Driver.class);
  editorDriver.initialize(requestFactory,personEditor);
  if (requestContext == null) {
    fetchAndEdit();
    return;
  }
  editorDriver.edit(person,requestContext);
  personEditor.focus();
  favorite.setValue(manager.isFavorite(person),false);
  dialog.center();
}

Fixed version (ground truth):
/** 
 * Construct and display the UI that will be used to edit the current PersonProxy, using the given RequestContext to accumulate the edits.
 */
private void edit(RequestContext requestContext){
  editorDriver=GWT.create(Driver.class);
  editorDriver.initialize(requestFactory,personEditor);
  if (requestContext == null) {
    this.favorite.setVisible(true);
    fetchAndEdit();
    return;
  }
  editorDriver.edit(person,requestContext);
  personEditor.focus();
  favorite.setValue(manager.isFavorite(person),false);
  dialog.center();
}
Program: 53942
Project: 53942
Buggy source:
/** 
 * Reduce the number of   {@link HasData}s down to the specified level.
 * @param level the level to trim to
 */
private void trimToLevel(int level){
  adjustScrollLock();
  int curLevel=treeNodes.size() - 1;
  while (curLevel > level) {
    TreeNodeImpl<?> removed=treeNodes.remove(curLevel);
    removed.destroy();
    curLevel--;
  }
}

Fixed version (ground truth):
/** 
 * Reduce the number of   {@link HasData}s down to the specified level.
 * @param level the level to trim to
 */
private void trimToLevel(int level){
  adjustScrollLock();
  int curLevel=treeNodes.size() - 1;
  while (curLevel > level) {
    TreeNodeImpl<?> removed=treeNodes.remove(curLevel);
    removed.destroy();
    curLevel--;
  }
  if (level < treeNodes.size()) {
    TreeNodeImpl<?> node=treeNodes.get(level);
    node.display.focusedKey=null;
    node.display.focusedValue=null;
    node.display.isFocusedOpen=false;
  }
}
Program: 53943
Project: 53943
Buggy source:
/** 
 * Test that a tree node is destroyed if its associated data is lost when new data is provided to the node.
 */
public void testTreeNodeDataLost(){
  MockOpenHandler openHandler=new MockOpenHandler();
  MockCloseHandler closeHandler=new MockCloseHandler();
  tree.addOpenHandler(openHandler);
  tree.addCloseHandler(closeHandler);
  TreeNode root=tree.getRootTreeNode();
  TreeNode b=root.setChildOpen(1,true);
  assertEquals(b,openHandler.getLastEventAndClear().getTarget());
  List<String> list=new ArrayList<String>();
  list.add("String_Node_Str");
  list.add("String_Node_Str");
  list.add("String_Node_Str");
  model.rootDataProvider.setList(list);
  assertTrue(b.isDestroyed());
}

Fixed version (ground truth):
/** 
 * Test that a tree node is destroyed if its associated data is lost when new data is provided to the node.
 */
public void testTreeNodeDataLost(){
  MockOpenHandler openHandler=new MockOpenHandler();
  MockCloseHandler closeHandler=new MockCloseHandler();
  tree.addOpenHandler(openHandler);
  tree.addCloseHandler(closeHandler);
  TreeNode root=tree.getRootTreeNode();
  TreeNode b=root.setChildOpen(1,true);
  assertEquals(b,openHandler.getLastEventAndClear().getTarget());
  List<String> list=new ArrayList<String>();
  list.add("String_Node_Str");
  list.add("String_Node_Str");
  list.add("String_Node_Str");
  model.rootDataProvider.setList(list);
  assertTrue(b.isDestroyed());
  assertNotNull(root.setChildOpen(0,true));
}
Program: 53944
Project: 53944
Buggy source:
private void createHeadersAndFooters(){
  if (headersStale) {
    headersStale=false;
    createHeaders(false);
    createHeaders(true);
  }
}

Fixed version (ground truth):
private void createHeadersAndFooters(){
  createHeaders(false);
  createHeaders(true);
}
Program: 53946
Project: 53946
Buggy source:
/** 
 * Remove a column.
 * @param index the column index
 */
public void removeColumn(int index){
  if (index < 0 || index >= columns.size()) {
    throw new IndexOutOfBoundsException("String_Node_Str");
  }
  columns.remove(index);
  headers.remove(index);
  footers.remove(index);
  updateDependsOnSelection();
  headersStale=true;
  if (index <= keyboardSelectedColumn) {
    keyboardSelectedColumn=0;
    if (isInteractive) {
      for (int i=0; i < columns.size(); i++) {
        if (isColumnInteractive(columns.get(i))) {
          keyboardSelectedColumn=i;
          break;
        }
      }
    }
  }
  scheduleRedraw();
}

Fixed version (ground truth):
/** 
 * Remove a column.
 * @param index the column index
 */
public void removeColumn(int index){
  if (index < 0 || index >= columns.size()) {
    throw new IndexOutOfBoundsException("String_Node_Str");
  }
  columns.remove(index);
  headers.remove(index);
  footers.remove(index);
  updateDependsOnSelection();
  if (index <= keyboardSelectedColumn) {
    keyboardSelectedColumn=0;
    if (isInteractive) {
      for (int i=0; i < columns.size(); i++) {
        if (isColumnInteractive(columns.get(i))) {
          keyboardSelectedColumn=i;
          break;
        }
      }
    }
  }
  scheduleRedraw();
}
Program: 53947
Project: 53947
Buggy source:
@Template("String_Node_Str") SafeHtml th(String classes,SafeHtml contents);

Fixed version (ground truth):
@Template("String_Node_Str") SafeHtml th(int colspan,String classes,SafeHtml contents);