The get/setOption methods of java.net Socket, ServerSocket, and
DatagramSocket, are specified to throw NullPointerException if the given
option name is null ( rather than UnsupportedOperationException, which
is currently thrown ). The implementation correctly did this in JDK 9 (
on *nix platforms at least ), when the methods were added, but has since
regressed.

The fix is straight forward; explicitly check the given option name
using Objects::requireNonNull, and update an existing regression test to
ensure that this behaviour does not unwittingly regress.

Webrev:
  https://cr.openjdk.java.net/~chegar/8224477/webrev.00/

-Chris.

Reply via email to