On Fri, 4 Apr 2025 21:11:52 GMT, Ioi Lam <ik...@openjdk.org> wrote: >> All the opening and reading is handled by `URLClassPath` (it's not just >> JARs, can also be directories). I used only `defineClass` from >> `URLClassLoader` to minimize the behavior difference with the old code — >> besides defining the class it defines its package and protection domain. But >> it looks like static CDS strips these anyway, so I've removed >> `URLClassLoader` entirely. >> >> `URLClassPath` usage can also be removed — then the small addition to it >> from this PR won't be needed but its functionality will be somewhat >> duplicated in `CDS.UnregisteredLoader`. I've implemented this [in a separate >> branch](https://github.com/openjdk/jdk/compare/master...TimPushkin:jdk:one-loader-v2?expand=1). > > I prefer the changes in your separate branch. URLClassPath is intended for > sequential access. Adding the new method for random access could introduce > extraneous requirements that might affect future evolution of URLClassPath. > As the code for JarSource and Dir Source is quite small, I think it's > acceptable.
Agree, I've brought it here ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24223#discussion_r2031053093