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