On Fri, 31 Jul 2026 20:24:19 GMT, Ioi Lam <[email protected]> wrote:

>> src/hotspot/share/classfile/classLoader.cpp line 408:
>> 
>>> 406:     assert(result.get_type() == T_OBJECT, "just checking");
>>> 407:     if (result.get_oop() != nullptr) {
>>> 408:       return true;
>> 
>> ClassLoader::getResource may delegate. I just wonder if this should check 
>> that the URL locates an entry in this JAR file.
>
> @AlanBateman we can assert that the classloader is one of the built-in 
> loaders, so the behavior should be well defined.
> 
> I agree that we should call `ClassLoader.findResource()` and check that if 
> the returned URL matches the zip file's name.
> 
> It's probably easier to write most of the code in CDS.java. The native code 
> can pass the file name of the zip file as a URL (this can be done with 
> `CDSProtectionDomain::to_file_URL()`). The Java code can compare this URL 
> with the value returned by `ClassLoader.findResource()`.

I don't see that check that it's a built-in loaders (or assert) here.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32087#discussion_r3768864430

Reply via email to