RFR: 8338626: CDS handling of JAR Class-Path attribute should allow / separator on Windows

Ioi Lam iklam at openjdk.org
Wed Sep 11 07:41:04 UTC 2024


On Mon, 9 Sep 2024 20:46:45 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

> On Windows, we can use '/' as the file separator in the classpath but not in the `Class-Path:` attribute.
> This patch is to enable the use of '/' as the file separator in the `Class-Path:`attribute on Windows.
> 
> Passed tiers 1 - 3 testing.

Changes requested by iklam (Reviewer).

src/hotspot/share/classfile/classLoaderExt.cpp line 219:

> 217:     // On Windows, we also support forward slash as the file separator for Class-Path: attribute.
> 218:     if (dir_tail == nullptr) {
> 219:       dir_tail = strrchr(dir_name, '/');

There's still a bug in the current patch. If the input is


java -cp a\b/c.jar


The current patch gets "a" as the directory name, but it should get "a\b" instead.

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

PR Review: https://git.openjdk.org/jdk/pull/20924#pullrequestreview-2295929093
PR Review Comment: https://git.openjdk.org/jdk/pull/20924#discussion_r1753416353


More information about the hotspot-runtime-dev mailing list