< prev index next >

src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/HotSpotGraalRuntimeMBean.java

Print this page
rev 52470 : 8213596: test failure with Graal when security manager and policy file are used

@@ -78,11 +78,20 @@
 
     HotSpotGraalRuntime getRuntime() {
         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 {
         String[] result = runtime.getOptionValues(name);
         String value = result[0];
< prev index next >