RFR: 8235491: Tree/TableView: implementation of isSelected(int) violates contract [v2]

Andy Goryachev angorya at openjdk.org
Tue Jul 26 16:04:19 UTC 2022


On Tue, 26 Jul 2022 07:02:11 GMT, Ajit Ghaisas <aghaisas at openjdk.org> wrote:

>> Andy Goryachev has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - 8235491: whitespace
>>  - 8235491: javadoc
>
> modules/javafx.controls/src/main/java/javafx/scene/control/TableView.java line 2819:
> 
>> 2817:         public boolean isSelected(int index) {
>> 2818:             final boolean isCellSelectionEnabled = isCellSelectionEnabled();
>> 2819:             if (isCellSelectionEnabled) {
> 
> Code Style : Why to create a local variable with the same name as method it gets its value from?
> In this case changing to `if (isCellSelectionEnabled())` condition check looks simple enough.

+1

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

PR: https://git.openjdk.org/jfx/pull/839


More information about the openjfx-dev mailing list