RFR: 8318150: StaticProxySelector.select should not throw NullPointerExceptions

Daniel Fuchs dfuchs at openjdk.org
Mon Oct 16 11:52:48 UTC 2023


On Mon, 16 Oct 2023 09:21:52 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

> `ProxySelector.select` and `connectFailed` methods should throw `IllegalArgumentException`s on null parameters.
> 
> Additionally, the `select` method doesn't need to be synchronized - the selector is immutable.
> 
> Tier2 green.

Looks reasonable to me. I believe CSR and release notes would be warranted. Also it would be good to double check whether other implementations of ProxySelector - e.g. when using -Djava.net.useSystemProxies=true also respect the contract of throwing IAE in those cases. We can't check that with a non-regression test unfortunately (unless it's a manual test) - but some code inspection might reveal whether the contract is respected or not.

-------------

Marked as reviewed by dfuchs (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/16199#pullrequestreview-1679777786


More information about the net-dev mailing list