RFR: 8315130: java.lang.IllegalAccessError when processing classlist to create CDS archive [v4]

Timofei Pushkin tpushkin at openjdk.org
Mon Apr 7 11:39:52 UTC 2025


On Fri, 4 Apr 2025 21:11:52 GMT, Ioi Lam <iklam at 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


More information about the core-libs-dev mailing list