This is a clean backport of [JDK-8346518](https://bugs.openjdk.org/browse/JDK-8346518). CSR already approved.
------------- Commit messages: - Backport 9e8aa855fe3483b1a59233bcbd693cd0fed7de8e Changes: https://git.openjdk.org/jdk/pull/22809/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22809&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8346017 Stats: 242 lines in 3 files changed: 223 ins; 8 del; 11 mod Patch: https://git.openjdk.org/jdk/pull/22809.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/22809/head:pull/22809 PR: https://git.openjdk.org/jdk/pull/22809