< prev index next >
src/java.base/share/classes/java/net/Socket.java
Print this page
*** 468,478 ****
return;
// SocketImpl.connect() is a protected method, therefore we need to use
// getDeclaredMethod, therefore we need permission to access the member
oldImpl = AccessController.doPrivileged
! (new PrivilegedAction<Boolean>() {
public Boolean run() {
Class<?> clazz = impl.getClass();
while (true) {
try {
clazz.getDeclaredMethod("connect", SocketAddress.class, int.class);
--- 468,478 ----
return;
// SocketImpl.connect() is a protected method, therefore we need to use
// getDeclaredMethod, therefore we need permission to access the member
oldImpl = AccessController.doPrivileged
! (new PrivilegedAction<>() {
public Boolean run() {
Class<?> clazz = impl.getClass();
while (true) {
try {
clazz.getDeclaredMethod("connect", SocketAddress.class, int.class);
*** 909,919 ****
throw new SocketException("Socket input is shutdown");
final Socket s = this;
InputStream is = null;
try {
is = AccessController.doPrivileged(
! new PrivilegedExceptionAction<InputStream>() {
public InputStream run() throws IOException {
return impl.getInputStream();
}
});
} catch (java.security.PrivilegedActionException e) {
--- 909,919 ----
throw new SocketException("Socket input is shutdown");
final Socket s = this;
InputStream is = null;
try {
is = AccessController.doPrivileged(
! new PrivilegedExceptionAction<>() {
public InputStream run() throws IOException {
return impl.getInputStream();
}
});
} catch (java.security.PrivilegedActionException e) {
*** 949,959 ****
throw new SocketException("Socket output is shutdown");
final Socket s = this;
OutputStream os = null;
try {
os = AccessController.doPrivileged(
! new PrivilegedExceptionAction<OutputStream>() {
public OutputStream run() throws IOException {
return impl.getOutputStream();
}
});
} catch (java.security.PrivilegedActionException e) {
--- 949,959 ----
throw new SocketException("Socket output is shutdown");
final Socket s = this;
OutputStream os = null;
try {
os = AccessController.doPrivileged(
! new PrivilegedExceptionAction<>() {
public OutputStream run() throws IOException {
return impl.getOutputStream();
}
});
} catch (java.security.PrivilegedActionException e) {
< prev index next >