Examine the following situation: there is a code that shows a modal dialog. It contains Button, which has an action listener, which does two things:
calls hide on the modal dialog; set the value of the result (shared variable). If the modal dialog was shown from EDT, you will see the set value right after the return from dialog's show method. If modal dialog was shown from another thread, you will not see the value.
This happens because when a modal dialog is shown from non-EDT thread, it block that thread by waiting for some condition. When hide is called this condition is set, so blocked thread continues execution. However, modal dialog is still being process on EDT - pump is still running, event listener code is still being executed. This causes some problems to Swing (see 6308815) and is an inconsistency.
Ideally, we would need to wait for exit from pump before setting the condition which unblocks waiting thread. This is a proposed solution.
I have attached a test that can be used to demonstrate the problem. In the test a dialog is shown with a button in it. When the button is clicked, the dialog is hidden and a value of some property is printed in the system console. If the value is 'false', the bug is reproduced.