mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8263233: Update java.net and java.nio to use instanceof pattern variable
Reviewed-by: dfuchs, bpb, chegar, michaelm
This commit is contained in:
parent
3fe8a4661c
commit
fdd3941121
17 changed files with 39 additions and 73 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2021, 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
|
||||
|
@ -57,8 +57,7 @@ class SocksSocketImpl extends DelegatingSocketImpl implements SocksConsts {
|
|||
SocksSocketImpl(Proxy proxy, SocketImpl delegate) {
|
||||
super(delegate);
|
||||
SocketAddress a = proxy.address();
|
||||
if (a instanceof InetSocketAddress) {
|
||||
InetSocketAddress ad = (InetSocketAddress) a;
|
||||
if (a instanceof InetSocketAddress ad) {
|
||||
// Use getHostString() to avoid reverse lookups
|
||||
server = ad.getHostString();
|
||||
serverPort = ad.getPort();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue