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

Brian Burkhalter brian.burkhalter at oracle.com
Mon Feb 26 22:09:51 UTC 2018


On Feb 24, 2018, at 1:01 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:

> 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.

Sure.

>> 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.

You’re welcome. I looked over the refreshed-in-place webrev as well a diff between the previous and current patches and insofar as I can tell it looks good, including the changes used for the state constant definitions in the Channel classes, the updates to the two implCloseSelectableChannel() implementations, and the correction of the timeout calculation in SocketAdaptor.

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


More information about the nio-dev mailing list