nus-yam/ex-repair huggingface dataset:
Program: 56569
Project: 56569
Buggy source:
/** 
 * Sort range
 * @param index1 the sort index 1
 * @param desc1 true for descent, false for ascent of index 1
 * @param header includes header or not
 * @param matchCase matches character chase of not
 * @param sortByRows  sorts by row or not
 * @param dataOption1 data option 1 for sort
 * @param index2 the sort index 2
 * @param desc2 true for descent, false for ascent of index 2
 * @param dataOption2 data option 2 for sort
 * @param index3 the sort index 3
 * @param desc3 true for descent, false for ascent of index 3
 * @param dataOption3 data option31 for sort
 */
public void sort(Range index1,boolean desc1,boolean header,boolean matchCase,boolean sortByRows,SortDataOption dataOption1,Range index2,boolean desc2,SortDataOption dataOption2,Range index3,boolean desc3,SortDataOption dataOption3);

Fixed version (ground truth):
/** 
 * Sort range
 * @param index1 the sort index 1
 * @param desc1 true for descent, false for ascent of index 1
 * @param header includes header or not
 * @param matchCase matches character chase of not
 * @param sortByRows  sorts by row or not
 * @param dataOption1 data option 1 for sort
 * @param index2 the sort index 2
 * @param desc2 true for descent, false for ascent of index 2
 * @param dataOption2 data option 2 for sort
 * @param index3 the sort index 3
 * @param desc3 true for descent, false for ascent of index 3
 * @param dataOption3 data option31 for sort
 */
public void sort(Range index1,boolean desc1,SortDataOption dataOption1,Range index2,boolean desc2,SortDataOption dataOption2,Range index3,boolean desc3,SortDataOption dataOption3,boolean header,boolean matchCase,boolean sortByRows);
Program: 56570
Project: 56570
Buggy source:
public void api4Internal(){
  range.notifyDeleteFriendFocus(null);
  range.notifyMoveFriendFocus(null);
}

Fixed version (ground truth):
private void api4Internal(){
  range.notifyDeleteFriendFocus(null);
  range.notifyMoveFriendFocus(null);
}
Program: 56571
Project: 56571
Buggy source:
public void sort(Range index1,boolean desc1,boolean header,boolean matchCase,boolean sortByRows,SortDataOption dataOption1,Range index2,boolean desc2,SortDataOption dataOption2,Range index3,boolean desc3,SortDataOption dataOption3){
  range.sort(index1 == null ? null : ((RangeImpl)index1).getNative(),desc1,index2 == null ? null : ((RangeImpl)index1).getNative(),-1,desc2,index3 == null ? null : ((RangeImpl)index1).getNative(),desc3,header ? BookHelper.SORT_HEADER_YES : BookHelper.SORT_HEADER_NO,-1,matchCase,sortByRows,-1,dataOption1 == null ? BookHelper.SORT_NORMAL_DEFAULT : EnumUtil.toRangeSortDataOption(dataOption1),dataOption2 == null ? BookHelper.SORT_NORMAL_DEFAULT : EnumUtil.toRangeSortDataOption(dataOption2),dataOption3 == null ? BookHelper.SORT_NORMAL_DEFAULT : EnumUtil.toRangeSortDataOption(dataOption3));
}

Fixed version (ground truth):
public void sort(Range index1,boolean desc1,SortDataOption dataOption1,Range index2,boolean desc2,SortDataOption dataOption2,Range index3,boolean desc3,SortDataOption dataOption3,boolean header,boolean matchCase,boolean sortByRows){
  range.sort(index1 == null ? null : ((RangeImpl)index1).getNative(),desc1,index2 == null ? null : ((RangeImpl)index2).getNative(),-1,desc2,index3 == null ? null : ((RangeImpl)index3).getNative(),desc3,header ? BookHelper.SORT_HEADER_YES : BookHelper.SORT_HEADER_NO,-1,matchCase,sortByRows,-1,dataOption1 == null ? BookHelper.SORT_NORMAL_DEFAULT : EnumUtil.toRangeSortDataOption(dataOption1),dataOption2 == null ? BookHelper.SORT_NORMAL_DEFAULT : EnumUtil.toRangeSortDataOption(dataOption2),dataOption3 == null ? BookHelper.SORT_NORMAL_DEFAULT : EnumUtil.toRangeSortDataOption(dataOption3));
}
Program: 56572
Project: 56572
Buggy source:
public void apiNoOneUse(){
  range.getCount();
  range.getCurrentRegion();
  range.getDependents();
  range.getDirectDependents();
  range.getPrecedents();
  range.isCustomHeight();
}

Fixed version (ground truth):
private void apiNoOneUse(){
  range.getCount();
  range.getCurrentRegion();
  range.getDependents();
  range.getDirectDependents();
  range.getPrecedents();
  range.isCustomHeight();
}
Program: 56573
Project: 56573
Buggy source:
public void apply(Range cellRange,org.zkoss.zss.api.model.CellStyle newCellstyle){
  newCellstyle.setHidden(mfp_hidden.isChecked());
  newCellstyle.setLocked(mfp_hidden.isChecked());
}

Fixed version (ground truth):
@Override public void apply(Range cellRange,EditableCellStyle newCellstyle){
  newCellstyle.setHidden(mfp_hidden.isChecked());
  newCellstyle.setLocked(mfp_hidden.isChecked());
}
Program: 56574
Project: 56574
Buggy source:
public boolean ignore(Range cellRange,CellStyle oldCellstyle){
  return oldCellstyle.isHidden() == mfp_hidden.isChecked() && oldCellstyle.isLocked() == mfp_locked.isChecked();
}

