On Thu, 3 Nov 2022 16:17:09 GMT, Ajit Ghaisas <[email protected]> wrote:

>> it's not: `isAlreadySelected` is set on line 278 or 280.  Line 274 is just a 
>> declaration.
>
> What I mean by code simplification is -
> 
>         boolean isAlreadySelected = false;
>         MultipleSelectionModel<?> sm = getSelectionModel();
>         if (sm != null) {
>             isAlreadySelected = sm.isSelected(index);
> 
>             if (isAlreadySelected && shortcutDown) {
>                 sm.clearSelection(index);
>                 getFocusModel().focus(index);
>                 isAlreadySelected = false;
>             } else {
>                 sm.clearAndSelect(index);
>             }
>         }

in this version, there are code paths where you assign the same variable twice. 
 I don't do that, I don't like doing that.  Is this required or in the code 
style?

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

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

Reply via email to