mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8282686: Add constructors taking a cause to SocketException
Reviewed-by: alanb, xuelei, lancea, dfuchs
This commit is contained in:
parent
7194097bca
commit
1faa5c8092
7 changed files with 90 additions and 25 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
@ -120,12 +120,8 @@ public abstract class SocketFactory
|
|||
// The Exception is used by HttpsClient to signal that
|
||||
// unconnected sockets have not been implemented.
|
||||
//
|
||||
UnsupportedOperationException uop = new
|
||||
UnsupportedOperationException();
|
||||
SocketException se = new SocketException(
|
||||
"Unconnected sockets not implemented");
|
||||
se.initCause(uop);
|
||||
throw se;
|
||||
throw new SocketException("Unconnected sockets not implemented",
|
||||
new UnsupportedOperationException());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -173,8 +173,7 @@ class DefaultSSLServerSocketFactory extends SSLServerSocketFactory {
|
|||
}
|
||||
|
||||
private ServerSocket throwException() throws SocketException {
|
||||
throw (SocketException)
|
||||
new SocketException(reason.toString()).initCause(reason);
|
||||
throw new SocketException(reason.toString(), reason);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -263,8 +263,7 @@ class DefaultSSLSocketFactory extends SSLSocketFactory
|
|||
}
|
||||
|
||||
private Socket throwException() throws SocketException {
|
||||
throw (SocketException)
|
||||
new SocketException(reason.toString()).initCause(reason);
|
||||
throw new SocketException(reason.toString(), reason);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue