Our current practice, as discussed in this thread [1], is to update the minimum to a JDK LTS release. I would be reluctant to adopt a non-LTS release as the minimum and based on the responses the last time we raised this question, I suspect there would be other voices even more reluctant.

For the specific case of using Panama FFM or unnamed variable patterns, I don't see sufficient benefit to applications to justify it. These features would only be something used by JavaFX internals and wouldn't show up in any public API.

I do support bumping the minimum to JDK 21 in JavaFX 23, and was already planning to propose doing so early in the JavaFX 23 release.

-- Kevin

[1] https://mail.openjdk.org/pipermail/openjfx-dev/2022-July/034874.html


On 12/5/2023 12:28 AM, Nir Lisker wrote:
Hi all,

Panama's 'foreign' API will be released in JDK 22 [1][2]. It includes 'foreign memory' API for managing off-heap java memory, and 'foreign function' API for calling native functions. These replace some sun.misc.unsafe operations and all JNI.

We should start allowing developers to use the new APIs as they greatly improve many aspects of the code (safer, simpler and possibly more performant). I have used the foreign function API in other projects since its incubation period (Java 18 or 19) and I can say that it works well and causes much less headache than JNI, although I didn't do a performance comparison in those cases.

We should also think about replacing code with the new API. JavaFX uses sun.miscs.Unsafe in MarlinFX, and JNI is used extensively. While it's unreasonable (and at this point undesirable due to manpower constraints) to replace all of JNI, there are places where this approach should be looked at. The use of Unsafe also emits warnings, which we are trying to avoid.

I therefore propose that JavaFX 23 bump its Java requirement to 22, maintaining the "N-1 guarantee". I think that this is a significant enough addition that merits this version bump, and will also bring with it all the previous features starting with Java 18, out of which some useful ones are:
* Code Snippets [3] (18)
* Record Patterns [4] (21)
* Pattern Matching for switch [5] (21)
* Unnamed Variables & Patterns [6] (22)

We can start using the new APIs once the jfx 22 branch is split from the master.

- Nir

[1] https://openjdk.org/jeps/454
[2] https://download.java.net/java/early_access/jdk22/docs/api/java.base/java/lang/foreign/package-summary.html
[3] https://openjdk.org/jeps/413
[4] https://openjdk.org/jeps/440
[5] https://openjdk.org/jeps/441
[6] https://openjdk.org/jeps/456


Reply via email to