RFR: 8294626: Improve URL protocol lower casing
Alan Bateman
alanb at openjdk.org
Fri Sep 30 10:56:12 UTC 2022
On Fri, 30 Sep 2022 10:39:37 GMT, Claes Redestad <redestad at openjdk.org> 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.
>From a maintenance point of view it might be better to keep all special handling of these built-in schemes in URL rather than having them in two places. I'm thinking of isOverrideable, DefaultFactory.createURLStreamHandler and probably others. It's not a big issue, just a bit surprising to have special handling in code in two packages, if you see what I mean.
-------------
PR: https://git.openjdk.org/jdk/pull/10506
More information about the net-dev
mailing list