On 21/05/2019 19:36, Chris Hegarty wrote:
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/
There are two parts to the issue, one is missing null change (those
changes are fine), the other is throwing SocketException instead of
IllegalArgumentException for bad values. Maybe you are splitting that out?
I've had to do a big clean-up to OptionsTest as part of JDK-8221481 so
we might have to merge the changes. One nit is the patch here is all
the "->s" lines in nulls are missing a space.
-Alan