mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8258422: Cleanup unnecessary null comparison before instanceof check in java.base
Reviewed-by: chegar, aefimov
This commit is contained in:
parent
ff54b77b76
commit
022bc9f0cb
22 changed files with 69 additions and 81 deletions
|
@ -102,9 +102,8 @@ import java.util.Set;
|
|||
protected void connect(SocketAddress endpoint, int timeout)
|
||||
throws IOException
|
||||
{
|
||||
if (endpoint == null || !(endpoint instanceof InetSocketAddress))
|
||||
if (!(endpoint instanceof InetSocketAddress epoint))
|
||||
throw new IllegalArgumentException("Unsupported address type");
|
||||
final InetSocketAddress epoint = (InetSocketAddress)endpoint;
|
||||
String destHost = epoint.isUnresolved() ? epoint.getHostName()
|
||||
: epoint.getAddress().getHostAddress();
|
||||
final int destPort = epoint.getPort();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue