On Fri, 3 Oct 2025 13:14:43 GMT, Volkan Yazici <[email protected]> wrote:

> Replace `ThreadTracker` usage in `java.net.URL` with `ScopedValue` and add a 
> test.

src/java.base/share/classes/java/net/URL.java line 1402:

> 1400:             throw new Error("Circular loading of URL stream handler 
> providers detected");
> 1401:         }
> 1402:         return ScopedValue.where(IN_LOOKUP, true).call(() -> {

We should never reach here if the VM is not booted, or if the protocol is 
`file:` or `jrt:` - so it may be safe to use a lambda. The alternative would be 
to use an anonymous class and create a `new Runnable() { ... }` but it's 
probably not needed.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27623#discussion_r2402580089

Reply via email to