Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove sun.misc.Unsafe memory access API usage #8259

Open
mbien opened this issue Feb 18, 2025 · 0 comments
Open

Remove sun.misc.Unsafe memory access API usage #8259

mbien opened this issue Feb 18, 2025 · 0 comments
Labels
Code cleanup Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) Upgrade JDK Upgrade to the JDK requirements of a module.

Comments

@mbien
Copy link
Member

mbien commented Feb 18, 2025

JDK 26 or later will throw an exception whenever a memory-access method from the Unsafe class is used (JEP 498). JDK 24 will log warnings to console.

nb 25 started on JDK 24 in terminal will print the following to console:

WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper (jar:file:/home/mbien/dev/nb/java/maven/lib/guava-33.2.1-jre.jar!/)
WARNING: Please consider reporting this to the maintainers of class com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release

(but there might be more usages, guava might have it fixed in the next release google/guava#6806 (comment))

@mbien mbien added Code cleanup Upgrade JDK Upgrade to the JDK requirements of a module. Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) labels Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code cleanup Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) Upgrade JDK Upgrade to the JDK requirements of a module.
Projects
None yet
Development

No branches or pull requests

1 participant