On Wed, 12 Aug 2026 15:55:14 GMT, Matias Saavedra Silva <[email protected]> 
wrote:

>> When performing an AOT training run using a multi-release JAR file, the 
>> following warning can be encountered:
>> `[warning][aot] class org/example/Foo cannot be archived because it was not 
>> defined from <path to mr.jar> as claimed`
>> This warning results from a specific configuration of the JAR file where the 
>> class is not in the root directory but is present in the versioned directory 
>> `META-INF/version`. To fix this, an upcall to ClassLoader.getResource() is 
>> now made in the specific case where a multi-release JAR is being used and 
>> the class cannot be found through normal means. Verified with tier 1-5 tests.
>> 
>> 
>> 
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Matias Saavedra Silva has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Ioi offline comments

src/java.base/share/classes/jdk/internal/misc/CDS.java line 404:

> 402:     private static native boolean needsClassInitBarrier0(Class<?> c);
> 403: 
> 404:     public static URL getResource(ClassLoader loader, URL zipName, 
> String name) throws Exception {

This will need a clear comment on what it does because it's not obvious from 
the method signature. If this is for JAR file then the second parameter is a 
JAR url rather than a "zip name".

src/java.base/share/classes/jdk/internal/misc/CDS.java line 409:

> 407:         if (resource != null) {
> 408:             // If the resource is not in the correct JAR file, discard it
> 409:             if (resource.getProtocol().equals("jar")) {

URI schemes (or "protocols" in URL speak) are always compared without regard to 
case.

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

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

Reply via email to