Program: 145439
Project: 145439
Buggy source:
public ModelGrid(){
  super(new RowKeyProvider());
  addDomHandler(new KeyUpHandler(){
    @Override public void onKeyUp(    KeyUpEvent event){
      try {
        if (event.getNativeKeyCode() == KeyCodes.KEY_DELETE && deletable) {
          if (getSelectionModel() instanceof SetSelectionModel<?>) {
            SetSelectionModel<Row> rowSelection=(SetSelectionModel<Row>)getSelectionModel();
            rowsSource.getRowset().delete(rowSelection.getSelectedSet());
          }
        }
 else         if (event.getNativeKeyCode() == KeyCodes.KEY_INSERT && insertable) {
          rowsSource.getRowset().insert();
          Row inserted=rowsSource.getRowset().getCurrentRow();
          if (inserted != null && getSelectionModel() instanceof SetSelectionModel<?>) {
            SetSelectionModel<Row> rowSelection=(SetSelectionModel<Row>)getSelectionModel();
            rowSelection.clear();
            rowSelection.setSelected(inserted,true);
          }
        }
      }
 catch (      RowsetException e) {
        Logger.getLogger(ModelGrid.class.getName()).log(Level.SEVERE,null,e);
      }
    }
  }
,KeyUpEvent.getType());
  addDomHandler(new KeyDownHandler(){
    @Override public void onKeyDown(    KeyDownEvent event){
      if (event.getNativeKeyCode() == KeyCodes.KEY_F) {
        event.stopPropagation();
        event.preventDefault();
        ModelGrid.this.find();
      }
 else       if (event.getNativeKeyCode() == KeyCodes.KEY_F3) {
        event.stopPropagation();
        event.preventDefault();
        if (finder != null) {
          finder.findNext();
        }
      }
    }
  }
,KeyDownEvent.getType());
}

Fixed version (ground truth):
public ModelGrid(){
  super(new RowKeyProvider());
  addDomHandler(new KeyUpHandler(){
    @Override public void onKeyUp(    KeyUpEvent event){
      try {
        if (event.getNativeKeyCode() == KeyCodes.KEY_DELETE && deletable) {
          if (getSelectionModel() instanceof SetSelectionModel<?>) {
            SetSelectionModel<Row> rowSelection=(SetSelectionModel<Row>)getSelectionModel();
            rowsSource.getRowset().delete(rowSelection.getSelectedSet());
          }
        }
 else         if (event.getNativeKeyCode() == KeyCodes.KEY_INSERT && insertable) {
          rowsSource.getRowset().insert();
          Row inserted=rowsSource.getRowset().getCurrentRow();
          if (inserted != null && getSelectionModel() instanceof SetSelectionModel<?>) {
            SetSelectionModel<Row> rowSelection=(SetSelectionModel<Row>)getSelectionModel();
            rowSelection.clear();
            rowSelection.setSelected(inserted,true);
          }
        }
      }
 catch (      RowsetException e) {
        Logger.getLogger(ModelGrid.class.getName()).log(Level.SEVERE,null,e);
      }
    }
  }
,KeyUpEvent.getType());
  addDomHandler(new KeyDownHandler(){
    @Override public void onKeyDown(    KeyDownEvent event){
      if ((event.isMetaKeyDown() || event.isControlKeyDown()) && event.getNativeKeyCode() == KeyCodes.KEY_F) {
        event.stopPropagation();
        event.preventDefault();
        ModelGrid.this.find();
      }
 else       if (event.getNativeKeyCode() == KeyCodes.KEY_F3) {
        event.stopPropagation();
        event.preventDefault();
        if (finder != null) {
          finder.findNext();
        }
      }
    }
  }
,KeyDownEvent.getType());
}