RFR: 8338626: CDS handling of JAR Class-Path attribute should allow / separator on Windows
David Holmes
dholmes at openjdk.org
Wed Sep 11 01:28:13 UTC 2024
On Tue, 10 Sep 2024 20:55:12 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:
>> Consider `java -cp dir1/A.jar` ... where the manifiest of A.jar contains:
>> `Class-Path: a.jar`
>> The `dir_name` in the above corresponds to `dir1/A.jar`. The `strrchr` is trying to locate the separator between the directory and jar name. Later in the same function, it will combine the directory name (in this case `dir1`) with the names from each of the entry from the attribute and create a class path entry. In the example, it will create a class path entry of `dir1/a.jar`.
>> Before the patch, on Windows, it only works with '\' (the default file separator). e.g.` java -cp dir1\A.jar` ... .
>
> Also, the modified function is only called during CDS dump time for setting up the shared class paths for the app class loader.
To me it sounds like the logic should be always using `/` to locate and then use file_seperator to rewrite to a classpath filesystem entry.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20924#discussion_r1752992547
More information about the hotspot-runtime-dev
mailing list