JDK-8334138 : Suppress removal warnings for sun.misc.Unsafe memory access methods
  • Type: Bug
  • Component: javafx
  • Sub-Component: graphics
  • Affected Version: jfx23
  • Priority: P3
  • Status: In Progress
  • Resolution: Unresolved
  • Submitted: 2024-06-12
  • Updated: 2024-06-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
jfx23Unresolved
Related Reports
Relates :  
Relates :  
Relates :  
Description
The sun.misc.Unsafe access memory methods have been deprecated for removal by JEP 471 as of JDK 23.

We need to add `@SuppressWarnings("removal")` annotations to all MarlinFX classes that use sun.misc.Unsafe.

Longer term we need to replace our usage of these methods. See JDK-8334137.
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jfx/pull/1474 Date: 2024-06-12 20:03:24 +0000
12-06-2024

I attached a log file with the warnings. It was generated by enabling "-Xlint:removal", setting `jfx.jdk.target.version=23`, and building using a recent JDK 23 ea.
12-06-2024

I did a preliminary prototype of this while testing the implementation of JEP 471, JDK-8331670. The easiest thing to do is to annotate all top-level Marlin classes that access sun.misc.Unsafe. If it's not too much extra work, I might try to do more fine-grained annotations.
12-06-2024