RFR: 8222144: Lazily create JRT code source URLs for LoadedModules

Alan Bateman Alan.Bateman at oracle.com
Tue Apr 9 06:42:29 UTC 2019


On 08/04/2019 22:42, Claes Redestad wrote:
> Hi,
>
> currently we eagerly convert code source URIs to URLs to avoid recursive
> bootstrap issues with overrideable URL handlers. The JRT scheme handler
> is not overrideable, however, and also commonly used for all system
> modules. Creating these URLs lazily is a reasonable startup
> optimization since most applications will only ever load from a small
> fraction of the resolved system modules.
>
> Bug:    https://bugs.openjdk.java.net/browse/JDK-8222144
> Webrev: http://cr.openjdk.java.net/~redestad/8222144/open.00/
This looks good, a minor nit is that L127 can be if (uri != null && 
"jrt".equals(...)). We could extend it to "file" too because that scheme 
can't be overridden either.

At some point we need to clean up the "may be null" comment as all 
modules in the boot layer have a location. Also the set of schemes is 
limited to jrt, file and jar so we are guaranteed to have a protocol 
handler (if MalformedURLException or IAE is thrown then something is 
broken elsewhere).

-Alan


More information about the core-libs-dev mailing list