On Tue, 1 Sep 2026 21:29:08 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:
> 
>   Alan comments

Marked as reviewed by alanb (Reviewer).

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

> 288:   // if (StringUtils::strstr_nocase(cs->manifest(), "Multi-Release: 
> true") != nullptr) {
> 289:   //   cs->_is_multi_release_jar = true;
> 290:   // }

The new code uses strncasecmp so I assume the commented out should be removed 
now.

test/hotspot/jtreg/runtime/cds/appcds/MultiReleaseJars.java line 277:

> 275:             .runAOTWorkflow();
> 276: 
> 277:         // 8. AOT Test with space after enableMultiRelease=true

This runs with the property value set to "true<space>". The implNote in JarFile 
doesn't clearly specify the behavior when the property value isn't 
true/false/force but long standing behavior is to ignore the value and use the 
default value (true). So test 8 is okay but it probably should have a clearer 
comment on what it is testing.

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

PR Review: https://git.openjdk.org/jdk/pull/32087#pullrequestreview-5086250260
PR Review Comment: https://git.openjdk.org/jdk/pull/32087#discussion_r3911278091
PR Review Comment: https://git.openjdk.org/jdk/pull/32087#discussion_r3911370765

Reply via email to