RFR: 8361337: java/net/URLPermission/nstest/LookupTest.java should open connections with NO_PROXY

Jaikiran Pai jpai at openjdk.org
Fri Jul 4 01:54:42 UTC 2025


On Thu, 3 Jul 2025 20:25:13 GMT, Volkan Yazici <vyazici at openjdk.org> wrote:

> Explicitly use `NO_PROXY` in `LookupTest` to avoid test failures on environments where proxy is configured. Updated test run results on various platforms are attached to the ticket.

test/jdk/java/net/URLPermission/nstest/LookupTest.java line 108:

> 106: 
> 107:     private static void configureSystemWideNoProxy() {
> 108:         ProxySelector.setDefault(new ProxySelector() {

Hello Volkan, `ProxySelector.setDefault(ProxySelector.of(null))` allows you to disable proxy without requiring the code to provide a `ProxySelector` implementation. Maybe that could be used here? That might also mean you won't need a separate `configureSystemWideNoProxy()` method.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26120#discussion_r2184121699


More information about the net-dev mailing list