Skip to content

Conversation

@Maran23
Copy link
Member

@Maran23 Maran23 commented Jun 29, 2022

For some reason the skinProperty did not allow to set a new skin which is the same class as the previous one.
This leads to multiple issues:

  1. When creating a new skin (same class as previous), the skin will likely install some children and listener but is then rejected when setting it due to the skinProperty class constraint
    -> Control 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
  2. A skin of the same class can behave differently, so it is not really valid to reject a skin just because it is the same class as the previous
    -> Just imagine we have the following skin class
class MyCustomButtonSkin extends ButtonSkin {
    public MyCustomButtonSkin(Button button, boolean someFlag) { super(button); ... }
}

Now if we would change the skin of the Button two times like this:

button.setSkin(new MyCustomButtonSkin(button, true));
button.setSkin(new MyCustomButtonSkin(button, false));

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.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8276056: Control.skin.setSkin(Skin) fails to call dispose() on discarded Skin

Reviewers

Contributors

  • Jeanette Winzenburg <fastegal@openjdk.org>

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx pull/806/head:pull/806
$ git checkout pull/806

Update a local copy of the PR:
$ git checkout pull/806
$ git pull https://git.openjdk.org/jfx pull/806/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 806

View PR using the GUI difftool:
$ git pr show -t 806

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/806.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Jun 29, 2022

👋 Welcome back mhanl! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Ready for review label Jun 29, 2022
@mlbridge
Copy link

mlbridge bot commented Jun 29, 2022

Webrevs

@Maran23
Copy link
Member Author

Maran23 commented Jun 29, 2022

/contributor add @kleopatra

I used the tests you wrote in comments of the ticket. Thanks!

@openjdk
Copy link

openjdk bot commented Jun 29, 2022

@Maran23
Contributor Jeanette Winzenburg <fastegal@openjdk.org> successfully added.

@kevinrushforth kevinrushforth requested a review from aghaisas June 30, 2022 20:14
@kevinrushforth
Copy link
Member

This looks simple enough that a single Reviewer should be sufficient. The remove code looks quite questionable to me, so getting rid of it seems like a good thing.

Copy link
Collaborator

@aghaisas aghaisas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@openjdk
Copy link

openjdk bot commented Jul 8, 2022

@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:

8276056: Control.skin.setSkin(Skin) fails to call dispose() on discarded Skin

Co-authored-by: Jeanette Winzenburg <fastegal@openjdk.org>
Reviewed-by: aghaisas

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 8 new commits pushed to the master branch:

  • fc6a602: 8289587: IllegalArgumentException: Color.rgb's red parameter (-16776961) expects color values 0-255
  • 4dcd9e0: 8289171: Blank final field 'dialog' may not have been initialized in scene.control.Dialog:521
  • 28b8220: 8279297: Remove Shape::setMode method
  • 77ecfb7: 8289390: Fix warnings: type parameter E is hiding the type E
  • 704baa3: 8289396: Fix warnings: Null pointer access: The variable instance can only be null at this location
  • b9f3907: 8289751: Multiple unit test failures after JDK-8251483
  • 222b2b1: 8251483: TableCell: NPE on modifying item's list
  • b3eca1f: 8283346: Optimize observable ArrayList creation in FXCollections

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@aghaisas) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@openjdk openjdk bot added the ready Ready to be integrated label Jul 8, 2022
@Maran23
Copy link
Member Author

Maran23 commented Jul 8, 2022

/integrate

@openjdk openjdk bot added the sponsor Ready to sponsor label Jul 8, 2022
@openjdk
Copy link

openjdk bot commented Jul 8, 2022

@Maran23
Your change (at version 325d842) is now ready to be sponsored by a Committer.

@kevinrushforth
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Jul 8, 2022

Going to push as commit 178d898.
Since your change was applied there have been 8 commits pushed to the master branch:

  • fc6a602: 8289587: IllegalArgumentException: Color.rgb's red parameter (-16776961) expects color values 0-255
  • 4dcd9e0: 8289171: Blank final field 'dialog' may not have been initialized in scene.control.Dialog:521
  • 28b8220: 8279297: Remove Shape::setMode method
  • 77ecfb7: 8289390: Fix warnings: type parameter E is hiding the type E
  • 704baa3: 8289396: Fix warnings: Null pointer access: The variable instance can only be null at this location
  • b9f3907: 8289751: Multiple unit test failures after JDK-8251483
  • 222b2b1: 8251483: TableCell: NPE on modifying item's list
  • b3eca1f: 8283346: Optimize observable ArrayList creation in FXCollections

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Jul 8, 2022
@openjdk openjdk bot closed this Jul 8, 2022
@openjdk openjdk bot removed ready Ready to be integrated rfr Ready for review sponsor Ready to sponsor labels Jul 8, 2022
@openjdk
Copy link

openjdk bot commented Jul 8, 2022

@kevinrushforth @Maran23 Pushed as commit 178d898.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants