-
Notifications
You must be signed in to change notification settings - Fork 506
8159048: Animation and AnimationTimer methods must be called on JavaFX Application thread #1167
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
Conversation
👋 Welcome back jpereda! A progress list of the required criteria for merging this PR into |
@jperedadnr In case you missed it, this PR is not |
At first glance, this looks like a good fix. Since this enforces a new threading restriction on existing animation methods, it will need a CSR. /csr |
@kevinrushforth has indicated that a compatibility and specification (CSR) request is needed for this pull request. @jperedadnr please create a CSR request for issue JDK-8159048 with the correct fix version. This pull request cannot be integrated until the CSR request is approved. |
@kevinrushforth |
Webrevs
|
Thanks, @kevinrushforth, I've missed that, indeed. I've filed the CSR draft: https://bugs.openjdk.org/browse/JDK-8313378 |
minor: spelling in the title (Receiver) |
tests/system/src/test/java/test/com/sun/javafx/animation/AnimationTimerTest.java
Outdated
Show resolved
Hide resolved
tests/system/src/test/java/test/com/sun/javafx/animation/AnimationTimerTest.java
Show resolved
Hide resolved
tests/system/src/test/java/test/com/sun/javafx/animation/AnimationTimerTest.java
Show resolved
Hide resolved
I've edited the title of the original JBS issue https://bugs.openjdk.org/browse/JDK-8159048 to fix the typo. |
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, thank you!
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.
The CSR is ready to "Finalize". As soon as it is approved, you can integrate.
@jperedadnr One more thing I noticed: the titles of the bug and the CSR should match (it's not enforced, but it a best practice). So you should either change the title of the CSR back to match the title of the bug -- "Null PulseReceiver in AbstractMasterTimer" -- or change the title of the bug, along with this PR title, to match the CSR. In looking at it, I think the CSR title is more descriptive, so I might suggest some variant of that. Here a slightly shortened suggestion:
but what you have is fine as well. |
Makes sense, I've updated the title of both JBS issue and CSR. |
@jperedadnr You also need to update this PR title. Also, please "Finalize" the CSR when ready, since that will trigger the final review of the CSR. |
Sorry, missed that change. Done. |
@jperedadnr 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 29 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 |
/integrate |
Going to push as commit c3257fc.
Your commit was automatically rebased without conflicts. |
@jperedadnr Pushed as commit c3257fc. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
This PR adds a check to the Animation and AnimationTimer public methods to verify that these are called from the JavaFX Application thread. If the call is done from any other thread, an IllegalStateException will be thrown.
This will prevent users from getting unexpected errors (typically NPE, like the one posted in the JBS issue), and will fail fast with a clear exception and reason for it.
The javadoc of the Animation and AnimationTimer classes and public methods has been updated accordingly.
Tests for both classes have been included, failing (as in no exceptions were thrown when calling from a background thread) before this patch, and passing (as in ISE was thrown).
Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1167/head:pull/1167
$ git checkout pull/1167
Update a local copy of the PR:
$ git checkout pull/1167
$ git pull https://git.openjdk.org/jfx.git pull/1167/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1167
View PR using the GUI difftool:
$ git pr show -t 1167
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1167.diff
Webrev
Link to Webrev Comment