RFR: 8245145: Spinner: throws IllegalArgumentException when replacing skin [v3]

Andy Goryachev angorya at openjdk.org
Tue Dec 6 17:18:53 UTC 2022


On Tue, 6 Dec 2022 11:20:51 GMT, Ajit Ghaisas <aghaisas at openjdk.org> wrote:

>> Andy Goryachev has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 51 commits:
>> 
>>  - Merge remote-tracking branch 'origin/master' into 8245145.spinner.skin
>>  - Merge remote-tracking branch 'origin/master' into 8245145.spinner.skin
>>  - 8245145: cleanup
>>  - 8245145: cleanup
>>  - 8245145: cleanup
>>  - Merge remote-tracking branch 'origin/master' into 8245145.spinner.skin
>>  - 8245145: listener helper
>>  - Merge branch '8294809.listener.helper' into 8245145.spinner.skin
>>  - 8294809: whitespace
>>  - 8294809: no public api
>>  - ... and 41 more: https://git.openjdk.org/jfx/compare/e64e1292...c933b7b5
>
> modules/javafx.controls/src/main/java/javafx/scene/control/skin/SpinnerSkin.java line 267:
> 
>> 265:     @Override
>> 266:     public void install() {
>> 267:         getChildren().add(textField);
> 
> `dispose()` method removes 3 children, whereas `install()` method adds only 1 child. Is this intentional?

good question!  yes, it is intentional - the textField, unlike the buttons, comes from the control, so when we change skins the old skin removes it in its dispose(), followed by the new skin adding it back in install(), as it cannot do that in the constructor.

added a comment in the code to clarify

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

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


More information about the openjfx-dev mailing list