RFR: 8299699: Test runtime/cds/appcds/WrongClasspath.java fails after JDK-8299329

Ashutosh Mehra duke at openjdk.org
Fri Jan 6 14:32:27 UTC 2023


Failure happens because `TestCommon#patchJarForDynamicDump(String cp)` expects the jar files passed in `cp` parameter are with absolute path. The new test case added for JDK 8299329 passed jar files using path relative to work dir.


        if (!firstJar.startsWith(expected)) {
            throw new RuntimeException("FIXME: jar file not at a supported location ('"
                                       + expected + "'): " + firstJar);
        }


This fix converts `firstJar` into real path using `Path.toRealPath()` before doing `firstJar.startsWith(expected)`.
This way all relative paths are also converted to absolute paths before the check is performed.

Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>

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

Commit messages:
 - 8299699: Test runtime/cds/appcds/WrongClasspath.java fails after JDK-8299329

Changes: https://git.openjdk.org/jdk/pull/11882/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=11882&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8299699
  Stats: 3 lines in 1 file changed: 3 ins; 0 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/11882.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11882/head:pull/11882

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


More information about the hotspot-runtime-dev mailing list