On Wed, 25 May 2022 13:36:09 GMT, Prasanta Sadhukhan <psadhuk...@openjdk.org> 
wrote:

>> Good catch! Not really… It must not be `EXIT_ON_CLOSE`. The default value is 
>> `HIDE_ON_CLOSE` and it would work well because the frame will be disposed of 
>> after the latch is released.
>> 
>> And here I see another problem: the frame that's created by test has to 
>> handle `WindowListener.windowClosing`. Since it's required by all tests, 
>> `PassFailJFrame` should provide a default listener for this purpose.
>
> There are many swing tests that has EXIT_ON_CLOSE so not sure if it's a 
> problem .There are couple which have DISPOSE_ON_CLOSE which I can changed to 
> but not sure if it will have any effect..

It is a problem for jtreg tests: `System.exit` shouldn't be called. We should 
not use it for new tests even if there are tests which use it.

`DISPOSE_ON_CLOSE` is fine: it disposes of the frame; once there are no frames 
left, the JVM exits.

For this test, `DO_NOTHING_ON_CLOSE` could also work well. After all, the user 
is not expected to interact with the secondary frame at all.

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

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

Reply via email to