8213596: test failure with Graal when security manager and policy file are used
Reviewed-by: kvn
--- a/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/HotSpotGraalRuntimeMBean.java Fri Nov 09 09:57:22 2018 -0800
+++ b/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/HotSpotGraalRuntimeMBean.java Fri Nov 09 09:59:05 2018 -0800
@@ -80,7 +80,16 @@
return runtime;
}
- private static final boolean DEBUG = Boolean.getBoolean(HotSpotGraalRuntimeMBean.class.getSimpleName() + ".debug");
+ private static final boolean DEBUG = initDebug();
+
+ private static boolean initDebug() {
+ try {
+ return Boolean.getBoolean(HotSpotGraalRuntimeMBean.class.getSimpleName() + ".debug");
+ } catch (SecurityException e) {
+ // Swallow the exception
+ return false;
+ }
+ }
@Override
public Object getAttribute(String name) throws AttributeNotFoundException {