8064288: sun.management.Flag should loadLibrary()
authorbchristi
Fri, 14 Nov 2014 13:46:19 -0800
changeset 27735 8a0caceb319b
parent 27734 7d9f5cd9d441
child 27736 8c9bd4be4a86
8064288: sun.management.Flag should loadLibrary() Summary: Call System.loadLibrary("management") from Flag static initializer Reviewed-by: mchung
jdk/src/java.management/share/classes/sun/management/Flag.java
--- a/jdk/src/java.management/share/classes/sun/management/Flag.java	Thu Nov 20 10:58:03 2014 -0800
+++ b/jdk/src/java.management/share/classes/sun/management/Flag.java	Fri Nov 14 13:46:19 2014 -0800
@@ -28,6 +28,7 @@
 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 @@
     static synchronized native void setStringValue(String name, String value);
 
     static {
+        AccessController.doPrivileged(
+            new java.security.PrivilegedAction<Void>() {
+                public Void run() {
+                    System.loadLibrary("management");
+                    return null;
+                }
+            });
         initialize();
     }
     private static native void initialize();