Summary
Remove sun.misc.Unsafe.shouldBeInitialized(Class)
and sun.misc.Unsafe.ensureClassInitialized(Class)
. These methods have been deprecated, for removal, since JDK 15. The small number of libraries using these methods should migrate to using java.lang.invoke.MethodHandles.Lookup.ensureInitialized(Class)
(added in Java 15).
Problem
sun.misc.Unsafe
is an undocumented/unsupported critical internal API. We need to encourage libraries that use this API directly to move to using standard APIs where possible.
Solution
Remove sun.misc.Unsafe.shouldBeInitialized(Class)
and sun.misc.Unsafe.ensureClassInitialized(Class)
.
Add a release note.
Specification
Remove sun.misc.Unsafe.shouldBeInitialized(Class)
and sun.misc.Unsafe.ensureClassInitialized(Class)
.
- csr of
-
JDK-8316160 Remove sun.misc.Unsafe.{shouldBeInitialized,ensureClassInitialized}
- Resolved