RFR: 8328313: Archived module graph should allow identical --module-path to be specified during dump time and run time [v4]
Ioi Lam
iklam at openjdk.org
Sun Sep 29 04:15:41 UTC 2024
On Thu, 26 Sep 2024 00:45:20 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:
>> src/hotspot/share/classfile/classLoaderExt.cpp line 162:
>>
>>> 160: int n = os::snprintf(full_name, full_name_len, "%s%s%s", path, os::file_separator(), file_name);
>>> 161: assert((size_t)n == full_name_len - 1, "Unexpected number of characters in string");
>>> 162: module_paths->append(full_name);
>>
>> Can this case be handled: --module-path=dir
>>
>> - Dump time : dir contains only mod1.jar
>> - Run time : dir contains only mod1.jar and mod2.jmod
>
> It should work because the jmod file won't be added to the `module_paths`.
In my scenario, will the FMG be used? If so, the program won't be able to load the code in mod2.jmod, so the behavior will be wrong. Could you add a test case for this?
>> src/hotspot/share/runtime/arguments.cpp line 347:
>>
>>> 345: }
>>> 346: }
>>> 347: return false;
>>
>> Can this be simplified to `return (strcmp(key, MODULE_PROPERTY_PREFIX PATH) == 0)`?
>
> I'm not sure. Is your suggest equivalent to:
> `return (strcmp(key, "jdk.module.path"));`
Yes, the C++ compiler will automatically concatenate `MODULE_PROPERTY_PREFIX PATH` into a single string.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21048#discussion_r1779902553
PR Review Comment: https://git.openjdk.org/jdk/pull/21048#discussion_r1779902689
More information about the core-libs-dev
mailing list