Skip to content

Commit baf3bb0

Browse files
committed
8367388: Tests start to fail on JDK-21 after JDK-8351907
Backport-of: dea855e163572dc4a1761f5aefe89c148d75c9bf
1 parent 3758e58 commit baf3bb0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/java.desktop/unix/classes/sun/awt/screencast/XdgDesktopPortal.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
import sun.awt.UNIXToolkit;
3030

3131
import java.awt.Toolkit;
32+
import java.security.AccessController;
33+
import sun.security.action.GetPropertyAction;
3234

3335
public class XdgDesktopPortal {
3436
private static final String METHOD_X11 = "x11";
@@ -62,7 +64,11 @@ private XdgDesktopPortal() {}
6264
: METHOD_SCREENCAST;
6365
}
6466

65-
String m = System.getProperty("awt.robot.screenshotMethod", defaultMethod);
67+
@SuppressWarnings("removal")
68+
String m = AccessController.doPrivileged(
69+
new GetPropertyAction(
70+
"awt.robot.screenshotMethod", defaultMethod
71+
));
6672

6773
if (!METHOD_REMOTE_DESKTOP.equals(m)
6874
&& !METHOD_SCREENCAST.equals(m)

0 commit comments

Comments
 (0)