8166604: nio: remove unneeded locals variables and correct NPE

Reviewed-by: alanb
This commit is contained in:
Christoph Langer 2016-09-26 21:24:17 +02:00
parent 2d35d5bfc3
commit b6e72d65aa
2 changed files with 0 additions and 6 deletions
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();