Clean backport of P3 issue JDK-8322818. The test was initially problematic so I have to include the test-only fixes JDK-8323002 and JDK-8323296 (doing these as follow-on or dependent PRs wouldn't guarantee that would integrate at the same time).
------------- Commit messages: - JDK-8323002 and JDK-8323296 - Backport 4db7a1c3bb6b56cc7416aa27350406da27fe04a8 Changes: https://git.openjdk.org/jdk22/pull/72/files Webrev: https://webrevs.openjdk.org/?repo=jdk22&pr=72&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8322818 Stats: 126 lines in 2 files changed: 123 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk22/pull/72.diff Fetch: git fetch https://git.openjdk.org/jdk22.git pull/72/head:pull/72 PR: https://git.openjdk.org/jdk22/pull/72