RFR [13] 8224730: java.net.ServerSocket::toString not invoking checkConnect

Alan Bateman Alan.Bateman at oracle.com
Wed May 29 07:01:26 UTC 2019


On 28/05/2019 15:39, Chris Hegarty wrote:
> Please review this small change to ServerSocket::toString so that it
> correctly implements its specified behaviour ( to reveal the local
> address if SecurityManager::checkConnect succeeds ). Looks like this was
> a minor oversight in the implementation that was not caught by testing,
> as there was no fine grained test for it. This review contains a
> comprehensive test.
>
> Additionally, the ServerSocket::toString specification would benefit
> from a minor clarification that checkConnect is only invoked when the
> socket is bound. ( A CSR will be filed for this )
>
> https://cr.openjdk.java.net/~chegar/8224730/webrev.00/
This looks good. I just wonder if there is any merit is extending the 
test to exercise the socket adaptors returned by 
SocketChannel::socketand ServerSocketChannel::socket or maybe checking a 
separate test. The socket adaptors are often forgotten and I'm only 
bringing it up here while the issue with toString is fresh.

-Alan



More information about the net-dev mailing list