Clean backport of https://github.com/openjdk/jdk/pull/31681 PR.
--------- - [x] I confirm that I make this contribution in accordance with the [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). ------------- Commit messages: - Backport cc83fbd132cf4b121e9554255241eb175715865b Changes: https://git.openjdk.org/jdk/pull/31712/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=31712&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8387306 Stats: 4 lines in 1 file changed: 1 ins; 0 del; 3 mod Patch: https://git.openjdk.org/jdk/pull/31712.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/31712/head:pull/31712 PR: https://git.openjdk.org/jdk/pull/31712
