RFR: 8325566: [TestBug] Util.shutdown() to hide ALL Windows [v2]
Nir Lisker
nlisker at openjdk.org
Tue Mar 19 22:36:24 UTC 2024
On Tue, 19 Mar 2024 22:28:54 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
>> tests/system/src/test/java/test/util/Util.java line 383:
>>
>>> 381: runAndWait(() -> {
>>> 382: for (Window w : new ArrayList<>(Window.getWindows())) {
>>> 383: w.hide();
>>
>> I think you can use `List.copyOf` instead of an `ArrayList` since it doesn't get modified (it's a one-time copy).
>> The iteration can also be
>>
>> List.copyOf(Window.getWindows()).forEach(Window::hide);
>>
>> if you want.
>
> The only issue with this style is - it's hard to set breakpoints.
> In this case it's not that important.
> Thank you!
It's a matter of style mostly, so I don't really mind it. The debug issue can be remedied by adding breakpoints inside Lambdas, which all IDEs support I think (Eclipse and IntelliJ for sure).
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1407#discussion_r1531207452
More information about the openjfx-dev
mailing list