Clean backport of [JDK-8308499](https://bugs.openjdk.org/browse/JDK-8308499)
------------- Commit messages: - Backport 79ff72a7762deb6010b57e5ac0ccede3d035ab4c Changes: https://git.openjdk.org/jdk21/pull/41/files Webrev: https://webrevs.openjdk.org/?repo=jdk21&pr=41&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8308499 Stats: 7 lines in 1 file changed: 5 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk21/pull/41.diff Fetch: git fetch https://git.openjdk.org/jdk21.git pull/41/head:pull/41 PR: https://git.openjdk.org/jdk21/pull/41