Program: 143484
Project: 143484
Buggy source:
@Override public void foundSetChanged(FoundSetEvent event){
  if (allChanged)   return;
  if (event.getType() == FoundSetEvent.FIND_MODE_CHANGE || event.getType() == FoundSetEvent.FOUNDSET_INVALIDATED) {
    setAllChanged();
  }
 else   if (event.getType() == FoundSetEvent.CONTENTS_CHANGED) {
    if (event.getChangeType() == FoundSetEvent.CHANGE_DELETE) {
      int startIdx=(currentPage - 1) * PAGE_SIZE;
      int endIdx=currentPage * PAGE_SIZE;
      if (endIdx > currentFoundset.getSize())       endIdx=currentFoundset.getSize();
      if (event.getFirstRow() < endIdx) {
        int startRow=Math.max(startIdx,event.getFirstRow());
        int numberOfDeletes=Math.min(event.getLastRow(),endIdx) - event.getFirstRow() + 1;
        RowData data=getRows(endIdx - Math.min(PAGE_SIZE,numberOfDeletes),endIdx);
        rowChanges.add(new RowData(data.rows,startRow - startIdx,startRow + numberOfDeletes - startIdx,RowData.DELETE));
      }
 else       if (endIdx == 0) {
        setAllChanged();
      }
    }
 else     if (event.getChangeType() == FoundSetEvent.CHANGE_INSERT) {
      int startIdx=(currentPage - 1) * PAGE_SIZE;
      int endIdx=currentPage * PAGE_SIZE;
      if (endIdx > currentFoundset.getSize())       endIdx=currentFoundset.getSize();
      if (event.getFirstRow() < endIdx) {
        int startRow=Math.max(startIdx,event.getFirstRow());
        int numberOfInserts=Math.min(event.getLastRow(),endIdx) - event.getFirstRow() + 1;
        RowData rows=getRows(startRow,Math.min(startRow + numberOfInserts,endIdx));
        rows.setType(RowData.INSERT);
        rowChanges.add(rows);
      }
    }
 else     if (event.getChangeType() == FoundSetEvent.CHANGE_UPDATE) {
      RowData rows=getRows(event.getFirstRow(),event.getLastRow() + 1);
      if (rows != RowData.EMPTY) {
        rowChanges.add(rows);
      }
    }
  }
  application.getChangeListener().valueChanged();
}

Fixed version (ground truth):
@Override public void foundSetChanged(FoundSetEvent event){
  if (allChanged)   return;
  if (event.getType() == FoundSetEvent.FIND_MODE_CHANGE || event.getType() == FoundSetEvent.FOUNDSET_INVALIDATED) {
    setAllChanged();
  }
 else   if (event.getType() == FoundSetEvent.CONTENTS_CHANGED) {
    if (event.getChangeType() == FoundSetEvent.CHANGE_DELETE) {
      int startIdx=(currentPage - 1) * getPageSize();
      int endIdx=currentPage * getPageSize();
      if (endIdx > currentFoundset.getSize())       endIdx=currentFoundset.getSize();
      if (event.getFirstRow() < endIdx) {
        int startRow=Math.max(startIdx,event.getFirstRow());
        int numberOfDeletes=Math.min(event.getLastRow(),endIdx) - event.getFirstRow() + 1;
        RowData data=getRows(endIdx - Math.min(DEFAULT_PAGE_SIZE,numberOfDeletes),endIdx);
        rowChanges.add(new RowData(data.rows,startRow - startIdx,startRow + numberOfDeletes - startIdx,RowData.DELETE));
      }
 else       if (endIdx == 0) {
        setAllChanged();
      }
    }
 else     if (event.getChangeType() == FoundSetEvent.CHANGE_INSERT) {
      int startIdx=(currentPage - 1) * DEFAULT_PAGE_SIZE;
      int endIdx=currentPage * DEFAULT_PAGE_SIZE;
      if (endIdx > currentFoundset.getSize())       endIdx=currentFoundset.getSize();
      if (event.getFirstRow() < endIdx) {
        int startRow=Math.max(startIdx,event.getFirstRow());
        int numberOfInserts=Math.min(event.getLastRow(),endIdx) - event.getFirstRow() + 1;
        RowData rows=getRows(startRow,Math.min(startRow + numberOfInserts,endIdx));
        rows.setType(RowData.INSERT);
        rowChanges.add(rows);
      }
    }
 else     if (event.getChangeType() == FoundSetEvent.CHANGE_UPDATE) {
      RowData rows=getRows(event.getFirstRow(),event.getLastRow() + 1);
      if (rows != RowData.EMPTY) {
        rowChanges.add(rows);
      }
    }
  }
  application.getChangeListener().valueChanged();
}