changeset 53424:23beda532ebe

8213596: test failure with Graal when security manager and policy file are used Reviewed-by: kvn
author dlong
date Fri, 09 Nov 2018 09:59:05 -0800
parents 9887f04b0e0f
children 139afe113654
files src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/HotSpotGraalRuntimeMBean.java
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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 {