8162102: access denied to System Property awt.robot.gtk
authorarapte
Thu, 15 Sep 2016 01:36:56 +0530
changeset 41384 34b9174098ad
parent 41383 dd6dd24db080
child 41385 cb7b11285ba5
8162102: access denied to System Property awt.robot.gtk Reviewed-by: ssadetsky, serb
jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java
--- a/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java	Wed Sep 14 21:50:44 2016 +0530
+++ b/jdk/src/java.desktop/unix/classes/sun/awt/X11/XRobotPeer.java	Thu Sep 15 01:36:56 2016 +0530
@@ -26,6 +26,8 @@
 
 import java.awt.*;
 import java.awt.peer.*;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 
 import sun.awt.AWTAccessor;
 import sun.awt.SunToolkit;
@@ -38,7 +40,8 @@
     static final boolean tryGtk;
     static {
         loadNativeLibraries();
-        tryGtk = Boolean.getBoolean("awt.robot.gtk");
+        tryGtk = AccessController.doPrivileged((PrivilegedAction<Boolean>)()
+                -> Boolean.getBoolean("awt.robot.gtk"));
     }
 
     private static boolean isGtkSupported =  false;