-
Notifications
You must be signed in to change notification settings - Fork 478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JDK-8323615: PopupControl.skin.setSkin(Skin) fails to call dispose() on discarded Skin #1331
Conversation
…on discarded Skin
👋 Welcome back mhanl! A progress list of the required criteria for merging this PR into |
@@ -213,18 +213,6 @@ public PopupControl() { | |||
// a reference to the old value. | |||
private Skin<?> oldValue; | |||
|
|||
@Override |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic was introduce to deal with skins set from the css JDK-8096194
Are you sure it will still work? Do we need to test this scenario explicitly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the skin
/skinProperty
logic was there before, just moved.
It was added in https://bugs.openjdk.org/browse/JDK-8127070,
with the comment from David Grieve
: The code for handling the skin property in PopupControl needs to look like the code in Control.
So they basically synchronized the whole skin/skin name API to PopupControl
.
/reviewers 2 |
@andy-goryachev-oracle |
I think the proposed fix is correct. I've tried to re-load skin via CSS (see https://github.com/andy-goryachev-oracle/Test/blob/main/src/goryachev/bugs/PopupControl_SetSkin_8323615.java ) and it does seem to reload correctly, as far as I can tell. Loading fails without the fix, as expected. Still, i would like a second pair of eyes to look at this, if possible. |
|
||
assertNotEquals("New skin was not set", oldSkin, newSkin); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor: please remove extra newline, I'll reapprove if you choose to make the change
@arapte Can you be the second reviewer? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, and works as I expect it.
@Maran23 This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 23 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
@Maran23 |
Thank you for checking as well! /integrate |
Going to push as commit aac2df1.
Your commit was automatically rebased without conflicts. |
For some reason the
skinProperty
did not allow to set a new skin when it is the same class as the previous one.This leads to multiple issues:
skinProperty
class constraint->
PopupControl
is in a weird state as the current skin was not disposed since it is still set, although we already created and 'set' a new skin-> Just imagine we have the following skin class
Now if we would change the skin of the
PopupControl
two times like this:The second time the skin will be rejected as it is the same class, although I may changed the skin behaviour, in this case demonstrated by a boolean flag for showing purposes.
This is the same issue and fix as done for
Control
in JDK-8276056 (PR: #806)Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1331/head:pull/1331
$ git checkout pull/1331
Update a local copy of the PR:
$ git checkout pull/1331
$ git pull https://git.openjdk.org/jfx.git pull/1331/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1331
View PR using the GUI difftool:
$ git pr show -t 1331
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1331.diff
Webrev
Link to Webrev Comment