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

Alan Bateman alanb at openjdk.org
Tue Sep 10 06:20:05 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.

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

> 219:       dir_tail = strrchr(dir_name, '/');
> 220:     }
> 221: #endif

The value of the Class-Path attribute is a sequence of relative URLs, not file paths, so I wouldn't expect to see any usage of file::file_separator() here, even on Unix systems. Some further work may be needed here to align with how the Class-Path attribute is treated by the application class loader.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20924#discussion_r1751320886


More information about the hotspot-runtime-dev mailing list