mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8267521: Post JEP 411 refactoring: maximum covering > 50K
Reviewed-by: dfuchs, prr
This commit is contained in:
parent
40d23a0c0b
commit
508cec7535
18 changed files with 205 additions and 104 deletions
|
@ -48,7 +48,6 @@ import sun.net.ftp.*;
|
|||
import sun.util.logging.PlatformLogger;
|
||||
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
public class FtpClient extends sun.net.ftp.FtpClient {
|
||||
|
||||
private static int defaultSoTimeout;
|
||||
|
@ -111,16 +110,13 @@ public class FtpClient extends sun.net.ftp.FtpClient {
|
|||
|
||||
static {
|
||||
final int vals[] = {0, 0};
|
||||
final String encs[] = {null};
|
||||
|
||||
AccessController.doPrivileged(
|
||||
new PrivilegedAction<Object>() {
|
||||
|
||||
public Object run() {
|
||||
@SuppressWarnings("removal")
|
||||
final String enc = AccessController.doPrivileged(
|
||||
new PrivilegedAction<String>() {
|
||||
public String run() {
|
||||
vals[0] = Integer.getInteger("sun.net.client.defaultReadTimeout", 300_000).intValue();
|
||||
vals[1] = Integer.getInteger("sun.net.client.defaultConnectTimeout", 300_000).intValue();
|
||||
encs[0] = System.getProperty("file.encoding", "ISO8859_1");
|
||||
return null;
|
||||
return System.getProperty("file.encoding", "ISO8859_1");
|
||||
}
|
||||
});
|
||||
if (vals[0] == 0) {
|
||||
|
@ -135,7 +131,7 @@ public class FtpClient extends sun.net.ftp.FtpClient {
|
|||
defaultConnectTimeout = vals[1];
|
||||
}
|
||||
|
||||
encoding = encs[0];
|
||||
encoding = enc;
|
||||
try {
|
||||
if (!isASCIISuperset(encoding)) {
|
||||
encoding = "ISO8859_1";
|
||||
|
@ -632,13 +628,10 @@ public class FtpClient extends sun.net.ftp.FtpClient {
|
|||
Socket s;
|
||||
if (proxy != null) {
|
||||
if (proxy.type() == Proxy.Type.SOCKS) {
|
||||
s = AccessController.doPrivileged(
|
||||
new PrivilegedAction<Socket>() {
|
||||
|
||||
public Socket run() {
|
||||
return new Socket(proxy);
|
||||
}
|
||||
});
|
||||
PrivilegedAction<Socket> pa = () -> new Socket(proxy);
|
||||
@SuppressWarnings("removal")
|
||||
var tmp = AccessController.doPrivileged(pa);
|
||||
s = tmp;
|
||||
} else {
|
||||
s = new Socket(Proxy.NO_PROXY);
|
||||
}
|
||||
|
@ -646,13 +639,9 @@ public class FtpClient extends sun.net.ftp.FtpClient {
|
|||
s = new Socket();
|
||||
}
|
||||
|
||||
InetAddress serverAddress = AccessController.doPrivileged(
|
||||
new PrivilegedAction<InetAddress>() {
|
||||
@Override
|
||||
public InetAddress run() {
|
||||
return server.getLocalAddress();
|
||||
}
|
||||
});
|
||||
PrivilegedAction<InetAddress> pa = () -> server.getLocalAddress();
|
||||
@SuppressWarnings("removal")
|
||||
InetAddress serverAddress = AccessController.doPrivileged(pa);
|
||||
|
||||
// Bind the socket to the same address as the control channel. This
|
||||
// is needed in case of multi-homed systems.
|
||||
|
@ -925,13 +914,10 @@ public class FtpClient extends sun.net.ftp.FtpClient {
|
|||
Socket s;
|
||||
if (proxy != null) {
|
||||
if (proxy.type() == Proxy.Type.SOCKS) {
|
||||
s = AccessController.doPrivileged(
|
||||
new PrivilegedAction<Socket>() {
|
||||
|
||||
public Socket run() {
|
||||
return new Socket(proxy);
|
||||
}
|
||||
});
|
||||
PrivilegedAction<Socket> pa = () -> new Socket(proxy);
|
||||
@SuppressWarnings("removal")
|
||||
var tmp = AccessController.doPrivileged(pa);
|
||||
s = tmp;
|
||||
} else {
|
||||
s = new Socket(Proxy.NO_PROXY);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue