8064288: sun.management.Flag should loadLibrary()

Call System.loadLibrary("management") from Flag static initializer

Reviewed-by: mchung
This commit is contained in:
Brent Christian 2014-11-14 13:46:19 -08:00
parent d5edf27b6a
commit f4aff42708

View File

@ -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<Void>() {
public Void run() {
System.loadLibrary("management");
return null;
}
});
initialize();
}
private static native void initialize();