-
Bug
-
Resolution: Fixed
-
P4
-
jfx11
-
b04
-
generic
-
generic
TreeTableCell and TableCell have a boolean flag that is called: lockItemOnEdit.
This flag is always false in production.
It is only changed by some JUnit tests to remove the need of setting up the whole table framework for the sake of just testing the cell.
// We check the boolean lockItemOnEdit field here, as whilst we want to
// updateItem normally, when it comes to unit tests we can't have the
// item change in all circumstances.
if (! lockItemOnEdit) {
updateItem(-1);
}
This ticket proposes to remove this flag as it is irritating when checking out the sources.
It is also not best practise to mix code (e.g. variables) into 'production' classes that are only needed for testing.
Unlike package private methods we usually create and access via shims.
To remove this flag, it can simply be attached to the shim instead.
The shim then checks the flag instead. The flag is anyway accessed via a shim, so nothing will change on this side.
This flag is always false in production.
It is only changed by some JUnit tests to remove the need of setting up the whole table framework for the sake of just testing the cell.
// We check the boolean lockItemOnEdit field here, as whilst we want to
// updateItem normally, when it comes to unit tests we can't have the
// item change in all circumstances.
if (! lockItemOnEdit) {
updateItem(-1);
}
This ticket proposes to remove this flag as it is irritating when checking out the sources.
It is also not best practise to mix code (e.g. variables) into 'production' classes that are only needed for testing.
Unlike package private methods we usually create and access via shims.
To remove this flag, it can simply be attached to the shim instead.
The shim then checks the flag instead. The flag is anyway accessed via a shim, so nothing will change on this side.
- links to
-
Commit openjdk/jfx/771273f7
-
Review(master) openjdk/jfx/1198