RFR [9] 8143554: UnsupportedOperationException is not thrown for unsupported options

Alan Bateman Alan.Bateman at oracle.com
Tue Dec 8 13:51:25 UTC 2015



On 08/12/2015 13:44, Svetlana Nikandrova wrote:
> Hi Alan,
>
> thank you for your replay. Please let me explain a little.
> For example ServerSocket and Socket have different supported options 
> set, but the same SocketImpl under the hood.
> Yes, SocketImpl's setOptions() and getOptions() can be modified to add 
> additional check for the actual socket type that encloses that socket 
> implementation, but I believe this will intricate method's logic and 
> tangle the dependencies. I like it how it was done in jdk 8 - clean 
> and simple - so I think it's a good idea to maintain that approach in 
> jdk 9 as well.
I think this needs a closer look and I hope Michael will have cycles. As 
things currently stands then the SocketImpl methods are specified to 
throw UOE if called with unsupported operations. Yes, this might mean 
the implementation needs to know whether it's for a connecting or 
listening socket.

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


More information about the net-dev mailing list