< prev index next >

modules/graphics/src/main/java/com/sun/glass/ui/Robot.java

Print this page
rev 9452 : 8144680: Stage.alwaysOnTop() doesn't work if a security manager is set
Reviewed-by:

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -44,12 +44,13 @@
         // Ideally, we should restrict user access to Glass packages at all,
         // but that's not the case right now. To prevent applications from
         // using Robot, we check for AllPermission here as we don't have
         // (and will unlikely have in the future) specific permission for
         // this functionality
-        if (System.getSecurityManager() != null) {
-            AccessController.checkPermission(allPermission);
+        final SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            sm.checkPermission(allPermission);
         }
         Application.checkEventThread();
         _create();
     }
 
< prev index next >