Fixed version (ground truth):
@Override public boolean ignore(Range cellRange,CellStyle oldCellstyle){
  return oldCellstyle.isHidden() == mfp_hidden.isChecked() && oldCellstyle.isLocked() == mfp_locked.isChecked();
}
Program: 56575
Project: 56575
Buggy source:
public void onOK(){
  try {
    final Checkbox mfp_locked=(Checkbox)Path.getComponent("String_Node_Str");
    final Checkbox mfp_hidden=(Checkbox)Path.getComponent("String_Node_Str");
    Range range=Ranges.range(spreadsheet.getSelectedSheet(),spreadsheet.getSelection());
    CellOperationUtil.applyCellStyle(range,new EditableCellStyle(){
      public boolean ignore(      Range cellRange,      CellStyle oldCellstyle){
        return oldCellstyle.isHidden() == mfp_hidden.isChecked() && oldCellstyle.isLocked() == mfp_locked.isChecked();
      }
      public void apply(      Range cellRange,      org.zkoss.zss.api.model.CellStyle newCellstyle){
        newCellstyle.setHidden(mfp_hidden.isChecked());
        newCellstyle.setLocked(mfp_hidden.isChecked());
      }
    }
);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  Window formatMainWin=(Window)Path.getComponent("String_Node_Str");
  formatMainWin.setVisible(false);
  spreadsheet.setHighlight(null);
}

Fixed version (ground truth):
public void onOK(){
  try {
    final Checkbox mfp_locked=(Checkbox)Path.getComponent("String_Node_Str");
    final Checkbox mfp_hidden=(Checkbox)Path.getComponent("String_Node_Str");
    Range range=Ranges.range(spreadsheet.getSelectedSheet(),spreadsheet.getSelection());
    CellOperationUtil.applyCellStyle(range,new CellStyleApplier(){
      @Override public boolean ignore(      Range cellRange,      CellStyle oldCellstyle){
        return oldCellstyle.isHidden() == mfp_hidden.isChecked() && oldCellstyle.isLocked() == mfp_locked.isChecked();
      }
      @Override public void apply(      Range cellRange,      EditableCellStyle newCellstyle){
        newCellstyle.setHidden(mfp_hidden.isChecked());
        newCellstyle.setLocked(mfp_hidden.isChecked());
      }
    }
);
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  Window formatMainWin=(Window)Path.getComponent("String_Node_Str");
  formatMainWin.setVisible(false);
  spreadsheet.setHighlight(null);
}
Program: 56576
Project: 56576
Buggy source:
@Override public boolean doCustomSort(){
  if (spreadsheet.getSelectedSheet() != null) {
    openCustomSortDialog(getSelection());
  }
  return true;
}

Fixed version (ground truth):
public boolean doCustomSort(){
  if (spreadsheet.getSelectedSheet() != null) {
    openCustomSortDialog(getSelection());
  }
  return true;
}
Program: 56577
Project: 56577
Buggy source:
@Override public boolean doRowHeight(){
  if (spreadsheet.getSelectedSheet() != null) {
    openModifyHeaderSizeDialog(WorkbookCtrl.HEADER_TYPE_ROW,getSelection());
  }
  return true;
}

Fixed version (ground truth):
public boolean doRowHeight(){
  if (spreadsheet.getSelectedSheet() != null) {
    openModifyHeaderSizeDialog(WorkbookCtrl.HEADER_TYPE_ROW,getSelection());
  }
  return true;
}
Program: 56578
Project: 56578
Buggy source:
@Override public boolean doInsertFunction(){
  openInsertFormulaDialog(getSelection());
  return true;
}

Fixed version (ground truth):
public boolean doInsertFunction(){
  openInsertFormulaDialog(getSelection());
  return true;
}
Program: 56579
Project: 56579
Buggy source:
@Override public boolean doSaveBook(){
  if (FileHelper.hasSavePermission() && spreadsheet.getBook() != null) {
    DesktopWorkbenchContext workbench=getDesktopWorkbenchContext();
    if (workbench.getWorkbookCtrl().hasFileExtentionName()) {
      workbench.getWorkbookCtrl().save();
      workbench.fireWorkbookSaved();
      _lastActionContext=getContext();
    }
 else {
      workbench.getWorkbenchCtrl().openSaveFileDialog();
      _lastActionContext=getContext();
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean doSaveBook(){
  if (FileHelper.hasSavePermission() && spreadsheet.getBook() != null) {
    DesktopWorkbenchContext workbench=getDesktopWorkbenchContext();
    if (workbench.getWorkbookCtrl().hasFileExtentionName()) {
      workbench.getWorkbookCtrl().save();
      workbench.fireWorkbookSaved();
      _lastActionContext=getContext();
    }
 else {
      workbench.getWorkbenchCtrl().openSaveFileDialog();
      _lastActionContext=getContext();
    }
  }
  return true;
}
Program: 56580
Project: 56580
Buggy source:
@Override public boolean doNewBook(){
  getDesktopWorkbenchContext().getWorkbookCtrl().newBook();
  getDesktopWorkbenchContext().fireWorkbookChanged();
  return true;
}

Fixed version (ground truth):
public boolean doNewBook(){
  getDesktopWorkbenchContext().getWorkbookCtrl().newBook();
  getDesktopWorkbenchContext().fireWorkbookChanged();
  return true;
}
Program: 56581
Project: 56581
Buggy source:
@Override public boolean doExportPDF(){
  Rect selection=getSelection();
  if (spreadsheet.getBook() != null) {
    openExportPdfDialog(selection);
    _lastActionContext=getContext();
  }
  return true;
}

Fixed version (ground truth):
public boolean doExportPDF(){
  Rect selection=getSelection();
  if (spreadsheet.getBook() != null) {
    openExportPdfDialog(selection);
    _lastActionContext=getContext();
  }
  return true;
}
Program: 56582
Project: 56582
Buggy source:
@Override public boolean doPasteSpecial(){
  Rect selection=getSelection();
  Clipboard copyFrom=getClipboard();
  if (copyFrom == null) {
    Messagebox.show("String_Node_Str");
    return true;
  }
  if (spreadsheet.getSelectedSheet() != null) {
    spreadsheet.setSelection(selection);
    openPasteSpecialDialog();
    _lastActionContext=getContext();
  }
  return true;
}

Fixed version (ground truth):
public boolean doPasteSpecial(){
  Rect selection=getSelection();
  Clipboard copyFrom=getClipboard();
  if (copyFrom == null) {
    Messagebox.show("String_Node_Str");
    return true;
  }
  if (spreadsheet.getSelectedSheet() != null) {
    spreadsheet.setSelection(selection);
    openPasteSpecialDialog();
    _lastActionContext=getContext();
  }
  return true;
}
Program: 56583
Project: 56583
Buggy source:
@Override public boolean doFormatCell(){
  if (spreadsheet.getSelectedSheet() != null) {
    openFormatNumberDialog(getSelection());
  }
  return true;
}

Fixed version (ground truth):
public boolean doFormatCell(){
  if (spreadsheet.getSelectedSheet() != null) {
    openFormatNumberDialog(getSelection());
  }
  return true;
}
Program: 56584
Project: 56584
Buggy source:
@Override public boolean doColumnWidth(){
  if (spreadsheet.getSelectedSheet() != null) {
    openModifyHeaderSizeDialog(WorkbookCtrl.HEADER_TYPE_COLUMN,getSelection());
  }
  return true;
}

Fixed version (ground truth):
public boolean doColumnWidth(){
  if (spreadsheet.getSelectedSheet() != null) {
    openModifyHeaderSizeDialog(WorkbookCtrl.HEADER_TYPE_COLUMN,getSelection());
  }
  return true;
}
Program: 56585
Project: 56585
Buggy source:
@Override public boolean doHyperlink(){
  if (spreadsheet.getSelectedSheet() != null) {
    openHyperlinkDialog(getSelection());
  }
  return true;
}

Fixed version (ground truth):
public boolean doHyperlink(){
  if (spreadsheet.getSelectedSheet() != null) {
    openHyperlinkDialog(getSelection());
  }
  return true;
}
Program: 56586
Project: 56586
Buggy source:
public void onClick$export() throws IOException, InterruptedException {
  applyPrintSetting();
  Exporter c=Exporters.getExporter("String_Node_Str");
  if (c == null) {
    Messagebox.show("String_Node_Str");
    return;
  }
  if (c.isSupportHeadings()) {
    c.enableHeadings(includeHeadings());
  }
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  export(c,baos);
  final AMedia amedia=new AMedia("String_Node_Str","String_Node_Str","String_Node_Str",baos.toByteArray());
  Filedownload.save(amedia);
  revertPrintSetting();
  _exportToHtmlDialog.fireOnClose(null);
}

Fixed version (ground truth):
public void onClick$export() throws IOException, InterruptedException {
  applyPrintSetting();
  Exporter c=Exporters.getExporter("String_Node_Str");
  if (c == null) {
    Messagebox.show("String_Node_Str");
    return;
  }
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  export(c,baos);
  final AMedia amedia=new AMedia("String_Node_Str","String_Node_Str","String_Node_Str",baos.toByteArray());
  Filedownload.save(amedia);
  revertPrintSetting();
  _exportToHtmlDialog.fireOnClose(null);
}
Program: 56587
Project: 56587
Buggy source:
public void onClick$export() throws InvalidFormatException, IOException, InterruptedException {
  applyPrintSetting();
  Exporter c=Exporters.getExporter("String_Node_Str");
  if (c == null) {
    Messagebox.show("String_Node_Str");
    return;
  }
  if (c.isSupportHeadings()) {
    c.enableHeadings(includeHeadings());
  }
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  export(c,baos);
  final AMedia amedia=new AMedia("String_Node_Str","String_Node_Str","String_Node_Str",baos.toByteArray());
  Filedownload.save(amedia);
  revertPrintSetting();
  _exportToPdfDialog.fireOnClose(null);
}

Fixed version (ground truth):
public void onClick$export() throws InvalidFormatException, IOException, InterruptedException {
  applyPrintSetting();
  Exporter c=Exporters.getExporter("String_Node_Str");
  if (c == null) {
    Messagebox.show("String_Node_Str");
    return;
  }
  ByteArrayOutputStream baos=new ByteArrayOutputStream();
  export(c,baos);
  final AMedia amedia=new AMedia("String_Node_Str","String_Node_Str","String_Node_Str",baos.toByteArray());
  Filedownload.save(amedia);
  revertPrintSetting();
  _exportToPdfDialog.fireOnClose(null);
}
Program: 56588
Project: 56588
Buggy source:
public void focusTo(int row,int column,boolean fireFocusEvent){
  spreadsheet.focusTo(row,column);
  if (fireFocusEvent) {
    org.zkoss.zk.ui.event.Events.sendEvent(new CellEvent(Events.ON_CELL_FOUCSED,spreadsheet,spreadsheet.getSelectedSheet(),row,column));
  }
}

Fixed version (ground truth):
public void focusTo(int row,int column,boolean fireFocusEvent){
  spreadsheet.focusTo(row,column);
  if (fireFocusEvent) {
    org.zkoss.zk.ui.event.Events.sendEvent(new CellEvent(Events.ON_CELL_FOUCSED,spreadsheet,spreadsheet.getSelectedSheet(),row,column,null));
  }
}
Program: 56589
Project: 56589
Buggy source:
/** 
 * Apply font style according to the   {@link FontStyleApplier}
 * @param range the range to be applied
 * @param applyer the font style appliler
 */
public static void applyFontStyle(Range range,final FontStyleApplier applyer){
  if (range.isProtected())   return;
  range.visit(new CellVisitor(){
    @Override public boolean visit(    Range cellRange){
      CellStyle ostyle=cellRange.getCellStyle();
      Font ofont=ostyle.getFont();
      if (applyer.ignore(cellRange,ostyle,ofont)) {
        return true;
      }
      EditableCellStyle nstyle=cellRange.getCellStyleHelper().createCellStyle(ostyle);
      EditableFont nfont=null;
      Font sfont=applyer.search(cellRange,ostyle,ofont);
      if (sfont == null) {
        nfont=cellRange.getCellStyleHelper().createFont(ofont);
        nstyle.setFont(nfont);
        applyer.apply(cellRange,nstyle,nfont);
      }
 else {
        nstyle.setFont(nfont);
      }
      cellRange.setCellStyle(nstyle);
      return true;
    }
    @Override public boolean ignoreIfNotExist(    int row,    int column){
      return false;
    }
    @Override public boolean createIfNotExist(    int row,    int column){
      return true;
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Apply font style according to the   {@link FontStyleApplier}
 * @param range the range to be applied
 * @param applyer the font style appliler
 */
public static void applyFontStyle(Range range,final FontStyleApplier applyer){
  if (range.isProtected())   return;
  range.visit(new CellVisitor(){
    @Override public boolean visit(    Range cellRange){
      CellStyle ostyle=cellRange.getCellStyle();
      Font ofont=ostyle.getFont();
      if (applyer.ignore(cellRange,ostyle,ofont)) {
        return true;
      }
      EditableCellStyle nstyle=cellRange.getCellStyleHelper().createCellStyle(ostyle);
      EditableFont nfont=null;
      Font sfont=applyer.search(cellRange,ostyle,ofont);
      if (sfont == null) {
        nfont=cellRange.getCellStyleHelper().createFont(ofont);
        nstyle.setFont(nfont);
        applyer.apply(cellRange,nstyle,nfont);
      }
 else {
        nstyle.setFont(sfont);
      }
      cellRange.setCellStyle(nstyle);
      return true;
    }
    @Override public boolean ignoreIfNotExist(    int row,    int column){
      return false;
    }
    @Override public boolean createIfNotExist(    int row,    int column){
      return true;
    }
  }
);
}
Program: 56590
Project: 56590
Buggy source:
private void refreshToolbarDisabled(){
  Set<UserAction> disabled=new HashSet<UserAction>(_actionDisabled);
  disabled.clear();
  if (getBook() == null) {
    disabled.addAll(Arrays.asList(DefaultUserActionHandler.DisabledAction4BookClosed));
  }
 else {
    if (getSelectedSheet().isProtected()) {
      disabled.addAll(Arrays.asList(DefaultUserActionHandler.DisabledAction4SheetProtected));
    }
    if (!getSelectedSheet().isAutoFilterEnabled()) {
      disabled.addAll(Arrays.asList(DefaultUserActionHandler.DisabledAction4FilterDisabled));
    }
  }
  smartUpdate("String_Node_Str",convertActionDisabledToJSON(_actionDisabled));
}

Fixed version (ground truth):
private void refreshToolbarDisabled(){
  if (!isInvalidated()) {
    smartUpdate("String_Node_Str",convertActionDisabledToJSON(getDisabledUserAction()));
  }
}
Program: 56594
Project: 56594
Buggy source:
@Test public void testParseDateInput(){
  for (int j=0; j < OK.length; ++j) {
    Object[] result=_formater.parseDateInput(OK[j][0]);
    assertTrue(OK[j][0] + "String_Node_Str" + j,result[1] != null);
    assertEquals(OK[j][0] + "String_Node_Str" + j,OK[j][1],(String)result[1]);
  }
  for (int j=0; j < FAIL.length; ++j) {
    Object[] result=_formater.parseDateInput(FAIL[j]);
    assertFalse(FAIL[j] + "String_Node_Str" + j,result[1] != null);
    assertEquals(FAIL[j] + "String_Node_Str" + j,FAIL[j],(String)result[0]);
  }
}

Fixed version (ground truth):
@Test public void testParseDateInput(){
  Locales.setThreadLocal(Locale.US);
  for (int j=0; j < OK.length; ++j) {
    Object[] result=_formater.parseDateInput(OK[j][0]);
    assertTrue(OK[j][0] + "String_Node_Str" + j,result[1] != null);
    assertEquals(OK[j][0] + "String_Node_Str" + j,OK[j][1],(String)result[1]);
  }
  for (int j=0; j < FAIL.length; ++j) {
    Object[] result=_formater.parseDateInput(FAIL[j]);
    assertFalse(FAIL[j] + "String_Node_Str" + j,result[1] != null);
    assertEquals(FAIL[j] + "String_Node_Str" + j,FAIL[j],(String)result[0]);
  }
}
Program: 56595
Project: 56595
Buggy source:
/** 
 * @throws java.lang.Exception
 */
@Before public void setUp() throws Exception {
  final String filename="String_Node_Str";
  final InputStream is=new ClassLocator().getResourceAsStream(filename);
  _book=(XBook)new ExcelImporter().imports(is,filename);
  assertTrue(_book instanceof XBook);
  assertTrue(_book instanceof HSSFBookImpl);
  assertTrue(_book instanceof HSSFWorkbook);
  assertEquals(filename,((XBook)_book).getBookName());
  assertEquals("String_Node_Str",_book.getSheetName(0));
  assertEquals(0,_book.getSheetIndex("String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * @throws java.lang.Exception
 */
@Before public void setUp() throws Exception {
  final String filename="String_Node_Str";
  final InputStream is=new ClassLocator().getResourceAsStream(filename);
  _book=(XBook)new ExcelImporter().imports(is,filename);
  assertTrue(_book instanceof XBook);
  assertTrue(_book instanceof HSSFBookImpl);
  assertTrue(_book instanceof HSSFWorkbook);
  assertEquals(filename,((XBook)_book).getBookName());
  assertEquals("String_Node_Str",_book.getSheetName(0));
  assertEquals(0,_book.getSheetIndex("String_Node_Str"));
  Library.setProperty("String_Node_Str","String_Node_Str");
  Library.setProperty("String_Node_Str","String_Node_Str");
}
Program: 56596
Project: 56596
Buggy source:
/** 
 * Returns true indicate spreadsheet index column/row is number 
 * @return
 */
private boolean isAllCellNumberType(int idx){
  XSheet sheet=ss.getSelectedXSheet();
  Rect rect=ss.getSelection();
  int top=sortOrientation ? idx : rect.getTop();
  int left=sortOrientation ? rect.getLeft() : idx;
  int bottom=sortOrientation ? idx : rect.getBottom();
  int right=sortOrientation ? rect.getRight() : idx;
  for (int row=top; row <= bottom; row++) {
    for (int col=left; col <= right; col++) {
      Cell c=Utils.getCell(sheet,row,col);
      if (c != null) {
        int type=c.getCellType() != Cell.CELL_TYPE_FORMULA ? c.getCellType() : c.getCachedFormulaResultType();
        if (type != Cell.CELL_TYPE_NUMERIC)         return false;
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Returns true indicate spreadsheet index column/row is number 
 * @return
 */
private boolean isAllCellNumberType(int idx){
  Sheet sheet=ss.getSelectedSheet();
  Rect rect=ss.getSelection();
  int top=sortOrientation ? idx : rect.getTop();
  int left=sortOrientation ? rect.getLeft() : idx;
  int bottom=sortOrientation ? idx : rect.getBottom();
  int right=sortOrientation ? rect.getRight() : idx;
  for (int row=top; row <= bottom; row++) {
    for (int col=left; col <= right; col++) {
      Range r=Ranges.range(sheet,row,col);
      if (r.getCellData().getResultType() != CellType.NUMERIC) {
        return false;
      }
    }
  }
  return true;
}
Program: 56597
Project: 56597
Buggy source:
public void onClick$okBtn(){
  if (hasEmptyArgs(sortLevelModel.getInnerList())) {
    Messagebox.show(getLabel("String_Node_Str"));
    return;
  }
  String dupTarget=checkDuplicateSortIndex(sortLevelModel.getInnerList());
  if (dupTarget != null) {
    Messagebox.show(dupTarget + "String_Node_Str" + getLabel("String_Node_Str"));
    return;
  }
  int count=0;
  int size=sortLevelModel.size() <= 3 ? sortLevelModel.size() : 3;
  int[] index=new int[size];
  int[] dataOption=new int[size];
  boolean[] algorithm=new boolean[size];
  for (Iterator iter=sortLevelModel.iterator(); iter.hasNext() && count < index.length; count++) {
    SortLevel l=(SortLevel)iter.next();
    index[count]=l.sortIndex;
    algorithm[count]=l.order;
    dataOption[count]=l.dataOption;
  }
  Utils.sort(ss.getSelectedXSheet(),ss.getSelection(),index,algorithm,dataOption,hasHeader.isChecked(),caseSensitive.isChecked(),sortOrientation);
  _customSortDialog.fireOnClose(null);
}

Fixed version (ground truth):
public void onClick$okBtn(){
  if (hasEmptyArgs(sortLevelModel.getInnerList())) {
    Messagebox.show(getLabel("String_Node_Str"));
    return;
  }
  String dupTarget=checkDuplicateSortIndex(sortLevelModel.getInnerList());
  if (dupTarget != null) {
    Messagebox.show(dupTarget + "String_Node_Str" + getLabel("String_Node_Str"));
    return;
  }
  int count=0;
  int size=sortLevelModel.size() <= 3 ? sortLevelModel.size() : 3;
  int[] index=new int[size];
  int[] dataOption=new int[size];
  boolean[] algorithm=new boolean[size];
  for (Iterator iter=sortLevelModel.iterator(); iter.hasNext() && count < index.length; count++) {
    SortLevel l=(SortLevel)iter.next();
    index[count]=l.sortIndex;
    algorithm[count]=l.order;
    dataOption[count]=l.dataOption;
  }
  sort(ss.getSelectedSheet(),ss.getSelection(),index,algorithm,dataOption,hasHeader.isChecked(),caseSensitive.isChecked(),sortOrientation);
  _customSortDialog.fireOnClose(null);
}
Program: 56598
Project: 56598
Buggy source:
public void onOK(){
  try {
    Checkbox mfp_locked=(Checkbox)Path.getComponent("String_Node_Str");
    Checkbox mfp_hidden=(Checkbox)Path.getComponent("String_Node_Str");
    int left=spreadsheet.getSelection().getLeft();
    int right=spreadsheet.getSelection().getRight();
    int top=spreadsheet.getSelection().getTop();
    int bottom=spreadsheet.getSelection().getBottom();
    XSheet sheet=spreadsheet.getSelectedXSheet();
    for (int row=top; row <= bottom; row++) {
      for (int col=left; col <= right; col++) {
        final Cell cell=Utils.getCell(sheet,row,col);
        if (cell != null) {
          CellStyle cs=cell.getCellStyle();
          cs.setHidden(mfp_hidden.isChecked());
          cs.setLocked(mfp_hidden.isChecked());
        }
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    System.out.println("String_Node_Str");
  }
  Window formatMainWin=(Window)Path.getComponent("String_Node_Str");
  formatMainWin.setVisible(false);
  spreadsheet.setHighlight(null);
}

Fixed version (ground truth):
public void onOK(){
  try {
    Checkbox mfp_locked=(Checkbox)Path.getComponent("String_Node_Str");
    Checkbox mfp_hidden=(Checkbox)Path.getComponent("String_Node_Str");
    int left=spreadsheet.getSelection().getLeft();
    int right=spreadsheet.getSelection().getRight();
    int top=spreadsheet.getSelection().getTop();
    int bottom=spreadsheet.getSelection().getBottom();
    Sheet sheet=spreadsheet.getSelectedSheet();
    for (int row=top; row <= bottom; row++) {
      for (int col=left; col <= right; col++) {
        final Cell cell=Utils.getCell(sheet,row,col);
        if (cell != null) {
          CellStyle cs=cell.getCellStyle();
          cs.setHidden(mfp_hidden.isChecked());
          cs.setLocked(mfp_hidden.isChecked());
        }
      }
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
    System.out.println("String_Node_Str");
  }
  Window formatMainWin=(Window)Path.getComponent("String_Node_Str");
  formatMainWin.setVisible(false);
  spreadsheet.setHighlight(null);
}
Program: 56599
Project: 56599
Buggy source:
private Font getFont(Worksheet sheet,int row,int column){
  return sheet.getBook().getFontAt(getCell(sheet,3,0).getCellStyle().getFontIndex());
}

Fixed version (ground truth):
private Font getFont(Worksheet sheet,int row,int column){
  return sheet.getBook().getFontAt(getCell(sheet,row,column).getCellStyle().getFontIndex());
}
Program: 56600
Project: 56600
Buggy source:
private void onFriendFocusMove(SSDataEvent event){
  final Ref rng=event.getRef();
  if (getSheet(rng).equals(_selectedSheet)) {
    final Focus focus=(Focus)event.getPayload();
    final String id=focus.id;
    if (!id.equals(_focus.id)) {
      final Focus ofocus=_focuses.get(id);
      moveEditorFocus(id,focus.name,ofocus != null ? ofocus.color : nextFocusColor(),focus.row,focus.col);
    }
  }
}

Fixed version (ground truth):
private void onFriendFocusMove(SSDataEvent event){
  final Ref rng=event.getRef();
  Worksheet sheet=getSheet(rng);
  if (sheet == null) {
    return;
  }
  if (sheet.equals(_selectedSheet)) {
    final Focus focus=(Focus)event.getPayload();
    final String id=focus.id;
    if (!id.equals(_focus.id)) {
      final Focus ofocus=_focuses.get(id);
      moveEditorFocus(id,focus.name,ofocus != null ? ofocus.color : nextFocusColor(),focus.row,focus.col);
    }
  }
}
Program: 56601
Project: 56601
Buggy source:
private void onFriendFocusDelete(SSDataEvent event){
  final Ref rng=event.getRef();
  if (BookHelper.getSheet(_book,rng.getOwnerSheet()).equals(_selectedSheet)) {
    final Focus focus=(Focus)event.getPayload();
    removeEditorFocus(focus.id);
  }
}

Fixed version (ground truth):
private void onFriendFocusDelete(SSDataEvent event){
  final Ref rng=event.getRef();
  Worksheet sheet=BookHelper.getSheet(_book,rng.getOwnerSheet());
  if (sheet == null) {
    return;
  }
  if (sheet.equals(_selectedSheet)) {
    final Focus focus=(Focus)event.getPayload();
    removeEditorFocus(focus.id);
  }
}
Program: 56602
Project: 56602
Buggy source:
public static String[] getValidationList(Worksheet sheet,DataValidation validation){
  DataValidationConstraint constraint=validation.getValidationConstraint();
  if (constraint.getValidationType() != ValidationType.LIST) {
    return null;
  }
  String[] list=constraint.getExplicitListValues();
  if (list != null) {
    return list;
  }
  String txt=constraint.getFormula1();
  Book book=sheet.getBook();
  final ValueEval ve=BookHelper.evaluateFormulaValueEval(book,book.getSheetIndex(sheet),txt,true);
  if (ve instanceof AreaEval) {
    final AreaEval ae=(AreaEval)ve;
    if (ae.isColumn() || ae.isRow()) {
      final int rows=ae.getHeight();
      final int cols=ae.getWidth();
      final int top=ae.getFirstRow();
      final int left=ae.getFirstColumn();
      String[] xlist=new String[rows * cols];
      for (int r=0, j=0; r < rows; ++r) {
        int rowIndex=r + top;
        for (int c=0; c < cols; ++c) {
          int colIndex=c + left;
          final Cell cell=BookHelper.getCell(sheet,rowIndex,colIndex);
          xlist[j++]=BookHelper.getCellText(cell);
        }
      }
      return xlist;
    }
  }
  return null;
}

Fixed version (ground truth):
public static String[] getValidationList(Worksheet sheet,DataValidation validation){
  DataValidationConstraint constraint=validation.getValidationConstraint();
  if (constraint.getValidationType() != ValidationType.LIST) {
    return null;
  }
  String[] list=constraint.getExplicitListValues();
  if (list != null) {
    return list;
  }
  String txt=constraint.getFormula1();
  Book book=sheet.getBook();
  final ValueEval ve=BookHelper.evaluateFormulaValueEval(book,book.getSheetIndex(sheet),txt,true);
  if (ve instanceof AreaEval) {
    final AreaEval ae=(AreaEval)ve;
    if (ae.isColumn() || ae.isRow()) {
      Worksheet worksheet=null;
      if (ae instanceof LazyAreaEval) {
        worksheet=book.getWorksheet(((LazyAreaEval)ve).getSheetName());
      }
 else {
        worksheet=sheet;
      }
      final int rows=ae.getHeight();
      final int cols=ae.getWidth();
      final int top=ae.getFirstRow();
      final int left=ae.getFirstColumn();
      String[] xlist=new String[rows * cols];
      for (int r=0, j=0; r < rows; ++r) {
        int rowIndex=r + top;
        for (int c=0; c < cols; ++c) {
          int colIndex=c + left;
          final Cell cell=BookHelper.getCell(worksheet,rowIndex,colIndex);
          xlist[j++]=BookHelper.getCellText(cell);
        }
      }
      return xlist;
    }
  }
  return null;
}
Program: 56603
Project: 56603
Buggy source:
private Map convertDataValidationToJSON(DataValidation dv){
  final CellRangeAddressList addrList=dv.getRegions();
  final int addrCount=addrList.countRanges();
  final List<Map> addrmapary=new ArrayList<Map>(addrCount);
  for (int j=0; j < addrCount; ++j) {
    final CellRangeAddress addr=addrList.getCellRangeAddress(j);
    final int left=addr.getFirstColumn();
    final int right=addr.getLastColumn();
    final int top=addr.getFirstRow();
    final int bottom=addr.getLastRow();
    final Worksheet sheet=this.getSelectedSheet();
    final Map<String,Integer> addrmap=new HashMap<String,Integer>();
    addrmap.put("String_Node_Str",left);
    addrmap.put("String_Node_Str",top);
    addrmap.put("String_Node_Str",right);
    addrmap.put("String_Node_Str",bottom);
    addrmapary.add(addrmap);
  }
  final Map validMap=new HashMap();
  validMap.put("String_Node_Str",addrmapary);
  validMap.put("String_Node_Str",dv.getSuppressDropDownArrow());
  validMap.put("String_Node_Str",dv.getShowPromptBox());
  validMap.put("String_Node_Str",dv.getPromptBoxTitle());
  validMap.put("String_Node_Str",dv.getPromptBoxText());
  String[] validationList=BookHelper.getValidationList(getSelectedSheet(),dv);
  if (validationList != null) {
    JSONArray jsonAry=new JSONArray();
    for (    String v : validationList) {
      jsonAry.add(v);
    }
    validMap.put("String_Node_Str",jsonAry);
  }
  return validMap;
}

Fixed version (ground truth):
private Map convertDataValidationToJSON(DataValidation dv){
  final CellRangeAddressList addrList=dv.getRegions();
  final int addrCount=addrList.countRanges();
  final List<Map> addrmapary=new ArrayList<Map>(addrCount);
  for (int j=0; j < addrCount; ++j) {
    final CellRangeAddress addr=addrList.getCellRangeAddress(j);
    final int left=addr.getFirstColumn();
    final int right=addr.getLastColumn();
    final int top=addr.getFirstRow();
    final int bottom=addr.getLastRow();
    final Worksheet sheet=this.getSelectedSheet();
    final Map<String,Integer> addrmap=new HashMap<String,Integer>();
    addrmap.put("String_Node_Str",left);
    addrmap.put("String_Node_Str",top);
    addrmap.put("String_Node_Str",right);
    addrmap.put("String_Node_Str",bottom);
    addrmapary.add(addrmap);
  }
  final Map validMap=new HashMap();
  validMap.put("String_Node_Str",addrmapary);
  validMap.put("String_Node_Str",dv.getShowPromptBox());
  validMap.put("String_Node_Str",dv.getPromptBoxTitle());
  validMap.put("String_Node_Str",dv.getPromptBoxText());
  String[] validationList=BookHelper.getValidationList(getSelectedSheet(),dv);
  if (validationList != null) {
    validMap.put("String_Node_Str",dv.getSuppressDropDownArrow());
    JSONArray jsonAry=new JSONArray();
    for (    String v : validationList) {
      jsonAry.add(v);
    }
    validMap.put("String_Node_Str",jsonAry);
  }
  return validMap;
}
Program: 56604
Project: 56604
Buggy source:
private static Set<Action> getDefaultActiobDisabled(){
  if (_defToolbarActiobDisabled == null) {
    _defToolbarActiobDisabled=new HashSet<Action>();
    HashMap<String,Action> toolbarActions=Action.getAll();
    String[] actions=Library.getProperty(TOOLBAR_DISABLED_ACTION,"String_Node_Str").split("String_Node_Str");
    for (    String a : actions) {
      String action=a.trim();
      if (toolbarActions.containsKey(action)) {
        _defToolbarActiobDisabled.add(toolbarActions.get(action));
      }
    }
  }
  return _defToolbarActiobDisabled;
}

Fixed version (ground truth):
private static Set<Action> getDefaultActiobDisabled(){
  if (_defToolbarActiobDisabled == null) {
    _defToolbarActiobDisabled=new HashSet<Action>();
    HashMap<String,Action> toolbarActions=Action.getAll();
    String[] actions=Library.getProperty(TOOLBAR_DISABLED_ACTION,"String_Node_Str").split("String_Node_Str");
    for (    String a : actions) {
      String action=a.trim();
      if (toolbarActions.containsKey(action)) {
        _defToolbarActiobDisabled.add(toolbarActions.get(action));
      }
    }
  }
  return new HashSet<Action>(_defToolbarActiobDisabled);
}
Program: 56605
Project: 56605
Buggy source:
T getHelper(String sheetId){
  return helpers.get(sheetId);
}

Fixed version (ground truth):
public T getHelper(String sheetId){
  return helpers.get(sheetId);
}
Program: 56606
Project: 56606
Buggy source:
void putHelper(String sheetId,T helper){
  helpers.put(sheetId,helper);
}

Fixed version (ground truth):
public void putHelper(String sheetId,T helper){
  helpers.put(sheetId,helper);
}
Program: 56607
Project: 56607
Buggy source:
protected ClientAnchor getClientAnchor(int row,int col,int widgetWidth,int widgetHeight){
  HeaderPositionHelper rowSizeHelper=(HeaderPositionHelper)_spreadsheet.getAttribute("String_Node_Str");
  HeaderPositionHelper colSizeHelper=(HeaderPositionHelper)_spreadsheet.getAttribute("String_Node_Str");
  int lCol=col;
  int tRow=row;
  int rCol=lCol;
  int bRow=tRow;
  int offsetWidth=0;
  int offsetHeight=0;
  for (int r=tRow; r < _spreadsheet.getMaxrows(); r++) {
    int cellHeight=rowSizeHelper.getSize(r);
    widgetHeight-=cellHeight;
    if (widgetHeight <= 0) {
      bRow=r;
      if (widgetHeight < 0) {
        offsetHeight=cellHeight - Math.abs(widgetHeight);
      }
      break;
    }
  }
  for (int c=lCol; c < _spreadsheet.getMaxcolumns(); c++) {
    int cellWidth=colSizeHelper.getSize(c);
    widgetWidth-=cellWidth;
    if (widgetWidth <= 0) {
      rCol=c;
      if (widgetWidth < 0) {
        offsetWidth=cellWidth - Math.abs(widgetWidth);
      }
      break;
    }
  }
  if (_spreadsheet.getBook() instanceof HSSFWorkbook) {
    return new HSSFClientAnchor(0,0,offsetWidth,offsetHeight,(short)lCol,tRow,(short)rCol,bRow);
  }
 else {
    return new XSSFClientAnchor(0,0,pxToEmu(offsetWidth),pxToEmu(offsetHeight),lCol,tRow,rCol,bRow);
  }
}

Fixed version (ground truth):
protected ClientAnchor getClientAnchor(int row,int col,int widgetWidth,int widgetHeight){
  final String sid=((SheetCtrl)_spreadsheet.getSelectedSheet()).getUuid();
  HeaderPositionHelper rowSizeHelper=((HelperContainer<HeaderPositionHelper>)_spreadsheet.getAttribute("String_Node_Str")).getHelper(sid);
  HeaderPositionHelper colSizeHelper=((HelperContainer<HeaderPositionHelper>)_spreadsheet.getAttribute("String_Node_Str")).getHelper(sid);
  int lCol=col;
  int tRow=row;
  int rCol=lCol;
  int bRow=tRow;
  int offsetWidth=0;
  int offsetHeight=0;
  for (int r=tRow; r < _spreadsheet.getMaxrows(); r++) {
    int cellHeight=rowSizeHelper.getSize(r);
    widgetHeight-=cellHeight;
    if (widgetHeight <= 0) {
      bRow=r;
      if (widgetHeight < 0) {
        offsetHeight=cellHeight - Math.abs(widgetHeight);
      }
      break;
    }
  }
  for (int c=lCol; c < _spreadsheet.getMaxcolumns(); c++) {
    int cellWidth=colSizeHelper.getSize(c);
    widgetWidth-=cellWidth;
    if (widgetWidth <= 0) {
      rCol=c;
      if (widgetWidth < 0) {
        offsetWidth=cellWidth - Math.abs(widgetWidth);
      }
      break;
    }
  }
  if (_spreadsheet.getBook() instanceof HSSFWorkbook) {
    return new HSSFClientAnchor(0,0,offsetWidth,offsetHeight,(short)lCol,tRow,(short)rCol,bRow);
  }
 else {
    return new XSSFClientAnchor(0,0,pxToEmu(offsetWidth),pxToEmu(offsetHeight),lCol,tRow,rCol,bRow);
  }
}
Program: 56608
Project: 56608
Buggy source:
private void initBook0(Book book){
  if (_book != null) {
    if (_focusListener != null)     removeEventListener(Events.ON_CELL_FOUCSED,_focusListener);
    deleteFocus();
    _book.unsubscribe(_dataListener);
    _book.removeVariableResolver(_variableResolver);
    _book.removeFunctionMapper(_functionMapper);
    if (_focusListener != null)     removeEventListener(Events.ON_CELL_FOUCSED,_focusListener);
  }
  if (_selectedSheet != null) {
    doSheetClean(_selectedSheet);
  }
  _selectedSheet=null;
  _selectedSheetId=null;
  _selectedSheetName=null;
  _book=book;
  if (_book != null) {
    _book.subscribe(_dataListener);
    _book.addVariableResolver(_variableResolver);
    _book.addFunctionMapper(_functionMapper);
    if (_focus == null) {
      _focus=newFocus();
      ((BookCtrl)_book).addFocus(_focus);
    }
    if (EventQueues.APPLICATION.equals(_book.getShareScope()) || EventQueues.SESSION.equals(_book.getShareScope())) {
      this.addEventListener(Events.ON_CELL_FOUCSED,_focusListener=new EventListener(){
        @Override public void onEvent(        Event event) throws Exception {
          doMoveSelfFocus((CellEvent)event);
        }
      }
);
    }
  }
}

Fixed version (ground truth):
private void initBook0(Book book){
  if (_book != null) {
    if (_focusListener != null)     removeEventListener(Events.ON_CELL_FOUCSED,_focusListener);
    deleteFocus();
    _book.unsubscribe(_dataListener);
    _book.removeVariableResolver(_variableResolver);
    _book.removeFunctionMapper(_functionMapper);
    if (_focusListener != null)     removeEventListener(Events.ON_CELL_FOUCSED,_focusListener);
  }
  if (_selectedSheet != null) {
    doSheetClean(_selectedSheet);
  }
  if (!Objects.equals(_book,book)) {
    removeAttribute(MERGE_MATRIX_KEY);
    clearHeaderSizeHelper(true,true);
    _custColId=new SequenceId(-1,2);
    _custRowId=new SequenceId(-1,2);
  }
  _selectedSheet=null;
  _selectedSheetId=null;
  _selectedSheetName=null;
  _book=book;
  if (_book != null) {
    _book.subscribe(_dataListener);
    _book.addVariableResolver(_variableResolver);
    _book.addFunctionMapper(_functionMapper);
    if (_focus == null) {
      _focus=newFocus();
      ((BookCtrl)_book).addFocus(_focus);
    }
    if (EventQueues.APPLICATION.equals(_book.getShareScope()) || EventQueues.SESSION.equals(_book.getShareScope())) {
      this.addEventListener(Events.ON_CELL_FOUCSED,_focusListener=new EventListener(){
        @Override public void onEvent(        Event event) throws Exception {
          doMoveSelfFocus((CellEvent)event);
        }
      }
);
    }
  }
}
Program: 56609
Project: 56609
Buggy source:
private HeaderPositionHelper myGetColumnPositionHelper(Worksheet sheet,int maxcol){
  if (sheet != getSelectedSheet())   throw new UiException("String_Node_Str");
  HeaderPositionHelper helper=(HeaderPositionHelper)getAttribute(COLUMN_SIZE_HELPER_KEY);
  if (helper == null) {
    final int defaultColSize=sheet.getDefaultColumnWidth();
    final int defaultColSize256=defaultColSize * 256;
    final int charWidth=getDefaultCharWidth();
    final int defaultColSizeInPx=Utils.defaultColumnWidthToPx(defaultColSize,charWidth);
    List<HeaderPositionInfo> infos=new ArrayList<HeaderPositionInfo>();
    for (int j=0; j <= maxcol; ++j) {
      final boolean hidden=sheet.isColumnHidden(j);
      final int fileColumnWidth=sheet.getColumnWidth(j);
      if (fileColumnWidth != defaultColSize256 || hidden) {
        final int colwidth=fileColumnWidth != defaultColSize256 ? Utils.fileChar256ToPx(fileColumnWidth,charWidth) : defaultColSizeInPx;
        infos.add(new HeaderPositionInfo(j,colwidth,_custColId.next(),hidden));
      }
    }
    helper=new HeaderPositionHelper(defaultColSizeInPx,infos);
    setAttribute(COLUMN_SIZE_HELPER_KEY,helper);
  }
  return helper;
}

Fixed version (ground truth):
private HeaderPositionHelper myGetColumnPositionHelper(Worksheet sheet,int maxcol){
  HelperContainer<HeaderPositionHelper> helpers=(HelperContainer)getAttribute(COLUMN_SIZE_HELPER_KEY);
  if (helpers == null) {
    setAttribute(COLUMN_SIZE_HELPER_KEY,helpers=new HelperContainer<HeaderPositionHelper>());
  }
  final String sheetId=((SheetCtrl)sheet).getUuid();
  HeaderPositionHelper helper=helpers.getHelper(sheetId);
  if (helper == null) {
    final int defaultColSize=sheet.getDefaultColumnWidth();
    final int defaultColSize256=defaultColSize * 256;
    final int charWidth=getDefaultCharWidth();
    final int defaultColSizeInPx=Utils.defaultColumnWidthToPx(defaultColSize,charWidth);
    List<HeaderPositionInfo> infos=new ArrayList<HeaderPositionInfo>();
    for (int j=0; j <= maxcol; ++j) {
      final boolean hidden=sheet.isColumnHidden(j);
      final int fileColumnWidth=sheet.getColumnWidth(j);
      if (fileColumnWidth != defaultColSize256 || hidden) {
        final int colwidth=fileColumnWidth != defaultColSize256 ? Utils.fileChar256ToPx(fileColumnWidth,charWidth) : defaultColSizeInPx;
        infos.add(new HeaderPositionInfo(j,colwidth,_custColId.next(),hidden));
      }
    }
    helpers.putHelper(sheetId,helper=new HeaderPositionHelper(defaultColSizeInPx,infos));
  }
  return helper;
}
Program: 56611
Project: 56611
Buggy source:
private HeaderPositionHelper[] getPositionHelpers(Worksheet sheet){
  if (sheet == null) {
    return null;
  }
  if (sheet != getSelectedSheet())   throw new UiException("String_Node_Str" + sheet.getSheetName());
  HeaderPositionHelper helper=(HeaderPositionHelper)getAttribute(ROW_SIZE_HELPER_KEY);
  int maxcol=0;
  if (helper == null) {
    int defaultSize=this.getRowheight();
    List<HeaderPositionInfo> infos=new ArrayList<HeaderPositionInfo>();
    for (    Row row : sheet) {
      final boolean hidden=row.getZeroHeight();
      final int height=Utils.getRowHeightInPx(sheet,row);
      if (height != defaultSize || hidden) {
        infos.add(new HeaderPositionInfo(row.getRowNum(),height,_custRowId.next(),hidden));
      }
      final int colnum=row.getLastCellNum() - 1;
      if (colnum > maxcol) {
        maxcol=colnum;
      }
    }
    helper=new HeaderPositionHelper(defaultSize,infos);
    setAttribute(ROW_SIZE_HELPER_KEY,helper);
  }
  return new HeaderPositionHelper[]{helper,myGetColumnPositionHelper(sheet,maxcol)};
}

Fixed version (ground truth):
private HeaderPositionHelper[] getPositionHelpers(Worksheet sheet){
  if (sheet == null) {
    return null;
  }
  HelperContainer<HeaderPositionHelper> helpers=(HelperContainer)getAttribute(ROW_SIZE_HELPER_KEY);
  if (helpers == null) {
    setAttribute(ROW_SIZE_HELPER_KEY,helpers=new HelperContainer<HeaderPositionHelper>());
  }
  final String sheetId=((SheetCtrl)sheet).getUuid();
  HeaderPositionHelper helper=helpers.getHelper(sheetId);
  int maxcol=0;
  if (helper == null) {
    int defaultSize=this.getRowheight();
    List<HeaderPositionInfo> infos=new ArrayList<HeaderPositionInfo>();
    for (    Row row : sheet) {
      final boolean hidden=row.getZeroHeight();
      final int height=Utils.getRowHeightInPx(sheet,row);
      if (height != defaultSize || hidden) {
        infos.add(new HeaderPositionInfo(row.getRowNum(),height,_custRowId.next(),hidden));
      }
      final int colnum=row.getLastCellNum() - 1;
      if (colnum > maxcol) {
        maxcol=colnum;
      }
    }
    helpers.putHelper(sheetId,helper=new HeaderPositionHelper(defaultSize,infos));
  }
  return new HeaderPositionHelper[]{helper,myGetColumnPositionHelper(sheet,maxcol)};
}
Program: 56612
Project: 56612
Buggy source:
private void updateCell(Worksheet sheet,int left,int top,int right,int bottom){
  if (this.isInvalidated())   return;
  String sheetId=Utils.getSheetUuid(sheet);
  if (!sheetId.equals(this.getSelectedSheetId()))   return;
  left=left > 0 ? left - 1 : 0;
  top=top > 0 ? top - 1 : 0;
  final Rect rect=getActiveRangeHelper().getRect(_selectedSheet);
  final int loadLeft=rect.getLeft();
  final int loadTop=rect.getTop();
  final int loadRight=rect.getRight();
  final int loadBottom=rect.getBottom();
  final int frRow=getRowfreeze();
  final int frCol=getColumnfreeze();
  final int frTop=top <= frRow ? top : -1;
  final int frBottom=frRow;
  final int frLeft=left <= frCol ? left : -1;
  final int frRight=frCol;
  if (loadLeft > left) {
    left=loadLeft;
  }
  if (loadRight < right) {
    right=loadRight;
  }
  if (loadTop > top) {
    top=loadTop;
  }
  if (loadBottom < bottom) {
    bottom=loadBottom;
  }
  if (frTop >= 0 && frTop <= frBottom && left >= 0 && left <= right) {
    responseUpdateCell(sheet,sheetId,left,frTop,right,frBottom);
  }
  if (frLeft >= 0 && frLeft <= frRight && top >= 0 && top <= bottom) {
    responseUpdateCell(sheet,sheetId,frLeft,top,frRight,bottom);
  }
  if (top >= 0 && top <= bottom && left >= 0 && left <= right) {
    responseUpdateCell(sheet,sheetId,left,top,right,bottom);
  }
}

Fixed version (ground truth):
private void updateCell(Worksheet sheet,int left,int top,int right,int bottom){
  if (this.isInvalidated())   return;
  String sheetId=Utils.getSheetUuid(sheet);
  if (!getActiveRangeHelper().containsSheet(sheet))   return;
  left=left > 0 ? left - 1 : 0;
  top=top > 0 ? top - 1 : 0;
  final Rect rect=getActiveRangeHelper().getRect(_selectedSheet);
  final int loadLeft=rect.getLeft();
  final int loadTop=rect.getTop();
  final int loadRight=rect.getRight();
  final int loadBottom=rect.getBottom();
  final int frRow=getRowfreeze();
  final int frCol=getColumnfreeze();
  final int frTop=top <= frRow ? top : -1;
  final int frBottom=frRow;
  final int frLeft=left <= frCol ? left : -1;
  final int frRight=frCol;
  if (loadLeft > left) {
    left=loadLeft;
  }
  if (loadRight < right) {
    right=loadRight;
  }
  if (loadTop > top) {
    top=loadTop;
  }
  if (loadBottom < bottom) {
    bottom=loadBottom;
  }
  if (frTop >= 0 && frTop <= frBottom && left >= 0 && left <= right) {
    responseUpdateCell(sheet,sheetId,left,frTop,right,frBottom);
  }
  if (frLeft >= 0 && frLeft <= frRight && top >= 0 && top <= bottom) {
    responseUpdateCell(sheet,sheetId,frLeft,top,frRight,bottom);
  }
  if (top >= 0 && top <= bottom && left >= 0 && left <= right) {
    responseUpdateCell(sheet,sheetId,left,top,right,bottom);
  }
}