8064288: sun.management.Flag should loadLibrary()
Summary: Call System.loadLibrary("management") from Flag static initializer
Reviewed-by: mchung
--- 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();