Skip to content

Commit

Permalink
8316160: Remove sun.misc.Unsafe.{shouldBeInitialized,ensureClassIniti…
Browse files Browse the repository at this point in the history
…alized}

Reviewed-by: rriggs, mchung, jpai
  • Loading branch information
Alan Bateman committed Sep 15, 2023
1 parent 86dde5e commit 25f32f3
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions src/jdk.unsupported/share/classes/sun/misc/Unsafe.java
Expand Up @@ -727,42 +727,6 @@ public Object staticFieldBase(Field f) {
return theInternalUnsafe.staticFieldBase(f);
}

/**
* Detects if the given class may need to be initialized. This is often
* needed in conjunction with obtaining the static field base of a
* class.
*
* @deprecated No replacement API for this method. As multiple threads
* may be trying to initialize the same class or interface at the same time.
* The only reliable result returned by this method is {@code false}
* indicating that the given class has been initialized. Instead, simply
* call {@link java.lang.invoke.MethodHandles.Lookup#ensureInitialized(Class)}
* that does nothing if the given class has already been initialized.
* This method is subject to removal in a future version of JDK.
*
* @return false only if a call to {@code ensureClassInitialized} would have no effect
*
*/
@Deprecated(since = "15", forRemoval = true)
@ForceInline
public boolean shouldBeInitialized(Class<?> c) {
return theInternalUnsafe.shouldBeInitialized(c);
}

/**
* Ensures the given class has been initialized. This is often
* needed in conjunction with obtaining the static field base of a
* class.
*
* @deprecated Use the {@link java.lang.invoke.MethodHandles.Lookup#ensureInitialized(Class)}
* method instead. This method is subject to removal in a future version of JDK.
*/
@Deprecated(since = "15", forRemoval = true)
@ForceInline
public void ensureClassInitialized(Class<?> c) {
theInternalUnsafe.ensureClassInitialized(c);
}

/**
* Reports the offset of the first element in the storage allocation of a
* given array class. If {@link #arrayIndexScale} returns a non-zero value
Expand Down

1 comment on commit 25f32f3

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.