RFR: 8254692: (se) Clarify the behaviour of the non-abstract SelectorProvider::inheritedChannel

Chris Hegarty chegar at openjdk.java.net
Tue Oct 20 08:20:14 UTC 2020


On Tue, 20 Oct 2020 07:06:21 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Please review this fix to provide spec clarity on the default implementation of
>> java.nio.channels.spi.SelectorProvider::inheritedChannel() method which simply returns “null”, and a test for it.
>> Please review the corresponding CSR as well: https://bugs.openjdk.java.net/browse/JDK-8254848
>
> test/jdk/java/nio/channels/etc/ProtocolFamilies.java line 47:
> 
>> 45: /*
>> 46:  * @test
>> 47:  * @bug 8254692
> 
> test/jdk/java/nio/channels/spi/SelectorProvider/inheritedChannel would be a more appropriate location to test this.
> 
> I assume you modified etc/ProtocolFamilies.java you because it has a custom provider that doesn't override this method
> but this test has the summary "Test SocketChannel, ServerSocketChannel and DatagramChannel with various ProtocolFamily
> combinations" so not really the right place.

The test method being changed here assets other aspects of the default implementation of `SelectorProvider` - this is
just another case. I guess is depends on ones view, whether these checks should be co-located based on functionality or
based on category of behaviour.  It might be best to create a new
test/jdk/java/nio/channels/spi/SelectorProvider/DefaultImplementationTest.java to hold such, and move the other
assertions there too.  But the higher-order bit is that we have tests.

-------------

PR: https://git.openjdk.java.net/jdk/pull/745


More information about the nio-dev mailing list