提交 b064ce8e 编写于 作者: B bchristi

8064288: sun.management.Flag should loadLibrary()

Summary: Call System.loadLibrary("management") from Flag static initializer
Reviewed-by: mchung
上级 18eb91a7
/* /*
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
...@@ -28,6 +28,7 @@ package sun.management; ...@@ -28,6 +28,7 @@ package sun.management;
import java.util.*; import java.util.*;
import com.sun.management.VMOption; import com.sun.management.VMOption;
import com.sun.management.VMOption.Origin; import com.sun.management.VMOption.Origin;
import java.security.AccessController;
/** /**
* Flag class is a helper class for constructing a VMOption. * Flag class is a helper class for constructing a VMOption.
...@@ -114,6 +115,13 @@ class Flag { ...@@ -114,6 +115,13 @@ class Flag {
static synchronized native void setStringValue(String name, String value); static synchronized native void setStringValue(String name, String value);
static { static {
AccessController.doPrivileged(
new java.security.PrivilegedAction<Void>() {
public Void run() {
System.loadLibrary("management");
return null;
}
});
initialize(); initialize();
} }
private static native void initialize(); private static native void initialize();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册