# HG changeset patch # User dmarkov # Date 1513374573 0 # Node ID a099e4d4c35b14e3c6feb1f0254b4fa001ba49b1 # Parent 291020144f22e36c296348c657ac7d810b552160 8154405: AccessControlException by URLPermission check Reviewed-by: serb, ssadetsky, mullan diff -r 291020144f22 -r a099e4d4c35b src/java.desktop/share/classes/java/awt/Toolkit.java --- a/src/java.desktop/share/classes/java/awt/Toolkit.java Fri Dec 15 10:44:06 2017 -0800 +++ b/src/java.desktop/share/classes/java/awt/Toolkit.java Fri Dec 15 21:49:33 2017 +0000 @@ -673,11 +673,13 @@ *

* This method first checks if there is a security manager installed. * If so, the method calls the security manager's - * {@code checkPermission} method with the - * url.openConnection().getPermission() permission to ensure - * that the access to the image is allowed. For compatibility - * with pre-1.2 security managers, if the access is denied with - * {@code FilePermission} or {@code SocketPermission}, + * {@code checkPermission} method with the corresponding + * permission to ensure that the access to the image is allowed. + * If the connection to the specified URL requires + * either {@code URLPermission} or {@code SocketPermission}, + * then {@code URLPermission} is used for security checks. + * For compatibility with pre-1.2 security managers, if the access + * is denied with {@code FilePermission} or {@code SocketPermission}, * the method throws the {@code SecurityException} * if the corresponding 1.1-style SecurityManager.checkXXX method * also denies permission. @@ -717,11 +719,13 @@ *

* This method first checks if there is a security manager installed. * If so, the method calls the security manager's - * {@code checkPermission} method with the - * url.openConnection().getPermission() permission to ensure - * that the image creation is allowed. For compatibility - * with pre-1.2 security managers, if the access is denied with - * {@code FilePermission} or {@code SocketPermission}, + * {@code checkPermission} method with the corresponding + * permission to ensure that the image creation is allowed. + * If the connection to the specified URL requires + * either {@code URLPermission} or {@code SocketPermission}, + * then {@code URLPermission} is used for security checks. + * For compatibility with pre-1.2 security managers, if the access + * is denied with {@code FilePermission} or {@code SocketPermission}, * the method throws {@code SecurityException} * if the corresponding 1.1-style SecurityManager.checkXXX method * also denies permission.