RFR: 8231372: JFXPanel fails to render if setScene called on Swing thread

Kevin Rushforth kcr at openjdk.java.net
Fri Dec 4 02:14:02 UTC 2020


This fix was originally proposed by @mruzicka in PR #16 which was closed several months ago without being integrated. At the time we didn't have a test case that was failing.

While evaluating a bug that I filed, [JDK-8235843](https://bugs.openjdk.java.net/browse/JDK-8235843), I discovered that that bug was a duplicate of this one. The original proposed fix is correct, although I modified it slightly to add a try / finally so that the secondary event loop will be terminated even if the setScene throws an exception. I also added a unit test. Since the bulk of the fix is from PR #16, I will add the contributor of that PR.

NOTE to reviewers: I pushed two commits to my branch. The first is exactly the commit created for PR #16 and the second is the unit test along with the fix to the code to add try / finally. As always, they will be squashed into a single commit by Skara.

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

Commit messages:
 - Add automated tests, enclose the latch in try/finally,
 - 8231372: Correctly terminate secondary event loop in JFXPanel.setScene()

Changes: https://git.openjdk.java.net/jfx/pull/362/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jfx&pr=362&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8231372
  Stats: 62 lines in 2 files changed: 56 ins; 1 del; 5 mod
  Patch: https://git.openjdk.java.net/jfx/pull/362.diff
  Fetch: git fetch https://git.openjdk.java.net/jfx pull/362/head:pull/362

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


More information about the openjfx-dev mailing list