< prev index next >

src/java.base/share/classes/java/net/SocksSocketImpl.java

Print this page
rev 14210 : 8154231: Simplify access to System properties from JDK code
Reviewed-by: rriggs

*** 31,40 **** --- 31,41 ---- import java.security.PrivilegedAction; import java.security.PrivilegedExceptionAction; import sun.net.SocksProxy; import sun.net.spi.DefaultProxySelector; import sun.net.www.ParseUtil; + import sun.security.action.GetPropertyAction; /* import org.ietf.jgss.*; */ /** * SOCKS (V4 & V5) TCP socket implementation (RFC 1928). * This is a subclass of PlainSocketImpl.
*** 175,186 **** }); if (pw != null) { userName = pw.getUserName(); password = new String(pw.getPassword()); } else { ! userName = java.security.AccessController.doPrivileged( ! new sun.security.action.GetPropertyAction("user.name")); } if (userName == null) return false; out.write(1); out.write(userName.length()); --- 176,186 ---- }); if (pw != null) { userName = pw.getUserName(); password = new String(pw.getPassword()); } else { ! userName = GetPropertyAction.getProperty("user.name"); } if (userName == null) return false; out.write(1); out.write(userName.length());
*** 1086,1096 **** if (applicationSetProxy) { try { userName = System.getProperty("user.name"); } catch (SecurityException se) { /* swallow Exception */ } } else { ! userName = java.security.AccessController.doPrivileged( ! new sun.security.action.GetPropertyAction("user.name")); } return userName; } } --- 1086,1095 ---- if (applicationSetProxy) { try { userName = System.getProperty("user.name"); } catch (SecurityException se) { /* swallow Exception */ } } else { ! userName = GetPropertyAction.getProperty("user.name"); } return userName; } }
< prev index next >