From f4aff4270865de2eb699c156269bd95685429c54 Mon Sep 17 00:00:00 2001 From: Brent Christian Date: Fri, 14 Nov 2014 13:46:19 -0800 Subject: [PATCH] 8064288: sun.management.Flag should loadLibrary() Call System.loadLibrary("management") from Flag static initializer Reviewed-by: mchung --- .../share/classes/sun/management/Flag.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/jdk/src/java.management/share/classes/sun/management/Flag.java b/jdk/src/java.management/share/classes/sun/management/Flag.java index 4f52cb51495..52da43e8408 100644 --- a/jdk/src/java.management/share/classes/sun/management/Flag.java +++ b/jdk/src/java.management/share/classes/sun/management/Flag.java @@ -28,6 +28,7 @@ package sun.management; import java.util.*; import com.sun.management.VMOption; import com.sun.management.VMOption.Origin; +import java.security.AccessController; /** * Flag class is a helper class for constructing a VMOption. @@ -115,6 +116,13 @@ class Flag { static synchronized native void setStringValue(String name, String value); static { + AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public Void run() { + System.loadLibrary("management"); + return null; + } + }); initialize(); } private static native void initialize();