On Mon, 31 Aug 2026 19:05:03 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:
> 
>   Added test cases

src/hotspot/share/cds/aotClassLocation.cpp line 286:

> 284:   if (StringUtils::strstr_nocase(cs->manifest(), "Multi-Release: true") 
> != nullptr) {
> 285:     cs->_is_multi_release_jar = true;
> 286:   }

I see you've added a test to make sure the check is case insensitive, and a 
test for `-Djdk.util.jar.enableMultiRelease=false`, good. What happens with 
`Multi-Release: truex`. This will not be treated as a MR JAR in the Java code 
but it looks like AOTClassLocation::allocate will set _is_multi_release_jar to 
true. It may not cause an issue but I think needs to be checked.

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

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

Reply via email to