RFR: 8361067: Test ExtraButtonDrag.java requires frame.dispose in finally block [v8]
Abhishek Kumar
abhiscxk at openjdk.org
Wed Aug 6 06:28:15 UTC 2025
On Tue, 5 Aug 2025 11:01:24 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: Summary updated
test/jdk/java/awt/Mouse/MouseModifiersUnitTest/ExtraButtonDrag.java line 28:
> 26: * @key headful
> 27: * @bug 6315717
> 28: * @summary Verifies that mouse drag events received for every button if the property is set to true
Suggestion:
* @summary Verifies that the mouse drag events received for every button if the property is set to true
test/jdk/java/awt/Mouse/MouseModifiersUnitTest/ExtraButtonDrag.java line 53:
> 51: private static volatile Point centerFrame;
> 52: private static volatile Point outboundsFrame;
> 53: static String osName = System.getProperty("os.name");
Can be declared as `final` variable as it's value is not going to be changed
Suggestion:
private static final String OS_NAME = System.getProperty("os.name");
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26043#discussion_r2255984137
PR Review Comment: https://git.openjdk.org/jdk/pull/26043#discussion_r2255973828
More information about the client-libs-dev
mailing list