8180949: Correctly handle exception in TCPChannel.createConnection

Reviewed-by: rriggs
This commit is contained in:
Rob McKenna 2017-05-24 22:07:07 +01:00
parent 74ef00df37
commit e830b7d68e

View File

@ -296,16 +296,12 @@ public class TCPChannel implements Channel {
out.flush();
}
} catch (IOException e) {
try {
conn.close();
} catch (Exception ex) {}
if (e instanceof RemoteException) {
throw (RemoteException) e;
} else {
if (conn != null
&& e instanceof java.net.SocketTimeoutException)
{
try {
conn.close();
} catch (Exception ex) {}
}
throw new ConnectIOException(
"error during JRMP connection establishment", e);
}