changeset 15701:03fdbc829db3

8166604: nio: remove unneeded locals variables and correct NPE Reviewed-by: alanb
author clanger
date Mon, 26 Sep 2016 21:24:17 +0200
parents fb7345accd74
children 57746f6885ac
files src/java.base/share/classes/sun/nio/ch/DatagramChannelImpl.java src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java
diffstat 2 files changed, 0 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.base/share/classes/sun/nio/ch/DatagramChannelImpl.java	Mon Sep 26 08:19:07 2016 -0700
+++ b/src/java.base/share/classes/sun/nio/ch/DatagramChannelImpl.java	Mon Sep 26 21:24:17 2016 +0200
@@ -328,8 +328,6 @@
     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 @@
 
     @Override
     public DatagramChannel connect(SocketAddress sa) throws IOException {
-        int localPort = 0;
-
         synchronized(readLock) {
             synchronized(writeLock) {
                 synchronized (stateLock) {
--- a/src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java	Mon Sep 26 08:19:07 2016 -0700
+++ b/src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java	Mon Sep 26 21:24:17 2016 +0200
@@ -616,8 +616,6 @@
     }
 
     public boolean connect(SocketAddress sa) throws IOException {
-        int localPort = 0;
-
         synchronized (readLock) {
             synchronized (writeLock) {
                 ensureOpenAndUnconnected();