8198562: (ch) Separate blocking and non-blocking code paths (part 1)

Alan Bateman Alan.Bateman at oracle.com
Sat Feb 24 09:01:50 UTC 2018

On 24/02/2018 01:24, Brian Burkhalter wrote:
> I think that this looks good, much cleaner and with better 
> consistency. I do have a few minor suggestions which if accepted don’t 
> necessitate any further review.
> 1. ServerSocketAdaptor
> Use System.nanoTime() instead of System.currentTimeMillis() as in 
> SocketAdaptor?
Right, and there is also an issue with the existing code in the adaptors 
where they don't adjust the timeout specified to poll correctly. I think 
this may date back to when this code was changed to not use a temporary 
Selector. So yes, definitely needs to be cleaned up but I'd prefer to do 
it with a separate issue.

> 2. ServerSocketChannelImpl and SocketChannelImpl
> In various locations replace "if (x == null) throw new 
> NullPointerException();” with "Objects.requireNonNull();".
I can include this cleanup.

> 3. SocketChannelImpl
> Lines 347-348 change to Objects.checkFromIndexSize(offset, length, 
> dsts.length);
> Lines 458-459 change to Objects.checkFromIndexSize(offset, length, 
> srcs.length);
I can include this cleanup too.

Thanks for going through the changes.


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

More information about the nio-dev mailing list