On Fri, 30 Sep 2022 10:39:37 GMT, Claes Redestad <[email protected]> wrote:

> Move a simple utility method from `URL` to the shared `sun.net.util.URLUtil` 
> class, rename it for clarity and enhance it so that it returns the string 
> literal if the protocol matches one of the tested variants. This helps reduce 
> dependencies from bootstrap code on `Locale` while improving the performance 
> and allocation pressure in certain applications.

`URLUtil` already exists, is used during bootstrap from non-java.net packages 
and would profit from reusing this lower case method. Making the method in 
`URL` public is a non-starter. I'd love having module-scoped visibility 
modifier (so we could share static utility methods without resorting to 
non-exported utility classes), but without that this was the best option to get 
the full benefit without duplicating the logic in places like 
`URLUtil.urlNoFragString`

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

PR: https://git.openjdk.org/jdk/pull/10506

Reply via email to