Summary
Change the exception types thrown by ProxySelector instances returned by ProxySelector.of(InetSocketAddress) to match the exception specification.
Problem
ProxySelector methods select and connectFailed are documented to validate their parameters and throw an IllegalArgumentException when called with null arguments. The DefaultProxySelector class conforms to that specification, but the ProxySelector instances returned by ProxySelector.of do not (they either ignore null parameters or throw NullPointerException instead).
Solution
Modify the ProxySelector subclass used by ProxySelector.of to conform to the specification, i.e. modify select method to throw an IllegalArgumentException instead of a NullPointerException on null parameter, and modify connectFailed to throw an IllegalArgumentException on null parameter instead of ignoring the parameters.
Specification
No changes to specification.
- csr of
-
JDK-8318150 StaticProxySelector.select should not throw NullPointerExceptions
-
- Resolved
-