8166604: nio: remove unneeded locals variables and correct NPE
Reviewed-by: alanb
This commit is contained in:
parent
2d35d5bfc3
commit
b6e72d65aa
jdk/src/java.base/share/classes/sun/nio/ch
@ -328,8 +328,6 @@ class DatagramChannelImpl
|
||||
public SocketAddress receive(ByteBuffer dst) throws IOException {
|
||||
if (dst.isReadOnly())
|
||||
throw new IllegalArgumentException("Read-only buffer");
|
||||
if (dst == null)
|
||||
throw new NullPointerException();
|
||||
synchronized (readLock) {
|
||||
ensureOpen();
|
||||
// Socket was not bound before attempting receive
|
||||
@ -716,8 +714,6 @@ class DatagramChannelImpl
|
||||
|
||||
@Override
|
||||
public DatagramChannel connect(SocketAddress sa) throws IOException {
|
||||
int localPort = 0;
|
||||
|
||||
synchronized(readLock) {
|
||||
synchronized(writeLock) {
|
||||
synchronized (stateLock) {
|
||||
|
@ -616,8 +616,6 @@ class SocketChannelImpl
|
||||
}
|
||||
|
||||
public boolean connect(SocketAddress sa) throws IOException {
|
||||
int localPort = 0;
|
||||
|
||||
synchronized (readLock) {
|
||||
synchronized (writeLock) {
|
||||
ensureOpenAndUnconnected();
|
||||
|
Loading…
x
Reference in New Issue
Block a user