RFR: 8251481: TableCell accessing row: NPE on auto-sizing [v3]

Jeanette Winzenburg fastegal at openjdk.java.net
Fri Jan 28 12:43:18 UTC 2022


On Thu, 27 Jan 2022 10:21:18 GMT, Marius Hanl <mhanl at openjdk.org> wrote:

>> modules/javafx.controls/src/test/java/test/javafx/scene/control/TableCellTest.java line 371:
>> 
>>> 369:     @Test
>>> 370:     public void testRowIsNotNullWhenAutoSizing() {
>>> 371:         TableColumn<String, String> tableColumn = new TableColumn<>();
>> 
>> - the bug that's fixed in this PR is in TableColumnHeader, shouldn't the test be in TableColumnHeaderTest?
>> - if you decide to keep it here: it's in the middle of some edit-related tests, you might consider moving it up/down before/after those
>> - the fix aligns the resizeToFit method for TableView with that for TreeTableView: for symmetry, I would also expect a test method for the latter (which will pass both before and after the fix)
>
> I can align it. And yeah makes sense to add a test for the TreeTableView/TreeTableCell.

just curious: why didn't you move the tests into TableColumnHeaderTest?

> Pretty sure table row is never null. Or is it on some corner case? 

updateItem has no precondition :) So a clean implementation must cope with whatever state the cell is in (getting away with not thinking of potential corner cases most of the time).

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

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


More information about the openjfx-dev mailing list