[jfx17] RFR: 8270314: TreeTableCell: inconsistent naming for tableRow and tableColumn property methods [v3]

Kevin Rushforth kcr at openjdk.java.net
Fri Jul 16 13:30:28 UTC 2021


> In the `TreeTableCell` class there is a mismatch between name of the following property method vs the getter:
> 
> 
>     public final ReadOnlyObjectProperty<TreeTableRow<S>> tableRowProperty()
>     public final TreeTableRow<S> getTreeTableRow()
> 
> 
> The get method has "Tree" in the name while the property method does not.
> 
> By contrast, the corresponding methods for column are self-consistent, and are named without "Tree" in the name:
> 
> 
>     public final ReadOnlyObjectProperty<TreeTableColumn<S,​T>> tableColumnProperty()
>     public final TreeTableColumn<S,​T> getTableColumn()
> 
> 
> The solution is to effectively change `getTreeTableRow()` to `getTableRow()`. In order to preserve source and binary compatibility, the method is copied rather than renamed. The existing `getTreeTableRow()` method is deprecated (not for removal).
> 
> Additionally, the docs for each property is on a private property field that *does* have tree in the name, which results in no docs being generated for either the `tableRow` or `tableColumn` property.
> 
> Finally, there is a problem with the implementation of the `tableRowProperty()` method in that it returns the writable property by mistake rather than the read-only property that is specified by the method's return type.
> 
> In summary, the following changes are made to `TreeTableCell`:
> 
> 1. Deprecate the `getTreeTableRow` method.
> 2. Add a `getTableRow` method.
> 3. Rename the (private) property object fields from `treeTableRow` and `treeTableColumn` to `tableRow` and `tableColumn`, including the name of the bean, so that they match the public property method names. This will allow API docs to be generated.
> 4. Change the implementation of the tableRowProperty() method to return a read-only property.
> 
> In addition to changing the existing implementation and tests to call the new `getTableRow` method instead of the now-deprecated `getTreeTableRow` method, I added unit tests to validate changes 3 and 4.
> 
> NOTE: this is targeted to `jfx17`.

Kevin Rushforth has updated the pull request incrementally with one additional commit since the last revision:

  Renamed updateTreeTable{Row,Column} to updateTable{Row,Column}

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

Changes:
  - all: https://git.openjdk.java.net/jfx/pull/575/files
  - new: https://git.openjdk.java.net/jfx/pull/575/files/759d8890..5c519ed1

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jfx&pr=575&range=02
 - incr: https://webrevs.openjdk.java.net/?repo=jfx&pr=575&range=01-02

  Stats: 84 lines in 11 files changed: 22 ins; 0 del; 62 mod
  Patch: https://git.openjdk.java.net/jfx/pull/575.diff
  Fetch: git fetch https://git.openjdk.java.net/jfx pull/575/head:pull/575

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


More information about the openjfx-dev mailing list