EVALUATION
Problem caused by attempt to offload work from main FX thread to system thread that then tries get it back on the same FX thread
but it is blocked. In AWT case we will use another EDT and this will avoid this type of deadlock but JavaFX has single JavaFX application thread.
The fix starts using Waiter interface. In JavaFX case this will enter the nested event loop before blocking current event loop.
In AWT case this will just execute requested operation in place.
The hang is always reproducible when FileSaveService is called from the FX app thread.
AWT case - Waiter calls task.run (com.sun.deploy.util.Waiter.default_waiter) and the change has no impact on AWT
FX case - Waiter starts nested event loop and starts new worker thread to call task.run (com.sun.deploy.uitoolkit.impl.fx.FxWaiter) and unblocks file chooser
|