8344233: Remove calls to SecurityManager and doPrivileged in java.net.ProxySelector and sun.net.spi.DefaultProxySelector after JEP 486 integration

Reviewed-by: dfuchs
This commit is contained in:
Jaikiran Pai 2024-11-16 11:39:20 +00:00
parent d2e4b51133
commit a91d4c022f
4 changed files with 111 additions and 160 deletions

View file

@ -28,8 +28,6 @@ package java.net;
import java.io.IOException;
import java.util.List;
import sun.security.util.SecurityConstants;
/**
* Selects the proxy server to use, if any, when connecting to the
* network resource referenced by a URL. A proxy selector is a
@ -94,11 +92,6 @@ public abstract class ProxySelector {
* @since 1.5
*/
public static ProxySelector getDefault() {
@SuppressWarnings("removal")
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(SecurityConstants.GET_PROXYSELECTOR_PERMISSION);
}
return theProxySelector;
}
@ -114,11 +107,6 @@ public abstract class ProxySelector {
* @since 1.5
*/
public static void setDefault(ProxySelector ps) {
@SuppressWarnings("removal")
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
sm.checkPermission(SecurityConstants.SET_PROXYSELECTOR_PERMISSION);
}
theProxySelector = ps;
}