-
Bug
-
Resolution: Fixed
-
P4
-
jfx16
Happens if instantiated with null tablePosition (stumbling over it triggered JDK-8187229, though the underlying reason of that is different - incorrect edit location).
Misbehavior was introduced when fixingJDK-8120610 (by removing null guard of tablePosition without updating the accessors to cope with null pos). Also effects default onCommit handlers which went unnoticed because of .. unusual tests.
example of failing tests (for TableColumn.CellEditEvent, similar for TreeTableColumn.CellEditEvent):
/**
* NPE with not-null table on accessing table.
*/
@Test
public void testNullTablePosition() {
CellEditEvent<String, String> ev = new CellEditEvent<>(table, null, editAnyEvent(), null);
ev.getTableView();
}
----
Note: the part below was originally included in this issue, on further analysis moved toJDK-8271474
- throws NPE if instantiated with null table
might be considered a strengthening of precondition, because the table is passed as source to super. Arguably, though because that role is an implementation detail. At least, it should be specified as requiring not-null
/**
* Strengthened precondition: event must handle null source.
*/
@Test
public void testNullTable() {
CellEditEvent<?, ?> ev = new CellEditEvent<Object, Object>(null, // null table
new TablePosition<>(null, -1, null), editAnyEvent(), null);
}
Misbehavior was introduced when fixing
example of failing tests (for TableColumn.CellEditEvent, similar for TreeTableColumn.CellEditEvent):
/**
* NPE with not-null table on accessing table.
*/
@Test
public void testNullTablePosition() {
CellEditEvent<String, String> ev = new CellEditEvent<>(table, null, editAnyEvent(), null);
ev.getTableView();
}
----
Note: the part below was originally included in this issue, on further analysis moved to
- throws NPE if instantiated with null table
might be considered a strengthening of precondition, because the table is passed as source to super. Arguably, though because that role is an implementation detail. At least, it should be specified as requiring not-null
/**
* Strengthened precondition: event must handle null source.
*/
@Test
public void testNullTable() {
CellEditEvent<?, ?> ev = new CellEditEvent<Object, Object>(null, // null table
new TablePosition<>(null, -1, null), editAnyEvent(), null);
}
- relates to
-
JDK-8120610 EditingCellProperty is not set to null
- Resolved
-
JDK-8271474 Tree-/TableCell: inconsistent edit event firing pattern
- Resolved
-
JDK-8271484 Tree-/TableCell: NPE when accessing edit event from startEdit
- Resolved
-
JDK-8187229 Tree/TableCell: cancel event must return correct editing location
- Resolved
(2 links to)