RFR(XS): 8166604: nio: remove unneeded locals variables and correct NPE

Alan Bateman Alan.Bateman at oracle.com
Fri Sep 23 14:15:22 UTC 2016


On 23/09/2016 08:18, Langer, Christoph wrote:

> Hi,
>
> please review a small cleanup in nio socket and datagram channel that 
> I have spotted.
>
> I would even suggest to completely remove the null check throwing NPE 
> in DatagramChannelImpl.receive(ByteBuffer dst) as an NPE would 
> implicitly be thrown when dst is null and dst.isReadOnly() is called. 
> The current behavior would not change then.
>
> Webrev: http://cr.openjdk.java.net/~clanger/webrevs/8166604.0/ 
> <http://cr.openjdk.java.net/%7Eclanger/webrevs/8166604.0/>
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8166604 
> <https://bugs.openjdk.java.net/browse/JDK-8166604>
>
>
Checking dst for null is redundant as you observe but what you have in 
the current patch looks fine.

-Alan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20160923/fce7fc30/attachment.html>


More information about the nio-dev mailing list