RFR: 8356308: Assert with -Xlog:class+path when classpath has an empty element

Ioi Lam iklam at openjdk.org
Wed May 21 21:33:29 UTC 2025


When the classpath has an element that's the empty string (e.g., `java  -Xlog:class+path -cp :abc ...`, where the first element is `""` and the second element is `"abc"`), the VM asserts.

The fix is simple:


-     if (do_substitute) {
+     if (do_substitute && remove_prefix_len > 0) {


I also improved the logs to help debugging classpath mismatches when using the AOT cache.

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

Commit messages:
 - 8356308: Assert with -Xlog:class+path when classpath has an empty element

Changes: https://git.openjdk.org/jdk/pull/25372/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25372&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8356308
  Stats: 101 lines in 4 files changed: 89 ins; 6 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/25372.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25372/head:pull/25372

PR: https://git.openjdk.org/jdk/pull/25372


More information about the hotspot-runtime-dev mailing list