On Wed, 23 Sep 2026 15:39:33 GMT, Marius Hanl <[email protected]> wrote:

>> This PR integrates the `Platform` functionality into `PlatformUtil`, so that 
>> we only have one place where we do OS stuff. And can delete `Platform`.
>> 
>> Something that was first discussed in 
>> https://github.com/openjdk/jfx/pull/1864 and I also saw when I did the 
>> cleanup some months ago in PR https://github.com/openjdk/jfx/pull/2190.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Marius Hanl has updated the pull request incrementally with three additional 
> commits since the last revision:
> 
>  - Move platform factory to GlassPlatform
>  - Move accessible handling to GlassPlatform
>  - Move headless, egl embedded type (now monocle) to GlassPlatform

modules/javafx.base/src/main/java/com/sun/javafx/PlatformUtil.java line 171:

> 169:             int lastIndexOfSlash = Math.max(
> 170:                     s.lastIndexOf('/'), s.lastIndexOf('\\'));
> 171:             return new File(new URI(s.substring(0, lastIndexOfSlash + 
> 1)).toURL().getPath());

`new URL` was deprecated, so replaced with the recommended alternative. Can 
also revert, but since I touched the class and  I thought this might be a good 
thing (+ you will probbaly test the offline build anyway again?).

modules/javafx.graphics/src/main/java/com/sun/glass/ui/GlassPlatform.java line 
57:

> 55:         String embeddedType = System.getProperty("glass.platform", 
> "").toLowerCase(Locale.ROOT);
> 56:         IS_HEADLESS = "headless".equals(embeddedType);
> 57:         IS_MONOCLE = "monocle".equals(embeddedType);

Monocle was always tested, so we could remove `getEmbeddedType()` and just test 
for monocle directly.

modules/javafx.graphics/src/main/java/com/sun/glass/ui/GlassPlatform.java line 
63:

> 61:             IS_ACCESSIBILITY_ENABLED = Boolean.parseBoolean(override);
> 62:         } else {
> 63:             IS_ACCESSIBILITY_ENABLED = true;

Before, we checked if >= Mac 10.9 and >= Windows 7. Which I think are both 
anyway our minimum supported platforms, right?

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2299#discussion_r4084303449
PR Review Comment: https://git.openjdk.org/jfx/pull/2299#discussion_r4084310262
PR Review Comment: https://git.openjdk.org/jfx/pull/2299#discussion_r4084343673

Reply via email to