Integrated: 8316160: Remove sun.misc.Unsafe.{shouldBeInitialized,ensureClassInitialized}

Alan Bateman alanb at openjdk.org
Fri Sep 15 09:12:48 UTC 2023


On Wed, 13 Sep 2023 09:50:35 GMT, Alan Bateman <alanb at openjdk.org> wrote:

> Unsafe.{shouldBeInitialized,ensureClassInitialized} are deprecated for removal since JDK 15. It's time to remove them. Lookup.ensureInitialized(Class) was added in Java 15 as a standard API to ensure that an accessible class is initialized. 
> 
> A search of 175973022 classes in 484751 artifacts found:
> - 23 usages of Unsafe.shouldBeInitialized, of which 8 are unique
> - 121 usages of Unsafe.ensureClassInitialized, of which 31 are unique
> 
> Not a lot of usage, many of the usages seem to be code compiled to older releases.

This pull request has now been integrated.

Changeset: 25f32f35
Author:    Alan Bateman <alanb at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/25f32f353830fddd4883f0fd191303b9dd9898c7
Stats:     36 lines in 1 file changed: 0 ins; 36 del; 0 mod

8316160: Remove sun.misc.Unsafe.{shouldBeInitialized,ensureClassInitialized}

Reviewed-by: rriggs, mchung, jpai

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

PR: https://git.openjdk.org/jdk/pull/15707


More information about the core-libs-dev mailing list