RFR: 8324941: POC for Headless platform for JavaFX [v4]

Johan Vos jvos at openjdk.org
Mon Jul 7 09:18:44 UTC 2025


On Fri, 27 Jun 2025 19:31:43 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> Johan Vos has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Process reviewer comments
>
> modules/javafx.graphics/src/main/java/com/sun/glass/ui/headless/HeadlessRobot.java line 231:
> 
>> 229:         if (windows.isEmpty()) return null;
>> 230:         if (windows.size() == 1) return (HeadlessWindow)windows.get(0);
>> 231:         return (HeadlessWindow)windows.get(windows.size() -1);
> 
> call me old fashioned, but would a straightforward reverse `for` loop be better in this case?  no unnecessary memory allocations required.
> 
> here and in two methods below?

I'm not a fan of using Streams if it's not really needed, but in this case I think there might be benefits in eliminating the non-candidates in 1 statement -- I might be wrong though, didn't look yet at how this is compiled.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1836#discussion_r2189460398


More information about the openjfx-dev mailing list