RFR: 8348299: Update List/ItemEventTest/ItemEventTest.java [v2]

Alexey Ivanov aivanov at openjdk.org
Thu Jan 23 11:19:47 UTC 2025


On Thu, 23 Jan 2025 09:40:19 GMT, Alexander Zvegintsev <azvegint at openjdk.org> wrote:

>> Alexey Ivanov has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Use setLength to reset actualSelectionOrder
>>   
>>   Co-authored-by: Aleksandr Zvegintsev <77687766+azvegint at users.noreply.github.com>
>
> test/jdk/java/awt/List/ItemEventTest/ItemEventTest.java line 82:
> 
>> 80:         pack();
>> 81:         setLocationRelativeTo(null);
>> 82:         setVisible(true);
> 
> Didn't we decide that we should also now handle AWT calls on EDT?

We did, as far as know… Yet it's a test for AWT component; AWT is a grey area which doesn't state its threading model clearly: is it thread-safe to call AWT components methods from threads other than EDT?

I didn't look thoroughly at the bugs for which the test was written, using the main thread could be the purpose of the test.

Other than that, I agree it's safer to create UI components on EDT and query their properties. And I'm not fan of extending `Frame`…

I'd rather postpone further clean-up of the test to a later time… The test has been running successfully without many failures since 2016, so moving all the UI calls from the main thread to EDT isn't a priority.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23238#discussion_r1926809432


More information about the client-libs-dev mailing list