DatagramSocket incorrectly caches the first set of socket options that it encounters (through an invocation of supportedOptions()), subsequently returning that set of options regardless of what the particular datagram socket impl actually supports.
Webrev: https://cr.openjdk.java.net/~chegar/8241988/webrev/ JIRA: https://bugs.openjdk.java.net/browse/JDK-8241988 This issue has been filed so as to extract the long(ish) standing issue from the work being done to support JEP 373 [1]. The code changes in this review are only slightly different to the changes being proposed in the review for 373 [1], so can be merged will little effort. -Chris. [1] https://mail.openjdk.java.net/pipermail/net-dev/2020-April/013748.html