RFR: 8279640: ListView with null SelectionModel/FocusModel throws NPE [v3]

Marius Hanl mhanl at openjdk.org
Mon Sep 12 16:28:22 UTC 2022


On Mon, 12 Sep 2022 16:06:20 GMT, danielpeintner <duke at openjdk.org> wrote:

>> Marius Hanl has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
>> 
>>  - Merge branch 'master' of https://github.com/openjdk/jfx into 8279640-list-view-null-selection-focus-model
>>  - Fix NPE for null selection/focus -model in queryAccessibleAttribute(..)
>>  - Still set anchor when the selection model is null
>>  - Using global StageLoader
>>  - 8279640: ListView with null SelectionModel/FocusModel throws NPE
>
> modules/javafx.controls/src/main/java/com/sun/javafx/scene/control/behavior/ListViewBehavior.java line 581:
> 
>> 579: 
>> 580:         MultipleSelectionModel<T> selectionModel = getNode().getSelectionModel();
>> 581:         if (selectionModel == null) return;
> 
> VERY MINOR style issue: this seems to be the only place where you use a _one-liner_ return

Yes, this is unfortunately different everywhere in JavaFX and I usually just adapt to the already existing code, but in this case I didn't. Just changed it.

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

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


More information about the openjfx-dev mailing list