< prev index next >
src/java.base/share/classes/java/net/SocksSocketImpl.java
Print this page
@@ -80,11 +80,11 @@
final int timeout)
throws IOException
{
try {
AccessController.doPrivileged(
- new java.security.PrivilegedExceptionAction<Void>() {
+ new java.security.PrivilegedExceptionAction<>() {
public Void run() throws IOException {
superConnectServer(host, port, timeout);
cmdIn = getInputStream();
cmdOut = getOutputStream();
return null;
@@ -155,11 +155,11 @@
String userName;
String password = null;
final InetAddress addr = InetAddress.getByName(server);
PasswordAuthentication pw =
java.security.AccessController.doPrivileged(
- new java.security.PrivilegedAction<PasswordAuthentication>() {
+ new java.security.PrivilegedAction<>() {
public PasswordAuthentication run() {
return Authenticator.requestPasswordAuthentication(
server, addr, serverPort, "SOCKS5", "SOCKS authentication", null);
}
});
@@ -349,11 +349,11 @@
if (server == null) {
// This is the general case
// server is not null only when the socket was created with a
// specified proxy in which case it does bypass the ProxySelector
ProxySelector sel = java.security.AccessController.doPrivileged(
- new java.security.PrivilegedAction<ProxySelector>() {
+ new java.security.PrivilegedAction<>() {
public ProxySelector run() {
return ProxySelector.getDefault();
}
});
if (sel == null) {
@@ -593,11 +593,11 @@
byte[] addr1 = baddr.getAddress();
/* Test for AnyLocal */
InetAddress naddr = baddr;
if (naddr.isAnyLocalAddress()) {
naddr = AccessController.doPrivileged(
- new PrivilegedAction<InetAddress>() {
+ new PrivilegedAction<>() {
public InetAddress run() {
return cmdsock.getLocalAddress();
}
});
@@ -669,11 +669,11 @@
if (server == null) {
// This is the general case
// server is not null only when the socket was created with a
// specified proxy in which case it does bypass the ProxySelector
ProxySelector sel = java.security.AccessController.doPrivileged(
- new java.security.PrivilegedAction<ProxySelector>() {
+ new java.security.PrivilegedAction<>() {
public ProxySelector run() {
return ProxySelector.getDefault();
}
});
if (sel == null) {
@@ -722,11 +722,11 @@
}
// Connects to the SOCKS server
try {
AccessController.doPrivileged(
- new PrivilegedExceptionAction<Void>() {
+ new PrivilegedExceptionAction<>() {
public Void run() throws Exception {
cmdsock = new Socket(new PlainSocketImpl());
cmdsock.connect(new InetSocketAddress(server, serverPort));
cmdIn = cmdsock.getInputStream();
cmdOut = cmdsock.getOutputStream();
@@ -753,11 +753,11 @@
+ savedExc.getMessage());
}
} else {
try {
AccessController.doPrivileged(
- new PrivilegedExceptionAction<Void>() {
+ new PrivilegedExceptionAction<>() {
public Void run() throws Exception {
cmdsock = new Socket(new PlainSocketImpl());
cmdsock.connect(new InetSocketAddress(server, serverPort));
cmdIn = cmdsock.getInputStream();
cmdOut = cmdsock.getOutputStream();
< prev index next >