RFR: 8361067: Test ExtraButtonDrag.java requires frame.dispose in finally block [v6]

Phil Race prr at openjdk.org
Thu Jul 31 20:19:02 UTC 2025


On Thu, 31 Jul 2025 05:37:59 GMT, Ravi Gupta <rgupta at openjdk.org> wrote:

>> Test test/jdk/java/awt/Mouse/MouseModifiersUnitTest/ExtraButtonDrag.java left debris on system whenever fails its required frame.dispose() in finally block.
>> 
>> 
>>  finally {
>>             EventQueue.invokeAndWait(ExtraButtonDrag::disposeFrame);
>>         }
>>     public static void disposeFrame() {
>>         if (frame != null) {
>>             frame.dispose();
>>             frame = null;
>>         }
>>     }
>
> Ravi Gupta has updated the pull request incrementally with one additional commit since the last revision:
> 
>   8361067: Review Comments fix

Marked as reviewed by prr (Reviewer).

test/jdk/java/awt/Mouse/MouseModifiersUnitTest/ExtraButtonDrag.java line 123:

> 121:                             + " : dragged = " + dragged);
> 122:                     }
> 123:                 } else { // WToolkit

And macOS ?
Seems like this should be (1) X, (2) everything else ?
And I think that checking the Toolkit like this is iffy.
When we get to Wayland it will be WLToolkit on Linux and the test will do the wrong thing.
Yes, I am assuming that this aspect of Wayland will be X compatible ...
This is pre-existing so I leave it up to you but I'd prefer to have a check that doesn't use the name of an implementation class if there's an alternative. Like just checking if this is Linux.

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

PR Review: https://git.openjdk.org/jdk/pull/26043#pullrequestreview-3076765605
PR Review Comment: https://git.openjdk.org/jdk/pull/26043#discussion_r2246293381


More information about the client-libs-dev mailing list