<Swing Dev> RFR: 8261689: javax/swing/JComponent/7154030/bug7154030.java still fails with "Exception: Failed to hide opaque button" [v2]

Alexander Zuev kizune at openjdk.java.net
Wed Mar 3 04:56:39 UTC 2021


On Tue, 2 Mar 2021 23:21:49 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

> > Should `frame` be declared as `volatile`? It's accessed on main thread in finally block.
> > In addition to it, `frame.getBounds()` and `frame.getInsets()` are called on main thread instead of EDT.
> 
> I couldn't link this comment to the code because GitHub does not allow adding comments to unmodified lines. Do I understand correctly that you're for leaving it as is?

Pretty much. Making frame volatile will not change the behavior, the assignment to it made in one place and it's on EDT inside invokeAndWait block, making it volatile will change nothing, it will be fully assigned by the time we leave EDT. And calling non-disruptive getters such getInsets or getBounds from main thread is not a problem either. By that time frame should be visible and in position - otherwise we will have much more interesting problems.

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

PR: https://git.openjdk.java.net/jdk/pull/2790


More information about the swing-dev mailing list