RFR: 8089398: [ChoiceBox, ComboBox] throws NPE on setting value on null selectionModel

Marius Hanl mhanl at openjdk.java.net
Thu Jul 1 15:36:07 UTC 2021


On Thu, 1 Jul 2021 15:29:01 GMT, Marius Hanl <mhanl at openjdk.org> wrote:

> I don't see any benefit with a noop selection model, but we need/should cleanup some null checks and somehow still silently set a selection model while we as a developer set it to null (so I guess we expected null to be returned when we call the getSelectionModel())

Something similar is done in e.g. TextField. Internally, when **setText()** with null is called, it will be treated as empty String. But when you call **getText()**, you still will get null. This looks a bit hacky though.

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

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


More information about the openjfx-dev mailing list