On Fri, 14 Jan 2022 00:04:49 GMT, Marius Hanl <mh...@openjdk.org> wrote:

> This PR will fix a simple NPE which may happens when using the `TableRow` 
> inside a `TableCell` during the initial auto sizing.
> In the auto sizing code, no `TableRow` is set, therefore `getTableRow()` will 
> return null and it is not possible to e.g. access the row item.
> 
> This is fixed by adding the `TableRow` in the `resizeColumnToFitContent` 
> method, similar as it is already done for the `TreeTableView` 
> (`TreeTableRow`).

hmm .. I think here are two issues:

- the auto-sizing code definitely needs to fully configure the cell (with 
index, row, column, tableView plus applying css) to measure the correct size
- the implementation of cell.updateItem (even though it's my own ;) is a bit 
fishy: does its spec really guarantee that getTableRow() != null if !empty()? 
Meanwhile, I think that's not the case - but then, it's for demonstrating the 
first bullet :)

The first is fixed by this PR (looks good on first sight). The second might 
need a clarification in the method doc .. or not, undecided.

-------------

PR: https://git.openjdk.java.net/jfx/pull/716

Reply via email to