Skip to content

Commit 25f32f3

Browse files
author
Alan Bateman
committedSep 15, 2023
8316160: Remove sun.misc.Unsafe.{shouldBeInitialized,ensureClassInitialized}
Reviewed-by: rriggs, mchung, jpai
1 parent 86dde5e commit 25f32f3

File tree

1 file changed

+0
-36
lines changed

1 file changed

+0
-36
lines changed
 

‎src/jdk.unsupported/share/classes/sun/misc/Unsafe.java

-36
Original file line numberDiff line numberDiff line change
@@ -727,42 +727,6 @@ public Object staticFieldBase(Field f) {
727727
return theInternalUnsafe.staticFieldBase(f);
728728
}
729729

730-
/**
731-
* Detects if the given class may need to be initialized. This is often
732-
* needed in conjunction with obtaining the static field base of a
733-
* class.
734-
*
735-
* @deprecated No replacement API for this method. As multiple threads
736-
* may be trying to initialize the same class or interface at the same time.
737-
* The only reliable result returned by this method is {@code false}
738-
* indicating that the given class has been initialized. Instead, simply
739-
* call {@link java.lang.invoke.MethodHandles.Lookup#ensureInitialized(Class)}
740-
* that does nothing if the given class has already been initialized.
741-
* This method is subject to removal in a future version of JDK.
742-
*
743-
* @return false only if a call to {@code ensureClassInitialized} would have no effect
744-
*
745-
*/
746-
@Deprecated(since = "15", forRemoval = true)
747-
@ForceInline
748-
public boolean shouldBeInitialized(Class<?> c) {
749-
return theInternalUnsafe.shouldBeInitialized(c);
750-
}
751-
752-
/**
753-
* Ensures the given class has been initialized. This is often
754-
* needed in conjunction with obtaining the static field base of a
755-
* class.
756-
*
757-
* @deprecated Use the {@link java.lang.invoke.MethodHandles.Lookup#ensureInitialized(Class)}
758-
* method instead. This method is subject to removal in a future version of JDK.
759-
*/
760-
@Deprecated(since = "15", forRemoval = true)
761-
@ForceInline
762-
public void ensureClassInitialized(Class<?> c) {
763-
theInternalUnsafe.ensureClassInitialized(c);
764-
}
765-
766730
/**
767731
* Reports the offset of the first element in the storage allocation of a
768732
* given array class. If {@link #arrayIndexScale} returns a non-zero value

0 commit comments

Comments
 (0)