mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-22 20:14:43 +02:00
8235521: Replacement API for Unsafe::ensureClassInitialized
Reviewed-by: alanb, chegar, psandoz
This commit is contained in:
parent
6fc6476da8
commit
71d646a160
22 changed files with 708 additions and 83 deletions
|
@ -25,6 +25,7 @@
|
|||
|
||||
package sun.management;
|
||||
|
||||
import java.lang.invoke.MethodHandles;
|
||||
import java.lang.management.*;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
|
@ -39,7 +40,6 @@ import java.security.AccessController;
|
|||
import java.security.PrivilegedActionException;
|
||||
import java.security.PrivilegedExceptionAction;
|
||||
|
||||
import jdk.internal.access.SharedSecrets;
|
||||
import jdk.internal.misc.VM;
|
||||
import jdk.internal.misc.VM.BufferPool;
|
||||
|
||||
|
@ -63,7 +63,9 @@ public class ManagementFactoryHelper {
|
|||
static {
|
||||
// make sure that the management lib is loaded within
|
||||
// java.lang.management.ManagementFactory
|
||||
jdk.internal.misc.Unsafe.getUnsafe().ensureClassInitialized(ManagementFactory.class);
|
||||
try {
|
||||
MethodHandles.lookup().ensureInitialized(ManagementFactory.class);
|
||||
} catch (IllegalAccessException e) {}
|
||||
}
|
||||
|
||||
private static final VMManagement jvm = new VMManagementImpl();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue